<?php
	include "../db_connection/db_connection.php";
	include "../config/config.php";
	
	$emp_id=base64_decode(base64_decode(base64_decode(base64_decode($_GET['emp_id']))));
	//echo "SELECT * FROM emp_current_design, design_det WHERE emp_current_design.emp_det_id='$emp_id' AND emp_current_design.curr_status!='closed' AND emp_current_design.design_det_id = design_det.design_det_id";
?>
<script type="text/javascript">
	$(".select").chosen(); 
</script>
        
<div class="grid6 searchDrop">
<select data-placeholder="Choose The Design No..." class="select" name="desin_no" id="desin_no" style="width:300px;" tabindex="2">
    <option value=""></option>
    <?php
        $SLCT_comp = "SELECT * FROM cad_loading, design_det WHERE cad_loading.design_det_id = design_det.design_det_id AND cad_loading.emp_det_id='$emp_id' AND cad_loading.design_det_id NOT IN (SELECT design_det_id FROM emp_current_design WHERE emp_det_id='$emp_id' AND curr_status='closed' AND curr_status='finished')";
		//$SLCT_comp = "SELECT * FROM emp_current_design, design_det WHERE emp_current_design.emp_det_id='$emp_id' AND (emp_current_design.curr_status!='closed' AND emp_current_design.curr_status!='finished') AND emp_current_design.design_det_id = design_det.design_det_id";
        $QURY_comp = mysqli_query($connect,$SLCT_comp);
        while($FTCH_comp = mysqli_fetch_object($QURY_comp))
        {                                            
            $design_det_id	=	base64_encode(base64_encode(base64_encode(base64_encode($FTCH_comp->design_det_id))));
            
            $SLCT_d = "SELECT  * FROM master_cat WHERE master_cat_id = '$FTCH_comp->master_cat_id'";
            $QURY_d = mysqli_query($connect,$SLCT_d);
            $FTCH_d = mysqli_fetch_object($QURY_d);
    ?>
            <option value="<?php echo $design_det_id;?>"><?php echo $FTCH_d->master_cat_name." ".$FTCH_comp->design_no; ?></option>
    <?php
        }                                            
    ?>
</select>
</div>
