require_once(__DIR__ . '/../../../vendor/autoload.php');
use Orchard\Mysqli\Wrapper as MysqliWrapper;
$wrapperObj = new MysqliWrapper($mysqli);
// make sure that the person has enough priviledge...
if (check_user_role($wrapperObj, 3) or check_user_role($wrapperObj, 6)) { ?>
|
Last Week |
Last Month |
Last 3 Month |
// priority 1 screenshots.
$sql = "SELECT sum( IF(start_date >= (curdate() - INTERVAL 7 DAY), 1, 0) ) as total_lastweek
, sum( IF(start_date >= (curdate() - INTERVAL 1 month), 1, 0) ) as total_lastmonth
, sum( IF(start_date >= (curdate() - INTERVAL 3 month), 1, 0) ) as total_last3month
FROM screenshot
WHERE priority = 1";
if(!$screenshot_result = mysql_query($sql))
showerror();
if($screenshot_row = mysql_fetch_array($screenshot_result))
{
?>
| Priority 1 |
">=$screenshot_row["total_lastweek"]?> |
">=$screenshot_row["total_lastmonth"]?> |
">=$screenshot_row["total_last3month"]?> |
}
?>
// All screenshots.
$sql = "SELECT sum( IF(start_date >= (curdate() - INTERVAL 7 DAY), 1, 0) ) as total_lastweek
, sum( IF(start_date >= (curdate() - INTERVAL 1 month), 1, 0) ) as total_lastmonth
, sum( IF(start_date >= (curdate() - INTERVAL 3 month), 1, 0) ) as total_last3month
FROM screenshot
WHERE 1";
if(!$screenshot_result = mysql_query($sql))
showerror();
if($screenshot_row = mysql_fetch_array($screenshot_result))
{
?>
| All Screenshots |
">=$screenshot_row["total_lastweek"]?> |
">=$screenshot_row["total_lastmonth"]?> |
">=$screenshot_row["total_last3month"]?> |
}
?>
}
?>