Ejemplo n.º 1
0
$m = $this->module->id;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canView = BasicPermission::model()->checkModules($m, 'view');
$canAddInvoice = BasicPermission::model()->checkModules(LbInvoice::model()->getEntityType(), 'add');
if (!$canView) {
    echo "Have no permission to see this record";
    return;
}
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" style="margin-left:-11px;"><h3>' . Yii::t('lang', 'Customers') . '</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton($model->getHomeURLNormalized());
echo '&nbsp;';
// new
if ($canAdd || $canAddInvoice) {
    LBApplicationUI::newButtonGroup(Yii::t('lang', 'New'), array('buttons' => array(array('items' => array(array('label' => Yii::t('lang', 'New Address'), 'url' => LbCustomerAddress::model()->getCreateURLNormalized(array('customer_id' => $model->lb_record_primary_key)), 'visible' => $canAdd), array('label' => Yii::t('lang', 'New Contact'), 'url' => LbCustomerContact::model()->getCreateURLNormalized(array('customer_id' => $model->lb_record_primary_key)), 'visible' => $canAdd), array('label' => Yii::t('lang', 'New Invoice'), 'url' => '#', 'visible' => $canAddInvoice), '---', array('label' => Yii::t('lang', 'New Customer'), 'url' => $model->getCreateURLNormalized(), 'visible' => $canAdd))))));
}
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');
Ejemplo n.º 2
0
    <div>
    <div id ="show_invoice">
    <?php 
