<?php
	global $connect;
	/*$SLCT_CNT	=	"SELECT * FROM `guest_user_details`,guest_user WHERE guest_user.guest_id=guest_user_details.guest_user_id AND guest_user_details.`statu_s` = 'active' AND guest_user_details.ord_status = 'no' GROUP BY guest_user_details.`guest_user_id`";
	$QURY_CNT	=	mysqli_query($connect,$SLCT_CNT);
	$NUMR_CNT	=	mysqli_num_rows($QURY_CNT);*/
	//$FTCH_CNT	=	mysqli_fetch_object($QURY_CNT);

	/*$SLCT_CNT	=	"SELECT count(DISTINCT(guest_user_id)) as CNTQ FROM `guest_user_details`,guest_user WHERE guest_user.guest_id=guest_user_details.guest_user_id AND guest_user_details.`statu_s` = 'active' AND guest_user_details.ord_status = 'no'";
	$QURY_CNT	=	mysqli_query($connect,$SLCT_CNT);
	$NUMR_CNT1	=	mysqli_fetch_array($QURY_CNT);
	$NUMR_CNT	=	$NUMR_CNT1['CNTQ'];*/

	$LP_CNT1=0;

	/*$SLCT_CNT1 = "SELECT party_det_id FROM design_sel_det GROUP BY party_det_id ORDER BY design_sel_det_id DESC";
	//echo $SLCT_CNT1;
	$QURY_CNT1 = mysqli_query($connect,$SLCT_CNT1);

	if(mysqli_num_rows($QURY_CNT1)>0)
	{
		while($FTCH_CNT1 = mysqli_fetch_object($QURY_CNT1))
		{
			$SLCT_CNT2 = "SELECT COUNT(design_sel_det_id) AS sel_cnt FROM design_sel_det WHERE  party_det_id = '$FTCH_CNT1->party_det_id' GROUP BY DATE(sel_date)";
			$QURY_CNT2 = mysqli_query($connect,$SLCT_CNT2);
			$FTCH_CNT2 = mysqli_fetch_object($QURY_CNT2);

			$SLCT_CNT3 = "SELECT COUNT(design_sel_det_id) AS des_cnt FROM design_sel_det WHERE party_det_id = '$FTCH_CNT1->party_det_id' AND ord_status = 'yes'";
			$QURY_CNT3 = mysqli_query($connect,$SLCT_CNT3);
			if(mysqli_num_rows($QURY_CNT3)>0)
			{
				$FTCH_CNT3 = mysqli_fetch_object($QURY_CNT3);
				if($FTCH_CNT3->des_cnt != $FTCH_CNT2->sel_cnt)
				{
					$LP_CNT1 = $LP_CNT1 +1;
				}
			}
			}
	}*/

	/*$SLCT_CNT1 = "SELECT * FROM design_sel_det WHERE ord_status='no' GROUP BY party_det_id,sel_date";
	$QURY_CNT1 = mysqli_query($connect,$SLCT_CNT1);
	$LP_CNT1 = mysqli_num_rows($QURY_CNT1);*/

	$qty=0;
	/*$SLCT_prt = "SELECT * FROM design_sel_det WHERE ord_status='no' GROUP BY party_det_id,sel_date ORDER BY design_sel_det_id DESC";
	$QURY_prt = mysqli_query($connect,$SLCT_prt);	
	while($FTCH_prt = mysqli_fetch_object($QURY_prt))
	{
	   $SLCT_dd = "SELECT COUNT(design_sel_det_id) AS sel_cnt FROM design_sel_det WHERE ord_status='no' AND party_det_id = '$FTCH_prt->party_det_id' and `sel_date` ='$FTCH_prt->sel_date' GROUP BY sel_date";
	   $QURY_dd = mysqli_query($connect,$SLCT_dd);
	   $FTCH_dd = mysqli_fetch_object($QURY_dd);
	   $qty = $qty+$FTCH_dd->sel_cnt;
	 // if(mysqli_num_rows($QURY_dd)>0){
		//	$FTCH_dd = mysqli_fetch_object($QURY_dd);
	//		$qty = $qty+$FTCH_dd->sel_cnt;
	//	}else{
			//$qty = $qty;
		//}
	}*/

	$sel_temp = mysqli_query($connect,"select * from temp_statistics order by id desc limit 0,1");
	$res_temp = mysqli_fetch_array($sel_temp,MYSQLI_ASSOC);
	$LP_CNT1 = $res_temp['req_value1'];
	$qty = $res_temp['req_value2'];
?>
<div class="breadLinks">
    <ul>
    	<?php
		if($admin_flagg==1)
		{
		?>
    	<li><a <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="note_list.php" <?php } ?> title=""><span>Notepad</span></a></li>
        <!--<li><a <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="cli_ord_req_pend_list.php" <?php } ?> title=""><span>Client Req.</span> <strong>(<?php echo $LP_CNT1; ?> - <?php echo $qty; ?>)</strong></a></li>-->
		<?php
		}
		//else if($admin_flagg==2){
		?>
    	<li style="border:none;"><a <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="cli_ord_req_pend_list.php" <?php } ?> title=""><span>Client Req.</span> <strong><span id="client_place">(<?php //echo $LP_CNT1; ?> - <?php //echo $qty; ?>)</span></strong></a></li><li style="margin-left:-11px;"><a href="javascript:;" onclick="client_ref();"><img src="images/refresh.png" width="15" height="15"></a></li>
        <?php
		//}
		?>
		<?php /*?><li><a href="cli_ord_req_list.php" title=""><i class="icos-list"></i><span>Client</span> <strong>(<?php echo $LP_CNT1; ?>)</strong></a></li>
        <li><a href="guest_ord_req_list.php" title=""><i class="icos-check"></i><span>Guest User</span> <strong><?php /*?>(<?php echo $NUMR_CNT; ?>)<?php */?></strong></a></li>
        <!--<li class="has">
            <a title="">
                <i class="icos-money3"></i>
                <span>Invoices</span>
                <span><img src="images/elements/control/hasddArrow.png" alt="" /></span>
            </a>
            <ul>
                <li><a href="#" title=""><span class="icos-add"></span>New invoice</a></li>
                <li><a href="#" title=""><span class="icos-archive"></span>History</a></li>
                <li><a href="#" title=""><span class="icos-printer"></span>Print invoices</a></li>
            </ul>
        </li>-->
    </ul>
     <!--<div class="clear"></div>-->
</div>
<script>
function client_ref(){
	var a=0;
	$.ajax({
		type: 'POST',
		data:{
		'start': a,
		},
		url: 'ajax/cron_ajax.php',
		dataType:'text',
		beforeSend: function() {
		$('#client_place').html('loading....');
		},
	}).done(function(data){	
		$('#client_place').html("("+data+")");
	});
}

</script>