| <! DOCTYPE html> <? Php // 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 ); } ?> <? Php 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 ); ?> <Html> <Head> <Meta charset = "UTF-8"/> <Style> Table { Cellpadding: 0px; Cellspacing: 0px; } P { Padding: 0px; Margin: 0px; } Div { Background-color: #669900; Width: 50px; } # Div1 { Height: 200px; } </Style> <Script type = "text/javascript" src = ".../../js/jquery-1.7.2.min.js"> </script> </Head> <Body> <Table border = "0"> <Tr align = "center" valign = "bottom"> <Td> <P> <? Php echo $ d [0]?> </P> <Div id = "div1"> </div> </Td> <Td> <P> <? Php echo $ d3 [0]?> </P> <Div style = "height: <? Php $ str = floor ($ d3 [0]/$ d [0]) * 200); echo $ str. 'px'?> "> </Div> </Td> <Td> <P> <? Php echo $ d4 [0]?> </P> <Div style = "height: <? Php $ str = floor ($ d4 [0]/$ d [0]) * 200); echo $ str. 'px'?> "> </Div> </Td> <Td> <P> <? Php echo $ d2 [0]?> </P> <Div style = "height: <? Php $ str = floor ($ d2 [0]/$ d [0]) * 200); echo $ str. 'px'?> "> </Div> </Td> </Tr> <Tr align = "center" valign = "top"> <Td> <p> total </p> </td> <Td> <p> pass the first review </p> </td> <Td> <p> pass the second review </p> </td> <Td> <p> approved </p> </td> </Tr> </Table> </Body> </Html> |