Changeset 28 for trunk/www/task.php
- Timestamp:
- Jun 13, 2009, 9:01:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/task.php
r22 r28 22 22 23 23 chdir($Config['BaseDir']); 24 $DbResult = $this->Database->query('SELECT * FROM Task WHERE State = "Waiting"ORDER BY Id,Time ASC');24 $DbResult = $this->Database->query('SELECT * FROM Task WHERE State = 0 ORDER BY Id,Time ASC'); 25 25 while($Task = $DbResult->fetch_assoc()) 26 26 { 27 $this->Database->query('UPDATE Task SET State= "Running"WHERE Id='.$Task['Id']);27 $this->Database->query('UPDATE Task SET State=1 WHERE Id='.$Task['Id']); 28 28 echo('Provádím úlohu '.$Task['Id'].': '.$Task['Title']."...\n"); 29 29 $Task['CommandList'] = "#!/bin/sh\n".$Task['CommandList']; … … 34 34 $Output = implode("\n", $Output); 35 35 echo($Output); 36 $this->Database->query('UPDATE Task SET State="Finished", Output="'.addslashes($Output).'" WHERE Id='.$Task['Id']); 36 echo("Hotovo\n"); 37 $this->Database->query('UPDATE Task SET State=2, Output="'.addslashes($Output).'" WHERE Id='.$Task['Id']); 37 38 } 38 return($Output);39 39 } 40 41 function GetUserTaskList($UserId) 42 { 43 $Output = ''; 44 $DbResult = $this->Database->query('SELECT * FROM Task WHERE (State IN ("Waiting", "Running")) AND (User='.$UserId.') ORDER BY Id,Time ASC'); 45 while($DbRow = $DbResult->fetch_assoc()) 46 { 47 $Output .= ''; 48 } 49 return($Output); 50 } 51 40 52 41 function Abort($Id) 53 42 {
Note:
See TracChangeset
for help on using the changeset viewer.