<?php
	include "db_connection/db_connection.php";
	include "config/config.php";
	
	if($_SESSION['admin_login_id'] == '')
	{
		echo "<script>window.location='index.php';</script>";
	}
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <title><?php echo $PROJECT_TITLE ?></title>
        
        
        <link href="css/styles.css" rel="stylesheet" type="text/css" />
        <!--[if IE]> <link href="css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->
        
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
        <script type="text/javascript" src="js/waiting_for_appr_JS.js"></script>
        <script type="text/javascript" src="js/plugins/forms/ui.spinner.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.mousewheel.js"></script>
         
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
        
        <script type="text/javascript" src="js/plugins/charts/excanvas.min.js"></script>
        <script type="text/javascript" src="js/plugins/charts/jquery.flot.js"></script>
        <script type="text/javascript" src="js/plugins/charts/jquery.flot.orderBars.js"></script>
        <script type="text/javascript" src="js/plugins/charts/jquery.flot.pie.js"></script>
        <script type="text/javascript" src="js/plugins/charts/jquery.flot.resize.js"></script>
        <script type="text/javascript" src="js/plugins/charts/jquery.sparkline.min.js"></script>
        
        <script type="text/javascript" src="js/plugins/tables/jquery.dataTables.js"></script>
        <script type="text/javascript" src="js/plugins/tables/jquery.sortable.js"></script>
        <script type="text/javascript" src="js/plugins/tables/jquery.resizable.js"></script>
        
        <script type="text/javascript" src="js/plugins/forms/autogrowtextarea.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.uniform.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.inputlimiter.min.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.tagsinput.min.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.maskedinput.min.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.autotab.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.chosen.min.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.dualListBox.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.cleditor.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.ibutton.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.validationEngine-en.js"></script>
        <script type="text/javascript" src="js/plugins/forms/jquery.validationEngine.js"></script>
        
        <script type="text/javascript" src="js/plugins/uploader/plupload.js"></script>
        <script type="text/javascript" src="js/plugins/uploader/plupload.html4.js"></script>
        <script type="text/javascript" src="js/plugins/uploader/plupload.html5.js"></script>
        <script type="text/javascript" src="js/plugins/uploader/jquery.plupload.queue.js"></script>
        
        <script type="text/javascript" src="js/plugins/wizards/jquery.form.wizard.js"></script>
        <script type="text/javascript" src="js/plugins/wizards/jquery.validate.js"></script>
        <script type="text/javascript" src="js/plugins/wizards/jquery.form.js"></script>
        
        <script type="text/javascript" src="js/plugins/ui/jquery.collapsible.min.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.breadcrumbs.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.tipsy.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.progress.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.timeentry.min.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.colorpicker.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.jgrowl.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.fancybox.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.fileTree.js"></script>
        <script type="text/javascript" src="js/plugins/ui/jquery.sourcerer.js"></script>
        
        <script type="text/javascript" src="js/plugins/others/jquery.fullcalendar.js"></script>
        <script type="text/javascript" src="js/plugins/others/jquery.elfinder.js"></script>
        
        <script type="text/javascript" src="js/plugins/ui/jquery.easytabs.min.js"></script>
        <script type="text/javascript" src="js/files/bootstrap.js"></script>
        <script type="text/javascript" src="js/files/functions.js"></script>
        
        <!-- Shared on MafiaShare.net  --><!-- Shared on MafiaShare.net  --></head>
        
        <body onload="document.getElementById('listpage').focus();">
        
        <!-- Top line begins -->
        <?php include "header_footer/header.php"; ?>
        <!-- Top line ends -->
        
        
        <!-- Sidebar begins -->
        <?php include "menus/left_menu.php"; ?>
        <!-- Sidebar ends -->
        
        
        
        <!-- Content begins -->
        <div id="content">
            <!--<div class="contentTop">
                <span class="pageTitle"><span class="icon-key-2"></span>Form validation engines</span>
                <ul class="quickStats">
                    <li>
                        <a href="" class="blueImg"><img src="images/icons/quickstats/plus.png" alt="" /></a>
                        <div class="floatR"><strong class="blue">5489</strong><span>visits</span></div>
                    </li>
                    <li>
                        <a href="" class="redImg"><img src="images/icons/quickstats/user.png" alt="" /></a>
                        <div class="floatR"><strong class="blue">4658</strong><span>users</span></div>
                    </li>
                    <li>
                        <a href="" class="greenImg"><img src="images/icons/quickstats/money.png" alt="" /></a>
                        <div class="floatR"><strong class="blue">1289</strong><span>orders</span></div>
                    </li>
                </ul>
                <div class="clear"></div>
            </div>-->
            <?php include "menus/top_menu.php"; ?> 
            <!-- Breadcrumbs line -->
            <div class="breadLine">
                <div class="bc">
                    <ul id="breadcrumbs" class="breadcrumbs">
                        <li><a href="home.php">Dashboard</a></li>
                        <li><a href="javascritp:">Waiting for Approval</a></li>
                        
                    </ul>
                </div>        
                <?php include "menus/top_left_menu.php"; ?>  
            </div>          
            <!-- Main content -->
            <div class="wrapper">
            	<?php
					$des_det = $_GET['des_sts'];
				?>
            	<ul class="middleNavR">
                    <li><a href="waiting_for_appr_list.php?des_sts=<?php echo $des_det; ?>" id="listpage" title="List Waiting for Approval" class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
                </ul>
                <?php
					$page_id = base64_encode(base64_encode(base64_encode(base64_encode(1))));
					$des_no  = base64_decode(base64_decode(base64_decode(base64_decode($_GET['des_no']))));
					$emp_ad_id  = base64_decode(base64_decode(base64_decode(base64_decode($_GET['emp_ad_id']))));
					
					$SLCT_CAD = "SELECT * FROM emp_current_design,design_det WHERE design_det.design_det_id = emp_current_design.design_det_id AND emp_current_design.design_det_id = '$des_no' AND emp_current_design.emp_det_id='$emp_ad_id'";
					//echo $SLCT_CAD;
					$QURY_CAD = mysqli_query($connect,$SLCT_CAD);
					$FTCH_CAD = mysqli_fetch_object($QURY_CAD);
					
					$cur_ad_id  = base64_encode(base64_encode(base64_encode(base64_encode($FTCH_CAD->emp_current_design_id))));
					
					$SLCT_CURR_TIM = "SELECT SEC_TO_TIME( SUM( TIME_TO_SEC( `time_taken` ) ) ) AS tot_time FROM emp_current_design_det WHERE emp_current_design_id = '$FTCH_CAD->emp_current_design_id'";
					$QURY_CURR_TIM = mysqli_query($connect,$SLCT_CURR_TIM);
					$FTCH_CURR_TIM = mysqli_fetch_object($QURY_CURR_TIM);
					
					$SLCT_t = "SELECT * FROM master_cad_cat WHERE master_cad_cat_id = '$FTCH_CAD->master_cad_cat_id'";
					$QURY_t = mysqli_query($connect,$SLCT_t);
					if(mysqli_num_rows($QURY_t )>0)
					{
						$FTCH_t = mysqli_fetch_object($QURY_t);
						$cad_cat_name = $FTCH_t->cad_cat_name;
						$cad_pnts = $FTCH_t->cad_points;
					}
					else
					{ 
						$cad_cat_name = "------"; 
						$cad_pnts="----"; 
					}
					
					$SLCT_re = "SELECT * FROM emp_current_design_rework WHERE emp_det_id = '$emp_ad_id' AND design_det_id='$des_no'";
					$QURY_re = mysqli_query($connect,$SLCT_re);
					if(mysqli_num_rows($QURY_re)>0)
					{
						$FTCH_t = mysqli_fetch_object($QURY_re);
						$re_pnts = $FTCH_t->rework_pnts;
					}
					else
					{
						$re_pnts = $cad_pnts;
					}
					
					$SLCT_d = "SELECT * FROM master_cat WHERE master_cat_id = '$FTCH_CAD->master_cat_id'";
					//echo $SLCT_d;
					$QURY_d = mysqli_query($connect,$SLCT_d);
					$FTCH_d = mysqli_fetch_object($QURY_d);	
					
					$SLCT_em = "SELECT * FROM emp_det WHERE emp_det_id = '$emp_ad_id'";
					//echo $SLCT_d;
					$QURY_em = mysqli_query($connect,$SLCT_em);
					$FTCH_em = mysqli_fetch_object($QURY_em);		
					
					if($FTCH_CAD->curr_status=='finished' || $FTCH_CAD->curr_status=='waiting')
					{
						$imag_1 = "../cad_fin_images/M.".$FTCH_CAD->img_ext; 
						$imag_2 = "../cad_fin_images/L.".$FTCH_CAD->img_ext;
						$img_flagg = 1;
					}
					else
					{
						$img_flagg = 2;
					}
					if($FTCH_CAD->mas_fin_ext!=''){ $imag = "../mas_fin_images/M.".$FTCH_CAD->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_CAD->mas_fin_ext; }
					
					else if($FTCH_CAD->cad_fin_ext!=''){ $imag = "../cad_fin_images/M.".$FTCH_CAD->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_CAD->cad_fin_ext; }
					
					else if($FTCH_CAD->imag_ext!=''){ $imag = "../design_images/M.".$FTCH_CAD->imag_ext; $imag1 = "../design_images/L.".$FTCH_CAD->imag_ext; }
					
              	?>
                <form id="validate" name="cur_des" class="main" method="post" action="bl/waiting_for_appr_add_BL.php?cur_ad_id=<?php echo $cur_ad_id; ?>&des_sts=<?php echo $des_det; ?>" enctype="multipart/form-data">
                	<fieldset>
                    	<input type="hidden" name="des_no" id="des_no" value="<?php echo $_GET['des_no']; ?>" />
                        <input type="hidden" name="emp_id" id="emp_id" value="<?php echo $_GET['emp_ad_id']; ?>" />
                        <input type="hidden" name="cad_pnts" id="cad_pnts" value="<?php echo $cad_pnts; ?>" />
                		<div class="fluid">
                			<div class="widget">
                				<div class="formRow">
                					<table width="100%">
                                    	<tr>
                                        	<td width="10%" style="display:table-cell; vertical-align:middle;"><strong>Des Name  :  </strong></td>
                                            <td width="14%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_em->name; ?></td>
                                            <td width="10%" style="display:table-cell; vertical-align:middle;"><strong>Design No  :  </strong></td>
                                            <td width="10%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_d->master_cat_name." ".$FTCH_CAD->design_no; ?></td>
                                            <td width="5%" style="display:table-cell; vertical-align:middle;"><strong>Point  :  </strong></td>
                                            <td width="3%" style="display:table-cell; vertical-align:middle;"><?php echo $re_pnts; ?></td>
                                            <td width="10%" style="display:table-cell; vertical-align:middle;"><strong>No.of Pieces  :  </strong></td>
                                            <td width="3%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_CAD->no_of_pice; ?></td>
                                            <td width="10%" style="display:table-cell; vertical-align:middle;"><strong>Appr. Weight  :  </strong></td>
                                            <td width="6%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_CAD->approximate_weight; ?></td>                                            
                                            <td width="10%" style="display:table-cell; vertical-align:middle;"><strong>Total Time  :  </strong></td>
                                            <td width="15%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_CURR_TIM->tot_time; ?> hrs</td>
                                        </tr>
                                    </table>
                				</div>
                                <div class="formRow">
                                	<table width="100%">
                                    	<tr>
                                        	<td width="80%" style="vertical-align:top; text-align:center; display:table-cell;">
                                            	<div class="widget" style="margin-top:0px;">
                                                    <table cellpadding="0" cellspacing="0" width="100%" class="tDefault" id="resize2">
                                                        <thead>
                                                            <tr>
                                                                <td class="sortCol" width="8%"><div>S.no<span></span></div></td>
                                                                <td class="sortCol" width="15%"><div>W.app Date<span></span></div></td>
                                                                <td class="sortCol" width="15%"><div>App. Date<span></span></div></td>
                                                                <td class="sortCol" width="10%"><div>Admin<span></span></div></td>
                                                                <td class="sortCol" width="15%"><div>Cad Volume<span></span></div></td>
                                                                <td class="sortCol" width="15%"><div>Des. Height<span></span></div></td>
                                                                <td class="sortCol" width="15%"><div>Des. Width<span></span></div></td>
                                                                <td class="sortCol" width="20%"><div>Remarks<span></span></div></td>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                        	<?php
																$i=1;
																$SLCT_CURR_APP  = "SELECT * FROM emp_current_design_det WHERE emp_current_design_id='$FTCH_CAD->emp_current_design_id' AND (waiting_app_dt!='' OR approved_dt!='')";
																//echo $SLCT_CURR_DET;
																$EXEC_CURR_APP 	= mysqli_query($connect,$SLCT_CURR_APP);
																while($FTCH_CURR_APP	= mysqli_fetch_object($EXEC_CURR_APP))
																{
															?>
                                                                  	<tr>
                                                                        <td class="sortCol"><div><?php echo $i; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->waiting_app_dt; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->approved_dt; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->appr_name; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->cad_vol; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->design_height; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->design_width; ?><span></span></div></td>
                                                                        <td class="sortCol"><div><?php echo $FTCH_CURR_APP->remarks; ?><span></span></div></td>
                                                                    </tr>
                                                          	<?php
																	$i++;
																}
															?>
                                                        </tbody>
                                                    </table>
                                                </div>                                                
                                            </td>
                                            <td width="20%" style="vertical-align:top; text-align:center; display:table-cell;">
                                            	<div class="body" style="height:200;text-align:center">
                                                    <a href="<?php echo $imag1; ?>" title="<?php echo $FTCH_d->master_cat_name." ".$FTCH_CAD->design_no; ?>" class="lightbox" rel="group"><img src="<?php echo $imag; ?>" width="220" height="220"/></a>
                                                </div><br />
												<?php 
                                                    if($img_flagg==1)
                                                    {
                                                ?>
                                                        <div class="body" style="height:200;text-align:center">
                                                            <a href="<?php echo $imag_2; ?>" title="<?php echo $FTCH_d->master_cat_name." ".$FTCH_CAD->design_no; ?>" class="lightbox" rel="group"><img src="<?php echo $imag_1; ?>" width="220" height="220"/></a>
                                                        </div>
                                                <?php
                                                    }
                                                ?>
                                            </td>
                                       	</tr>
                                    </table>
                				</div>
                			</div>
                      	</div>
                        <div class="widget">
                            <!--<div style="max-height:700px; overflow-y:auto;">-->
                                <table cellpadding="0" cellspacing="0" width="100%" class="tDefault" id="resize2">
                                    <thead>
                                        <tr>
                                            <td class="sortCol" width="10%"><div>S.no<span></span></div></td>
                                            <td class="sortCol" width="15%"><div>Date<span></span></div></td>
                                            <td class="sortCol" width="15%"><div>Start Time<span></span></div></td>
                                            <td class="sortCol" width="20%"><div>End Time<span></span></div></td>
                                            <td class="sortCol" width="20%"><div>Time Taken<span></span></div></td>
                                            <td class="sortCol" width="20%"><div>Total Design Time<span></span></div></td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    	<?php
											$loop=1;
											$SLCT_CURR = "SELECT * FROM emp_current_design_det WHERE emp_current_design_id = '$FTCH_CAD->emp_current_design_id'";
											$QURY_CURR = mysqli_query($connect,$SLCT_CURR);
											while($FTCH_CURR = mysqli_fetch_object($QURY_CURR))
											{
												if($loop%2 != "0")
													$bg = "gradeX";
												else
													$bg = "class='gradeC'";
										?>
                                                <tr>
                                                    <td style="display:table-cell; vertical-align:middle;" align="center"><?php echo $loop; ?></td>
                                                    <td style="display:table-cell; vertical-align:middle;" align="center"><?php echo str_replace("-","/",$FTCH_CURR->work_dt); ?></td>
                                                    <td style="display:table-cell; vertical-align:middle;" align="center"><?php echo $FTCH_CURR->start_time; ?><input type="hidden" name="st_tim[<?php echo $loop; ?>]" id="st_tim<?php echo $loop; ?>" value="<?php echo $FTCH_CURR->start_time; ?>" /></td>
                                                    <td style="display:table-cell; vertical-align:middle;" align="center"><span id="out_div<?php echo $loop; ?>"><?php echo $FTCH_CURR->end_time; ?></span><input type="hidden" name="out_tim[<?php echo $loop; ?>]" id="out_tim<?php echo $loop; ?>" value="<?php echo $FTCH_CURR->end_time; ?>" /></td>
                                                    <td style="display:table-cell; vertical-align:middle;" align="center"><span id="tak_div<?php echo $loop; ?>"><?php echo $FTCH_CURR->time_taken; ?></span><input type="hidden" name="tim_tak[<?php echo $loop; ?>]" id="tim_tak<?php echo $loop; ?>" value="<?php echo $FTCH_CURR->time_taken; ?>" /></td>
                                                    <td style="display:table-cell; vertical-align:middle;" align="center"><span id="tot_div<?php echo $loop; ?>"><?php echo $FTCH_CURR->tot_time; ?></span><input type="hidden" name="tot_tim[<?php echo $loop; ?>]" id="tot_tim<?php echo $loop; ?>" value="<?php echo $FTCH_CURR->tot_time; ?>" /></td>
                                                </tr>
                                        <?php
												$loop++;
											}
										?>
                                    </tbody>
                                </table> 
                                <input type="hidden" name="tot_loop" id="tot_loop" value="<?php echo $loop; ?>" />
                            <!--</div>-->
                        </div> 
						<?php
							$loop2=1;
							$SLCT_STN = "SELECT * FROM emp_current_design_stone WHERE design_det_id = '$des_no' AND emp_det_id='$emp_ad_id' AND statu_s='1'";
							$QURY_STN = mysqli_query($connect,$SLCT_STN);
							if(mysqli_num_rows($QURY_STN)>0)
							{
						?>
								<div class="widget" >
									<table width="100%" class="tDefault" id="resize2">
										<thead>
											<tr>
												<td align="center"  width="5%" style="display:table-cell; vertical-align:middle;"><strong>Sl No</strong></td>
												<td align="center" width="20%" style="display:table-cell; vertical-align:middle;"><strong>Stone Shape</strong></td>
												<td align="center" width="20%" style="display:table-cell; vertical-align:middle;"><strong>Stone Size</strong></td>
												<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><strong>Stone Weight</strong></td>
												<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><strong>Quantity</strong></td>
												<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><strong>Total Weight</strong></td>
											</tr>
										</thead>
                                    	<tbody>
										<?php
											while($FTCH_STN = mysqli_fetch_object($QURY_STN))
											{
												$SLCT_STN1 = "SELECT * FROM mas_stone_cat WHERE mas_stone_cat_id = '$FTCH_STN->mas_stone_cat_id'";
												$QURY_STN1 = mysqli_query($connect,$SLCT_STN1);
												$FTCH_STN1 = mysqli_fetch_object($QURY_STN1);	
												
												$SLCT_STN2 = "SELECT * FROM mas_stone_type WHERE mas_stone_type_id = '$FTCH_STN->mas_stone_type_id'";
												$QURY_STN2 = mysqli_query($connect,$SLCT_STN2);
												$FTCH_STN2 = mysqli_fetch_object($QURY_STN2);
										?>
												<tr>
													<td align="center" width="5%" style="display:table-cell; vertical-align:middle;"><?php echo $loop2; ?></td>
													<td align="center" width="20%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_STN1->cat_name; ?></td>
													<td align="center" width="20%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_STN2->stone_name; ?></td>
													<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><?php echo number_format($FTCH_STN->stone_weight,4)." g"; ?></td>
													<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><?php echo $FTCH_STN->quantity; ?></td>
													<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><?php echo number_format($FTCH_STN->total_weight,4)." g"; ?></td>
												</tr>
										<?php
												$loop2++;
											}
										?>
												<tr>
													<td align="center" colspan="4" style="display:table-cell; vertical-align:middle;">&nbsp;</td>
													<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><strong>Total Stone Weight</strong></td>
													<td align="center" width="15%" style="display:table-cell; vertical-align:middle;"><?php echo number_format($FTCH_CAD->total_stone_weight,4)." g"; ?></td>
												</tr>
										</tbody>
									</table>
									<div class="clear"></div>
								</div>
						<?php
							}
						?>
                        <div class="fluid">
                            <div class="widget"> 
                                <div class="formRow">
                                    <div class="grid2"><label>Type :</label> <input type="hidden" name="lbl_titl" id="lbl_titl" value="<?php echo $FTCH_CAD->curr_status; ?>" /></div>
                                    <div class="grid9">
                                        <table>
                                        	<tr>
                                            	<td><input type="radio" id="radio1" name="question1" value="rework" onfocus="foc(this.id)" onblur="stnon(this.id)" onclick="rework_hid(1)" /><label for="radio1" class="mr20">Rework</label></td> 
                                            	<?php if($FTCH_CAD->curr_status!='finished'){?><td><input type="radio" id="radio2" name="question1" value="approved" onfocus="foc(this.id)" onblur="stnon(this.id)" onclick="rework_hid(2)" /><label for="radio2" class="mr20">Approved</label></td><?php } ?>
                                        		<td><input type="radio" id="radio3" name="question1" value="closed" onfocus="foc(this.id)" onblur="stnon(this.id)" onclick="rework_hid(3)" /><label for="radio3" class="mr20">Closed</label></td>                                        		
                                         	</tr>
                                       	</table>                                        
                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div id="rewk_div" style="display:none;">
                                	<div class="formRow">
	                                    <div class="grid2"><label>Rework For:</label> </div>
	                                    <div class="grid9">
	                                        <table>
	                                        	<tr>
	                                            	<td><input type="radio" id="re_radio1" name="rework1" value="same" onfocus="foc(this.id)" onblur="stnon(this.id)" onclick="other_emp_hid(1)"/><label for="re_radio1" class="mr20">Same</label></td> 
	                                            	<td><input type="radio" id="re_radio2" name="rework1" value="other" onfocus="foc(this.id)" onblur="stnon(this.id)" onclick="other_emp_hid(2)" /><label for="re_radio2" class="mr20">Other</label></td>                                        		
	                                         	</tr>
	                                       	</table>                                        
	                                    </div>
	                                    <div class="clear"></div>
	                               	</div>
                                    <div class="formRow">
	                                    <div class="grid2"><label>Rework Reason:</label> </div>
	                                    <div class="grid4 searchDrop">
	                                        <select data-placeholder="Choose an Reason..." class="select" name="rework_reason" id="rework_reason" style="width:250px;" tabindex="2">
	                                            <option value=""></option>
	                                            <?php
	                                            $SLCT_E = "SELECT master_cad_remarks_id,description FROM master_cad_remarks WHERE statu_s='active'"; 
	                                            $QURY_E = mysqli_query($connect,$SLCT_E);
	                                            while($FTCH_E = mysqli_fetch_object($QURY_E))
	                                            {
	                                            ?>
	                                            	<option value="<?php echo $FTCH_E->master_cad_remarks_id ?>"><?php echo $FTCH_E->description ?></option>
	                                            <?php
	                                            }
	                                            ?>	                                                
	                                        </select>
	                                    </div>
	                                    <div class="clear"></div>
                                	</div>
                                	<div class="clear"></div>
                                </div>
                                <div class="formRow" id="other_emp" style="display:none;">
                                    <div class="grid2"><label>CAD Designer:</label> </div>
                                    <div class="grid4 searchDrop">
                                        <select data-placeholder="Choose an Employee..." class="select" name="hdes_name" id="hdes_name" style="width:250px;" tabindex="2">
                                            <option value=""></option>
                                            <?php
                                            $SLCT_E = "SELECT * FROM emp_det WHERE master_dept_id = '2' AND emp_det_id NOT IN($emp_ad_id) AND statu_s='active'"; //HERE THE 2 IS REPRESENTS CAD DESIGNER ID 
                                            //echo $SLCT;
                                            $QURY_E = mysqli_query($connect,$SLCT_E);
                                            while($FTCH_E = mysqli_fetch_object($QURY_E))
                                            {
                                            ?>
                                            	<option value="<?php echo $FTCH_E->emp_det_id ?>"><?php echo $FTCH_E->name ?></option>
                                            <?php
                                            }
                                            ?>
                                                
                                        </select>
                                    </div>
                                    <div class="grid2"><label>Rework Points:</label> </div>
                                    <div class="grid4"><input type="text" name="rework_pnts" id="rework_pnts" value="" style="width:100px;" /></div>
                                    <div class="clear"></div>
                                </div>
                                <div class="formRow">
                                    <div class="grid2"><label>Remarks :</label> </div>
                                    <div class="grid9"><textarea name="remarks" id="remarks" rows="5" style="width:250px"></textarea></div>
                                    <div class="clear"></div>
                                </div>
                                
                                <div class="formRow">
                                    <input type="button" value="Finish" class="buttonM bBlack formSubmit" onclick="form_submit()" onfocus="foc(this.id)" onblur="stnon(this.id)" style="float: right; margin-left:20px;"/>
                                    <!--<input type="button" value="Reset" class="buttonM bRed" onclick="form_reload()" onfocus="foc(this.id)" onblur="stnon(this.id)" style="float: right; margin-left:20px;" />-->
                                    <div class="clear"></div>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                	</fieldset>
                </form>              
            </div>
            <!-- Main content ends -->
        </div>       
        <!-- Content ends -->
    </body>
</html>
