<?php 
	include "db_connection/db_connection.php";
	include "config/config.php";
$LP_CNT1=0;
$qty=0;
	$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);

	$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;
	}

$insert_stat = mysqli_query($connect,"insert into temp_statistics(req_value1,req_value2) values('".$LP_CNT1."','".$qty."')");
?>