|
// Calculate the day of the previous month
Function last_month_today ($ time ){
$ Last_month_time = mktime (date ("G", $ time), date ("I", $ time), date ("s", $ time ), date ("n", $ time), 0, date ("Y", $ time ));
$ Last_month_t = date ("t", $ last_month_time );
If ($ last_month_t <date ("j", $ time )){
Return date ("Y-m-t H: I: s", $ last_month_time );
}
Return date ("Y-m", $ last_month_time). "-d", $ time );
}
?>
Include dirname (_ FILE _). '/config. php ';
$ EndDate = date ('Y-m-D ');
$ Date = strtotime ($ endDate );
$ BeginDate = last_month_today ($ date );
// Query the total number of data entries in the last month
$ SQL = 'SELECT count (*) from newpro where p_date> \ ''. $ beginDate. '\' and p_date <\''. $ endDate .'\'';
// $ SQL = "select count (*) from newpro where p_date> '$ inindate' and p_date <'$ endDate'"; // This statement can also be used.
$ D = db ()-> query ($ SQL)-> fetch (PDO: FETCH_NUM );
// Echo "total number of data entries:". $ d [0];
// Query the number of data entries that have passed the review
$ Sql2 = $ SQL. 'and is_pa_check_first = 1 and is_pa_check_second = 1 and is_pa_check_third = 1 ';
$ D2 = db ()-> query ($ sql2)-> fetch (PDO: FETCH_NUM );
// Echo "number of data records approved:". $ d2 [0];
// Query the number of items that have been approved at a time
$ Sql3 = $ SQL. 'and is_pa_check_first = 1 ';
$ D3 = db ()-> query ($ sql3)-> fetch (PDO: FETCH_NUM );
// Query the number of items that pass the secondary review
$ Sql4 = $ SQL. 'and is_pa_check_first = 1 and is_pa_check_second = 1 ';
$ D4 = db ()-> query ($ sql4)-> fetch (PDO: FETCH_NUM );
?>
|