add_warehouse.php 495 B

123456789101112131415
  1. <?php /** Created by Anton on 31.01.2020. */
  2. require '../yiiInit.php';
  3. $title = (string) Yii::$app->request->post('title');
  4. $company = (int) Yii::$app->request->post('company');
  5. $number = (int) Yii::$app->request->post('number');
  6. $warehouse = new \app\models\entity\Warehouse();
  7. $warehouse->title = $title;
  8. $warehouse->company = $company;
  9. $warehouse->number = $number;
  10. $warehouse->save();
  11. Yii::$app->response->redirect(\yii\helpers\Url::to($_SERVER['HTTP_REFERER']))->send();