<?php include "../../includes/start_ajax.php";

?>

<div  align=left >
<?php



$this_url="mod/addon_matrix/index.php";


$main_key_id="add_code";
$main_key_name="add_name";
$main_key_table="t_".$key_table_prefix."_addon";


echo "<form name='addon_matrix'  >";
  echo "<section class='view_toolbar'>";
                    echo "<div class='view_toolbar_left' style='width:50%;'>";
						echo "<span class='fa fa-cogs'></span> Product-Addon Matrix ";
                    echo "</div>";
                    echo "<div class='view_toolbar_right'>";	
    					
                    echo "</div>";
    echo "</section>";
    
?>

<?php


echo "<section class='view_toolbar' style=''>";
	
		echo "<div style='padding:0px 10px 0px 10px;'>";
	
			echo "Addon: <select name='add_code' class='dropdown dropdown-l'  onchange=\"mon_send_get('".$this_url."','?".$main_key_id."='+this.value,'div_main')\" >";
            
                echo "<option value='' >";
                    echo "--Select--";
                echo "</option>";
            
                $query_data = "select * from ".$main_key_table."
                            where client_id = '".$CurrentUserID."' ";
                $result_data = mysqli_query($dbconn,$query_data);
                while($line_data = mysqli_fetch_array($result_data,MYSQLI_ASSOC))
                {
                    
                    if($line_data[$main_key_id]==$_REQUEST[$main_key_id])
                    {
                        echo "<option value='".$line_data[$main_key_id]."' selected >";
                    }
                    else
                    {
                        echo "<option value='".$line_data[$main_key_id]."' >";
                    }
                    
                    
                    
                        echo $line_data[$main_key_id];
                        echo " - ";
                        echo $line_data[$main_key_name];
                    echo "</option>";    
                }
                
            
            
                
            
            echo "</select>";
            
            
	
		echo "</div>";
				
        
                
                
	echo "</section>";	
	 
     
     
    echo "<section class='view_content'>";
     
        echo "<div class='view_list_title_row'>";
            echo "<div class='view_list_title_content'>";
                echo "<div style='min-width:20px;' class='view_list_title_row_count'  >";
                    echo "#";
                echo "</div>";
                    
                echo "<div style='width:100px;' class='view_list_title_content_object'  >";
                    echo "Product Code<br>";
                echo "</div>";
                
                echo "<div style='width:200px;' class='view_list_title_content_object'  >";
                    echo "Product Name<br>";
                echo "</div>";
				
			echo "</div>";
            echo "<div class='view_list_title_content'>";
            echo "</div>";
        echo "</div>";
        
        $count=1;
        
        $query_product="select * from t_".$key_table_prefix."_product where client_id = '".$CurrentUserID."';  ";
        $result_product = mysqli_query($dbconn,$query_product);
        while($line_product = mysqli_fetch_array($result_product,MYSQLI_ASSOC))
        {
            
            
                
            
            
            
            
            echo "<div class='view_row'>";
                echo "<div class='view_row_content'>";
                    echo "<div style='min-width:20px;' class='view_row_count'  >";
                        echo "".$count."";
                    echo "</div>";
                    
                    
                    echo "<div style='width:100px;' class='view_row_content_object'  >";
                        echo "<font class='view_row_content_label'>Product Code</font>";
                        echo "<font class='view_row_content_text'>";
                            echo $line_product["pdt_code"];
                        echo "</font><br>";
                    
                    echo "</div>";
                    
                                
                                
                    echo "<div style='width:200px;' class='view_row_content_object'  >";
                        echo "<font class='view_row_content_label'>Product Name</font>";
                        echo "<font class='view_row_content_text'>";
                            echo $line_product["pdt_name"];
                        echo "</font><br>";
                    
                    echo "</div>";  
                                
                                
                echo "</div>";
                
                
                echo "<div class='view_row_button'>";
                        echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_send_get('$this_url','?$main_key_id=".$_REQUEST[$main_key_id]."','div_main')\" >";
                            echo '<i class="fa fa-square fa-stack-2x color_green"  ></i><i class="fa fa-check fa-stack-1x color_white" ></i>';
                        echo "</div>";
                echo "</div>";
                
                
                
            echo "</div>";
            
        
        
            $count++;
            
        }
        
     echo "</section>";
     
     
     
echo "</form>";

	
?>

	


</div>

<?php include "../../includes/end_ajax.php";

?>
