public function actionCreate() { $model = new LbPayment(); $lbInvoiceModel = new LbInvoice(); $customer_id = 0; if (isset($_GET['id']) && $_GET['id'] != "") { $customer_id = $_GET['id']; } LBApplication::render($this, 'create', array('model' => $model, 'lbInvoiceModel' => $lbInvoiceModel, 'customer_id' => $customer_id)); }
public function actionIndex() { $taxModel = LbTax::model()->getTaxes(); $list = UserList::model()->getList(); $translate = Translate::model()->search(); $translate = new Translate('search'); $translate->unsetAttributes(); // clear any default values if (isset($_GET['Translate'])) { $translate->attributes = $_GET['Translate']; } LBApplication::render($this, 'index', array('taxModel' => $taxModel, 'list' => $list, 'translate' => $translate)); // $this->render('index'); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new LbCustomerAddress(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $customer_id = $_REQUEST['customer_id']; if (isset($_POST['LbCustomerAddress'])) { $model->attributes = $_POST['LbCustomerAddress']; $model->lb_customer_id = $customer_id; if ($model->save()) { Yii::app()->request->redirect(Yii::app()->createUrl('lbCustomer/default/view', array('id' => $customer_id))); } } LBApplication::render($this, 'create', array('model' => $model, 'customer_id' => $customer_id)); }
public function actionUpdateTax($id) { $model = LbTax::model()->findByPk($id); if (isset($_POST['LbTax'])) { $model->attributes = $_POST['LbTax']; $lbtax_arr = $_POST['LbTax']; if (!($tax = LbTax::model()->IsNameTax($lbtax_arr['lb_tax_name'], $id))) { LBApplication::render($this, '_form_update_tax', array('model' => $model, 'error' => 'Tax Name Exist')); } else { if ($model->save()) { $this->redirect($this->createUrl('/' . LBApplication::getCurrentlySelectedSubscription() . '/configuration')); } } } LBApplication::render($this, '_form_update_tax', array('model' => $model, 'error' => '')); }
public function ActionCreateAddress($id) { $addressModel = LbCustomerAddress(); LBApplication::render($this, '_form_new_address', array('addressModel' => $addressModel)); }
public function actionDashboard() { LBApplication::render($this, 'dashboard', array()); }
public function actionListPayment() { LBApplication::render($this, 'form_list_payment', array()); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { // if user is already logged in // redirect to dash board if (!Yii::app()->user->isGuest) { $this->redirect(array('project/index')); } $model = new Account(); //$companyModel = new Company(); //$companyContactModel = new CompanyContact(); $accountSubscriptionModel = new AccountSubscription(); $accountProfile = new AccountProfile(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); /** * Process form's submission * param's name must be in this format, e.g. "Account[account_email]" */ if (isset($_POST['Account'])) { $model->attributes = $_POST['Account']; $model->account_id = null; //$companyModel->attributes = $_POST['Company']; //$companyContactModel->attributes = $_POST['CompanyContact']; $accountSubscriptionModel->attributes = $_POST['AccountSubscription']; $accountProfile->attributes = $_POST['AccountProfile']; /** $model->account_company_name = $companyModel->company_name; $model->account_contact_surname = $companyContactModel->contact_surname; $model->account_contact_given_name = $companyContactModel->contact_given_name; $model->account_subscription_package_id = $accountSubscriptionModel->account_subscription_package_id; **/ // SAVE ACCOUNT //$model->account_password = $model->hashPassword($model->account_password); $model->account_status = ACCOUNT_STATUS_ACTIVATED; // ACCOUNT_STATUS_NOT_ACTIVATED; $save_result = ''; // save user account record to database $save_result = $model->save(); if ($save_result) { // create/update subscription record $accountSubscriptionModel->account_id = $model->account_id; $accountSubscriptionModel->account_subscription_start_date = date('Y-m-d H:i'); $accountSubscriptionModel->account_subscription_status_id = 1; $accountSubscriptionModel->save(); // create account profile $accountProfile->account_id = $model->account_id; $accountProfile->account_profile_preferred_display_name = $accountProfile->account_profile_given_name . ' ' . $accountProfile->account_profile_surname; $accountProfile->save(); /** // create company record $companyModel->company_master_account_id = $model->account_id; $companyModel->company_is_master = COMPANY_IS_MASTER; // save company record to database, // if successful, create contact record if ($companyModel->save()) { // create contact record $companyContactModel->contact_email1 = $model->account_email; $companyContactModel->company_id = $companyModel->company_id; $companyContactModel->account_id = $model->account_id; // save contact record to database $companyContactModel->save(); }**/ // notify user through email $model->sendSuccessfulSignupEmailNotification(); } // redirect to view if ($save_result) { //$this->redirect(array('view','id'=>$model->account_id)); $this->redirect(Yii::app()->baseUrl . '/product/signup-success.php'); } } /** * otherwise just show creation form */ $active_subscription_packages = SubscriptionPackage::getActivePackages(); $active_subscription_package_names = array(); foreach ($active_subscription_packages as $item) { $active_subscription_package_names[$item->subscription_package_id] = $item->subscription_package_name; } $data = array('model' => $model, 'accountProfileModel' => $accountProfile, 'accountSubscriptionModel' => $accountSubscriptionModel, 'active_subscription_packages' => $active_subscription_package_names); LBApplication::render($this, 'create', $data); //$this->render('create',); }
/** * Display info dasdboard. */ public function actionDashboard() { $model = new LbInvoice('search'); $model->unsetAttributes(); // clear any default values $invoiceModel = new LbQuotation(); if (isset($_GET['LbInvoice'])) { $model->attributes = $_GET['LbInvoice']; } LBApplication::render($this, 'dashboard', array('model' => $model, 'quotationModel' => $invoiceModel)); }
function actionListEx() { $model = new LbExpenses(); LBApplication::render($this, 'listExpenses.php', array('model' => $model)); }
public function actionAjaxQuickCreateTax($id) { $model = new LbTax(); $submission_type = isset($_GET['form_type']) ? $_GET['form_type'] : 'default'; $quotationModel = LbQuotation::model()->findByPk($id); if (isset($_POST['LbTax'])) { $model->attributes = $_POST['LbTax']; $lbtax_arr = $_POST['LbTax']; if (!LbTax::model()->IsNameTax($lbtax_arr['lb_tax_name'])) { $error['error'] = "Tax Name Exist."; LBApplication::renderPlain($this, array('content' => CJSON::encode($error))); return false; } if ($model->save()) { $result['yes'] = true; if ($submission_type == 'ajax') { // auto add this tax item into this invoice $quotaitonTax = new LbQuotationTax(); if ($quotaitonTax->addTaxToQuotation($id, $model)) { $this->actionAjaxUpdateTaxs($id); } // print json result of this quotation item //LBApplication::renderPlain($this, array('content'=>CJSON::encode($result))); return true; } } } $submission_details = array(); $submission_details["type"] = $submission_type; LBApplication::render($this, '_form_tax', array('model' => $model, 'quotationModel' => $quotationModel, 'submission_details' => $submission_details)); }
public function actionDashboard() { $model = new LbContracts(); LBApplication::render($this, 'dashboard', array('model' => $model)); }
public function actionaddPayment() { $model = new LbPaymentVendor(); $lbInvoiceModel = new LbInvoice(); $customer_id = 0; if (isset($_GET['id']) && $_GET['id'] != "") { $customer_id = $_GET['id']; } // $this->render('createPayment',array( // 'model'=>$model, // 'customer_id'=>$customer_id // )); LBApplication::render($this, 'createPayment', array('model' => $model, 'customer_id' => $customer_id)); }
public function actionAssignInvoice() { $expenses_id = isset($_REQUEST['expenses_id']) ? $_REQUEST['expenses_id'] : 0; $expensesModel = LbExpenses::model()->findByPk($expenses_id); $invoiceModel = new LbInvoice('search'); $invoiceModel->unsetAttributes(); if (isset($_GET['LbInvoice'])) { $invoiceModel->attributes = $_GET['LbInvoice']; } $invoice_id = Yii::app()->request->getParam('invoice_id'); if (isset($invoice_id) && is_array($invoice_id) && count($invoice_id) > 0) { foreach ($invoice_id as $invoice) { if ($invoice > 0) { if (isset($expenses_id) && $expenses_id > 0) { $expensesInvoice = new LbExpensesInvoice(); $expensesInvoice->lb_expenses_id = $expenses_id; $expensesInvoice->lb_invoice_id = $invoice; $expensesInvoice->save(); } } } } LBApplication::render($this, '_assign_invoice', array('invoiceModel' => $invoiceModel, 'expensesModel' => $expensesModel)); }
/** * Manages all models. */ public function actionAdmin() { $model = new AccountInvitation('search'); $model->unsetAttributes(); // clear any default values $model->account_invitation_master_id = Yii::app()->user->id; if (isset($_GET['AccountInvitation'])) { $model->attributes = $_GET['AccountInvitation']; } LBApplication::render($this, 'admin', array('model' => $model)); /** $this->render('admin',array( 'model'=>$model, ));**/ }