/** * Manages all models. */ public function actionAdmin() { $model = new Orderproduct(); $model->unsetAttributes(); // clear any default values if ( isset( $_GET['Orderproduct'] ) ) $model->attributes = $_GET['Orderproduct']; $id=$_GET['id']; $this->render( 'admin', array( 'model' => $model,'id'=>$id, ) ); }
public function renderPOSTypeDashboard() { if($this->isSales()) { $this->redirect( Yii::app()->createUrl('order/' . Helper::CONST_posclient) ); }else { $customerduemodel = new Person; $customerduemodel->unsetAttributes(); $productpricemodel = new Subproductprice; $productpricemodel->unsetAttributes(); $orderproductmodel = new Orderproduct; $orderproductmodel->unsetAttributes(); $this->render( $this->getView('index','index'), array( 'customerduemodel' => $customerduemodel, 'productpricemodel' => $productpricemodel, 'orderproductmodel' => $orderproductmodel, ) ); } }
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate( $id ) { $model = $this->loadModel( $id ); $model->isopedit = false; $opmodel = new Orderproduct; $opmodel->unsetAttributes(); // clear any default values $opmodel->order_id = (empty($model->id)?0:$model->id); $model->ismsedit = false; $model->isotedit = false; $milestonemodel = new Milestone; $milestonemodel->unsetAttributes(); // clear any default values $milestonemodel->order_id = (empty($model->id)?0:$model->id); $otmodel = new Ordertask; $otmodel->unsetAttributes(); // clear any default values $otmodel->order_id = (empty($model->id)?0:$model->id); $alltasks = $this->getAllTasks(); $allcontractors = Yii::app()->controller->getPeopleLookup(Helper::CONST_Contractor); $this->subTitle = ucwords( $this->action->id ) . ' ' . $this->getMenuLabels( ucwords( $this->controllerID ) ); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if ( !empty( $_POST['Order'] ) && !empty($_POST['Person'])) { $rtn = $this->saveOrUpdateTheModel($model); if($rtn) { $this->redirect( array( 'admin' ) ); } } $this->render( 'update', array( 'model' => $model, 'opmodel' => $opmodel, 'allproducts'=>Yii::app()->user->products, 'milestonemodel'=>$milestonemodel, 'otmodel' => $otmodel, 'alltasks' => $alltasks, 'allcontractors' => $allcontractors, ) ); }
public function actionDailyItemSales() { $model = new Orderproduct( 'dailyitemsales' ); $model->unsetAttributes(); // clear any default values //$model->groupby = Helper::CONST_Product; if ( isset( $_GET['Orderproduct'] ) ) $model->attributes = $_GET['Orderproduct']; if(!empty( $_GET['actionid'] ) && $_GET['actionid'] == Helper::CONST_PDF) { $html = $this->renderPartial( Helper::CONST_dailyItemSales, array( 'model' => $model, ),true ); $this->writeToPdf( $html ); } else { $this->render( Helper::CONST_dailyItemSales, array( 'model' => $model, ) ); } }