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');
 }
 public function actionsaveUser()
 {
     //Метод сохранения пользователей
     $parse_str = array();
     parse_str($_POST['post'], $parse_str);
     foreach ($parse_str as $k => $v) {
         $this->post[$k] = MYChtml::fromUTF8($v);
         // iconv("UTF-8","windows-1251",$v);
     }
     if (Users::checkDoubleLogin($this->post['login'])) {
         $this->ajaxMessages('dphone');
     }
     if (strlen($this->post['email']) > 0) {
         if (Users::checkDoubleEmail($this->post['email'])) {
             $this->ajaxMessages('demail');
         }
         if (!AccessoryFunctions::emailValidation($this->post['email'])) {
             $this->ajaxMessages('femail');
         }
     }
     if ($this->post['password'] != $this->post['password_repeat']) {
         $this->ajaxMessages('dpassword');
     }
     echo Users::saveUser($this->post);
 }
 public function actionCheckplate($plate)
 {
     if (Trucks::checkPlate(MYChtml::fromUTF8($plate))) {
         echo "true";
     } else {
         echo "false";
     }
 }
 function actionCreateAndSendAccess()
 {
     if ($_POST['accounts'] == 0) {
         $account = new BncomplexAccount();
         $account->date_create = new CDbExpression("now()");
         //$account->forsearch
         $account->user = BNComplex::generateUserLogin();
         $account->forsearch = $account->user;
         $account->pass = BNComplex::generatePass();
         $account->phone = $_POST["phone"];
         $result = $account->save();
     } else {
         $account = BncomplexAccount::model()->find("user=:user", array(":user" => $_POST["accounts"]));
         $result = $account;
     }
     if ($result) {
         foreach ($_POST["plates"] as $plate) {
             if (strlen(str_replace(" ", "", $plate)) > 0) {
                 if (BncomplexSubscription::model()->count("plate=:plate and id_account=:account", array(":plate" => $plate, ":account" => $account->id)) == 0) {
                     $subs = new BncomplexSubscription();
                     $subs->id_account = $account->id;
                     $subs->plate = MYChtml::check_num($plate);
                     if (!$subs->save()) {
                         print_r($subs->getErrors());
                     }
                 }
             }
         }
     } else {
         echo "Пиздец" . $_POST["accounts"];
     }
     if ($account) {
         $BNLogin = BNComplex::createAccount($account);
         if ($BNLogin) {
         } else {
             echo "Опять пиздец";
         }
     }
     $this->render("createandsend", array("account" => $account, "isNew" => $_POST['accounts'] == 0 ? "Новый" : "Старый"));
 }
Beispiel #5
0
 public function ajaxMessages($str)
 {
     echo MYChtml::toUTF8($str);
     die;
 }
Beispiel #6
0
            <?php 
    echo $item->rating == 1 ? 'Положительный' : 'Отрицательный';
    ?>
        </td>
        <td>
            <a href="#" class="deleteComment" id="dComment<?php 
    echo $item->id;
    ?>
 ">Удалить</a>
            <br>
            <a href="#" class="editComment" id="eComment<?php 
    echo $item->id;
    ?>
 ">Редактировать</a>
        </td>
    </tr>
    <?php 
}
?>
</table>



<script src="<?php 
echo Yii::app()->request->baseUrl;
?>
/js/cabinet.js"></script>

<?php 
echo MYChtml::showMessage($_GET);
Beispiel #7
0
 public static function checkPlate($plate)
 {
     $plate = MYChtml::check_num($plate);
     return Trucks::model()->find("plate=:plate", array(":plate" => $plate));
 }
Beispiel #8
0
            <?php 
if ($result["result"] == "error") {
    if ($result["errno"] > 0) {
        echo MYChtml::alert_msg($this->errorSave[$result["errno"]]);
    }
    if ($result["errno"] == -1) {
        echo MYChtml::alert_msg("Сообщить об ошибке в БД");
    }
}
if ($result["result"] == "noerror") {
    $this->redirect($this->createUrl("requestshipping/create", array("success" => 1)));
    //echo MYChtml::success_msg("Заявка на перевозку сохранена.");
}
if ($_GET['success'] == 1) {
    echo MYChtml::success_msg("Заявка на перевозку сохранена.");
}
?>
            <br>
            <div class="panel-body nopadding" style="max-width: 1000px">
