本文整理汇总了PHP中Order::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::unsetAttributes方法的具体用法?PHP Order::unsetAttributes怎么用?PHP Order::unsetAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order::unsetAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderCRTypeDashboard
public function renderCRTypeDashboard()
{
$model = new Order ( 'search' );
$model->unsetAttributes(); // clear any default values
$model->splsearch = Helper::CONST_Tomorrow;
$model->hdnactionname = Helper::CONST_indexactionid;
$timeslotmodel = new Persontimeslot;
$timeslotmodel->unsetAttributes();
$timeslotmodel->slotdate = $model->splsearch;
if ( isset( $_GET['Order'] ) )
{
$model->attributes = $_GET['Order'];
$timeslotmodel->slotdate = $model->splsearch;
}
$options = $this->prepareOrderGridOptions($model->hdnactionname,
Helper::CONST_grid_Height_200);
$this->render( $this->getView('index','index'),
array(
'model' => $model,
'origin' => $model->hdnactionname,
'options'=> $options,
'fromdb' => true,
'timeslotmodel' => $timeslotmodel,
)
);
}
示例2: actionList
public function actionList()
{
$pid = 5;//支付状态
$start = '';//开始时间
$stop = '';//结束时间
$model=new Order();
//计算总共有几个订单
$allcount = $model->count(array('condition'=>'updatetime<>0'));
$model->unsetAttributes(); // clear any default values
if(isset($_GET['pay_way'])){
//$model->attributes=$_GET['Order'];
$pid = $_GET['pay_way'];
}
if(isset($_GET['start'])){
$start = $_GET['start'];
}
if(isset($_GET['stop'])){
$stop = $_GET['stop'];
}
Yii::app()->session['myurl'] = $this->createUrl('list');
$this->render('list',array(
'model'=>$model,
'pid'=>$pid,
'start'=>$start,
'stop'=>$stop,
'allcount'=>$allcount,
));
}
示例3: actionUpdate
/**
* Update order
* @param bool $new
* @throws CHttpException
*/
public function actionUpdate($new = false)
{
if (SLicenseChecker::check() === false && SLicenseChecker::isOnLocalhost() === false) {
throw new CHttpException(404, 'В ознакомительной версии редактирование заказов недоступно.');
}
if ($new === true) {
$model = new Order();
$model->unsetAttributes();
} else {
$model = $this->_loadModel($_GET['id']);
}
if (Yii::app()->request->isPostRequest) {
$model->attributes = $_POST['Order'];
if ($model->validate()) {
$model->save();
// Update quantities
if (sizeof(Yii::app()->request->getPost('quantity', array()))) {
$model->setProductQuantities(Yii::app()->request->getPost('quantity'));
}
$model->updateDeliveryPrice();
$model->updateTotalPrice();
$this->setFlashMessage(Yii::t('OrdersModule.admin', 'Изменения успешно сохранены'));
if (isset($_POST['REDIRECT'])) {
$this->smartRedirect($model);
} else {
$this->redirect(array('index'));
}
}
}
$this->render('update', array('deliveryMethods' => StoreDeliveryMethod::model()->applyTranslateCriteria()->orderByName()->findAll(), 'statuses' => OrderStatus::model()->orderByPosition()->findAll(), 'model' => $model));
}
示例4: actionAdmin
public function actionAdmin()
{
$model = new Order('search');
$model->unsetAttributes();
if (isset($_GET['Order'])) {
$model->setAttributes($_GET['Order']);
}
$this->render('admin', array('model' => $model));
}
示例5: actionIndex
/**
* Manages all models.
*/
public function actionIndex()
{
$model = new Order('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Order'])) {
$model->attributes = $_GET['Order'];
}
$this->render('admin', array('model' => $model));
}
示例6: actionIndex
public function actionIndex()
{
$model = new Order('search');
$model->unsetAttributes();
// clear any default values
if (Yii::app()->getRequest()->getQuery('Order')) {
$model->setAttributes(Yii::app()->getRequest()->getQuery('Order'));
}
$this->render('index', ['model' => $model]);
}
示例7: actionIndex
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
*/
public function actionIndex()
{
$this->breadcrumbs = array($this->ID . ' Manager' => array('index'));
$this->pageTitle = "List of Order";
$model = new Order('search');
$model->unsetAttributes();
if (isset($_GET['Order'])) {
$model->attributes = $_GET['Order'];
}
$this->render($this->view . 'index', array('model' => $model));
}
示例8: actionIndex
public function actionIndex()
{
$model = new Order('search');
$model->unsetAttributes();
if ($_GET['Order']) {
$model->attributes = $_GET['Order'];
}
$users = Order::model()->getUser();
$amount = Order::model()->getAmount();
$this->render('index', ['model' => $model, 'users' => $users, 'amount' => $amount]);
}
示例9: actionAdmin
/**
* list data order
*/
public function actionAdmin()
{
/* untuk cek login admin */
IsAuth::Admin();
/* panggil model order dan function search */
$model = new Order('search');
/* clear semua default value attributes */
$model->unsetAttributes();
/* jika data order dikirim
* sebagai kriteria pencarian */
if (isset($_GET['Order'])) {
/* set nilai attributes
* untuk pencarian data order */
$model->attributes = $_GET['Order'];
}
/* render file views/orders/admin */
$this->render('admin', array('model' => $model));
}
示例10: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
unset(Yii::app()->request->cookies['from_date']);
// first unset cookie for dates
unset(Yii::app()->request->cookies['to_date']);
$model = new Order('search');
$model->unsetAttributes();
// clear any default values
if (!empty($_POST)) {
Yii::app()->request->cookies['from_date'] = new CHttpCookie('from_date', $_POST['from_date']);
// define cookie for from_date
Yii::app()->request->cookies['to_date'] = new CHttpCookie('to_date', $_POST['to_date']);
$model->from_date = $_POST['from_date'];
$model->to_date = $_POST['to_date'];
}
if (isset($_GET['Order'])) {
$model->attributes = $_GET['Order'];
}
$this->render('admin', array('model' => $model));
}
示例11: actionUpdate
/**
* Update order
* @param bool $new
* @throws CHttpException
*/
public function actionUpdate($new = false)
{
Yii::app()->clientScript->registerScriptFile($this->module->assetsUrl . '/admin/orders.update.js', CClientScript::POS_END);
if ($new === true) {
$model = new Order();
$model->unsetAttributes();
} else {
$model = $this->_loadModel($_GET['id']);
}
if (!$model->isNewRecord) {
$update = Yii::t('CartModule.admin', 'UPDATE_ORDER', array('{order_id}' => CHtml::encode($model->id)));
}
$this->pageName = $model->isNewRecord ? Yii::t('CartModule.admin', 'Создание заказа') : Yii::t('CartModule.admin', 'ORDER', 0);
$this->breadcrumbs = array(Yii::t('CartModule.admin', 'ORDER', 0) => $this->createUrl('index'), $model->isNewRecord ? Yii::t('CartModule.admin', 'Создание заказа') : $update);
if (Yii::app()->request->isPostRequest) {
$model->attributes = $_POST['Order'];
if ($model->validate()) {
$model->save();
// Update quantities
if (sizeof(Yii::app()->request->getPost('quantity', array()))) {
$model->setProductQuantities(Yii::app()->request->getPost('quantity'));
}
$model->updateDeliveryPrice();
$model->updateTotalPrice();
if ($model->isNewRecord === false) {
$template[] = 'delete';
}
// register all delivery methods to recalculate prices
Yii::app()->clientScript->registerScript('deliveryMetohds', strtr('var deliveryMethods = {data};', array('{data}' => CJavaScript::jsonEncode($deliveryMethods))), CClientScript::POS_END);
/// if ($new) {
// $this->setFlashMessage(Yii::t('core', 'Теперь Вы можете добавить товары.'));
//}
$this->redirect(array('update', 'id' => $model->id));
}
}
$this->render('update', array('deliveryMethods' => ShopDeliveryMethod::model()->applyTranslateCriteria()->orderByName()->findAll(), 'paymentMethods' => ShopPaymentMethod::model()->findAll(), 'statuses' => OrderStatus::model()->orderByPosition()->findAll(), 'model' => $model));
}
示例12: actionRecord
public function actionRecord($id)
{
$model=new Order('search');
$model->unsetAttributes(); // clear any default values
$model->mid = $id;
if(isset($_GET['Order']))
$model->attributes=$_GET['Order'];
$this->render('record',array(
'model'=>$model,
));
}
示例13: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Order('search');
$model->unsetAttributes();
$users = new Users('search');
$users->unsetAttributes();
if (isset($_GET['Users'])) {
$users->attributes = $_GET['Users'];
}
if (isset($_GET['Order'])) {
$model->attributes = $_GET['Order'];
}
$this->render('admin', array('model' => $model, 'users' => $users));
}
示例14: actionViewAssignedOrders
public function actionViewAssignedOrders()
{
$model = new Order('viewAssignedOrders');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Order'])) {
$model->attributes = $_GET['Order'];
}
if (isset($_GET['pageSize'])) {
Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
unset($_GET['pageSize']);
}
$this->render('viewAssignedOrders', array('model' => $model));
}
示例15: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Order( 'search' );
$model->unsetAttributes(); // clear any default values
$this->subTitle = ucwords( $this->action->id ) . ' ' . $this->getMenuLabels( ucwords( $this->controllerID ) );
if ( isset( $_GET['Order'] ) )
$model->attributes = $_GET['Order'];
if(!empty( $_GET['actionid'] ) && $_GET['actionid'] == Helper::CONST_PDF)
{
$html = $this->renderPartial( 'admin', array(
'model' => $model,
),true );
$this->writeToPdf( $html );
}
else
{
$this->render( 'admin', array(
'model' => $model,
) );
}
}