function actionAjaxLoadFormViewPayment() { //LBApplication::renderPartial($this, '_form_view_payment', array()); $model = new LbPayment(); $lbInvoiceModel = new LbInvoice(); LBApplication::renderPartial($this, '_form_view_payment', array('model' => $model, 'lbInvoiceModel' => $lbInvoiceModel)); }
$("#hidden-quotation-customer-id").val(newValue); }', 'onShown' => 'js: function() { var $tip = $(this).data("editableContainer").tip(); var dropdown = $tip.find("select"); $(dropdown).bind("change", function(e){ onChangeCustomerDropdown(e,' . $model->lb_record_primary_key . '); }); }', 'options' => array('sourceCache' => false), 'htmlOptions' => array('id' => 'LbInvoice_quotation_customer_id_' . $model->lb_record_primary_key))); $custoemr_id = 0; $custoemr_name = ""; if ($model->lb_quotation_customer_id) { $custoemr_id = $model->lb_quotation_customer_id; $custoemr_name = str_replace(' ', '-', $model->customer->lb_customer_name); } if ($custoemr_id > 0) { echo ' <a id="user" href="' . $this->createUrl('/' . LBApplication::getCurrentlySelectedSubscription() . '/lbCustomer/' . $model->lb_quotation_customer_id . '-' . $custoemr_name) . '"><i class="icon-search"></i></a>'; } else { echo ' <a id="user"><i class="icon-search"></i></a>'; } ?> </div> </div> <div id="container-quotation-customer-address"> <div class="field-label-left"><?php echo Yii::t('lang', 'Billing Address'); ?> :</div> <div class="field-value-left"> <?php $this->widget('editable.EditableField', array('type' => 'select', 'model' => $model, 'attribute' => 'lb_quotation_customer_address_id', 'emptytext' => 'Choose address', 'url' => $model->getActionURLNormalized('ajaxUpdateField'), 'source' => $this->createUrl('/lbCustomerAddress/default/dropdownJSON', array('allow_add' => YES, 'quotation_id' => $model->lb_record_primary_key)), 'placement' => 'right', 'display' => 'js: function(value, sourceData) {
public function actiondropdownJSONCategory($vendor_id = false, $vendor_invoice_id = false) { $vendor_id = isset($_GET['vendor_id']) ? $_GET['vendor_id'] : 0; $quotation_id = isset($_GET['vendor_invoice_id']) ? $_GET['vendor_invoice_id'] : 0; $category_arr = SystemList::model()->getItemsForListCode('expenses_category', LbVendor::LB_QUERY_RETURN_TYPE_DROPDOWN_ARRAY); $category_arr = SystemList::model()->findAll('system_list_code = "expenses_category"'); $ordered_results = array(); $ordered_results[0] = array('value' => '0', 'text' => 'Choose category') + $ordered_results; foreach ($category_arr as $value) { $ordered_results[] = array('value' => $value['system_list_item_id'], 'text' => $value['system_list_item_name']); } LBApplication::renderPlain($this, array('content' => CJSON::encode($ordered_results))); }
/** * GET FULL NAME * * @param number $account_id * @return string|Ambigous <string, string> */ public function getFullName($account_id = 0) { $model = $this; if ($account_id > 0) { $profile = AccountProfile::model()->getProfile($account_id); if ($profile) { $model = $profile; } } $name = $model->account_profile_given_name . " " . $model->account_profile_surname . "."; if (trim($name) != '.') { return LBApplication::encodeToUTF8($name); } return ''; }
<?php $this->widget('bootstrap.widgets.TbTabs', array('type' => 'pills', 'encodeLabel' => false, 'tabs' => array(array('id' => 'tab1', 'label' => '<strong>' . Yii::t('lang', 'package') . '</strong>', 'content' => LBApplication::renderPartial($this, 'paypal.views.creditCard.index', array('value' => $subscription), true), 'active' => true), array('id' => 'tab2', 'label' => '<strong>' . Yii::t('lang', 'Subcriptions') . '</strong>', 'content' => 'Loading....', 'active' => false), array('id' => 'tab3', 'label' => '<strong>' . Yii::t('lang', 'User Subcription') . '</strong>', 'content' => 'Loading.....', 'active' => false)), 'events' => array('shown' => 'js:loadContent'))); ?> <script type="text/javascript"> function loadContent(e){ var tabId = e.target.getAttribute("href"); var ctUrl = ''; if(tabId == '#tab2') { ctUrl = '<?php echo $this->createUrl('/paypal/subscription/admin'); ?> '; } else if(tabId == '#tab3') { ctUrl = '<?php echo $this->createUrl('/paypal/userSubscription/admin'); ?> '; } if(ctUrl != '') { $.ajax({ url : ctUrl, type : 'POST', dataType : 'html', cache : false, success : function(html) {
<?php /* @var $this DefaultController */ // echo $model->lb_record_primary_key; $m = $this->module->id; $canView = BasicPermission::model()->checkModules($m, 'view'); if (!$canView) { echo "Have no permission to see this record"; return; } echo '<div id="lb-container-header">'; echo '<div class="lb-header-right" ><h3>Report</h3></div>'; echo '<div class="lb-header-left">'; echo ' '; echo '</div>'; echo '</div><br>'; $tab = "all"; if (isset($_GET['tab'])) { $tab = $_GET['tab']; } $this->widget('bootstrap.widgets.TbTabs', array('type' => 'tabs', 'encodeLabel' => false, 'tabs' => array(array('id' => 'tab1', 'label' => '<strong>' . Yii::t('lang', 'Aging Report') . '</strong>', 'content' => LBApplication::renderPartial($this, '_form_aging_report', array(), true), 'active' => $tab == "aging_report" || $tab == "all" ? true : false), array('id' => 'tab2', 'label' => '<strong>' . Yii::t('lang', 'Cash Receipt') . '</strong>', 'content' => $this->renderPartial('_form_cash_receipt', array(), true), 'active' => $tab == "cash_receipt" ? true : false), array('id' => 'tab3', 'label' => '<strong>' . Yii::t('lang', 'Invoice Journal') . '</strong>', 'content' => $this->renderPartial('_form_invoice_journal', array(), true), 'active' => $tab == "invoice_journal" ? true : false), array('id' => 'tab4', 'label' => '<strong>' . Yii::t('lang', 'GST Report') . '</strong>', 'content' => $this->renderPartial('_form_gst_report', array(), true), 'active' => $tab == "gst_report" ? true : false), array('id' => 'tab5', 'label' => '<strong>' . Yii::t('lang', 'Sales Report') . '</strong>', 'content' => $this->renderPartial('_form_sale_report', array(), true), 'active' => $tab == "sales_report" ? true : false), array('id' => 'tab6', 'label' => '<strong>' . Yii::t('lang', 'Customer Statements') . '</strong>', 'content' => $this->renderPartial('_form_customer_statements', array(), true), 'active' => $tab == "customer_statement" ? true : false))));
<?php /* @var $this LbInvoiceController */ /* @var $model LbInvoice */ /* @var $ownCompany LbCustomer */ // header container div echo '<div id="invoice-header-container" class="container-header" style="position: relative">'; //echo $model->lb_vendor_company_id; echo '<div id="logo_wrapper" style="overflow:hidden;text-align: center;">'; // $company = (isset($model->owner) ? $model->lb_vendor_company_id : ''); $folder = 'images/logo/'; // $model=LbVendor::model()->findByPk($id); $company = $model->lb_vd_invoice_company_id; $path = YII::app()->baseUrl . "/images/logo/"; $filename = ''; $file_arr = array_diff(scandir($folder), array('.', '..')); $subcription = LBApplication::getCurrentlySelectedSubscription(); foreach ($file_arr as $key => $file) { $file_name = explode('.', $file); $file_name_arr = explode('_', $file_name[0]); // print_r($file_name_arr); if ($file_name_arr[0] == $subcription && $file_name_arr[1] == $company) { echo "<img src='" . $path . $file . "' style='max-height:120px' />"; } } $this->widget('ext.EAjaxUpload.EAjaxUpload', array('id' => 'uploadFile', 'config' => array('action' => $this->createUrl('uploadLogo', array('id' => $model->lb_record_primary_key, 'sub_cription' => $subcription, 'company_id' => $company)), 'allowedExtensions' => array("jpeg", "jpg", "gif", "png"), 'sizeLimit' => 10 * 1024 * 1024, 'minSizeLimit' => 1 * 1024, 'multiple' => true, 'onComplete' => "js:function(id, fileName, responseJSON){\n \$('#uploadFile .qq-upload-list').html('');\n //\$('#logo_wrapper img').attr('src','" . $path . "'+fileName);\n window,location.reload(true);\n }"))); echo '</div>'; //echo '<h3 id="po-number-container">'.$model->getDisplayPOStatus($model->lb_vendor_status).'</h3>'; echo '<div id="invoice-basic-info-container" style="float: left;width:36%;">'; echo '<h3 id="po-number-container">'; $this->widget('editable.EditableField', array('type' => 'text', 'model' => $model, 'attribute' => 'lb_vd_invoice_no', 'url' => LbVendor::model()->getActionURLNormalized('AjaxUpdateFieldVD'), 'placement' => 'right')); echo '</h3><br />';
/** * 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',); }
public static function getSubscriptionId() { $subcription_id = LBApplication::getCurrentlySelectedSubscription(); // Truyen tham so subcription_id cua he thong tich hop vao day. return $subcription_id; }
// print_r($invoice_total); ?> <h5 style="margin: 20px 0px 5px 0px;font-weight: bold;"> <span> <input class="pdf_checkbox" name="<?php echo $data_invocie->lb_record_primary_key; ?> " type="checkbox" value="<?php echo $data_invocie->lb_record_primary_key; ?> " /> </span> <span style="text-decoration: underline;"> <?php echo LBApplication::workspaceLink($data_invocie->lb_vd_invoice_no); ?> </span> <sapn style="margin-left: 65px;color: #000000; font-weight: normal">Total: <?php echo $invoice_total->lb_vendor_last_outstanding; ?> </span> </h5> <table border="0" width="100%" class="items table table-bordered"> <thead> <tr> <th width="250" class="lb-grid-header"><?php echo Yii::t('lang', 'Amount Paid'); ?> </th> <th width="150" class="lb-grid-header"><?php
function actionajaxDeletePayment() { if (isset($_GET['id'])) { $payment_item_id = $_GET['id']; } //delete payment item $payment = LbPaymentItem::model()->deleteByPk($payment_item_id); $invoice_id = $_GET['invoice_id']; $invoiceTotal = LbInvoiceTotal::model()->getInvoiceTotal($invoice_id); $taxRecord['paid'] = $invoiceTotal->calculateInvoicetotalPaid($invoice_id); $taxRecord['outstanding'] = $invoiceTotal->calculateInvoiceTotalOutstanding(); if ($invoiceTotal->calculateInvoiceTotalOutstanding() <= 0) { $taxRecord['status'] = 'I_PAID'; } else { $taxRecord['status'] = 'Open'; } //update invoice total // if($payment->delete()) // echo 'success'; LBApplication::renderPlain($this, array('content' => CJSON::encode($taxRecord))); }
/** * return the address lines in json format * * @param unknown $id */ public function actionAddressLinesJSON($id) { $model = $this->loadModel($id); $address_lines = $model->formatAddressLines(); LBApplication::renderPartial($this, '//layouts/plain_ajax_content', array('content' => CJSON::encode($address_lines))); }
public function actionajaxQuickCreateCurrency() { $invoice_id = isset($_REQUEST['invoice_id']) ? $_REQUEST['invoice_id'] : ''; // $model = LbInvoice::model()->findByPk($invoice_id); $model = $this->loadModel($invoice_id); $GeneraModel = new LbGenera(); if (isset($_POST['LbGenera'])) { $GeneraModel->attributes = $_POST['LbGenera']; if ($GeneraModel->save()) { $model->lb_invoice_currency = $GeneraModel->lb_record_primary_key; $model->save(); } LBApplication::renderPlain($this, array('content' => CJSON::encode($GeneraModel))); return true; } LBApplication::renderPartial($this, '_form_currency', array('model' => $model, 'GeneraModel' => $GeneraModel)); }
public function validateEmail() { if (LBApplication::isValidEmail($this->account_email) !== false) { // find if this email is used by other account already or not $account = Account::model()->find('account_id != :account_id AND account_email = :account_email', array(':account_id' => $this->account_id, ':account_email' => $this->account_email)); if ($account != null && $account->account_id > 0) { $this->addError('account_email', 'This email is already used.'); } else { return true; } } else { $this->addError('account_email', 'This email is not a valid email: ' . $this->account_email); } return false; }
} ?> <div class="accordion-group"> <div class="accordion-heading" id="view_payment"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#form_view_payment"> <i></i> <span style="color: #6E8900;font-size: 20px; font-weight: bold"><?php echo Yii::t('lang', 'View Payment'); ?> </span> </a> </div> <div id="form_view_payment" class="accordion-body collapse"> <div class="accordion-inner"> <?php LBApplication::renderPartial($this, '_view_payment', array('customer_id' => $customer_id)); ?> </div> </div> </div> </div> </div> <script type="text/javascript"> // Style accodtion icon //$('a:active i').addClass("icon-minus-sign"); //$('.accordion-body.in.collapse i').addClass("icon-plus-sign"); $('#new_payment i').addClass('icon-minus-sign'); $('#view_payment i').addClass('icon-plus-sign'); $('#form_new_payment').on('show', function () { $('#new_payment i').removeClass();
<script language="javascript"> $(document).ready(function(){ $('#contactable').contactable({ subject: 'I need help', url: '<?php echo Yii::app()->createUrl('site/contact'); ?> ', name: 'Name', email: 'Email', dropdownTitle: 'Topic', dropdownOptions: ['General', 'Bug Report', 'Feature Request'], message: 'Message', submit: 'Send', }); $("#linx-menu-item-selected-subscription").html( '<?php echo LBApplication::getShortName($selected_subscription_label, false, 10); ?> '); // very simple to use! $('.dropdown-toggle').dropdownHover().dropdown(); }); </script> </body> </html>
public function checkModules($module_name, $per_value, $created_by = false) { $user_id = Yii::app()->user->id; $canAdd = BasicPermission::model()->checkPerModule($module_name, 'add'); $canEditOwn = BasicPermission::model()->checkPerModule($module_name, 'update own'); $canEditAll = BasicPermission::model()->checkPerModule($module_name, 'update all'); $canDeleteOwn = BasicPermission::model()->checkPerModule($module_name, 'delete own'); $canDeleteAll = BasicPermission::model()->checkPerModule($module_name, 'delete all'); $canViewOwn = BasicPermission::model()->checkPerModule($module_name, 'view own'); $canViewAll = BasicPermission::model()->checkPerModule($module_name, 'view all'); $canListOwn = BasicPermission::model()->checkPerModule($module_name, 'list own'); $canListAll = BasicPermission::model()->checkPerModule($module_name, 'list all'); $ownSub = AccountSubscription::model()->checkIsSubscriptionOwner(LBApplication::getCurrentlySelectedSubscription()); $result = false; if ($ownSub) { $result = true; if ($per_value == "list") { $result = FALSE; } } else { if ($per_value == "add") { $result = $canAdd; } else { if ($per_value == "update") { if ($canEditAll) { $result = true; } elseif ($canEditOwn && $user_id == $created_by) { $result = true; } } else { if ($per_value == "delete") { if ($canDeleteAll) { $result = true; } elseif ($canDeleteOwn && $user_id == $created_by) { $result = true; } } else { if ($per_value == "view") { if ($canViewAll) { $result = true; } elseif ($canViewOwn && $user_id == $created_by) { $result = true; } } else { if ($per_value == "list") { $result = -1; if ($canListAll) { $result = false; } else { if ($canListOwn) { $result = Yii::app()->user->id; } } } } } } } } return $result; }
/** * Manages all models. */ public function actionAdmin() { $model = new UserSubscription('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['UserSubscription'])) { $model->attributes = $_GET['UserSubscription']; } LBApplication::renderPartial($this, 'admin', array('model' => $model)); }
public function actionupdateComment() { $description = false; if (isset($_POST['id_comment'])) { $id_commment = $_POST['id_comment']; } if (isset($_POST['description'])) { $description = $_POST['description']; } $model = LbComment::model()->findByPk($id_commment); $model->lb_comment_description = $description; $date = date('Y-m-d'); $model->lb_comment_date = $date; if ($model->update()) { $response = array(); $response['success'] = YES; $response['lb_comment_description'] = nl2br($model->lb_comment_description); $response['lb_comment_date'] = $model->lb_comment_date; LBApplication::renderPlain($this, array('content' => CJSON::encode($response))); } }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new AccountSubscription(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['AccountSubscription'])) { // $model->attributes=$_POST['AccountSubscription']; // if($model->save()) // $this->redirect(array('view','id'=>$model->account_subscription_id)); // if (isset($_GET['package_id'])) // { $package_id = 4; // check if this user is already subscribe to this package // if (AccountSubscription::model()->isAlreadySubscribedToPackage($package_id)) // { // $this->redirect(array('accountTeamMember/admin')); // } // add subscription $accountSubscription = new AccountSubscription(); $accountSubscription->account_id = Yii::app()->user->id; $accountSubscription->account_subscription_package_id = $package_id; $accountSubscription->account_subscription_start_date = date('Y-m-d H:i:s'); $accountSubscription->account_subscription_status_id = ACCOUNT_SUBSCRIPTION_STATUS_ACTIVE; $accountSubscription->subscription_name = $_POST['AccountSubscription']['subscription_name']; if ($accountSubscription->save()) { LBApplication::setCurrentlySelectedSubscription($accountSubscription->account_subscription_id); } $this->redirect(array('accountTeamMember/admin')); // } // // no package id, go to home // $this->redirect(array('project/index')); } $this->render('create', array('model' => $model)); }
public function actionListPayment() { LBApplication::render($this, 'form_list_payment', array()); }
/* @var $invoiceItemModel LbInvoiceItem */ /* @var $invoiceDiscountModel LbInvoiceItem */ /* @var $invoiceTaxModel LbInvoiceItem */ /* @var $invoiceTotal LbInvoiceTotal */ $m = $this->module->id; $credit_by = LbCoreEntity::model()->getCoreEntity($m, $model->lb_record_primary_key)->lb_created_by; $canAdd = BasicPermission::model()->checkModules($m, 'add'); $canView = BasicPermission::model()->checkModules($m, 'view', $credit_by); $canList = BasicPermission::model()->checkModules($m, 'list', $credit_by); $canAddPayment = BasicPermission::model()->checkModules('lbPayment', 'add'); $canReport = DefinePermission::model()->checkFunction($m, 'view_report'); if (!$canView) { echo "Have no permission to see this record"; return; } LBApplication::renderPartial($this, '_page_header', array('model' => $model, 'expenses_id' => $expenses_id)); $this->renderPartial('_form', array('model' => $model, 'expenses_id' => $expenses_id)); $this->renderPartial('_form_line_items', array('model' => $model, 'invoiceItemModel' => $invoiceItemModel, 'invoiceDiscountModel' => $invoiceDiscountModel, 'invoiceTaxModel' => $invoiceTaxModel, 'invoiceTotal' => $invoiceTotal, 'expenses_id' => $expenses_id)); //echo '<div style="float: right; z-index: 9999; top: 150px; position: absolute; width: 60px; height: 300px; margin-left: 1020px; // border-bottom-right-radius: 5px; border-top-right-radius: 5px; // padding: 10px;">'; // //if($canAdd) // echo LBApplication::workspaceLink( // CHtml::image(Yii::app()->baseUrl . '/images/icons/icon_new.png', 'Share', array('class'=>'lb-side-icon')), // $model->getCreateURLNormalized(array('group'=>strtolower(LbInvoice::LB_INVOICE_GROUP_INVOICE))), // array('data-toggle'=>"tooltip", 'title'=>"Create new invoice", 'class'=>'lb-side-link-invoice')); //if($canAdd) // echo CHtml::link(CHtml::image(Yii::app()->baseUrl . '/images/icons/icon_copy.png', 'Copy invoice', array('class'=>'lb-side-icon')),'#', array('data-toggle'=>"tooltip",'onclick'=>'onclickCopyInvoice();', 'title'=>"Copy invoice", 'class'=>'lb-side-link-invoice')); //if($canAddPayment) // echo LBApplication::workspaceLink(
?> <?php // add new account fields if ($model->isNewRecord) { echo $form->textFieldRow($accountProfileModel, 'account_profile_company_name', array('size' => 60, 'maxlength' => 255) + (isset($_GET['ajax']) ? $iframe_input_style : array())); echo $form->textFieldRow($accountProfileModel, 'account_profile_given_name', array('size' => 60, 'maxlength' => 255) + (isset($_GET['ajax']) ? $iframe_input_style : array())); echo $form->textFieldRow($accountProfileModel, 'account_profile_surname', array('size' => 60, 'maxlength' => 255) + (isset($_GET['ajax']) ? $iframe_input_style : array())); echo $form->passwordFieldRow($model, 'account_password', array('size' => 60, 'maxlength' => 255) + (isset($_GET['ajax']) ? $iframe_input_style : array())); echo $form->hiddenField($model, 'account_timezone'); } else { // showing fields for updating account /**echo $form->textFieldRow($model,'account_timezone', array('size'=>60,'maxlength'=>255));**/ echo $form->dropDownListRow($model, 'account_timezone', LBApplication::getTimeZoneListSource()); echo $form->textFieldRow($model, 'account_language', array('size' => 60, 'maxlength' => 255)); } ?> <!-- div class="row"> <?php //echo $form->labelEx($model,'account_timezone'); ?> <?php //echo $form->textField($model,'account_timezone',array('size'=>60,'maxlength'=>255)); ?> <?php //echo $form->error($model,'account_timezone'); ?>
/* @var $expenses_invoice array of LbExpensesInvoice models */ $canAddInvoice = BasicPermission::model()->checkModules('lbInvoice', 'add'); $canAddDelete = BasicPermission::model()->checkModules('lbCustomer', 'delete'); if ($canAddInvoice) { echo '<div class="btn-toolbar">'; // LBApplicationUI::newButton(Yii::t('lang','New Invoice'), array('url'=>$this->createUrl('addInvoice'))); $this->widget('bootstrap.widgets.TbButton', array('label' => 'New Invoice', 'url' => LbInvoice::model()->getCreateURLNormalized(array('group' => strtolower(LbInvoice::LB_INVOICE_GROUP_INVOICE), 'expenses_id' => $expenses_id)))); $this->widget('bootstrap.widgets.TbButton', array('label' => 'Assign Invoice', 'htmlOptions' => array('onclick' => 'assignInvoice();'))); echo '</div>'; } $i = 0; foreach ($expenses_invoice as $ex_invoice) { $invoice = LbInvoice::model()->findByPk($ex_invoice->lb_invoice_id); $i++; echo "\n <div style='overflow:hidden; border-top: 1px solid #EEEEEE;margin-top: 5px;'>\n <div style='float:left'>\n <h4><span style='padding: 0 8px;background:#EEEEEE;border-radius:50%;'>{$i}</span> " . LBApplication::workspaceLink($invoice->lb_invoice_no, $invoice->customer ? $invoice->getViewURL($invoice->customer->lb_customer_name) : $invoice->getViewURL("No customer")) . "</h4>\n </div>"; if ($canAddDelete) { echo "<div style='float:right;margin-top:5px;'>\n <a href='#' onclick='ajaxDeleteInvoiceExpenses(" . $invoice->lb_record_primary_key . "); return false;'>\n <i class='icon-trash'></i>\n Delete\n </a>\n </div>"; } echo "</div>\n <div id='error_delete_expense_invoice_" . $invoice->lb_record_primary_key . "' class='alert alert-block alert-error' style='display:none;'></div>\n "; } // end for //form assign invoice $this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'modal-invoice-assign-form')); echo '<div class="modal-header" style="max-width:700px;">'; echo '<a class="close" data-dismiss="modal">×</a>'; echo '<h4>Assign Invoice</h4>'; echo '</div>'; echo '<div class="modal-body" style="max-height:500px" id="modal-view-invoice-body-' . $expenses_id . '">'; echo '</div>'; $this->endWidget();
<?php /* @var $this LbInvoiceController */ /* @var $model LbInvoice */ LBApplication::renderPartial($this, '_page_header', array('model' => $model)); $this->renderPartial('_form', array('model' => $model));
/** * Switch subscription * * @param unknown $id */ public function actionSubscription($id) { LBApplication::setCurrentlySelectedSubscription($id); $this->redirect(Yii::app()->baseUrl . "/" . $id . "/lbInvoice/dashboard"); }
echo '</div>'; echo '</div>'; ?> <div style="width:30%;margin-top:19px;margin-bottom:11px;"><span style="font-size: 16px;"><b><?php echo $model->lb_customer_name; ?> </b></span></div> <?php echo '<div class="btn-toolbar">'; // go back /** LBApplicationUI::newButton('New Address'); echo ' '; LBApplicationUI::newButton('New Contact'); echo ' '; LBApplicationUI::newButton('New Invoice');**/ echo '</div>'; $this->widget('editable.EditableDetailView', array('data' => $model, 'url' => $model->getActionURL('ajaxUpdateField'), 'params' => array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken), 'attributes' => array(array('name' => 'lb_customer_name', 'editable' => array('type' => 'text', 'inputclass' => 'input-large', 'emptytext' => 'Click to Update', 'validate' => 'function(value) { if(!value) return "Customer Name is required." }')), 'lb_customer_registration', 'lb_customer_tax_id', 'lb_customer_website_url', array('name' => 'lb_customer_is_own_company', 'editable' => array('type' => 'select', 'source' => array(LbCustomer::LB_CUSTOMER_IS_NOT_OWN_COMPANY, LbCustomer::LB_CUSTOMER_IS_OWN_COMPANY), 'placement' => 'right', 'validate' => 'function(value) { if(!value) return "Customer Name is required." }'))))); /** * Show tabs of other details: address, contact, invoice */ $tab_addresses = LBApplication::renderPartial($this, '_customer_addresses', array('customer_addresses' => $customer_addresses, 'customer_id' => $model->lb_record_primary_key), true); $tab_contacts = LBApplication::renderPartial($this, '_customer_contacts', array('customer_contacts' => $customer_contacts, 'customer_id' => $model->lb_record_primary_key), true); $this->widget('bootstrap.widgets.TbTabs', array('type' => 'tabs', 'encodeLabel' => false, 'tabs' => array(array('id' => 'tab1', 'label' => '<i class="icon-envelope"></i> <strong>' . Yii::t('lang', 'Addresses') . '</strong>', 'content' => $tab_addresses, 'active' => true), array('id' => 'tab2', 'label' => '<i class="icon-user"></i> <strong>' . Yii::t('lang', 'Contacts') . '</strong>', 'content' => $tab_contacts, 'active' => false), array('id' => 'tab3', 'label' => '<i class="icon-file"></i> <strong>' . Yii::t('lang', 'Invoices') . '</strong>', 'content' => LBApplication::renderPartial($this, '_view_invoice_customer', array('model' => $model), true), 'active' => false))));
function getViewModuleURL($controller, $id, $title, $params = null) { // clean the title $title = LBApplication::getURLEncodedString($title); $url = '/' . LBApplication::getCurrentlySelectedSubscription() . '/' . $this->module_name . "/" . $controller . "/{$id}-{$title}"; // add params if available if (is_array($params) && count($params)) { $url .= '?'; foreach ($params as $param_ => $val) { $url .= "{$param_}={$val}&"; } } return array($url); //trigger_error('Not Implemented!', E_USER_WARNING); }
function ActionLoadAjaxTabContract($id) { $customer_contacts = LbCustomerContact::model()->getContacts($id, LbCustomerContact::LB_QUERY_RETURN_TYPE_MODELS_ARRAY); LBApplication::renderPartial($this, '_customer_contacts', array('customer_contacts' => $customer_contacts, 'customer_id' => $id)); }
} ?> <div class="accordion-group"> <div class="accordion-heading" id="view_payment"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#form_view_payment"> <i></i> <span style="color: #fff;font-size: 20px; font-weight: bold"><?php echo Yii::t('lang', 'View Payment'); ?> </span> </a> </div> <div id="form_view_payment" class="accordion-body collapse"> <div class="accordion-inner"> <?php LBApplication::renderPartial($this, '_view_payment', array('lbInvoiceModel' => $lbInvoiceModel, 'model' => $model)); ?> </div> </div> </div> </div> </div> <script type="text/javascript"> // Style accodtion icon //$('a:active i').addClass("icon-minus-sign"); //$('.accordion-body.in.collapse i').addClass("icon-plus-sign"); $('#new_payment i').addClass('icon-minus-sign'); $('#view_payment i').addClass('icon-plus-sign'); $('#form_new_payment').on('show', function () { $('#new_payment i').removeClass();