コード例 #1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new KomponengajiM();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['KomponengajiM'])) {
         $model->attributes = $_POST['KomponengajiM'];
         if ($_POST['KomponengajiM']['is'] == "isgaji") {
             $model->isgaji = true;
             $model->ispotongan = false;
         } else {
             $model->isgaji = false;
             $model->ispotongan = true;
         }
         if ($model->save()) {
             $this->redirect(array('admin', 'id' => $model->komponengaji_id));
         }
     }
     $this->render('create', array('model' => $model));
 }