<?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/cnt_chkbox_JS.js"></script>
<script type="text/javascript" src="js/cli_ord_req_view_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"; ?>  

 <?php
			
			$guest_id	=	base64_decode(base64_decode(base64_decode(base64_decode($_GET['guest_id'])))); //THIS IS PAGE ID 
			$SLCT1 = "SELECT * FROM guest_user WHERE guest_id = '$guest_id'";
			$QURY1 = mysqli_query($connect,$SLCT1); 
			$FTCH1 = mysqli_fetch_object($QURY1);
			?>  
    <!-- 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:">Guest User Request</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="guest_ord_req_list.php" id="listpage" title="List Design Request " class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
			
    	</ul>            
  		

    	<!-- Chart --><!-- 6 + 6 -->
        <form id="validate" name="checklist" class="main" method="post" action="bl/po_entry_BL.php?page_id=<?php echo $page_id; ?>">
         <fieldset>
		      
        
    	 <div class="widget">
            <div class="whead"><h6><strong>Guest: </strong><?php echo $FTCH1->cmp_name;?></h6><h6 style="float:right; margin-right:50px">Total No of Dies : <span id="tot_no_die"></span></h6><h6 style="float:right; margin-right:20px">Total Designs : <span id="tot_no_desi"></span></span></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="79"><img src="images/elements/other/tableArrows.png" alt="" /></td>-->
            <th align="center" width="56">S.No<span class="sorting" style="display: block;"></span></th>
           <!-- <td align="center" width="87">Request Date </td>-->
            <th align="center" width="114">Design No</th>
            <th width="95" align="center">No of Dies</th>
			 <th width="104">No.Of. Order </th>
            <th width="103">No.Of Stock </th>
           <th width="129">Image</th>
			<!--<th width="186">Remarks</th>-->
            
           <!-- <td width="71">View</td>
            <td width="149">Status</td>-->
            </tr>
            </thead>
            <tbody>
            <?php
			
			
			$no_of_die = 0;									
			$SLCT = "SELECT * FROM guest_user_details WHERE guest_user_id = '$guest_id'";	
			$QURY = mysqli_query($connect,$SLCT);
			$loop=1;
			if(mysqli_num_rows($QURY)>0)
			{			
			while($FTCH = mysqli_fetch_object($QURY))
			{
								
				$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_or = "SELECT COUNT(design_det_id) AS or_cnt FROM po_entry_det WHERE design_det_id = '$FTCH->design_det_id' AND fin_status = 'no'"; 
                $QURY_or = mysqli_query($connect,$SLCT_or);
                $FTCH_or = mysqli_fetch_object($QURY_or);
				
				$SLCT_st = "SELECT COUNT(design_det_id) AS st_cnt FROM stock_det WHERE design_det_id = '$FTCH->design_det_id' AND st_fin_status = 'no'"; 
                $QURY_st = mysqli_query($connect,$SLCT_st);
                $FTCH_st = mysqli_fetch_object($QURY_st);	
				
				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 align="center" style="display:table-cell;vertical-align:middle;"><input type="checkbox" name="category[]" id="category<?php echo $loop ?>" value="<?php echo $FTCH->design_det_id ?>" onclick="cnt_chk_fn(<?php echo $loop ?>),hid_show(),check_ajax(<?php echo $loop ?>,this.value);"/></td>           <?php */?>
            <td align="center" style="display:table-cell;vertical-align:middle;"><?php echo $loop ?></td>
           <?php /*?> <td align="center" style="display:table-cell;vertical-align:middle;"><?php echo $FTCH->sel_date ?></td><?php */?>
            <td align="center" style="display:table-cell;vertical-align:middle;"><?php echo $FTCH_d->master_cat_name." ".$FTCH_t->design_no; ?></td>
			<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_t->master_pieces; ?></td>
			<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_or->or_cnt; ?></td>
            <td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_st->st_cnt; ?></td>
           <td align="center"><div class="body" align="center">
                	<a href="<?php echo $imag1; ?>" title="<h2><?php echo $FTCH_d->master_cat_name." ".$FTCH_t->design_no; ?></h2>" class="lightbox" rel="group"><img src="<?php echo $imag; ?>" width="60" height="60"/></a>
                </div></td>
		   <?php /*?><td class="center" style="display:table-cell;vertical-align:middle"><input name="remak[<?php echo $loop ?>]" id="remak<?php echo $loop ?>" type="text" class="rem_tx"/></td><?php */?>
           </tr>
            
            <?php
			$loop ++;
			$no_of_die= $no_of_die+$FTCH_t->master_pieces;
			 }
			 }
			 ?>				
            </tbody>
            </table> 
            <input name="des_tot_cnt" id="des_tot_cnt" type="hidden" value="<?php echo $loop-1; ?>" />
            <input type='hidden' name="no_of_die" id="no_of_die" value="<?php echo $no_of_die; ?>" >
			</div>
           </div>
        </div>   
		
		
		<?php /*?><div class="fluid" id="sub_but_dv" style="display:none;">
		<div class="widget">
           <div class="formRow">
           		<!--<div class="grid2"><label>Total Cost:<span class="req"></span></label></div>
            	<div class="grid2"><input type="text" value="" name="tot_cost" id="tot_cost" readonly="readonly"/></div>-->
           		<input type="button" value="Submit" class="buttonM bBlack formSubmit" onclick="vad_date_fm();" 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 class="clear"></div>
            </div>
        </div> <?php */?>  
       
        </fieldset>
        </form>
        
        <div class="fluid"><!-- Media table --></div>
        
        
        
    </div>
    <!-- Main content ends -->
<script>
	document.getElementById('tot_no_die').innerHTML = document.getElementById('no_of_die').value.trim(); 
	document.getElementById('tot_no_desi').innerHTML = document.getElementById('des_tot_cnt').value.trim();    	
</script>    
</div>
<!-- Content ends -->
<?php /*?><?php include "header_footer/footer.php"; ?><?php */?>
</body>
</html>