if (isset($_REQUEST['status_id'])) {
    $status = '("' . $_REQUEST['status_id'] . '")';
} else {
    $status = '("' . LbInvoice::LB_INVOICE_STATUS_CODE_DRAFT . '","' . LbInvoice::LB_INVOICE_STATUS_CODE_OPEN . '","' . LbInvoice::LB_INVOICE_STATUS_CODE_OVERDUE . '")';
}
?>
    <?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'lb-invoice-Outstanding-grid', 'dataProvider' => $model->getInvoiceByStatus($status, FALSE, 10, $canList), 'template' => "{items}\n{pager}\n{summary}", 'columns' => array(array('type' => 'raw', 'value' => function ($data) {
    if ($data->lb_invoice_status_code == "I_OPEN") {
        return "<a href='#' onclick='ajaxCheckStatus({$data->lb_record_primary_key}); return false;'>{$data->lb_invoice_no}</a>" . "<br/>" . LBApplicationUI::getStatusBadge($data->lb_invoice_status_code);
    } else {
        return LBApplication::workspaceLink($data->lb_invoice_no, $data->customer ? $data->getViewURL($data->customer->lb_customer_name) : $data->getViewURL("No customer")) . "<br/>" . LBApplicationUI::getStatusBadge($data->lb_invoice_status_code);
    }
}, 'htmlOptions' => array('width' => '130')), array('type' => 'raw', 'value' => '$data->customer ? $data->customer->lb_customer_name."<br><span style=\'color:#666;\'>". $data->lb_invoice_subject."</span>" : "No customer"
                                    ."<br><span style=\'color:#666;\'>". $data->lb_invoice_subject."</span>"', 'htmlOptions' => array('width' => '')), array('type' => 'raw', 'value' => 'date("d M Y",strtotime($data->lb_invoice_due_date))', 'htmlOptions' => array('width' => '100')), array('type' => 'raw', 'value' => 'LbInvoice::model()->getStatusAmount($data->lb_invoice_status_code,$data->total_invoice ? $data->total_invoice->lb_invoice_total_outstanding : "0.00")', 'htmlOptions' => array('width' => '120')))));
?>
        </div>
    </div>
    
    <!--    <div>
        <a class="more" href="<?php 
//php echo LbInvoice::model()->getActionURLNormalized('admin');
?>
"><?php 
//php echo Yii::t('lang','see more invoices');
?>
</a>
Ejemplo n.º 3
0
<?php

/* @var $this DefaultController */
/* @var $model LbTax */
/* @var $form CActiveForm */
echo "<h1>Update Tax</h1>";
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'lb-tax-form', 'enableAjaxValidation' => false, 'type' => 'horizontal'));
echo '<p class="note">Fields with <span class="required">*</span> are required.</p>';
if ($error != "") {
    echo '<div class="alert alert-block alert-error">';
    echo $error;
    echo '</div>';
}
echo $form->textFieldRow($model, 'lb_tax_name');
echo $form->textFieldRow($model, 'lb_tax_value', array('value' => number_format($model->lb_tax_value, 0)));
echo $form->checkBoxRow($model, 'lb_tax_is_default');
LBApplicationUI::submitButton('Save', array('url' => $this->createUrl('updateTax', array('id' => $model->lb_record_primary_key)), 'ajaxOptions' => array('id' => 'ajax-submit-form-new-tax-' . uniqid(), 'beforeSend' => 'function(data){
				if ($("#LbTax_lb_tax_name").val() == "" ||
				    $("#LbTax_lb_tax_value").val() == "")
				{
				    alert("Please fill in the required fields.");
                    return false;
				}

				return true;
			} '), 'htmlOptions' => array('style' => 'margin-left: auto; margin-right: auto', 'id' => 'ajax-btn-new-tax', 'live' => false)));
$this->endWidget();
// and form
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" ><h3>Expenses</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton(LbExpenses::model()->getAdminURLNormalized());
echo '&nbsp;';
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'New'), 'items' => array(array('label' => Yii::t('lang', 'New Expenses'), 'url' => LbExpenses::model()->getActionURLNormalized('create')), array('label' => Yii::t('lang', 'New Payment Voucher'), 'url' => LbExpenses::model()->getActionURLNormalized('createPaymentVoucher'))))), 'encodeLabel' => false));
echo '&nbsp;';
if ($id) {
    $this->widget('bootstrap.widgets.TbButton', array('label' => 'Print PDF', 'htmlOptions' => array('onclick' => 'print_PDF_PV()')));
}
echo '</div>';
echo '</div><br>';
echo '<div class = "header">';
if ($id) {
    echo '<div style="overflow:hidden; border-top: 1px solid #fff;margin-top: 5px; padding-bottom:5px;margin-bottom:5px;">';
    echo '</div>';
} else {
    echo '<h2>New Payment Voucher</h2>';
}
echo '</div>';
$this->renderPartial('_form_pv', array('model' => $model, 'modelPV' => $modelPv));
$this->renderPartial('_form_line_expenses', array('model' => $model, 'modelPV' => $modelPv));
?>
<script type="text/javascript">
Ejemplo n.º 5
0
                        $("#lb_invocie_status").html(dataJSON.lb_invoice_status_code);
                        onConfirmInvoiceSuccessful(dataJSON);
                    }
                            }'), array('id' => 'btn-confirm-invoice-' . $model->lb_record_primary_key));
    }
    // Buttom Write Off
    if ($model->lb_invoice_status_code != $model::LB_INVOICE_STATUS_CODE_WRITTEN_OFF && $model->lb_invoice_status_code != $model::LB_INVOICE_STATUS_CODE_PAID) {
        echo '&nbsp;';
        LBApplicationUI::ajaxButton(Yii::t('lang', 'Write off'), $model->getActionURLNormalized('ajaxUpdateStatus', array('id' => $model->lb_record_primary_key, 'status' => LbInvoice::LB_INVOICE_STATUS_CODE_WRITTEN_OFF)), array(), array('id' => 'btn-write-off-invoice-' . $model->lb_record_primary_key));
    }
}
if ($canDelete) {
    // Buttom DELETE
    if ($model->lb_invoice_status_code == $model::LB_INVOICE_STATUS_CODE_DRAFT) {
        echo '&nbsp;';
        LBApplicationUI::button(Yii::t('lang', 'Delete'), array('url' => $this->createUrl('delete', array('id' => $model->lb_record_primary_key)), 'htmlOptions' => array('onclick' => 'return confirm("Are you sure you want to delete this item?");', 'id' => 'btn-delete-invoice-' . $model->lb_record_primary_key)));
    }
}
echo '</div>';
/***************************** HIDDEN STUFF *************************************/
////// GENERIC MODAL HOLDER
////// We can use this to load anything into a modal,
////// through ajax as well
$this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'modal-holder-' . $model->lb_record_primary_key));
echo '<div class="modal-header">';
//
echo '<a class="close" data-dismiss="modal">&times;</a>';
echo '<h4 id="modal-header"></h4>';
echo '</div>';
// end modal header
// modal body
Ejemplo n.º 6
0
/* @var $customer_addresses array of LbCustomerAddress models */
$canDeleteAddress = BasicPermission::model()->checkModules(LbCustomerAddress::model()->getEntityType(), 'delete');
$canEditAddress = BasicPermission::model()->checkModules(LbCustomerAddress::model()->getEntityType(), 'edit');
$i = 0;
foreach ($customer_addresses as $address) {
    $i++;
    echo "\r\n                <div style='overflow:hidden; border-top: 1px solid #EEEEEE;margin-top: 5px;'>\r\n                    <div style='float:left'>\r\n                        <h4><span style='padding: 0 8px;background:#EEEEEE;border-radius:50%;'>{$i}</span> {$address->lb_customer_address_line_1}</h4>\r\n                    </div>\r\n                    <div style='float:right;margin-top:5px;'>\r\n                        <a href='#' onclick=\"onclickSlideToggle(" . $address->lb_record_primary_key . "); return false;\">\r\n                            <i class='icon-info-sign'></i>\r\n                            " . Yii::t('lang', 'Detail information') . "\r\n                        </a>";
    if ($canDeleteAddress) {
        echo "<a href='#' onclick='ajaxDeleteAddress(" . $address->lb_record_primary_key . "); return false;'>\r\n                            <i class='icon-trash'></i>\r\n                            " . Yii::t('lang', 'Delete') . "\r\n                        </a>";
    }
    echo "</div>\r\n                </div>\r\n                <div id='error_delete_address_" . $address->lb_record_primary_key . "' class='alert alert-block alert-error' style='display:none;'></div>\r\n            ";
    echo "<div id='detail_customer_address_" . $address->lb_record_primary_key . "' style='display:none;'>";
    $this->widget('editable.EditableDetailView', array('data' => $address, 'url' => $address->getActionURL('ajaxUpdateField'), 'params' => array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken), 'attributes' => array(array('name' => 'lb_customer_address_line_1', 'editable' => array('type' => 'text', 'inputclass' => 'input-large', 'emptytext' => 'Click to Update', 'validate' => 'function(value) {
                                                            if(!value) return "Address Line 1 is required."
                                                            }')), 'lb_customer_address_line_2', 'lb_customer_address_city', 'lb_customer_address_state', array('name' => 'lb_customer_address_country', 'editable' => array('type' => 'select', 'source' => LBApplicationUI::countriesDropdownData(), 'placement' => 'right')), 'lb_customer_address_postal_code', 'lb_customer_address_website_url', 'lb_customer_address_phone_1', 'lb_customer_address_phone_2', 'lb_customer_address_fax', 'lb_customer_address_email', 'lb_customer_address_note', array('name' => 'lb_customer_address_is_active', 'editable' => array('type' => 'select', 'source' => LbCustomerAddress::$dropdownActive, 'placement' => 'right')))));
    echo "</div>";
}
// end for
?>
<script>
    function onclickSlideToggle(id)
    {
        $("#detail_customer_address_"+id).slideToggle();
        $("#error_delete_address_"+id).css("display","none");
    }
    function ajaxDeleteAddress(id)
    {
        
        $.ajax({
            type:'POST',
Ejemplo n.º 7
0
<?php

/* @var $this LbCustomerController */
/* @var $model LbCustomer */
/* @var $addressModel LbCustomerAddress */
/* @var $contactModel LbCustomerContact */
//$this->renderPartial('//layouts/lang');
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" style="margin-left:-11px" ><h3>' . Yii::t('lang', 'Customers') . '</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton($model->getHomeURLNormalized());
echo '</div>';
echo '</div>';
?>
<div style="width:30%;margin-top:19px;margin-bottom:11px;"><span style="font-size: 16px;"><b><?php 
echo Yii::t('lang', 'New Customers');
?>
</b></span></div>
<div style="clear: both">
<?php 
$this->renderPartial('_form', array('model' => $model, 'addressModel' => $addressModel, 'contactModel' => $contactModel, 'own' => $own));
?>
</div>
Ejemplo n.º 8
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" style="margin-left:-11px;"><h4>Expenses</h4></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton(LbExpenses::model()->getActionURLNormalized('paymentVoucher'));
echo '&nbsp;';
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'New'), 'items' => array(array('label' => Yii::t('lang', 'New Expenses'), 'url' => LbExpenses::model()->getActionURLNormalized('create')), array('label' => Yii::t('lang', 'New Payment Voucher'), 'url' => LbExpenses::model()->getActionURLNormalized('createPaymentVoucher'))))), 'encodeLabel' => false));
echo '&nbsp;';
if ($id) {
    $this->widget('bootstrap.widgets.TbButton', array('label' => 'Print PDF', 'htmlOptions' => array('onclick' => 'print_PDF_PV()')));
}
echo '</div>';
echo '</div><br>';
echo '<div class = "header" style="margin-bottom:10px">';
if ($id) {
    echo '<div style="overflow:hidden; border-top: 1px solid #fff;margin-top: 5px; padding-bottom:5px;margin-bottom:5px;">';
    echo '</div>';
} else {
    echo '<span style="font-size:16px;"><b>New Payment Voucher</b></span>';
}
echo '</div>';
$this->renderPartial('_form_pv', array('model' => $model, 'modelPV' => $modelPv));
$this->renderPartial('_form_line_expenses', array('model' => $model, 'modelPV' => $modelPv));
?>
<script type="text/javascript">
Ejemplo n.º 9
0
/* @var $model LbInvoice */
/* @var $customerModel LbCustomer */
/* @var $customerContactModel LbCustomerContact */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'lb-quick-create-customer-contact-form', 'enableAjaxValidation' => false, 'type' => 'horizontal'));
echo '<p class="note">Fields with <span class="required">*</span> are required.</p>';
echo $form->textFieldRow($customerContactModel, 'lb_customer_contact_first_name');
echo $form->textFieldRow($customerContactModel, 'lb_customer_contact_last_name');
echo $form->textFieldRow($customerContactModel, 'lb_customer_contact_email_1');
echo $form->textFieldRow($customerContactModel, 'lb_customer_contact_office_phone');
echo $form->textFieldRow($customerContactModel, 'lb_customer_contact_mobile');
echo $form->hiddenField($customerContactModel, 'lb_customer_contact_is_active', array('value' => $customerContactModel::LB_CUSTOMER_CONTACT_IS_ACTIVE));
LBApplicationUI::submitButton('Save', array('url' => $model->getActionURLNormalized('ajaxQuickCreateContact', array('ajax' => 1, 'id' => $model->lb_record_primary_key)), 'buttonType' => 'ajaxSubmit', 'ajaxOptions' => array('id' => 'ajax-quick-create-contact-' . uniqid(), 'beforeSend' => 'function(data){
				if ($("#LbCustomerContact_lb_customer_contact_first_name").val() == ""
				    || $("#LbCustomerContact_lb_customer_contact_last_name").val() == "")
				{
				    alert("Please fill in the required fields.");
                    return false;
				}

				return true;
			} ', 'success' => 'function(data, status, obj) {
            if (data != null)
            {
                var dataJSON = jQuery.parseJSON(data);
                updateAttentionUI(' . $model->lb_record_primary_key . ',
                    dataJSON.lb_record_primary_key, dataJSON.lb_customer_contact_first_name
                                                    + " " + dataJSON.lb_customer_contact_last_name);
                lbAppUIHideModal(' . $model->lb_record_primary_key . ');
            }
		}'), 'htmlOptions' => array('style' => 'margin-left: auto; margin-right: auto', 'id' => 'ajax-btn-quick-create-address', 'live' => false)));
$this->endWidget();
Ejemplo n.º 10
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$m = $this->module->id;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canList = BasicPermission::model()->checkModules($m, 'list');
echo '<div class="btn-toolbar">';
if ($canAdd) {
    LBApplicationUI::newButton(Yii::t('lang', 'New Payment Voucher'), array('url' => $this->createUrl('createPaymentVoucher')));
}
echo '</div><br/>';
echo '<div align="right">';
//from
echo Yii::t('lang', 'From') . ':</td>';
echo '&nbsp;&nbsp;';
echo '<input type="text" id="pv_date" name="LbExpenses[lb_expenses_date]" value="' . date('d-m-Y') . '"><span style="display: none" id="LbExpenses_lb_expenses_date_em_" class="help-inline error"></span>';
echo '&nbsp;&nbsp;&nbsp;';
//to
echo Yii::t('lang', 'To') . ':</td>';
echo '&nbsp;&nbsp;';
echo '<input type="text" id="pv_date_to" name="LbExpenses[lb_expenses_date]" value="' . date('d-m-Y') . '"><span style="display: none" id="LbExpenses_lb_expenses_date_em_" class="help-inline error"></span>';
echo '&nbsp;&nbsp;&nbsp;';
echo '<button class="btn" name="yt0" type="submit" onclick = "searchPV()" style="margin-top:-10px">Search</button>';
echo '</div><br/>';
echo '<div id ="list_payment_voucher">';
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'payment_invoice_grid', 'type' => 'bordered', 'dataProvider' => LbPaymentVoucher::model()->search(), 'columns' => array(array('class' => 'CButtonColumn', 'template' => '{delete}', 'deleteButtonUrl' => 'CHtml::normalizeUrl(array("/lbExpenses/default/deletePaymentVoucher", "id"=>$data->lb_record_primary_key))', 'htmlOptions' => array('width' => '30'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('header' => Yii::t('lang', 'Date'), 'name' => 'lb_customer_id', 'type' => 'raw', 'id' => '$data->lb_record_primary_key', 'value' => '$data->lb_pv_date', 'htmlOptions' => array('width' => '120'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('header' => Yii::t('lang', 'Payment Voucher No'), 'type' => 'raw', 'value' => '($data->lb_payment_voucher_no) ? LBApplication::workspaceLink($data->lb_payment_voucher_no, YII::app()->baseUrl."/index.php/lbExpenses/default/CreatePaymentVoucher/id/".$data->lb_record_primary_key ) : LBApplication::workspaceLink("No customer", $data->getViewURL("No customer") )', 'htmlOptions' => array('width' => '180'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('header' => Yii::t('lang', 'Title'), 'type' => 'raw', 'value' => '$data->lb_pv_title', 'htmlOptions' => array('width' => '150'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('header' => Yii::t('lang', 'Description'), 'type' => 'raw', 'value' => '$data->lb_pv_description', 'htmlOptions' => array('width' => '250'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('header' => Yii::t('lang', 'Create By'), 'type' => 'raw', 'value' => 'AccountProfile::model()->getFullName($data->lb_pv_create_by)', 'htmlOptions' => array('style' => 'width: 80px;text-align:left;'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')))));
echo '</div>';
Ejemplo n.º 11
0
    
    <?php 
//($model->customerAddress->lb_customer_address_line_1!=NULL) ? $model->customerAddress->lb_customer_address_line_1.'. ' : ''
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'usergrid', 'itemsCssClass' => 'table-bordered items', 'dataProvider' => $list, 'columns' => array(array('class' => 'editable.EditableColumn', 'name' => 'system_list_item_id', 'headerHtmlOptions' => array('style' => 'width: 110px'), 'editable' => array('apply' => '$data->system_list_item_id', 'placement' => 'right')), array('class' => 'editable.EditableColumn', 'name' => 'system_list_item_name', 'headerHtmlOptions' => array('style' => 'width: 110px'), 'editable' => array('apply' => '$data->system_list_item_name', 'url' => Yii::app()->createAbsoluteUrl('configuration/ajaxUpdateItem'), 'placement' => 'right')), array('class' => 'CButtonColumn', 'template' => "{delete}", 'buttons' => array('delete' => array('url' => 'Yii::app()->createUrl("configuration/deleteItem", array("id"=>$data->system_list_item_id,"list"=>$data->system_list_code))'))))));
?>
    
     
<fieldset>
    
    <?php 
//    LBApplicationUI::backButton(Yii::app()->createUrl('configuration/index'), false);
?>
    
        <?php 
echo '<div class="btn-toolbar" id ="new_item">';
LBApplicationUI::newButton('New Item', array());
echo '</div>';
//            LBApplicationUI::newButton('New Item', array());
?>
    
    
    

<div hidden ="true" id="form-new-item" class="accordion-body collapse in">
    <input type="text" value="" id="new"><lable id ="err"></lable>
                    <?php 
//echo '<br>';
?>
                    <?php 
echo '<div id ="newItem">';
echo CHtml::Button('Insert', array('onclick' => 'load_item();return false;', 'class' => 'btn', 'style' => 'margin-top:-3px;'));
Ejemplo n.º 12
0
<?php

/* @var $this DefaultControllersController */
/* @var $model LbEmployee */
$this->breadcrumbs = array('Lb Employees' => array('index'), $model->lb_record_primary_key => array('view', 'id' => $model->lb_record_primary_key), 'Update');
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" style="margin-left:-11px;"><h3>' . Yii::t('lang', 'Employee') . '</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton($model->getActionModuleURL('default', 'Dashboard'));
echo '&nbsp;';
// new
echo '</div>';
echo '</div>';
$this->menu = array(array('label' => 'List LbEmployee', 'url' => array('index')), array('label' => 'Create LbEmployee', 'url' => array('create')), array('label' => 'View LbEmployee', 'url' => array('view', 'id' => $model->lb_record_primary_key)), array('label' => 'Manage LbEmployee', 'url' => array('admin')));
?>
<div style="width:30%;margin-top:19px;margin-bottom:11px;"><span style="font-size: 16px;"><b><?php 
echo $model->employee_name;
?>
</b></span></div>


<?php 
$this->renderPartial('_form', array('model' => $model));
Ejemplo n.º 13
0
<?php

/* @var $expenses_customer array of LbExpensesCustomer models */
$canAddCustomer = BasicPermission::model()->checkModules('lbCustomer', 'add');
$canAddDelete = BasicPermission::model()->checkModules('lbCustomer', 'delete');
if ($canAddCustomer) {
    echo '<div class="btn-toolbar">';
    LBApplicationUI::newButton(Yii::t('lang', 'New Customer'), array('url' => $this->createUrl('addCustomer')));
    echo '</div>';
}
$i = 0;
foreach ($expenses_customer as $customer) {
    $client = LbCustomer::model()->findByPk($customer->lb_customer_id);
    if (count($client) > 0) {
        $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> {$client->lb_customer_name}</h4>\n                    </div>";
        if ($canAddDelete) {
            echo "<div style='float:right;margin-top:5px;'>\n                            <a href='#' onclick='ajaxDeleteCustomerExpenses(" . $client->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_customer_" . $client->lb_record_primary_key . "' class='alert alert-block alert-error' style='display:none;'></div>\n            ";
    }
}
// end for
?>
<script>

    function ajaxDeleteCustomerExpenses(id)
    {
        
        $.ajax({
            type:'POST',
Ejemplo n.º 14
0
echo $form->textFieldRow($contactModel, 'lb_customer_contact_office_phone');
echo $form->textFieldRow($contactModel, 'lb_customer_contact_mobile');
echo $form->hiddenField($contactModel, 'lb_customer_contact_is_active', array('value' => $contactModel::LB_CUSTOMER_CONTACT_IS_ACTIVE));
echo '</div></div>';
// end body
echo '</div>';
// end accordion-group
/** END CONTACT **/
?>
</fieldset>

		<?php 
//   $expenses_id = $expensesModel->lb_record_primary_key;
LBApplicationUI::submitButton('Save', array('url' => LbExpenses::model()->getActionURLNormalized('ExpensesNewCustomer', array('ajax' => 1, 'form_type' => 'ajax', 'expenses_id' => $expensesModel->lb_record_primary_key)), 'buttonType' => 'ajaxSubmit', 'ajaxOptions' => array('id' => 'ajax-expenses-new-customer-' . uniqid(), 'beforeSend' => 'function(data){
				if ($("#LbCustomer_lb_customer_name").val() == "")
				{
				    
                                    $("#customer_error").html("<div class=\'alert alert-block alert-error\'>Please fill in the required fields.</div>");
                                    return false;
				}

				return true;
                            } ', 'success' => 'function(data){      
                            refreshCustomerName();
                            $("#modal-customer-form").modal("hide");
                        }'), 'htmlOptions' => array('style' => 'margin-left: auto; margin-right: auto', 'id' => 'ajax-btn-new-customer', 'live' => false)));
?>
&nbsp;&nbsp;
                <?php 
LBApplicationUI::submitButton('Close', array('htmlOptions' => array('data-dismiss' => 'modal')));
$this->endWidget();
Ejemplo n.º 15
0
<?php

$model = UserList::model()->search();
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'lb_list', 'dataProvider' => $model, 'htmlOptions' => array('class' => 'items table table-bordered', 'width' => '98%'), 'columns' => array(array('name' => 'List', 'type' => 'raw', 'value' => 'CHtml::link($data->system_list_code,Yii::app()->createUrl("configuration/list_item",array("list"=>$data->system_list_code)))'), array('class' => 'CButtonColumn', 'template' => '{update}{delete}', 'buttons' => array('delete' => array('url' => 'Yii::app()->createUrl("/configuration/deleteList",array("list"=>$data->system_list_code))'), 'update' => array('url' => 'Yii::app()->createUrl("/configuration/updateList",array("list"=>$data->system_list_code))'))))));
echo '<div class="btn-toolbar" id ="new_item">';
LBApplicationUI::newButton('New List', array());
echo '</div>';
?>
    
    
    

<div hidden ="true" id="form-new-item" class="accordion-body collapse in">
    <input type="text" value="" id="new"><lable id ="err"></lable>
                    <?php 
//echo '<br>';
?>
                    <?php 
echo '<div id ="newItem">';
echo CHtml::Button('Insert', array('onclick' => 'load_item();return false;', 'class' => 'btn', 'style' => 'margin-top:-3px;'));
echo '</div>';
?>
                
</div><!-- form -->
<style>
    .table
    {
        width: 98%;
    }
    </style>
<script>
Ejemplo n.º 16
0
<?php

/* @var $this LbExpensesController */
/* @var $model LbExpenses */
/* @var $form CActiveForm */
$valuePv = false;
if (isset($_REQUEST['idPV'])) {
    $valuePv = $_REQUEST['idPV'];
}
echo '<input type="hidden" value="' . $valuePv . '"  id="idPv">';
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" style="margin-left:-11px;"><h4>Expenses</h4></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton(LbExpenses::model()->getActionURLNormalized('expenses'));
echo '&nbsp;';
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'New'), 'items' => array(array('label' => Yii::t('lang', 'New Expenses'), 'url' => LbExpenses::model()->getActionURLNormalized('create')), array('label' => Yii::t('lang', 'New Payment Voucher'), 'url' => LbExpenses::model()->getActionURLNormalized('createPaymentVoucher'))))), 'encodeLabel' => false));
echo '</div>';
echo '</div><br>';
?>

<div class="form">

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'lb-expenses-form', 'enableAjaxValidation' => true, 'type' => 'horizontal', 'htmlOptions' => array('enctype' => 'multipart/form-data', 'onsubmit' => "validation();")));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	
     
        
Ejemplo n.º 17
0
 public function actionHistorySalary()
 {
     $model = new LbEmployeePayment();
     LBApplicationUI::renderPartial($this, '_form_employee_report', array('model' => $model));
 }
Ejemplo n.º 18
0
<?php

$canAdd = BasicPermission::model()->checkModules('lbPayment', 'add');
$customer_arr = LbCustomer::model()->getCompanies($sort = 'lb_customer_name ASC', LbCustomer::LB_QUERY_RETURN_TYPE_DROPDOWN_ARRAY);
$option_customer = array(0 => 'Choose Customer') + $customer_arr;
?>
<style>
    .accordion-heading{
        background: rgb(91,183,91);
    }
</style>
<?php 
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" style="margin-left:-11px;"><h3>' . Yii::t('lang', 'Payment') . '</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton(LbInvoice::model()->getAdminURLNormalized());
echo '&nbsp;';
echo '</div>';
echo '</div>';
echo '<div style="clear: both;overflow:hidden"><Br>';
?>
<div style="overflow: hidden;">
    <div class="accordion" id="accordion2">
        <?php 
if ($canAdd) {
    ?>
        <div class="accordion-group">
            <div class="accordion-heading" id="new_payment">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#form_new_payment">
                    <i></i>
                    <span style="color: #fff;font-size: 20px; font-weight: bold"><?php 
Ejemplo n.º 19
0
                    if(data != null)
                    {
                        var dataJSON = jQuery.parseJSON(data);
                        onConfirmInvoiceSuccessful(dataJSON);
                        $("#invoice-header-container .ribbon-green").html(dataJSON.lb_vendor_status);
                        $("#lb_invocie_status").html(dataJSON.lb_vendor_status);
                        $("#btn-write-off-invoice-"+dataJSON.lb_record_primary_key).remove();
                    }
                            }'), array('id' => 'btn-write-off-invoice-' . $model->lb_record_primary_key));
    }
}
if ($canDelete) {
    // Buttom DELETE
    if ($model->lb_vd_invoice_status == $model::LB_VD_STATUS_CODE_DRAFT) {
        echo '&nbsp;';
        LBApplicationUI::button(Yii::t('lang', 'Delete'), array('url' => LbVendor::model()->getActionURLNormalized('deleteVDInvoice', array('id' => $model->lb_record_primary_key)), 'htmlOptions' => array('onclick' => 'return confirm("Are you sure you want to delete this item?");', 'id' => 'btn-delete-invoice-' . $model->lb_record_primary_key)));
    }
}
echo '</div>';
echo '</div></div>';
?>
<script language="javascript">
   $(document).ready(function(){
    $('.invoice-item-description').autosize({append: "\n"}); 
    bindLineItemsForChanges("<?php 
echo $grid_id;
?>
");
    bindDiscountsForChanges("<?php 
echo $discount_grid_id;
?>
Ejemplo n.º 20
0
    $file_name_arr = explode('_', $file_name[0]);
    //                 print_r($file_name_arr);
    if ($file_name_arr[0] == $subcription && $file_name_arr[1] == $company) {
        $logo = "<img src='" . $path . $file . "' style='height:80' />";
    }
}
// if(count($file_arr)>0)
//{
$html_logo = '
            <tr>
                <td colspan="2" align="center">' . $logo . '</td>
            </tr>
                ';
//}
//END LOGO
$country = LBApplicationUI::countriesDropdownData();
$address = "";
if (isset($model->customerAddress)) {
    $address = ($model->customerAddress->lb_customer_address_line_1 != NULL ? $model->customerAddress->lb_customer_address_line_1 . '. ' : '') . ($model->customerAddress->lb_customer_address_line_2 != NULL ? $model->customerAddress->lb_customer_address_line_2 . '<br>' : '') . ($model->customerAddress->lb_customer_address_state != NULL ? $model->customerAddress->lb_customer_address_state . ', ' : '') . ($model->customerAddress->lb_customer_address_city != NULL ? $model->customerAddress->lb_customer_address_city . ', ' : '') . ($model->customerAddress->lb_customer_address_country != NULL && $model->customerAddress->lb_customer_address_country != 0 ? $country[$model->customerAddress->lb_customer_address_country] . ' ' : '') . ($model->customerAddress->lb_customer_address_postal_code != NULL ? $model->customerAddress->lb_customer_address_postal_code . '<br>' : '') . ($model->customerAddress->lb_customer_address_phone_1 != NULL ? 'Phone: ' . $model->customerAddress->lb_customer_address_phone_1 . ' ' : '') . ($model->customerAddress->lb_customer_address_fax != NULL ? 'Fax: ' . $model->customerAddress->lb_customer_address_fax : '') . '<br>' . ($model->customerAddress->lb_customer_address_website_url != NULL ? $model->customerAddress->lb_customer_address_website_url : '');
}
$att = "";
if (isset($model->customerContact)) {
    $att = ($model->customerContact->lb_customer_contact_first_name != null ? $model->customerContact->lb_customer_contact_first_name . ' ' : '') . ($model->customerContact->lb_customer_contact_last_name != NULL ? $model->customerContact->lb_customer_contact_last_name : '');
}
$add = "";
if (isset($model->ownerAddress->lb_customer_address_line_1) || isset($model->ownerAddress->lb_customer_address_line_2)) {
    $add = 'Address: ';
}
$subject = "";
if (isset($model->lb_invoice_subject)) {
    $subject = '<tr><td>&nbsp;</td></tr>
Ejemplo n.º 21
0
<?php

// Buttons
echo '<div class="btn-toolbar">';
LBApplicationUI::newButton('New Tax', array('url' => $this->createUrl('createTax')));
echo '</div>';
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'lb_tax_grid', 'dataProvider' => $taxModel, 'columns' => array(array('name' => 'lb_tax_name', 'header' => 'Tax Name', 'value' => '$data->lb_tax_name'), array('name' => 'lb_tax_value', 'header' => 'Value', 'value' => '$data->lb_tax_value'), array('name' => 'lb_tax_is_default', 'header' => 'Tax Default', 'value' => '$data->lb_tax_is_default'), array('class' => 'CButtonColumn', 'template' => '{update}{delete}', 'buttons' => array('delete' => array('url' => 'Yii::app()->createUrl("/configuration/deleteTax",array("id"=>$data->lb_record_primary_key))', 'visible' => 'LbTax::model()->IsTaxExistInvoiceORQuotation($data->lb_record_primary_key)==false'), 'update' => array('url' => 'Yii::app()->createUrl("/configuration/updateTax",array("id"=>$data->lb_record_primary_key))', 'visible' => 'LbTax::model()->IsTaxExistInvoiceORQuotation($data->lb_record_primary_key)==false'))))));
Ejemplo n.º 22
0
.qq-upload-button {
    background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
    border-bottom: medium none;
    color: #0088CC;
    display: block;
    padding: 7px 0;
    left: 460px;
    text-align: center;
}
</style>
<?php 
// echo $model->lb_record_primary_key;
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" ><h3>Bills</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton(LbVendor::model()->getActionURLNormalized('dashboard'));
echo '&nbsp;';
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-th-large"></i> ' . Yii::t('lang', 'New'), 'items' => array(array('label' => Yii::t('lang', 'Print PDF'), 'url' => '#'), array('label' => Yii::t('lang', 'Get Public URL'), 'url' => '#', 'linkOptions' => array()), array('label' => Yii::t('lang', 'Enter Payment'), 'url' => LbVendor::model()->getActionModuleURL('vendor', 'addPayment'), 'linkOptions' => array())))), 'encodeLabel' => false));
echo '</div>';
echo '</div><br>';
?>


<?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;">';
Ejemplo n.º 23
0
 * @var $this DefaultController;
 * @var $model LBContracts;
 */
$m = $this->module->id;
$canList = BasicPermission::model()->checkModules($m, 'list');
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$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" style="margin-left:-11px;"><h3>' . Yii::t('lang', 'Contract Dashboard') . '</h3></div>';
echo '<div class="lb-header-left">';
if ($canAdd) {
    LBApplicationUI::newButton(Yii::t('lang', 'New Contract'), array('url' => $this->createUrl('create')));
}
echo '</div>';
echo '</div>';
echo '<div style="clear: both;overflow:hidden"><Br>';
?>
<div class="panel">
    <span style="font-size:16px;"><b><?php 
echo Yii::t('lang', 'Outstanding Payments');
?>
</b></span>
    <?php 
$this->Widget('bootstrap.widgets.TbGridView', array('id' => 'lb_contract_outstanding_gridview', 'dataProvider' => $model->getContractOutstanding(5, $canList), 'type' => 'striped bordered condensed', 'columns' => array(array('name' => 'lb_contract_no', 'type' => 'raw', 'value' => '
                            ($data->lb_contract_no) ?
                                    LBApplication::workspaceLink($data->lb_contract_no, $data->getViewURL($data->customer->lb_customer_name) )
                                    :LBApplication::workspaceLink("No customer", $data->getViewURL("No customer") )
Ejemplo n.º 24
0
echo $form->textFieldRow($customerModel, 'lb_customer_name', array('class' => 'span4', 'maxlength' => 255));
echo $form->error($customerModel, 'lb_customer_name');
echo $form->textFieldRow($customerModel, 'lb_customer_website_url', array('class' => 'span4'));
echo $form->error($customerModel, 'lb_customer_website_url');
echo $form->hiddenField($customerModel, 'lb_customer_is_own_company', array('value' => $customerModel::LB_CUSTOMER_IS_NOT_OWN_COMPANY));
LBApplicationUI::submitButton('Save', array('url' => $model->getActionURLNormalized('ajaxQuickCreateCustomer', array('ajax' => 1, 'id' => $model->lb_record_primary_key)), 'buttonType' => 'ajaxSubmit', 'ajaxOptions' => array('id' => 'ajax-quick-create-customer-' . uniqid(), 'beforeSend' => 'function(data){
				if ($("#LbCustomer_lb_customer_name").val() == "")
				{
				    alert("Please fill in the required fields.");
                    return false;
				}

				return true;
			} ', 'success' => 'function(data, status, obj) {
            if (data != null)
            {
                var dataJSON = jQuery.parseJSON(data);
                var customer_editable = $("#LbInvoice_invoice_customer_id_' . $model->lb_record_primary_key . '");
                var address_editable = $("#LbInvoice_invoice_customer_address_id_' . $model->lb_record_primary_key . '");
                var attention_editable = $("#LbInvoice_invoice_attention_contact_id_' . $model->lb_record_primary_key . '");
                customer_editable.attr("data-value",dataJSON.lb_record_primary_key);
                customer_editable.html(dataJSON.lb_customer_name);
                customer_editable.editable("setValue", dataJSON.lb_record_primary_key);

                address_editable.html("Choose billing address");
                attention_editable.html("Choose attention");
                lbAppUIHideModal(' . $model->lb_record_primary_key . ');
            }
		}'), 'htmlOptions' => array('style' => 'margin-left: auto; margin-right: auto', 'id' => 'ajax-btn-quick-create-customer', 'live' => false)));
$this->endWidget();
// end form
Ejemplo n.º 25
0
//$this->breadcrumbs=array(
//	'Lb Contracts'=>array('index'),
//	$model->lb_record_primary_key,
//);
//$this->menu=array(
//	array('label'=>'List LbContracts', 'url'=>array('index')),
//	array('label'=>'Create LbContracts', 'url'=>array('create')),
//	array('label'=>'Update LbContracts', 'url'=>array('update', 'id'=>$model->lb_record_primary_key)),
//	array('label'=>'Delete LbContracts', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->lb_record_primary_key),'confirm'=>'Are you sure you want to delete this item?')),
//	array('label'=>'Manage LbContracts', 'url'=>array('admin')),
//);
//
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" ><h3>Contracts</h3></div>';
echo '<div class="lb-header-left">';
LBApplicationUI::backButton(LbContracts::model()->getActionURLNormalized("dashboard"));
echo '&nbsp;';
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'New Contract'), 'url' => $this->createUrl('create'))), 'encodeLabel' => false));
echo '</div>';
echo '</div><Br>';
?>
<div style="overflow: hidden; clear: both;">
    <div style="float: left;width: 300px;"><h3 style="line-height:10px;">Contract: <?php 
echo $model->lb_contract_no;
?>
</h3></div>
   <div style="text-align: right;"><h3 style="line-height:10px;"><?php 
echo $model->customer->lb_customer_name;
?>
</h3></div>
</div>
Ejemplo n.º 26
0
<?php

$this->breadcrumbs = array('Subscriptions' => array('index'), 'Manage');
//$this->menu=array(
//	array('label'=>'List Subscription', 'url'=>array('index')),
//	array('label'=>'Create Subscription', 'url'=>array('create')),
//);
LBApplicationUI::newButton(Yii::t('lang', 'New Subcription'), array('url' => $this->createUrl('/paypal/subscription/create')));
echo "<br><br>";
?>

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'subscription-grid', 'dataProvider' => $model->search(), 'columns' => array('subscription_id', 'subscription_name', 'subscription_cycle', 'subscription_value', array('class' => 'CButtonColumn'))));
Ejemplo n.º 27
0
$m = $this->module->id;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canList = BasicPermission::model()->checkModules($m, 'list');
$this->breadcrumbs = array('Lb Contracts' => array('index'), 'Manage');
//$this->menu=array(
//	array('label'=>'List LbContracts', 'url'=>array('index')),
//	array('label'=>'Create LbContracts', 'url'=>array('create')),
//);
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#lb-contracts-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<?php 
echo '<div id="lb-container-header">';
echo '<div class="lb-header-right" ><h3>Contracts</h3></div>';
echo '<div class="lb-header-left" style="width:400px;">';
LBApplicationUI::backButton(LbInvoice::model()->getActionURLNormalized("dashboard"));
echo '&nbsp;';
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> New Contract', 'url' => $this->createUrl('create'))), 'encodeLabel' => false));
echo '</div>';
echo '</div>';
echo '<br>';
?>
<div style="width: 100%;text-align: center;">
<?php 
$this->widget('bootstrap.widgets.TbButtonGroup', array('buttons' => array(array('label' => 'Active', 'url' => $this->createUrl('admin')), array('label' => 'No Active', 'url' => $this->createUrl('admin', array('status' => LbContracts::LB_CONTRACT_STATUS_NO_ACTIVE))), array('label' => 'Has Renew', 'url' => $this->createUrl('admin', array('status' => LbContracts::LB_CONTRACT_STATUS_HAS_RENEWED))), array('label' => 'End Contract', 'url' => $this->createUrl('admin', array('status' => LbContracts::LB_CONTRACT_STATUS_END))))));
?>
</div>
<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'lb-contracts-grid', 'dataProvider' => $model->getContract($status, 20, $canList), 'filter' => $model, 'columns' => array(array('header' => 'Contract No', 'name' => 'lb_contract_no', 'type' => 'raw', 'value' => '($data->lb_contract_no ?
					LBApplication::workspaceLink($data->lb_contract_no, $data->getViewURL($data->customer->lb_customer_name) )
					:LBApplication::workspaceLink("No customer", $data->getViewURL("No customer") )
Ejemplo n.º 28
0
// accordion group starts
echo '<div class="accordion-group">';
// heading
echo '<div class="accordion-heading lb_accordion_heading">';
echo '<a class="accordion-toggle lb_accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#form-new-customer-contact-collapse">';
echo Yii::t('lang', 'Contact Person') . ' (' . Yii::t('lang', 'Optional') . ')';
echo '</a></div>';
// end heading
// body
echo '<div id="form-new-customer-contact-collapse" class="accordion-body collapse">
      			<div class="accordion-inner">';
echo $form->textFieldRow($contactModel, 'lb_customer_contact_first_name');
echo $form->textFieldRow($contactModel, 'lb_customer_contact_last_name');
echo $form->textFieldRow($contactModel, 'lb_customer_contact_email_1');
echo $form->textFieldRow($contactModel, 'lb_customer_contact_office_phone');
echo $form->textFieldRow($contactModel, 'lb_customer_contact_mobile');
echo $form->hiddenField($contactModel, 'lb_customer_contact_is_active', array('value' => $contactModel::LB_CUSTOMER_CONTACT_IS_ACTIVE));
echo '</div></div>';
// end body
echo '</div>';
// end accordion-group
/** END CONTACT **/
?>
</fieldset>
<div style="padding-left: 200px;">
		<?php 
LBApplicationUI::submitButton('Save');
?>
</div>
<?php 
$this->endWidget();
Ejemplo n.º 29
0
<?php

/* @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')));
    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
?>
<script>

    function ajaxDeleteInvoiceExpenses(id)
    {
        
        $.ajax({
            type:'POST',
            url: "<?php 
echo $this->createUrl('deleteInvoiceExpenses');