/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'ubah' page. */ public function actionTambah() { $this->layout = '//layouts/box_kecil'; $model = new ReturPenjualan(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['ReturPenjualan'])) { $model->attributes = $_POST['ReturPenjualan']; if ($model->save()) { $this->redirect(array('ubah', 'id' => $model->id)); } } $customerList = Profil::model()->findAll(array('select' => 'id, nama', 'condition' => 'id>' . Profil::AWAL_ID . ' and tipe_id=' . Profil::TIPE_CUSTOMER, 'order' => 'nama')); $this->render('tambah', array('model' => $model, 'customerList' => $customerList)); }