public function actionCreate()
 {
     if ($_GET["select"] == 1) {
         //print_r($_POST);
         if (!Trucks::checkPlate($_POST["plate"])) {
             $truck = new Trucks();
             // print_r($_POST);
             $truck->plate = MYChtml::check_num($_POST["plate"]);
             /* if (strlen($data[1]) > 4) {$truck->is_conctract = 1; $truck->contract_number = $data[1];} else {$truck->is_conctract = 0; $truck->contract_number = "";}
                if (strlen($data[7]) > 4) {$truck->is_act = 1; $truck->act_number = $data[7];} else {$truck->is_act = 0; $truck->act_number = "";}*/
             $truck->balance_license_fee = (int) $_POST["amount_fee_license"];
             $truck->daily_license_fee = $_POST["weight"];
             $truck->comment = $_POST["comment"];
             $truck->fio = $_POST["fio"];
             if (!$truck->save()) {
                 print_r($truck->getErrors());
             }
         }
         $payment = new Payments();
         $payment->plate = MYChtml::check_num($_POST["plate"]);
         if ($_POST["amount_installation"] > 0) {
             $payment->amount_installation = (int) $_POST["amount_installation"];
         }
         if ($_POST["amount_fee_license"] > 0) {
             $payment->amount_fee_license = (int) $_POST["amount_fee_license"];
         }
         $payment->date = $_POST["date"];
         $payment->comment = $_POST["comment"];
         if (!$payment->save()) {
             print_r($payment->getErrors());
         }
     }
     $this->render('create');
 }
Example #2
0
 public function actionCheckplate($plate)
 {
     if (Trucks::checkPlate(MYChtml::fromUTF8($plate))) {
         echo "true";
     } else {
         echo "false";
     }
 }
 function actionConfirmNewGlonass()
 {
     if (Trucks::checkPlate(MYChtml::check_num($this->plate))) {
         $this->ErrorCode = "1";
         $this->data["result"] = "Такой автомобиль уже существует";
     } else {
         $this->ErrorCode = "0";
         $this->data["result"] = "Предоплата за установку ГЛОНАСС авто " . MYChtml::check_num($this->plate);
         $truck = new Trucks();
         $truck->plate = MYChtml::check_num($_POST["plate"]);
         $cash = (double) $_POST["amount"];
         if ($cash >= self::$installationPrice) {
             $installFee = self::$installationPrice;
             $balanceFee = $cash - self::$installationPrice;
             $installation_is_close = 1;
         } else {
             $balanceFee = 0;
             $installFee = $cash;
             $installation_is_close = 0;
         }
         if (self::$yearLicenseFeePrice <= $balanceFee) {
             $truck->daily_license_fee = self::$yearLicenseFeePrice / 365;
         } else {
             $truck->daily_license_fee = self::$monthLicenseFeePrice / 30;
         }
         $truck->installation_is_close = $installation_is_close;
         $truck->balance_license_fee = $balanceFee;
         $truck->comment = "Через аппарат session = " . $this->SessionID . ", телефон " . $_POST['phone'];
         $truck->type = 0;
         if ($truck->save()) {
             Payments::addBalanceAndInstatllFee($balanceFee, $installFee, MYChtml::check_num($this->plate));
         } else {
             $this->ErrorCode = "1";
         }
     }
     $this->sendRequest();
 }
Example #4
0
    <div class="contentpanel">
        <p class="mb20"><a href="http://datatables.net/" target="_blank">DataTables</a> is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, and will add advanced interaction controls to any HTML table.</p>

        <div class="panel panel-primary-head">
            <div class="panel-heading">
                <h4 class="panel-title">Basic Configuration</h4>
                <p>Searching, ordering, paging etc goodness will be immediately added to the table, as shown in this example.</p>
            </div><!-- panel-heading -->
            <br><?php 
$f = fopen($_FILES['userfile']['tmp_name'], 'r');
$i = 0;
while (!feof($f)) {
    $i++;
    $data = fgetcsv($f, 1000, ";");
    if ((int) $data[4] > 0 and strlen($data[8]) > 3) {
        if (Trucks::checkPlate($data[8])) {
        } else {
            $truck = new Trucks();
            $truck->plate = MYChtml::check_num($data[8]);
            if (strlen($data[1]) > 4) {
                $truck->is_conctract = 1;
                $truck->contract_number = $data[1];
            } else {
                $truck->is_conctract = 0;
                $truck->contract_number = "";
            }
            if (strlen($data[7]) > 4) {
                $truck->is_act = 1;
                $truck->act_number = $data[7];
            } else {
                $truck->is_act = 0;