<form action="<?php 
echo $this->createUrl("create", array("select" => 1));
?>
" method="post"  class="form-horizontal form-bordered">





    <div class="form-group">
        <label class="col-sm-4 control-label">Дата платежа(z отчета):</label>
 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();
 }
Beispiel #10
0
    // $reply = new ReplyShipping();
    ?>
                    <tr id="reply<?php 
    echo $reply->id;
    ?>
">
                        <td><input type="checkbox" value="<?php 
    echo $reply->id;
    ?>
"></td>
                        <td><?php 
    echo MYChtml::view_date($reply->date_create);
    ?>
</td>
                        <td><a href="#"  class="colabrator_login"><?php 
    echo MYChtml::view_date($reply->user->login);
    ?>
</a></td>
                        <td><?php 
    echo $reply->trucks_count;
    ?>
</td>

                        <td class="priceTd"><b><?php 
    echo $reply->price;
    ?>
 руб/кг</b><br>
                            <?php 
    echo $request->price;
    ?>
 руб/кг<br>
Beispiel #11
0
    ?>
</td>
                    <td><?php 
    echo $request->region_load_text;
    ?>
</td>
                    <td><?php 
    echo $request->regionUnload->name . ", " . $request->stevedore->name;
    ?>
</td>
                    <td><?php 
    echo $request->culure->culture;
    ?>
</td>
                    <td><?php 
    echo MYChtml::view_num($request->weight);
    ?>
 тонн</td>
                    <?php 
    $newViews = OperationWithRequests::getCountOfNewReply($request->id);
    ?>

                </tr>

                    <?php 
}
?>



                </tbody>
Beispiel #12
0
            $truck->balance_license_fee = 0;
            $truck->daily_license_fee = 10;
            $truck->comment = $data[0] . " ";
            $truck->fio = $data[3];
            if (!$truck->save()) {
                print_r($truck->getErrors());
                echo "<hr>";
                echo "Строка:" . $i;
                die;
            }
        }
        $payment = new Payments();
        $payment->amount_fee_license = 0;
        $payment->amount_installation = (int) $data[4];
        $payment->date = date("Y-m-d", strtotime($data[2]));
        $payment->plate = MYChtml::check_num($data[8]);
        if (!$payment->save()) {
            print_r($payment->getErrors());
            echo "Строка:" . $i;
            die;
            echo "<hr>";
        }
    }
    ob_start();
    echo "Строка " . $i . "<br>";
    ob_end_flush();
}
?>

        </div><!-- panel -->
Beispiel #13
0
 private function addSearch()
 {
     if (isset(Yii::app()->session['search'])) {
         foreach ($this->searchField as $val) {
             $this->criteria->addSearchCondition($val, Yii::app()->session['search'], true, "OR");
             $this->criteria->addSearchCondition($val, MYChtml::check_num(Yii::app()->session['search']), true, "OR");
         }
     }
 }
Beispiel #14
0
echo Yii::app()->request->baseUrl;
?>
/js/cabinet.js"></script>

        <script src="<?php 
echo Yii::app()->request->baseUrl;
?>
/js/script.js"></script>

        <script src="<?php 
echo Yii::app()->request->baseUrl;
?>
/js/bootstrap-wizard/form-wizard.min.js"></script>

        <?php 
echo MYChtml::showMessage($this->message);
?>

        <script src="<?php 
echo Yii::app()->request->baseUrl;
?>
/js/mask.js"></script>

	<script>

        var handleThemeSkins = function () {
            // Handle theme colors

            var setSkin = function (color) {
                $('#skin-switcher').attr("href", "<?php 
echo Yii::app()->request->baseUrl;