示例#1
1
 public function actionGenHandler()
 {
     $num = $_POST['num'];
     $type = $_POST['type'];
     $arr_no = [];
     for ($i = 0; $i < $num; $i++) {
         $no = Util::next($type);
         if ($no >= 10 && $no < 100) {
             $no = '0' . $no;
         } else {
             if ($no < 10) {
                 $no = '00' . $no;
             }
         }
         $no = $type . $no;
         $arr_no[] = $no;
         $card = new Card();
         $card->no = $no;
         $card->type = $type;
         $card->status = 'A';
         $card->create_dt = date('Y-m-d');
         $card->create_by = \Yii::$app->user->id;
         $card->save();
         $this->genBarCode($no);
     }
     $ty = Ref::getDesc('ctype', $type);
     $content = $this->renderPartial('daily_card', ['arr_no' => $arr_no, 'type' => $ty]);
     $pdf = new Pdf(['content' => $content, 'orientation' => Pdf::ORIENT_PORTRAIT, 'cssFile' => 'css/card.css', 'marginLeft' => 5, 'marginRight' => 5]);
     $pdf->render();
 }
示例#2
0
 public function actionCityLst()
 {
     $Util = new Util();
     $Util->set_prop_from_arr($_REQUEST);
     $ar['city_lst'] = $Util->city_lst();
     Core::encode_echo($ar);
 }
示例#3
0
 public function actionEdit()
 {
     $params = [];
     $params['oblast_lst'] = Util::getInstance()->oblast_lst();
     $this->view->registerJs("MamCtrl.actionEdit();", \yii\web\View::POS_END, 'actionEdit');
     return $this->render('edit', $params);
 }