mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
38
lib/model/Workorder.php
Executable file
38
lib/model/Workorder.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Subclass for representing a row from the 'workorder' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package lib.model
|
||||
*/
|
||||
class Workorder extends BaseWorkorder
|
||||
{
|
||||
function convertTime($time){
|
||||
$time = (int)$time;
|
||||
$sec = ($time < 1200) ? " AM" : " PM";
|
||||
|
||||
if($time == 0 or $time == 2400){
|
||||
return "12:00 pm";
|
||||
}
|
||||
|
||||
if($time >= 1300) $time = ($time - 1200);
|
||||
$len = strlen($time);
|
||||
$lenMinus2 = $len - 2;
|
||||
$hours = substr($time, 0, $lenMinus2);
|
||||
$min = substr($time,$lenMinus2,2);
|
||||
|
||||
return $hours.":".$min.$sec;
|
||||
}
|
||||
function getAssignerName(){
|
||||
$assignerID = $this->getAssignedBy();
|
||||
$assigner = UserPeer::retrieveByPk ($assignerID);
|
||||
|
||||
if($assigner)
|
||||
return $assigner->getFirstName();
|
||||
else
|
||||
return "----";
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user