Exemplo n.º 1
0
 /**
  * Creates a new Rodetail model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Rodetail();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->ID]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Exemplo n.º 2
0
 public function actionSimpantambah()
 {
     $roDetail = new Rodetail();
     if ($roDetail->load(Yii::$app->request->post()) && $roDetail->validate()) {
         $hsl = \Yii::$app->request->post();
         $kdro = $hsl['Rodetail']['KD_RO'];
         $kdBarang = $hsl['Rodetail']['KD_BARANG'];
         $nmBarang = Barangumum::findOne(['KD_BARANG' => $kdBarang]);
         $kdUnit = $hsl['Rodetail']['UNIT'];
         $rqty = $hsl['Rodetail']['RQTY'];
         $note = $hsl['Rodetail']['NOTE'];
         /*
          * Detail Request Order
          **/
         $roDetail->KD_RO = $kdro;
         $roDetail->CREATED_AT = date('Y-m-d H:i:s');
         $roDetail->NM_BARANG = $nmBarang->NM_BARANG;
         $roDetail->KD_BARANG = $kdBarang;
         $roDetail->UNIT = $kdUnit;
         $roDetail->RQTY = $rqty;
         $roDetail->NOTE = $note;
         $roDetail->STATUS = 0;
         $roDetail->save();
         return $this->redirect(['index?RequestorderSearch[KD_RO]=' . $kdro]);
     } else {
         return $this->redirect(['index']);
     }
 }