<?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/cam_finishing_add_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.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>

<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="#">Dashboard</a></li>
                <li><a href="javascript:">CAM Receiving</a></li>
                    
            </ul>
        </div>
	<?php include "menus/top_left_menu.php"; ?>            
        
    </div>
    
    <!-- Main content -->
    <div class="wrapper">
    
        <ul class="middleNavR">
            <!--<li><a href="#" title="Add an article" class="tipN"><img src="images/icons/middlenav/create.png" alt="" /></a></li>
            <li><a href="#" title="Upload files" class="tipN"><img src="images/icons/middlenav/upload.png" alt="" /></a></li>-->  
          <!--<li><a href="design_add.php" title="Add Design" class="tipN"><img src="images/icons/middlenav/add.png" alt="" /></a></li>-->
            <!--<li><a href="#" title="Messages" class="tipN"><img src="images/icons/middlenav/dialogs.png" alt="" /></a><strong>8</strong></li>-->
            <li><a href="cam_finishing_list.php" id="listpage" title="List CAM Finishing" class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
    	</ul>            
  		<?php
		$finishing_date	=	base64_decode(base64_decode(base64_decode($_GET['finishing_date']))); //THIS IS PAGE ID  
		
		$page_id= base64_encode(base64_encode(base64_encode(1))); //THIS IS FOR PAGE IDENTIFICATION IN BL FILE for add
		
		?>

    	<!-- Chart --><!-- 6 + 6 -->
        <form id="validate" name="checklist" class="main" method="post" action="bl/cam_finishing_BL.php?page_id=<?php echo $page_id; ?>" onsubmit="checkTheBox();">
         <fieldset>
              
        
    	 <div class="widget">
            <div class="whead"><!--<span class="titleIcon check"><input type="checkbox" id="titleCheck" name="titleCheck" /></span>-->
            <h6>CAM Receiving View</h6><h6>Receiving Date : <?php echo str_replace("-", "/",$finishing_date); ?></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>
            <table cellpadding="0" cellspacing="0" border="0" class="dTable" id="dynamic">
            <thead>
            <tr>
           <!-- <td width="79"><img src="images/elements/other/tableArrows.png" alt="" /></td>-->
            <th width="92" align="center">S.No<span class="sorting" style="display: block;"></span></th>
            <!--<td width="132">Category</td>-->
            <th width="126" align="center">Design No</th>
			<th width="95" align="center">No of Pieces</th>
            <th width="146" align="center">Loading Date</th>
            <th width="113" align="left">Design Status</th>
            <th width="114" align="center">CAM Weight</th>
            <th width="139" align="center">Image</th>
           <!-- <td width="71">View</td>
            <td width="149">Status</td>-->
           
            </tr>
            </thead>
            <tbody>
            <?php
			
			
			$SLCT = "SELECT  * FROM cam_finishing WHERE to_rtv_load = 'no' AND finishing_date = '$finishing_date' ORDER BY cam_finishing_id ASC";
			//echo $SLCT;
			$QURY = mysqli_query($connect,$SLCT);
			$loop=1;
			if(mysqli_num_rows($QURY)>0)
			{			
			while($FTCH = mysqli_fetch_object($QURY))
			{
				$design_id	=	base64_encode(base64_encode(base64_encode($FTCH->design_det_id)));
				
				$SLCT_t = "SELECT * FROM design_det WHERE design_det_id = '$FTCH->design_det_id'";
				$QURY_t = mysqli_query($connect,$SLCT_t);
				$FTCH_t = mysqli_fetch_object($QURY_t);
				
				$SLCT_d = "SELECT  * FROM master_cat WHERE master_cat_id = '$FTCH_t->master_cat_id'";
				$QURY_d = mysqli_query($connect,$SLCT_d);
				$FTCH_d = mysqli_fetch_object($QURY_d);
				
				$SLCT_ld = "SELECT  * FROM cam_loading WHERE design_det_id = '$FTCH->design_det_id'";
				$QURY_ld = mysqli_query($connect,$SLCT_ld);
				$FTCH_ld = mysqli_fetch_object($QURY_ld);
			
				if($loop%2 != "0")
					$bg = "gradeX";
				else
					$bg = "class='gradeC'";
					
					if($FTCH_t->mas_fin_ext!=''){ $imag = "../mas_fin_images/S.".$FTCH_t->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_t->mas_fin_ext;}

					else if($FTCH_t->cad_fin_ext!=''){ $imag = "../cad_fin_images/S.".$FTCH_t->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_t->cad_fin_ext;  }
					
					else if($FTCH_t->imag_ext!=''){ $imag = "../design_images/S.".$FTCH_t->imag_ext; $imag1 = "../design_images/L.".$FTCH_t->imag_ext; }
			?>
            
            <tr <?php echo $bg ?>>
            <?php /*?><td><input type="checkbox" name="category[]" id="<?php echo $loop ?>" value="<?php echo $FTCH->design_det_id ?>" /></td><?php */?>
            <td align="center" style="display:table-cell;vertical-align:middle"><?php echo $loop ?></td>
            <?php /*?><td align="center"><?php echo $FTCH_d->master_cat_name; ?></td><?php */?>
            <td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_d->master_cat_name." ".$FTCH_t->design_no; ?><?php if($FTCH_t->up_status=="yes"){ echo " ( Old ".$FTCH_t->no_of_tm_alt." )"; } ?></td>
            <td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_t->no_of_pieces; ?></td>
            <td align="center" style="display:table-cell;vertical-align:middle"><?php echo date("d/m/Y", strtotime($FTCH_ld->loading_date)); ?></td>
            <td align="left" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_t->design_status; ?></td>
            <td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH->cam_weight; ?></td>
            <td class="center" style="display:table-cell;vertical-align:middle"><div class="body" align="center">
                	<a href="<?php echo $imag1; ?>" title="<?php echo $FTCH_d->master_cat_name." ".$FTCH_t->design_no; ?>" class="lightbox" rel="group"><img src="<?php echo $imag; ?>" width="60" height="60"/></a>
                </div></td>
            <?php /*?><td class="center"><a href="employee_view.php?design_id=<?php echo $design_id ?>">View</a></td>
            <td class="center"><?php if($FTCH->statu_s=="active"){ ?><a href="bl/design_BL.php?design_id=<?php echo $design_id ?>&page_id=<?php echo $page_id; ?>&statu_s=active">Active</a><?php }else{ ?><a href="bl/design_BL.php?design_id=<?php echo $design_id ?>&page_id=<?php echo $page_id; ?>&statu_s=inactive">Inactive</a> <?php } ?></td><?php */?>
            </tr>
            
            <?php
			$loop ++;
		
			 }
			 }
			 ?>
            <?php if($loop==1){ ?>
            <tr>
              <td colspan="10" align="center">
              <div class="nNote nFailure">
                <p>Oops Sorry No Data Found...</p>
            </div>
              </td>
              </tr>
			<?php } ?>				
				
            </tbody>
            </table> 
            </div>
        </div>      
       
        </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>
