<?php
	include "db_connection/db_connection.php";
	include "config/config.php";

	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'";
		$QURY_log = mysqli_query($connect,$SLCT_log);
		$FTCH_log = mysqli_fetch_object($QURY_log);
		$party_id = '$FTCH_log->party_det_id';
	}
	
	$check_acc  = check_access('52');
?>
<!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/ftr_analize_JS.js"></script>
		<link href="css/styles.css" rel="stylesheet" type="text/css" />
		<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="tot_count()">
		<!-- 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:">FTR Analyze</a></li>
		            </ul>
		        </div>
				<?php include "menus/top_left_menu.php"; ?> 
    		</div>
    		<!-- Main content -->
    		<div class="wrapper"> 
			<?php if($check_acc==1){?>
			<?php
			   	$flag = 0;
			   	$sta_iden = '0';
			   	// THIS IS FOR CHECKING THE STAGE NAME
				if(isset($_GET['fdate']) && $_GET['fdate']!='' ){ $fdate = $_GET['fdate'];	}else{ $fdate = ''; }
				if(isset($_GET['todate']) && $_GET['todate']!='' ){ $todate = $_GET['todate'];	}else{ $todate = ''; }
				if(isset($_GET['yea_r']) && $_GET['yea_r']!='' ){ $yea_r = 'checked="checked"'; $y_r = $_GET['yea_r'];}else{ $yea_r = ''; $y_r = '';}
				if(isset($_GET['mont_h']) && $_GET['mont_h']!='' ){ $mont_h = 'checked="checked"'; $m_h = $_GET['mont_h'];}else{ $mont_h = ''; $m_h = ''; }
				if(isset($_GET['da_y']) && $_GET['da_y']!='' ){ $da_y = 'checked="checked"'; $d_y = $_GET['da_y'];}else{ $da_y = ''; $d_y = ''; }				
			?>    
	<ul class="middleNavR"></ul>
	<form id="acc_dat" name="acc_dat" class="main" method="post" action="" target="_blank">
		<fieldset>
			<div class="widget">
				<input name="flag_js" id="flag_js" type="hidden" value="<?php echo $sta_iden; ?>" /> <!--THIS IS FOR JS FUNCTIONALITY-->
				<div class="formRow" >
					<table width="100%">
						<tr>
		<td width="9%" style="display:table-cell; vertical-align:middle;">From Date:</td>
		<td width="22%"><div class="grid6"><input type="text" name="fdate" id="fdate" value="<?php echo $fdate ?>" class="datepicker" /></div></td>
		<td width="9%" style="display:table-cell; vertical-align:middle;">To Date:</td>
		<td width="23%"><div class="grid6"><input type="text" name="todate" id="todate" value="<?php echo $todate ?>" class="datepicker" /></div></td>
		<td width="10%" style="display:table-cell; vertical-align:middle;">Filter:</td>
		<td width="8%"><input id="yea_r"  name="filter" type="checkbox" value="y" <?php echo $yea_r ?> /> <label for="yea_r">Year</label></td>
		<td width="8%"><input id="mont_h" name="filter2" type="checkbox" value="m" <?php echo $mont_h ?> /> <label for="mont_h">Month</label></td>
		<td width="11%"><input id="da_y" name="filter3" type="checkbox" value="d" <?php echo $da_y ?> /> <label for="da_y">Day</label></td>
			</tr>
		</table>
	</div>
	<div class="formRow">
		<input type="button" value="Submit" class="buttonM bBlack formSubmit" onclick="fom_validate();" 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> 
                    	<?php if(isset($_GET['fdate']) && $_GET['fdate']!='' || isset($_GET['todate']) && $_GET['todate']!=''){ ?>	
	                    	<input type="hidden" value="<?php echo $_GET['fdate']; ?>" name="std" id="std" />
							<input type="hidden" value="<?php echo $_GET['todate']; ?>" name="edd" id="edd" />
							<input type="hidden" value="<?php echo $_GET['yea_r']; ?>" name="yr" id="yr" />
							<input type="hidden" value="<?php echo $_GET['mont_h']; ?>" name="mnt" id="mnt" />
							<input type="hidden" value="<?php echo $_GET['da_y']; ?>" name="dty" id="dty" />
							<input type="hidden" value="<?php echo $_GET['todate']; ?>" name="edd" id="edd" />
							<input type="hidden" value="" name="par_id" id="par_id" />
	<?php
		$ftr_date = "ECD.closed_dt"; 
		$rew_date = "ECDR.rework_dt";
		$dat_str = ''; //THIS IS FOR QUERY STRING
		$dat_str_rwrk = '';
		if($fdate!='' && $todate!='')
		{
			$dat_str = " AND STR_TO_DATE(".$ftr_date.",'%d-%m-%Y') BETWEEN STR_TO_DATE('$fdate','%d/%m/%Y') AND STR_TO_DATE('$todate','%d/%m/%Y')"; 
			$dat_str_rwrk = " AND STR_TO_DATE(".$rew_date.",'%d-%m-%Y') BETWEEN STR_TO_DATE('$fdate','%d/%m/%Y') AND STR_TO_DATE('$todate','%d/%m/%Y')"; 
			$flgg=1;
		}
		else if($fdate=='' && $todate!='')
		{
			if($yea_r!='' && $mont_h!='' && $da_y!='')
			{ 
			$dat_str = " AND STR_TO_DATE(".$ftr_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
			$dat_str_rwrk = " AND STR_TO_DATE(".$rew_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
			$flgg = 1;
	}
	else if($yea_r!='' && $mont_h!='' && $da_y=='')
	{
		$vl = explode("/",$todate);
		$todat_vl = $vl[2]."-".$vl[1]."-".$vl[0];
		$dat_str = " AND DATE_FORMAT(STR_TO_DATE(".$ftr_date.",'%d-%m-%Y'),'%m-%Y') = DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')";  
		$dat_str_rwrk = " AND DATE_FORMAT(STR_TO_DATE(".$rew_date.",'%d-%m-%Y'),'%m-%Y') = DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')";
		$flgg = 1;
	}
			else if($yea_r!='' && $mont_h=='' && $da_y=='')
			{ 
				$vl = explode("/",$todate);
				$todat_vl = ($vl[2]-1)."-12-31";
				$dat_str = " AND YEAR(STR_TO_DATE(".$ftr_date.",'%d-%m-%Y')) = YEAR(STR_TO_DATE('$todate','%d/%m/%Y'))";
				$dat_str_rwrk = " AND YEAR(STR_TO_DATE(".$rew_date.",'%d-%m-%Y')) = YEAR(STR_TO_DATE('$todate','%d/%m/%Y'))";
				$flgg = 1;
			}
			else if($yea_r=='' && $mont_h=='' && $da_y=='')
			{ 
				$dat_str = " AND STR_TO_DATE(".$ftr_date.",'%d-%m-%Y') <= STR_TO_DATE('$todate','%d/%m/%Y')";
				$dat_str_rwrk = " AND STR_TO_DATE(".$rew_date.",'%d-%m-%Y') <= STR_TO_DATE('$todate','%d/%m/%Y')";
				$flgg = 0;
			}
			else if($yea_r=='' && $mont_h!='' && $da_y=='')
			{ 
				$vl = explode("/",$todate);
				$todat_vl = $vl[2]."-".$vl[1]."-".$vl[0];
				$dat_str = " AND DATE_FORMAT(STR_TO_DATE(".$ftr_date.",'%d-%m-%Y'),'%m-%Y') = DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')";  
				$dat_str_rwrk = " AND DATE_FORMAT(STR_TO_DATE(".$rew_date.",'%d-%m-%Y'),'%m-%Y') = DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%m-%Y')";  
				$flgg = 1;
			} 
			else if($yea_r=='' && $mont_h=='' && $da_y!='')
			{ 
				$dat_str = " AND STR_TO_DATE(".$ftr_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$dat_str_rwrk = " AND STR_TO_DATE(".$rew_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$flgg = 1;
			}
			else if($yea_r!='' && $mont_h=='' && $da_y!='')
			{ 
				$dat_str = " AND STR_TO_DATE(".$ftr_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$dat_str_rwrk = " AND STR_TO_DATE(".$rew_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')"; 
				$flgg = 1;
			}
			else if($yea_r=='' && $mont_h!='' && $da_y!='')
			{ 
				$dat_str = " AND STR_TO_DATE(".$ftr_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')";
				$dat_str_rwrk = " AND STR_TO_DATE(".$rew_date.",'%d-%m-%Y') = STR_TO_DATE('$todate','%d/%m/%Y')";
				$flgg = 1;
			}
		}
	?>
<div class="widget" style="display: block">
<div class="whead">
	<ul class="titleToolbar">
		<li><h6 style=" margin-right:0px; text-align:center;">Total Design Qty&nbsp;&nbsp;&nbsp;<input class="dataNumGrey" type="text" id="tot_des" name="tot_des" value="" readonly="readonly" disabled="disabled" style="width:90px; font-size:12px; text-align:right; padding-right: 5px; margin: 0;" /></h6></li>
		<li><h6 style=" margin-right:42px; text-align:center;"><a href="ftr_analize_print.php?fdate=<?php echo $_GET['fdate'] ?>&todate=<?php echo $_GET['todate'] ?>&yea_r=<?php echo $_GET['yea_r'] ?>&mont_h=<?php echo $_GET['mont_h'] ?>&da_y=<?php echo $_GET['da_y'] ?>&flg=<?php echo base64_encode(base64_encode(base64_encode(base64_encode(1)))); ?>" target="_blank">Print</a></h6></li>
		</ul>
		<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="677" border="0" cellpadding="0" cellspacing="0" class="dTable" id="dynamic">
			<thead>
				<tr>
					<th width="10%" style="display:table-cell;vertical-align:middle">S.No<span class="sorting" style="display: block;"></span></th>
					<th width="20%" style="display:table-cell;vertical-align:middle">Cad Designer Name</th>
					<th width="10%" style="display:table-cell;vertical-align:middle">Total Design Finished</th>
					<th width="10%" style="display:table-cell;vertical-align:middle">First Time Finished Qty</th> 
					<th width="10%" style="display:table-cell;vertical-align:middle">First Time Finished Qty %</th>
		<?php
			$SLCT_MAS = "SELECT description FROM master_cad_remarks WHERE statu_s='active' ORDER BY master_cad_remarks_id ASC";
			$QURY_MAS = mysqli_query($connect,$SLCT_MAS);
			while($FTCH_MAS = mysqli_fetch_object($QURY_MAS))
			{
		?>
		<th width="7%" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_MAS->description; ?></th> 
		<th width="7%" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_MAS->description." %"; ?></th>
				<?php	
					}
				?>
			</tr>
		</thead>
		<tbody> 
			<?php
		$loop = 1;
		$tot_des = 0;
		$SLCT_FTR = "SELECT ED.emp_det_id, ED.name, COUNT(DISTINCT DD.design_det_id) AS DES_CNT, COUNT(DD.design_det_id) AS TOT_CNT, SUM(MCC.cad_points) AS CAD_PNTS
					FROM emp_current_design ECD INNER JOIN emp_det ED ON ED.emp_det_id=ECD.emp_det_id
					INNER JOIN design_det DD ON DD.design_det_id=ECD.design_det_id
					INNER JOIN master_cad_cat MCC ON MCC.master_cad_cat_id = DD.master_cad_cat_id
					WHERE FIND_IN_SET(ECD.curr_status,'closed,cancelled,stopped') ".$dat_str."  
					GROUP BY ED.emp_det_id ORDER BY ED.emp_det_id ASC";
		$QURY_FTR = mysqli_query($connect,$SLCT_FTR);
		if(mysqli_num_rows($QURY_FTR)>0)
		{
			$pg_flag1 = base64_encode(base64_encode(base64_encode(base64_encode(1))));
			$pg_flag2 = base64_encode(base64_encode(base64_encode(base64_encode(2))));

			while($FTCH_FTR = mysqli_fetch_object($QURY_FTR))
			{
				$SLCT_FTR1 = "SELECT COUNT(DISTINCT ECD.design_det_id) AS FRST_CNT, COUNT(ECD.design_det_id) AS FRST_TOT FROM emp_current_design ECD WHERE FIND_IN_SET(ECD.curr_status,'closed,cancelled,stopped') AND ECD.emp_det_id='".$FTCH_FTR->emp_det_id."' AND ECD.design_det_id NOT IN( SELECT ECDR.design_det_id FROM emp_current_design_rework ECDR WHERE ECDR.re_emp_det_id='".$FTCH_FTR->emp_det_id."' ".$dat_str_rwrk." ) ".$dat_str." GROUP BY ECD.emp_det_id ORDER BY ECD.emp_det_id ASC";
				$QURY_FTR1 = mysqli_query($connect,$SLCT_FTR1);
				if(mysqli_num_rows($QURY_FTR1)>0)
				{
					$FTCH_FTR1 = mysqli_fetch_object($QURY_FTR1);
					$frst_per = ($FTCH_FTR1->FRST_CNT/$FTCH_FTR->DES_CNT)*100;
					$frst_cnt = $FTCH_FTR1->FRST_CNT;
				}
				else
				{
					$frst_per = 0;
					$frst_cnt = 0;
				}
				$emp_id = base64_encode(base64_encode(base64_encode(base64_encode($FTCH_FTR->emp_det_id))));?>
		<tr>
			<td align="left" style="display:table-cell;vertical-align:middle"><?php echo $loop; ?></td> 
			<td align="left" style="display:table-cell;vertical-align:middle"><?php //echo $FTCH_FTR->name; 
			$name_count = strlen($FTCH_FTR->name);
				$name='';
				if($name_count>11){
					$name = substr($FTCH_FTR->name,0,11)."...";
				} else {
					$name = $FTCH_FTR->name;
				} ?>
			<?php if($name_count>11){?>
			<div class="tooltip1">
			<?php echo $name;?>
				<span class="tooltiptext1"><?php echo $FTCH_FTR->name;?></span>
			</div>
			<?php } else { ?>
			<?php echo $name;?>
			<?php } ?>
			</td> 
			<td align="center" style="display:table-cell;vertical-align:middle"><?php echo $FTCH_FTR->DES_CNT." ( ".$FTCH_FTR->CAD_PNTS." )"; ?></td>
			<td align="center" style="display:table-cell;vertical-align:middle">
			<?php 
			if($frst_cnt!=0)
			{
			?>
			<a href="ftr_analize_view.php?emp_id=<?php echo $emp_id; ?>&pg_flg=<?php echo $pg_flag1; ?>&fdate=<?php echo $_GET['fdate'] ?>&todate=<?php echo $_GET['todate'] ?>&yea_r=<?php echo $_GET['yea_r'] ?>&mont_h=<?php echo $_GET['mont_h'] ?>&da_y=<?php echo $_GET['da_y'] ?>"><?php echo $frst_cnt; ?></a>
			<?php
			}
			else
			{
				echo $frst_cnt;
			}
			?>
	</td> 
	<td align="center" style="display:table-cell;vertical-align:middle"><?php echo number_format($frst_per,2); ?></td>
	<?php
		$SLCT_MAS = "SELECT master_cad_remarks_id FROM master_cad_remarks WHERE statu_s='active' ORDER BY master_cad_remarks_id ASC";
		$QURY_MAS = mysqli_query($connect,$SLCT_MAS);
		while($FTCH_MAS = mysqli_fetch_object($QURY_MAS))
		{
			$SLCT_FTR2 = "SELECT COUNT(DISTINCT ECDR.design_det_id) AS DES_CNT, COUNT(ECDR.design_det_id) AS TOT_CNT FROM emp_current_design_rework ECDR WHERE ECDR.master_cad_remarks_id='".$FTCH_MAS->master_cad_remarks_id."' AND ECDR.re_emp_det_id='".$FTCH_FTR->emp_det_id."' ".$dat_str_rwrk." GROUP BY ECDR.re_emp_det_id ORDER BY ECDR.re_emp_det_id ASC";
			$QURY_FTR2 = mysqli_query($connect,$SLCT_FTR2);
			if(mysqli_num_rows($QURY_FTR2)>0)
			{
				$FTCH_FTR2 = mysqli_fetch_object($QURY_FTR2);
				if($FTCH_FTR2->DES_CNT!='0' || $FTCH_FTR2->DES_CNT!='')
				{
					if($FTCH_FTR2->DES_CNT==$FTCH_FTR2->TOT_CNT)
					{
						$des_cnt = $FTCH_FTR2->DES_CNT;	
					}
					else
					{
						$des_cnt = $FTCH_FTR2->DES_CNT." ( ".$FTCH_FTR2->TOT_CNT." ) ";
					}
					$des_per = ($FTCH_FTR2->DES_CNT/$FTCH_FTR->DES_CNT)*100;
					$des_flag = 1;
				}
				else
				{
					$des_cnt = 0;
					$des_per = 0;
					$des_flag = 2;
				}
			}
			else
			{
				$des_cnt = 0;
				$des_per = 0;
				$des_flag = 2;
			}
			$rmrk_id = base64_encode(base64_encode(base64_encode(base64_encode($FTCH_MAS->master_cad_remarks_id))));
	?>
			<td align="center" style="display:table-cell;vertical-align:middle">
				<?php 
				if($des_flag==1)
				{
				?>
					<a href="ftr_analize_view.php?emp_id=<?php echo $emp_id; ?>&rmrk_id=<?php echo $rmrk_id; ?>&pg_flg=<?php echo $pg_flag2; ?>&fdate=<?php echo $_GET['fdate'] ?>&todate=<?php echo $_GET['todate'] ?>&yea_r=<?php echo $_GET['yea_r'] ?>&mont_h=<?php echo $_GET['mont_h'] ?>&da_y=<?php echo $_GET['da_y'] ?>"><?php echo $des_cnt; ?></a>
				<?php	
				}
				else
				{
					echo $des_cnt;
				}
				?>
			</td> 
			<td align="center" style="display:table-cell;vertical-align:middle"><?php echo number_format($des_per,2); ?></td>
				<?php	
					}
				?>
		</tr>
			<?php
						$tot_des = $tot_des+$FTCH_FTR->DES_CNT;
						$loop++;
					}
				}
			?>    
	            						</tbody>    
	            					</table> 
	        					</div>
	        				</div>
	        			<?php } ?>	
	        			<input name="tot_design" id="tot_design" type="hidden" value="<?php echo $tot_des; ?>" />  
        			</fieldset>
     			</form>
        		<div class="fluid"><!-- Media table --></div> 
<?php } else {  echo ACCESS_MSG;} ?>
    		</div>
    		<!-- Main content ends -->    
		</div>
		<!-- Content ends -->
	</body>
</html>
