Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2. include("dbString.php");
  3.  
  4. class cjFramework
  5. {
  6.            public $unix_db = 'opgaver';
  7.            public $twoHours = 0;
  8.  
  9.            public function __construct() { $this->twoHours = (date("U") - (60*60*2)); }
  10.            public function getQuery($SQL){return(mysql_query($SQL));}
  11.            public function compile($d){die('<p>'.$d.'</p>');}
  12.  
  13.            public function __doTask(){
  14.                  $openDB = $this->getQuery('SELECT `tester_id`, `opgave_id`, `accepteret_tidspunkt` FROM `'.$this->unix_db.'_accepteret` WHERE `accepteret` = 1 AND `done` != 1 AND `accepteret_tidspunkt` > '.$this->twoHours);
  15.                  while ( $task = mysql_fetch_assoc($openDB) )
  16.                  {
  17.                        echo "Tester: ".$task['tester_id']." har accepteret opgaven d. ".date("d-m/Y H:i:s", $task['accepteret_tidspunkt']).", men har ikke lavet testen indenfor 2 timer (".date("d-m/Y H:i:s", $this->twoHours).")<br/>";
  18.                  }
  19.            }
  20.  
  21. }
  22.  
  23.  
  24. /** KΓΈr opgave hver 2. minut. **/
  25.  
  26. $l=new cjFramework;
  27. $l->__doTask();
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement