$sqldoc="select * from document_approve where ct_code='$cont' and status = '2' AND date >= '".date("$yearchk-12-16 00:00:00")."' AND date <= '".date("$yearchk-12-31 00:00:00")."' order by id asc ";
$sqldocinfra="select * from document_approveinfra where ct_code='$cont' and status = '2' AND date >= '".date("$yearchk-12-16 00:00:00")."' AND date <= '".date("$yearchk-12-31 00:00:00")."' order by id asc ";
$count_user = mysql_query("select count(*) from document_approve where ct_code='$cont' and status = '2' AND date >= '".date("$yearchk-12-16 00:00:00")."' AND date <= '".date("$yearchk-12-31 00:00:00")."' ");
$count_userinfra = mysql_query("select count(*) from document_approveinfra where ct_code='$cont' and status = '2' AND date >= '".date("$yearchk-12-16 00:00:00")."' AND date <= '".date("$yearchk-12-31 00:00:00")."' ");
$resultsdoc = mysql_query($sqldoc);
$resultsdocinfra = mysql_query($sqldocinfra);
$user_online = mysql_result($count_user,0);
$user_onlineinfra = mysql_result($count_userinfra,0);
while($fetcharrsdoc = mysql_fetch_array($resultsdoc))
while($fetcharrsdoc = mysql_fetch_array($resultsdocinfra))
{
$status = $fetcharrsdoc['status'];
$statusinfra = $fetcharrsdocinfra['status'];
$dateapprove = $fetcharrsdoc['date'];
$dateapproveinfra = $fetcharrsdocinfra['date'];
$iddocument = $fetcharrsdoc['id'];
$iddocumentinfra = $fetcharrsdocinfra['id'];
}
$datestamp = "15";
$datestampinfra = "15";
$day = "AND date >= '".date("$yearchk-12-16 00:00:00")."' AND date <= '".date("$yearchk-12-31 00:00:00")."' ";
$dayinfra = "AND date >= '".date("$yearchk-12-16 00:00:00")."' AND date <= '".date("$yearchk-12-31 00:00:00")."' ";
}