Exemplo n.º 1
0
 function ProcessActivatioPayment($paymetID, $amount)
 {
     $mDeployedVehicleList = $this->userId->getWaitingVehicleList();
     $cnt = sizeof($mDeployedVehicleList);
     if ($amount == 0 || $cnt == 0) {
         return 0;
     }
     $amount1 = $amount / $cnt;
     for ($i = 0; $i < $cnt; $i++) {
         Payments::add($paymetID, $amount1, 1, 2, $mDeployedVehicleList[$i]);
         $adder = new VehicleMailer($mDeployedVehicleList[$i]);
         $adder->sendVehicleActivatedMessage();
     }
     return $cnt;
 }
Exemplo n.º 2
0
     }
     break;
 case "delete":
     $id = $_GET['id'];
     echo $_GET['id'];
     $mVehicle = new Vehicle($id);
     /* if getCurrentJob() retruns o means vehicle is not on job... */
     if ($mVehicle->isOnTrip() != 0 || $mVehicle->getCurrentJob() != 0) {
         echo '<script language="javascript">';
         echo 'alert("Vehicle is on Job, can\'t delte now !!!")';
         echo '</script>';
         header('Location:index.php');
         break;
     }
     if ($mVehicle->delete()) {
         $adder = new VehicleMailer($id);
         $adder->sendVehicleDeletedMessage();
         header('Location:index.php');
     } else {
         header('Location:index.php');
     }
     //header('Location:abc.php');
     break;
 case "set_driver":
     $id = $_GET['id'];
     $driver_id = $_GET['driverid'];
     //echo $_GET['id'];
     $mVehicle = new Vehicle($id);
     if ($mVehicle->setDriver($driver_id)) {
         echo 1;
     } else {