예제 #1
0
 /**
  * Find all the trucks in your company
  * @param mixed $_SESSION
  * @return all the trucks in your company
  **/
 public static function GetAssignableTrucks($cust)
 {
     $sql = "SELECT * FROM GPSTruck WHERE CustomerId = :cust";
     $params = array(':cust' => $cust);
     $stm = pdo_execute_query($sql, $params);
     if ($stm) {
         $stm->setFetchMode(PDO::FETCH_CLASS, "Trucks");
         $trucks = $stm->fetchAll();
         if ($trucks) {
             foreach ($trucks as &$truck) {
                 $truck->DisplayName = Trucks::calculateDisplayName($truck);
             }
             return $trucks;
         } else {
             return array();
         }
         //empty
     }
     return false;
 }