<?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>

<script type="text/javascript" src="js/piece_loading_add_JS.js"></script>
<script type="text/javascript" src="js/cnt_chkbox_JS.js"></script>

<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/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.dataTables1.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>

<script type="text/javascript" src="js/charts/chart.js"></script>
<script type="text/javascript" src="js/charts/hBar_side.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">    
		<?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="javascript:">Piece Loading</a></li>
                        
                </ul>
            </div>
			<?php include "menus/top_left_menu.php"; ?>
  		</div>
    	<!-- Main content -->
    	<div class="wrapper">
            <ul class="middleNavR">
                <li><a href="po_finishing_list.php" id="listpage" title="List Purchase Order Finishing" class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
            </ul>            
			<?php
				$po_id= base64_decode(base64_decode(base64_decode($_GET['po_id'])));				
				if(isset($_GET['piece_trc']) && $_GET['piece_trc']!='')
				{
					$piece_trc= base64_decode(base64_decode(base64_decode(base64_decode($_GET['piece_trc']))));
					if($piece_trc=='Load')
					{
						$ld_flagg = 1;
						$flagg = 1;
						$disp ="none";
						$disp1 ="none";
						$trc_typ = '';
						$to_po_no = "";
					}
					else if($piece_trc=='Cancel')
					{
						$disp ="block";
						if(isset($_GET['trc_typ']) && $_GET['trc_typ']!='')
						{
							$trc_typ = base64_decode(base64_decode(base64_decode(base64_decode($_GET['trc_typ']))));
							if($trc_typ=='To Po')
							{
								if(isset($_GET['to_po']) && $_GET['to_po']!='')
								{
									$to_po_no = base64_decode(base64_decode(base64_decode(base64_decode($_GET['to_po']))));
									$ld_flagg = 3;	
									$flagg = 1;	
									$disp1 ="block";				
								}
								else
								{
									$flagg = 2;
									$disp1 ="none";
									$to_po_no = "";
								}
							}
							else if($trc_typ=='Box')
							{
								$ld_flagg = 2;
								$flagg = 1;	
								$disp1 ="none";
								$to_po_no = "";
							}
						}
						else
						{
							$flagg = 2;
							$trc_typ = '';
							$disp1 ="none";
							$to_po_no = "";
						}
					}
				}
				else
				{
					$piece_trc = '';
					$flagg = 2;
					$disp='none';
					$disp1 ="none";
					$trc_typ = '';
					$to_po_no = "";
				}
            ?>
    		<!-- Chart --><!-- 6 + 6 -->
        	<form id="validate" name="check_list" class="main" method="post" action="bl/piece_loading_BL.php" onsubmit="checkTheBox();">
        		<fieldset>
        			<div class="fluid">
            			<div class="widget">
                			<div class="formRow">
                            <?php
								$SLCT_po = "SELECT * FROM po_entry WHERE po_entry_id ='$po_id'";
								//echo $SLCT_po;
								$QURY_po = mysqli_query($connect,$SLCT_po);
								$FTCH_po = mysqli_fetch_object($QURY_po);
								
								$SLCT_tp = "SELECT * FROM party_det WHERE party_det_id = '$FTCH_po->party_det_id'";
								$QURY_tp = mysqli_query($connect,$SLCT_tp);
								$FTCH_tp = mysqli_fetch_object($QURY_tp);
							?>
                    			<div class="grid2"><label>PO No:<span class="req"></span></label></div>
                    			<div class="grid4"><input type="hidden" name="po_no" id="po_no" value="<?php echo $_GET['po_id']; ?>" readonly="readonly"/>
                                <?php 
                                if($admin_flagg==1)
                                {                                
                                	echo $FTCH_po->po_no." / ".$FTCH_tp->party_code." - ".$FTCH_tp->cmp_name; 
                                }
                                else 
                                {
                                	echo $FTCH_po->po_no." / ".$FTCH_tp->party_code;
                                }
                                ?>
                                </div><div class="clear"></div>
                			</div>
                            <div class="formRow">
                                <div class="grid2"><label>Piece Loading Type :<span class="req">*</span></label></div>
                                <div class="grid4 ">
									<table>
										<tr>
											<td><label for="piece_trc_1"><input <?php if($piece_trc=='Load'){ ?> checked="checked" <?php } ?> type="radio" name="piece_trc" id="piece_trc_1" value="<?php echo base64_encode(base64_encode(base64_encode(base64_encode("Load")))); ?>" onclick="reload_page(1)"/>Load&nbsp;&nbsp;&nbsp;&nbsp;</label></td>
											<td><label for="piece_trc_2"><input <?php if($piece_trc=='Cancel'){ ?> checked="checked" <?php } ?> type="radio" name="piece_trc" id="piece_trc_2" value="<?php echo base64_encode(base64_encode(base64_encode(base64_encode("Cancel")))); ?>" onclick="reload_page(2)" />Cancel</label></td>
										</tr>
									</table>
                                </div>
								<div class="clear"></div>
                            </div>
							<div class="formRow" style="display:<?php echo $disp; ?>">
                                <div class="grid2"><label>Tracking Type :<span class="req">*</span></label></div>
                                <div class="grid4 ">
									<table>
										<tr>
											<td><label for="trc_type_0"><input <?php if($trc_typ=='To Po'){ ?> checked="checked" <?php } ?> type="radio" name="trc_type" id="trc_type_0" value="<?php echo base64_encode(base64_encode(base64_encode(base64_encode("To Po")))); ?>" onclick="hide_page(1)"/>To PO&nbsp;&nbsp;&nbsp;&nbsp;</label></td>
											<td><label for="trc_type_1"><input <?php if($trc_typ=='Box'){ ?> checked="checked" <?php } ?> type="radio" name="trc_type" id="trc_type_1" value="<?php echo base64_encode(base64_encode(base64_encode(base64_encode("Box")))); ?>" onclick="hide_page(2)" />Box</label></td>
										</tr>
									</table>
                                </div>
								<div class="clear"></div>
                            </div>
							<div class="formRow" id="to_po_div" style="display:<?php echo $disp1; ?>">
                                <div class="grid2"><label>To Po No :<span class="req">*</span></label></div>
                                <div class="grid4 searchDrop">
                                    <select data-placeholder="Choose an Po No..." class="select" name="to_po" id="to_po" style="width:350px;" onchange="reload_page(3)" >
                                        <option value=""></option>
                                        <?php
                                       		mysqli_query($connect,"SET SESSION group_concat_max_len = 1000000;");													
											$SLCT_E = "SELECT po_entry.po_entry_id,po_entry.po_no,po_entry.party_det_id,GROUP_CONCAT(po_entry_det.design_det_id) AS design_det_id FROM po_entry,po_entry_det WHERE po_entry_det.po_entry_id =po_entry.po_entry_id AND po_entry_det.fin_status='no' AND po_entry_det.cancelled='no' AND po_entry.po_entry_id!='$po_id' AND design_det_id!=0 GROUP BY po_entry.po_entry_id";
											$QURY_E = mysqli_query($connect,$SLCT_E);
											if(mysqli_num_rows($QURY_E)>0)
											{
												while($FTCH_E = mysqli_fetch_object($QURY_E))
												{	
													$img_id = $FTCH_E->design_det_id;
													$SLCT_SAM = "SELECT design_det_id FROM piece_loading WHERE po_entry_id = '".$po_id."' AND piece_status = 'loading' AND FIND_IN_SET(`design_det_id`,'$img_id')";
													$QURY_SAM = mysqli_query($connect,$SLCT_SAM);
													if(mysqli_num_rows($QURY_SAM)>0)
													{
														$SLCT_tp1 = "SELECT * FROM party_det WHERE party_det_id = '$FTCH_E->party_det_id'";
														$QURY_tp1 = mysqli_query($connect,$SLCT_tp1);
														$FTCH_tp1 = mysqli_fetch_object($QURY_tp1);
										
														if($admin_flagg==1)
						                                {                                
						                                	$po_no = $FTCH_E->po_no." / ".$FTCH_tp1->party_code." - ".$FTCH_tp1->cmp_name; 
						                                }
						                                else 
						                                {
						                                	$po_no = $FTCH_E->po_no." / ".$FTCH_tp1->party_code;
						                                }								
                                        ?>
                                       					<option <?php if($to_po_no==$FTCH_E->po_entry_id){ ?>  selected="selected" <?php } ?> value="<?php echo base64_encode(base64_encode(base64_encode(base64_encode($FTCH_E->po_entry_id))));?>"><?php echo $po_no ?></option>
                                        <?php   
                                        			}                                     		
					                           	}		
                                        	}
                                        ?>                                    
                                    </select>
                                </div>
								<div class="clear"></div>
                            </div>
                            <div class="formRow">
                                <div class="grid2"><label>Date:<span class="req"></span></label></div>
                                <div class="grid4"><input type="text" value="" name="lod_dt" id="lod_dt" class="datepicker"/></div>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                  	<?php
						if($flagg == 1)
						{
					?>    				
							<div class="widget"> <!--style="width:600px; margin-left:150px;"-->
								<div class="whead"><span class="titleIcon check"><input type="checkbox" id="titleCheck" name="titleCheck" onclick="ckall()" onfocus="foc(this.id)" onblur="stnon(this.id)"/></span><h6>Piece Loading</h6><h6 style="float:right; margin-right:50px;"><input type="text" id="cnt_chk" name="cnt_chk" value="" readonly="readonly" disabled="disabled" style="width:50px; font-size:12px; text-align:center;" /></h6><div class="clear"></div></div>
								<div id="dyn" class="hiddenpars"><a href="javascript:0" id="searchlink" onfocus="foc(this.id)" onblur="stnon(this.id)" class="tOptions" title="Options"><img src="images/icons/options.png" alt="" /></a>
									<div style="max-height:700px; overflow-y:auto;">
									<table cellpadding="0" cellspacing="0" border="0" class="dTable check" id="checkAll">
										<thead>
											<tr>
												<td width="20"><img src="images/elements/other/tableArrows.png" alt="" /></td>
												<th width="26">S.No<span class="sorting" style="display: block;"></span></th>
												<th width="95">Design No</th>
												<th width="95">No of Masters</th>
												<th width="78">Image</th>
											</tr>
										</thead>
										<tbody>										
										<?php
											$loop=1;
											if($ld_flagg==1)
											{
												//$SLCT_t = "SELECT * FROM po_entry_det WHERE po_entry_id = '$po_id' AND fin_status = 'no' AND cancelled = 'no' AND design_det_id NOT IN(SELECT design_det_id FROM piece_loading WHERE piece_status = 'loading' ) ORDER BY design_det_id ASC";
												$SLCT_t = "SELECT * FROM po_entry_det WHERE po_entry_id = '$po_id' AND fin_status = 'no' AND cancelled = 'no' ORDER BY design_det_id ASC"; 
												// LIMIT 2000, 2000
												//LIMIT 0, 2000
											}
											else if($ld_flagg==2)
											{
												$SLCT_t = "SELECT * FROM piece_loading WHERE po_entry_id = '$po_id' AND piece_status = 'loading' ORDER BY design_det_id ASC";
											}
											else if($ld_flagg==3)
											{
												//$SLCT_t = "SELECT * FROM piece_loading WHERE po_entry_id = '$po_id' AND piece_status = 'loading' AND design_det_id IN(SELECT design_det_id FROM po_entry_det WHERE po_entry_det.po_entry_id ='$to_po_no' AND po_entry_det.fin_status='no' AND po_entry_det.cancelled='no') ORDER BY design_det_id ASC";
												$SLCT_t = "SELECT * FROM piece_loading WHERE po_entry_id = '$po_id' AND piece_status = 'loading' ORDER BY design_det_id ASC";
											}	
											//echo $SLCT_t;
											$QURY_t = mysqli_query($connect,$SLCT_t);
											if(mysqli_num_rows($QURY_t)>0)
											{
												while($FTCH_t = mysqli_fetch_object($QURY_t))
												{
													if($ld_flagg==1)
													{
														$SLCT_CONT = "SELECT design_det_id FROM piece_loading WHERE piece_status = 'loading' AND design_det_id = '$FTCH_t->design_det_id'";	
														$QURY_CONT = mysqli_query($connect,$SLCT_CONT);
														if(mysqli_num_rows($QURY_CONT)<1)
														{
														$SLCT_d = "SELECT * FROM design_det,master_cat WHERE master_cat.master_cat_id = design_det.master_cat_id AND design_det_id = '$FTCH_t->design_det_id'";
														$QURY_d = mysqli_query($connect,$SLCT_d);
														$FTCH_dt = mysqli_fetch_object($QURY_d);
														
														if($loop%2 != "0")
															$bg = "gradeX";
														else
															$bg = "class='gradeC'";
														 if($FTCH_dt->mas_fin_ext!=''){ $imag = "../mas_fin_images/S.".$FTCH_dt->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_dt->mas_fin_ext;}
							
														else if($FTCH_dt->cad_fin_ext!=''){ $imag = "../cad_fin_images/S.".$FTCH_dt->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_dt->cad_fin_ext; }
														
														else if($FTCH_dt->imag_ext!=''){ $imag = "../design_images/S.".$FTCH_dt->imag_ext; $imag1 = "../design_images/L.".$FTCH_dt->imag_ext; }
											?>
														<tr <?php echo $bg ?>>
															<td style="display:table-cell;vertical-align:middle;"><input type="checkbox" name="category[]" id="category<?php echo $loop ?>" onclick="cnt_chk_fn(<?php echo $loop ?>);" value="<?php echo $FTCH_dt->master_cat_id .",".$FTCH_t->design_det_id .",".$FTCH_t->po_entry_det_id?>" onfocus="foc(this.id)" onblur="stnon(this.id)"/></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $loop ?></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_dt->master_cat_name." ".$FTCH_dt->design_no; ?></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_dt->master_pieces; ?></td>
															<td class="center" align="center"><div class="body" align="center">
															<a href="<?php echo $imag1; ?>" class="lightbox" rel="group" title="<?php echo $FTCH_dt->master_cat_name." ".$FTCH_dt->design_no; ?>"><img src="<?php echo $imag; ?>" width="60" height="60"/></a></div></td>                            
														</tr>
					
											<?php       //die();
														$loop ++;
														}
													}	
													else if($ld_flagg==2)
													{
														$SLCT_d = "SELECT * FROM design_det,master_cat WHERE master_cat.master_cat_id = design_det.master_cat_id AND design_det_id = '$FTCH_t->design_det_id'";
														$QURY_d = mysqli_query($connect,$SLCT_d);
														$FTCH_dt = mysqli_fetch_object($QURY_d);
														
														if($loop%2 != "0")
															$bg = "gradeX";
														else
															$bg = "class='gradeC'";
														 if($FTCH_dt->mas_fin_ext!=''){ $imag = "../mas_fin_images/S.".$FTCH_dt->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_dt->mas_fin_ext;}
							
														else if($FTCH_dt->cad_fin_ext!=''){ $imag = "../cad_fin_images/S.".$FTCH_dt->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_dt->cad_fin_ext; }
														
														else if($FTCH_dt->imag_ext!=''){ $imag = "../design_images/S.".$FTCH_dt->imag_ext; $imag1 = "../design_images/L.".$FTCH_dt->imag_ext; }
											?>
														<tr <?php echo $bg ?>>
															<td style="display:table-cell;vertical-align:middle;"><input type="checkbox" name="category[]" id="category<?php echo $loop ?>" onclick="cnt_chk_fn(<?php echo $loop ?>);" value="<?php echo $FTCH_dt->master_cat_id .",".$FTCH_t->design_det_id .",".$FTCH_t->po_entry_det_id?>" onfocus="foc(this.id)" onblur="stnon(this.id)"/></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $loop ?></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_dt->master_cat_name." ".$FTCH_dt->design_no; ?></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_dt->master_pieces; ?></td>
															<td class="center" align="center"><div class="body" align="center">
															<a href="<?php echo $imag1; ?>" class="lightbox" rel="group" title="<?php echo $FTCH_dt->master_cat_name." ".$FTCH_dt->design_no; ?>"><img src="<?php echo $imag; ?>" width="60" height="60"/></a></div></td>                            
														</tr>
					
											<?php
														$loop ++;
													}
													else if($ld_flagg==3)
													{
														$SLCT_CONT = "SELECT design_det_id FROM po_entry_det WHERE po_entry_det.po_entry_id ='$to_po_no' AND po_entry_det.fin_status='no' AND po_entry_det.cancelled='no' AND design_det_id = '$FTCH_t->design_det_id'";	
														$QURY_CONT = mysqli_query($connect,$SLCT_CONT);
														if(mysqli_num_rows($QURY_CONT)>0)
														{
														$SLCT_d = "SELECT * FROM design_det,master_cat WHERE master_cat.master_cat_id = design_det.master_cat_id AND design_det_id = '$FTCH_t->design_det_id'";
														$QURY_d = mysqli_query($connect,$SLCT_d);
														$FTCH_dt = mysqli_fetch_object($QURY_d);
														
														if($loop%2 != "0")
															$bg = "gradeX";
														else
															$bg = "class='gradeC'";
														 if($FTCH_dt->mas_fin_ext!=''){ $imag = "../mas_fin_images/S.".$FTCH_dt->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_dt->mas_fin_ext;}
							
														else if($FTCH_dt->cad_fin_ext!=''){ $imag = "../cad_fin_images/S.".$FTCH_dt->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_dt->cad_fin_ext; }
														
														else if($FTCH_dt->imag_ext!=''){ $imag = "../design_images/S.".$FTCH_dt->imag_ext; $imag1 = "../design_images/L.".$FTCH_dt->imag_ext; }
											?>
														<tr <?php echo $bg ?>>
															<td style="display:table-cell;vertical-align:middle;"><input type="checkbox" name="category[]" id="category<?php echo $loop ?>" onclick="cnt_chk_fn(<?php echo $loop ?>);" value="<?php echo $FTCH_dt->master_cat_id .",".$FTCH_t->design_det_id .",".$FTCH_t->po_entry_det_id?>" onfocus="foc(this.id)" onblur="stnon(this.id)"/></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $loop ?></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_dt->master_cat_name." ".$FTCH_dt->design_no; ?></td>
															<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_dt->master_pieces; ?></td>
															<td class="center" align="center"><div class="body" align="center">
															<a href="<?php echo $imag1; ?>" class="lightbox" rel="group" title="<?php echo $FTCH_dt->master_cat_name." ".$FTCH_dt->design_no; ?>"><img src="<?php echo $imag; ?>" width="60" height="60"/></a></div></td>                            
														</tr>
					
											<?php
														$loop ++;
														}
													}
												}
											}
										?>
										</tbody>
									</table> 
									</div>
								</div>
							</div>
							<div class="fluid">
								<div class="widget">
									<div class="formRow">
										<input type="button" value="Submit" class="buttonM bBlack formSubmit" onclick="checkTheBox();" style="float: right; margin-left:20px;"/>
										<input type="button" value="Reset" class="buttonM bRed" style="float: right; margin-left:20px;" onclick="form_rest();"/>
										<div class="clear"></div>
									</div>
								</div>
							</div>
					<?php
						}
					?>
                </fieldset>
            </form>
            <div class="fluid"><!-- Media table --></div>
        </div>
        <!-- Main content ends -->
    </div>
    <!-- Content ends -->
    <?php /*?><?php include "header_footer/footer.php"; ?><?php */?>
</body>
</html>
