<?php
	//THIS IS FOR FINDING THE NUMBER OF FINISHED PENDING AMT
	$fin_pen_amt = 0;
	$fin_pen_qty = 1;
	$mast_pice1 = 0;
	$mast_pice2 = 0;
	$mast_pice3 = 0;
	$mast_pice4 = 0;
	$page_id1 = base64_encode(base64_encode(base64_encode(base64_encode(1))));
	$page_id2 = base64_encode(base64_encode(base64_encode(base64_encode(2))));
	$page_id3 = base64_encode(base64_encode(base64_encode(base64_encode(3))));
	$page_id4 = base64_encode(base64_encode(base64_encode(base64_encode(4))));

	

$sel_cron_top = mysqli_query($connect,"select * from cron_topmenu order by id desc Limit 0,1");
$res_crontop = mysqli_fetch_array($sel_cron_top,MYSQLI_ASSOC);
extract($res_crontop);

?>
<div class="contentTop">
        <span class="pageTitle"><span class="icon-screen"></span>Dashboard</span>
        <ul class="quickStats">
		<li >
		<a href="javascript:;" onclick="client_ref1();"><img src="images/refresh.png" width="15" height="15"></a>
		<span id="ldata" style="color:#B35D5D; font-weight:bold;"></span>
		</li>
            <li>
               <span style="margin-right:10px; float:left; margin-top:0px;" ><img src="images/pend_img.png" width="25" height="25" alt="" /></span>
                <?php
				if($admin_flagg==1)
				{
				?>
                	<div class="floatR"><strong class="blue"><span class="fin_pen_amt" style="color:#5d91a9; font-size:14px;"><?php echo number_format($fin_pen_amt,2); ?></span></strong><span style="padding-left:20px;"><a title="Order Pending" class="fin_pen_qty"<?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id1; ?>" <?php } ?>>( <?php echo $fin_pen_qty-1; ?> )</a></span><br><span class="mast_pice1" title="No of Dies for Order Pending Designs">( <?php echo $mast_pice1; ?> )</span></div>
            	<?php
				}
				else
				{
				?>
                	<div class="floatR" style="vertical-align:middle; padding-top:5px"><strong class="blue"><a title="Order Pending" class="fin_pen_qty" style="color:#5d91a9; font-size:14px;"  <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id1; ?>" <?php } ?>><?php echo $fin_pen_qty-1; ?></a></strong><br><span title="No of Dies for Order Pending Designs" class="mast_pice1">
					( <?php echo $mast_pice1; ?> )</span></div>
                <?php
				}
				?>
            </li>
            <li>
                <span style="margin-right:10px; float:left; margin-top:-3px;" ><img src="images/pend_deli.png" width="30" height="30" alt="" /></span>
                <?php
				if($admin_flagg==1)
				{
				?>
                	<div class="floatR"><strong class="blue" class="del_pen_amt"style="color:#5d91a9; font-size:14px; font-weight:bold;" ><?php echo number_format($del_pen_amt,2); ?></strong><span style="padding-left:20px;"><a title="Delivery Pending" class="del_pen_qty" <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id2; ?>" <?php } ?>>( <?php echo $del_pen_qty-1; ?> )</a></span><br><span title="No of Dies for Delivery Pending Designs" class="mast_pice2">( <?php echo $mast_pice2; ?> )</span></div>
            	<?php
				}
				else
				{
				?>
                	<div class="floatR" style="vertical-align:middle; padding-top:5px"><strong class="blue"><a title="Delivery Pending" class="del_pen_qty" style="color:#5d91a9; font-size:14px; font-weight:bold;" <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id2; ?>" <?php } ?>><?php echo $del_pen_qty-1; ?></a></strong><br><span title="No of Dies for Delivery Pending Designs" class="mast_pice2">( <?php echo $mast_pice2; ?> )</span></div>
                <?php
				}
				?>
            </li>
            <?php
				if($admin_flagg==1)
				{
				?>
					<li>
		                <span style="margin-right:10px; float:left; margin-top:-3px;" ><img src="images/pend_bill.png" width="30" height="30" alt="" /></span>
		                <div class="floatR"><strong class="blue"><span class="bil_pen_amt" style="color:#5d91a9; font-size:14px; font-weight:bold;"><?php echo number_format($bil_pen_amt,2); ?></span></strong><span style="padding-left:20px;"><a title="Bill Pending" class="bil_pen_qty" <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id4; ?>" <?php } ?>>( <?php echo $bil_pen_qty-1; ?> )</a></span><br><span title="No of Dies for Bill Pending Designs" class="mast_pice4">
						( <?php echo $mast_pice4; ?> )</span></div>
		            </li>
            <?php
				}
				?>
            <li>
                <span style="margin-right:10px; float:left; margin-top:2px;" ><img src="images/pend_stock.png" width="25" height="25" alt="" /></span>
                <?php
				if($admin_flagg==1)
				{
				?>
                	<div class="floatR"><strong class="blue"><span class="st_amt" style="color:#5d91a9; font-size:14px; font-weight:bold;"><?php echo "0.00";//echo number_format($st_amt,2); ?></span></strong><span style="padding-left:20px;"><a class="st_qty" title="Stock"  <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id3; ?>" <?php } ?>>( <?php echo "0";//$st_qty-1; ?> )</a></span><br><span title="No of Dies for Stock Pending Designs" class="mast_pice3">( <?php echo "0";// $mast_pice3; ?> )</div>
            	<?php
				}
				else
				{
				?>
                	<div class="floatR" style="vertical-align:middle; padding-top:5px"><strong class="blue"><a title="Stock" <?php if($ip_flagg==0){ ?> href="javascript:void(0)" <?php } else if($ip_flagg==1){ ?> href="pending_list.php?pg_id=<?php echo $page_id3; ?>" <?php } ?>> <span class="st_qty"><?php echo $st_qty-1; ?> </span></a></strong><br><span title="No of Dies for Stock Pending Designs" class="mast_pice3">( <?php echo $mast_pice3; ?> )</span></div>
                <?php
				}
				?>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
	
	<script>
function client_ref1(){
	var a=0;
	$.ajax({
		type: 'POST',
		data:{
		'start': a,
		},
		url: 'ajax/cron_top_menu.php',
		dataType:'text',
		beforeSend: function() {
		$('#ldata').html('loading....');
		},
	}).done(function(data){	//**
	var data = data.split('**');
		$('.fin_pen_amt').html(data[0]);
		$('.fin_pen_qty').html("( "+data[1]+" )");
		$('.del_pen_amt').html(data[2]);
		$('.del_pen_qty').html("( "+data[3]+" )");
		$('.bil_pen_amt').html(data[4]);
		$('.bil_pen_qty').html("( "+data[5]+" )");
		$('.mast_pice1').html("( "+data[6]+" )");
		$('.mast_pice2').html("( "+data[7]+" )");
		$('.mast_pice3').html("( "+data[8]+" )");
		$('.mast_pice4').html("( "+data[9]+" )");
		$('.st_amt').html(data[10]);
		$('.st_qty').html("( "+data[11]+" )");
		$('#ldata').html('');
	});
}

</script>