<?php
	include "db_connection/db_connection.php";
	include "config/config.php";
	ini_set('max_execution_time', 500);
	if($_SESSION['admin_login_id'] == '')
	{
		echo "<script>window.location='index.php';</script>";
	}
	else // THIS IS FOR GETTING PARTY DET ID ROM LOAGIN DET AND PARTY DET TABLE
	{
		$admin_id = $_SESSION['admin_login_id'];
		
		$SLCT_log = "SELECT * FROM login_details,ac_party_det WHERE ac_party_det.party_det_id = login_details.party_det_id AND login_details.admin_id = '$admin_id'";
		//echo $SLCT_log;
		$QURY_log = mysqli_query($connect,$SLCT_log);
		$FTCH_log = mysqli_fetch_object($QURY_log);
		$party_id = '$FTCH_log->party_det_id';
	}
?>
<!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" >
	function foc(ids)
	{
		document.getElementById(ids).style.border="2px solid #0099FF";
		
	}

	function stnon(ids)
	{
		document.getElementById(ids).style.border="thin solid #CCCCCC";
	}
	
</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(),party_cst()">
	<!-- 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.pgp">Dashboard</a></li>
	                <li><a href="javascript:">Piece Tracking</a></li>
	                    
	            </ul>
	        </div>
			<?php include "menus/top_left_menu.php"; ?> 
	    </div>    
	    <?php
	    if(isset($_GET['ser_dt']) && $_GET['ser_dt']!='')
		{
			$ser_flagg = 1;
			$date_dec  = $_GET['ser_dt']; 
		}
		else
		{
			$ser_flagg = 2;
			$date_dec  = "";
		}
		if(isset($_GET['ser_to_dt']) && $_GET['ser_to_dt']!='' )
		{
			$flagg = 1; 
			$date_tod  = $_GET['ser_to_dt'];  
			if($ser_flagg==1)
			{				
				$date_str  = " AND STR_TO_DATE(show_case.show_date,'%d-%m-%Y') BETWEEN STR_TO_DATE('$date_dec','%d/%m/%Y') AND STR_TO_DATE('$date_tod','%d/%m/%Y')";
			}
			else
			{
				$date_str  = " AND STR_TO_DATE(show_case.show_date,'%d-%m-%Y') < STR_TO_DATE('$date_tod','%d/%m/%Y')";
			}								
		}
		else
		{
			$flagg = 2;
			$date_dec = '';
			$date_str = '';
		}
		if(isset($_GET['cat_name']) && $_GET['cat_name']!='' )
		{
			$nam_id  = base64_decode(base64_decode(base64_decode(base64_decode($_GET['cat_name']))));
			$nam_str = " AND `show_case`.`master_cat_id`='$nam_id'";
								
		}
		else
		{
			$nam_id = '';
			$nam_str = '';
		}
		if(isset($_GET['sta_name']) && $_GET['sta_name']!='' )
		{
			$nam_dec  = $_GET['sta_name']; 
			$sta_id  = base64_decode(base64_decode(base64_decode(base64_decode($_GET['sta_name']))));
			if($sta_id==0)
			{
				$nm_flagg = 1;
				$sta_str = '';
			}
			else
			{
				$nm_flagg = 2;
				$sta_str = " HAVING COUNT(`po_entry_det`.`design_det_id`)=".$sta_id;	
			}				
		}
		else
		{
			$nm_flagg = 2;
			$nam_dec = '';
			$sta_str = '';
		}
	    ?>
	    <!-- Main content -->
	    <div class="wrapper">
	        <ul class="middleNavR">
	        	<li><a href="mov_non_mov_analyze.php?ser_to_dt=<?php echo $date_tod; ?>&ser_dt=<?php echo $date_dec; ?>&sta_name=<?php echo $nam_dec; ?>" title="Moving Non Moving List" id="listpage" class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
	        </ul>        
			<form>			
		   		<fieldset>
					<?php
					if($flagg == 1)
					{
					?>
					<input type="hidden" id="nm_flagg" name="nm_flagg" value="<?php echo $nm_flagg; ?>"/>
					<div class="widget" style="display: block"> <!--style="width:600px; margin-left:150px;"-->
						<div class="whead">
							<h6>Design List</h6>
							<h6 style="float:right; margin-right:35px;text-decoration:underline;">
								<a href="" target="_blank">Print</a>
							</h6>
							<?php
								if($nm_flagg!=1)
								{
							?>
							<h6 style="float:right; margin-right:20px">Total Cost : <input type="text" id="tot_amt" name="tot_amt" value="" readonly="readonly" disabled="disabled" style="width:150px; font-size:12px; text-align:center;" /></h6>
							<?php
								}
							?>
							<h6 style="float:right; margin-right:20px">Total Dies : <input type="text" id="tot_die" name="tot_die" value="" readonly="readonly" disabled="disabled" style="width:50px; font-size:12px; text-align:center;" /></h6>
							<h6 style="float:right; margin-right:20px">Total Quantity : <input type="text" id="tot_qty" name="tot_qty" 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>
							<table width="100%" border="0" cellpadding="0" cellspacing="0" class="dTable" id="dynamic">
								<thead>
									<?php
										if($nm_flagg!=1)
										{
									?>
											<tr>
												<th align="center" style="display:table-cell;vertical-align:middle" width="10%" rowspan="2">S.No<span class="sorting" style="display: block;"></span></th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%" rowspan="2">Design No</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%" rowspan="2">No of Dies</th>
												<th align="center" style="display:table-cell;vertical-align:middle; background-color:#eee;" colspan="3">Selling Qty</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%" rowspan="2">Total Cost</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%" rowspan="2">Image</th>
											</tr>
											<tr>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%">Selection Qty</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%">Finish Qty</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="15%">Delivered Qty</th>										
											</tr>
									<?php
										}
										else if($nm_flagg==1)
										{
									?>
											<tr>
												<th align="center" style="display:table-cell;vertical-align:middle" width="10%">S.No<span class="sorting" style="display: block;"></span></th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="25%">Design No</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="25%">No of Dies</th>
												<th align="center" style="display:table-cell;vertical-align:middle" width="25%">Image</th>
											</tr>
									<?php
										}
									?>	
								</thead>
								<tbody>
									<?php
										$tot_pic = 0;
										$party_cst = 0;
										$party_cnt = 0;
										if($nm_flagg==1)
										{
											$SLCT_PICE = "SELECT design_det_id FROM `show_case` WHERE `show_case`.`design_det_id` NOT IN( SELECT design_det_id FROM `po_entry`,`po_entry_det` WHERE `po_entry`.`po_entry_id` = `po_entry_det`.`po_entry_id` AND `po_entry_det`.`cancelled` = 'no' ) ".$date_str." ".$nam_str." ORDER BY `show_case`.`master_cat_id` ASC";
											$QURY_PICE = mysqli_query($connect,$SLCT_PICE);
											if(mysqli_num_rows($QURY_PICE)>0)
											{	
												$loop = 1;
												while($FTCH_PICE = mysqli_fetch_object($QURY_PICE))	
												{
													$des_id = base64_encode(base64_encode(base64_encode(base64_encode($FTCH_PICE->design_det_id))));
													$SLCT_DES = "SELECT `master_cat_name`, `design_no`, master_pieces, `imag_ext`, `cad_fin_ext`, `mas_fin_ext` FROM `design_det`,`master_cat` WHERE `design_det`.`design_det_id` = '$FTCH_PICE->design_det_id' AND `master_cat`.`master_cat_id` = `design_det`.`master_cat_id`";
													$QURY_DES = mysqli_query($connect,$SLCT_DES);		
													$FTCH_DES = mysqli_fetch_object($QURY_DES);
																									
													if($FTCH_DES->mas_fin_ext!=''){ $imag = "../mas_fin_images/S.".$FTCH_DES->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_DES->mas_fin_ext; }
													else if($FTCH_DES->cad_fin_ext!=''){ $imag = "../cad_fin_images/S.".$FTCH_DES->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_DES->cad_fin_ext; }												
													else if($FTCH_DES->imag_ext!=''){ $imag = "../design_images/S.".$FTCH_DES->imag_ext; $imag1 = "../design_images/L.".$FTCH_DES->imag_ext; }					
									?>
													<tr>
														<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_DES->master_cat_name." ".$FTCH_DES->design_no; ?></td>
														<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_DES->master_pieces; ?></td>
														<td align="center" style="display:table-cell;vertical-align:middle">
															<div class="body" align="center">
																<a href="<?php echo $imag1; ?>" id="searchlink1<?php echo $loop; ?>" onfocus="foc(this.id)" onblur="stnon(this.id)" title="<?php echo $FTCH_DES->master_cat_name." ".$FTCH_DES->design_no; ?>" class="lightbox" rel="group">
																	<img src="<?php echo $imag; ?>" width="60" height="60"/>
																</a> 
															</div>
														</td>
													</tr>
									<?php
													$loop++;
													$party_cnt = $party_cnt+1;
													$tot_pic = $tot_pic+$FTCH_DES->master_pieces;
												}
											}
										}
										if($nm_flagg==2)
										{
											$SLCT_PICE = "SELECT COUNT(`po_entry_det`.`design_det_id`) AS des_cnt, `po_entry_det`.`design_det_id`,`show_case`.`master_cat_id`  FROM `show_case`,`po_entry`,`po_entry_det` WHERE `po_entry`.`po_entry_id` = `po_entry_det`.`po_entry_id` AND po_entry_det.`cancelled` = 'no' AND `po_entry_det`.`design_det_id` = `show_case`.`design_det_id` ".$date_str."  ".$nam_str." GROUP BY `po_entry_det`.`design_det_id` ".$sta_str;
											//echo $SLCT_PICE;
											$QURY_PICE = mysqli_query($connect,$SLCT_PICE);
											if(mysqli_num_rows($QURY_PICE)>0)
											{	
												$loop = 1;
												while($FTCH_PICE = mysqli_fetch_object($QURY_PICE))	
												{
													$des_id = base64_encode(base64_encode(base64_encode(base64_encode($FTCH_PICE->design_det_id))));
													$SLCT_DES = "SELECT `master_cat_name`, `design_no`, master_pieces, `imag_ext`, `cad_fin_ext`, `mas_fin_ext` FROM `design_det`,`master_cat` WHERE `design_det`.`design_det_id` = '$FTCH_PICE->design_det_id' AND `master_cat`.`master_cat_id` = `design_det`.`master_cat_id`";
													$QURY_DES = mysqli_query($connect,$SLCT_DES);		
													$FTCH_DES = mysqli_fetch_object($QURY_DES);
												
																								
													$SLCT_PO1 = "SELECT COUNT(po_entry_det_id) AS po_cnt, IFNULL(SUM(cost_val),0.00) AS cost_val FROM po_entry,po_entry_det,party_cost_det WHERE `po_entry_det`.`design_det_id` = '$FTCH_PICE->design_det_id' AND po_entry_det.`cancelled` = 'no' AND fin_status='no' AND del_status='no' AND po_entry.po_entry_id=po_entry_det.po_entry_id AND po_entry.party_det_id=party_cost_det.party_det_id AND party_cost_det.updated='no' AND party_cost_det.master_cat_id = po_entry_det.master_cat_id";
													$QURY_PO1 = mysqli_query($connect,$SLCT_PO1);		
													$FTCH_PO1 = mysqli_fetch_object($QURY_PO1);
													
													$SLCT_PO2 = "SELECT COUNT(po_entry_det_id) AS fin_cnt, IFNULL(SUM(cost_val),0.00) AS cost_val FROM po_entry,po_entry_det,party_cost_det WHERE `po_entry_det`.`design_det_id` = '$FTCH_PICE->design_det_id' AND po_entry_det.`cancelled` = 'no' AND fin_status='yes' AND del_status='no' AND po_entry.po_entry_id=po_entry_det.po_entry_id AND po_entry.party_det_id=party_cost_det.party_det_id AND party_cost_det.updated='no' AND party_cost_det.master_cat_id = po_entry_det.master_cat_id";
													$QURY_PO2 = mysqli_query($connect,$SLCT_PO2);		
													$FTCH_PO2 = mysqli_fetch_object($QURY_PO2);
													
													$SLCT_PO3 = "SELECT COUNT(po_entry_det_id) AS del_cnt, IFNULL(SUM(cost_val),0.00) AS cost_val FROM po_entry,po_entry_det,party_cost_det WHERE `po_entry_det`.`design_det_id` = '$FTCH_PICE->design_det_id' AND po_entry_det.`cancelled` = 'no' AND fin_status='yes' AND del_status='yes' AND po_entry.po_entry_id=po_entry_det.po_entry_id AND po_entry.party_det_id=party_cost_det.party_det_id AND party_cost_det.updated='no' AND party_cost_det.master_cat_id = po_entry_det.master_cat_id";
													$QURY_PO3 = mysqli_query($connect,$SLCT_PO3);		
													$FTCH_PO3 = mysqli_fetch_object($QURY_PO3);
																									
													if($FTCH_DES->mas_fin_ext!=''){ $imag = "../mas_fin_images/S.".$FTCH_DES->mas_fin_ext; $imag1 = "../mas_fin_images/L.".$FTCH_DES->mas_fin_ext; }
													else if($FTCH_DES->cad_fin_ext!=''){ $imag = "../cad_fin_images/S.".$FTCH_DES->cad_fin_ext; $imag1 = "../cad_fin_images/L.".$FTCH_DES->cad_fin_ext; }												
													else if($FTCH_DES->imag_ext!=''){ $imag = "../design_images/S.".$FTCH_DES->imag_ext; $imag1 = "../design_images/L.".$FTCH_DES->imag_ext; }					
									?>
													<tr>
														<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_DES->master_cat_name." ".$FTCH_DES->design_no; ?></td>
														<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_DES->master_pieces; ?></td>
														<td align="center" style="display:table-cell;vertical-align:middle"><a href="mov_non_mov_view.php?des_id=<?php echo $des_id; ?>&pg_id=<?php echo base64_encode(base64_encode(base64_encode(base64_encode(1)))); ?>&cat_name=<?php echo $_GET['cat_name']; ?>&sta_name=<?php echo $nam_dec; ?>&ser_to_dt=<?php echo $date_tod; ?>&ser_dt=<?php echo $date_dec; ?>" id="viewlink1<?php echo $loop; ?>" onfocus="foc(this.id)" onblur="stnon(this.id)" title=" Order Qty Count"><u> <?php echo $FTCH_PO1->po_cnt; ?> </u></a><br>(&nbsp;<?php echo number_format($FTCH_PO1->cost_val,2); ?>&nbsp;)</td>
														<td align="center" style="display:table-cell;vertical-align:middle"><a href="mov_non_mov_view.php?des_id=<?php echo $des_id; ?>&pg_id=<?php echo base64_encode(base64_encode(base64_encode(base64_encode(2)))); ?>&cat_name=<?php echo $_GET['cat_name']; ?>&sta_name=<?php echo $nam_dec; ?>&ser_to_dt=<?php echo $date_tod; ?>&ser_dt=<?php echo $date_dec; ?>" id="viewlink2<?php echo $loop; ?>" onfocus="foc(this.id)" onblur="stnon(this.id)" title=" Finish Qty Count"><u> <?php echo $FTCH_PO2->fin_cnt; ?> </u></a><br>(&nbsp;<?php echo number_format($FTCH_PO2->cost_val,2); ?>&nbsp;)</td>
														<td align="center" style="display:table-cell;vertical-align:middle"><a href="mov_non_mov_view.php?des_id=<?php echo $des_id; ?>&pg_id=<?php echo base64_encode(base64_encode(base64_encode(base64_encode(3)))); ?>&cat_name=<?php echo $_GET['cat_name']; ?>&sta_name=<?php echo $nam_dec; ?>&ser_to_dt=<?php echo $date_tod; ?>&ser_dt=<?php echo $date_dec; ?>" id="viewlink3<?php echo $loop; ?>" onfocus="foc(this.id)" onblur="stnon(this.id)" title=" Delivered Qty Count"><u> <?php echo $FTCH_PO3->del_cnt; ?> </u></a><br>(&nbsp;<?php echo number_format($FTCH_PO3->cost_val,2); ?>&nbsp;)</td>
														<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_PO1->po_cnt+$FTCH_PO2->fin_cnt+$FTCH_PO3->del_cnt."<br>".number_format(($FTCH_PO1->cost_val+$FTCH_PO2->cost_val+$FTCH_PO3->cost_val),2); ?></td>
														<td align="center" style="display:table-cell;vertical-align:middle">
															<div class="body" align="center">
																<a href="<?php echo $imag1; ?>" id="searchlink1<?php echo $loop; ?>" onfocus="foc(this.id)" onblur="stnon(this.id)" title="<?php echo $FTCH_DES->master_cat_name." ".$FTCH_DES->design_no; ?>" class="lightbox" rel="group">
																	<img src="<?php echo $imag; ?>" width="60" height="60"/>
																</a> 
															</div>
														</td>
													</tr>
									<?php
													$loop++;
													$mas_pic = ($FTCH_PO1->po_cnt+$FTCH_PO2->fin_cnt+$FTCH_PO3->del_cnt)*$FTCH_DES->master_pieces;
													$tot_pic = $tot_pic+$mas_pic;
													$party_cst = $party_cst + $FTCH_PO1->cost_val+$FTCH_PO2->cost_val+$FTCH_PO3->cost_val;
													$party_cnt = $party_cnt + $FTCH_PO1->po_cnt+$FTCH_PO2->fin_cnt+$FTCH_PO3->del_cnt;
												}
											}
										}
									?>
								</tbody>
							</table>
						</div>
					</div>
					<input name="tot_cnt" id="tot_cnt" type="hidden" value="<?php echo $party_cnt; ?>" />
					<input name="tot_cst" id="tot_cst" type="hidden" value="<?php echo number_format($party_cst,2); ?>" />
					<input name="mas_die" id="mas_die" type="hidden" value="<?php echo $tot_pic;  ?>" />										
					<?php
					}
					?>
					<input name="flagg" id="flagg" type="hidden" value="<?php echo $flagg; ?>" />
        		</fieldset>
     		</form>
        	<div class="fluid"><!-- Media table --></div>
    	</div>
    	<!-- Main content ends -->    
	</div>
	<script>
		
		function party_cst()
		{
			var flagg = document.getElementById("flagg").value.trim();
			var nm_flagg = document.getElementById("nm_flagg").value.trim();
			if(flagg==1)
			{
				var tot_cst = document.getElementById("tot_cst").value.trim();
				var tot_cnt = document.getElementById("tot_cnt").value.trim();
				document.getElementById("tot_qty").value = tot_cnt;
				if(nm_flagg!=1)
				{
					document.getElementById("tot_amt").value = tot_cst;
				}
				document.getElementById("tot_die").value =  document.getElementById("mas_die").value;
			}
		}
	</script>
	<!-- Content ends -->
	<?php /*?><?php include "header_footer/footer.php"; ?><?php */?>
</body>
</html>
