Esempio n. 1
0
 public function actionprintPDF_employee()
 {
     $criteria = new CDbCriteria();
     $html2pdf = Yii::app()->ePdf->HTML2PDF();
     $model = LbEmployee::model()->findAll($criteria);
     $html2pdf->WriteHTML($this->renderPartial('PDFEmployee', array('model' => $model), true));
     $html2pdf->Output('Employee.pdf', 'I');
 }
Esempio n. 2
0
$m = $this->module->id;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canList = BasicPermission::model()->checkModules($m, 'list');
//echo $m;
$canAddQuotation = BasicPermission::model()->checkModules('lbQuotation', 'add');
$canListQuotation = BasicPermission::model()->checkModules('lbQuotation', 'list');
$canAddPayment = BasicPermission::model()->checkModules('lbPayment', 'add');
$canView = BasicPermission::model()->checkModules($m, 'view');
//date
echo '<div id="lb-container-header">';
echo '<div style="margin-left: -10px" class="lb-header-right"><h4>Employees</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 Employee'), 'url' => LbEmployee::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="panel">
    <div style="margin-top: 10px;" class="panel-header-title">
        <div class="panel-header-title-left" >
            <span style="font-size: 16px;"><b><?php 
echo Yii::t('lang', 'All Employee');
?>
</b></span>
        </div>
        <div class="panel-header-title-right" style="margin-left:-80px;margin-top:-8px;">
            <?php 
if ($canAdd) {
    ?>
Esempio n. 3
0
//Permission Quotation
$quotation_canAdd = BasicPermission::model()->checkModules('lbQuotation', 'add');
$quotation_canView = BasicPermission::model()->checkModules('lbQuotation', 'view');
//Permission Bills
$bill_canAdd = BasicPermission::model()->checkModules('lbVendor', 'add');
$bill_canView = BasicPermission::model()->checkModules('lbVendor', 'view');
//Permission Report
$report_canView = BasicPermission::model()->checkModules('lbReport', 'view');
$home_img = CHtml::image(Yii::app()->request->baseUrl . '/images/logo_home.png', '', array('height' => 30, 'width' => 30, 'style' => "margin-top:-5px"));
?>
<div class="container" id="page">

<div id="lb-top-menu">
			<?php 
$ownCompany = LbCustomer::model()->getOwnCompany();
$this->widget('bootstrap.widgets.TbNavbar', array('brand' => false, 'brandUrl' => isset(Yii::app()->user) ? LbInvoice::model()->getActionURL('dashboard') : Yii::app()->createUrl('site/login'), 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array()), array('class' => 'bootstrap.widgets.TbMenu', 'encodeLabel' => false, 'htmlOptions' => array('class' => 'pull-left'), 'items' => array(array('label' => $home_img, 'url' => LbInvoice::model()->getActionURL('dashboard')), array('label' => Yii::t('lang', 'Customers'), 'url' => LbCustomer::model()->getAdminURL(), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbCustomer'), 'items' => array(array('label' => Yii::t('lang', '<i class="icon-plus"></i> New Customer'), 'url' => LbCustomer::model()->getCreateURL(), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canAdd), '---', array('label' => Yii::t('lang', 'All Customers'), 'url' => LbCustomer::model()->getAdminURL(), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canView), array('label' => Yii::t('lang', 'Contracts'), 'url' => LbContracts::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canView), array('label' => Yii::t('lang', 'My Company'), 'url' => LbCustomer::model()->getActionURLNormalized('view', array('id' => $ownCompany->lb_record_primary_key)), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canView))), array('label' => Yii::t('lang', 'Income'), 'url' => LbInvoice::model()->getActionURL('dashboard'), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbInvoice'), 'items' => array(array('label' => Yii::t('lang', '<i class="icon-plus"></i> New Invoice'), 'url' => LbInvoice::model()->getCreateURLNormalized(array('group' => strtolower(LbInvoice::LB_INVOICE_GROUP_INVOICE))), 'visible' => $invoice_canAdd), array('label' => Yii::t('lang', '<i class="icon-plus"></i> New Quotation'), 'url' => LbQuotation::model()->getCreateURLNormalized(), 'visible' => $quotation_canAdd), array('label' => Yii::t('lang', '<i class="icon-plus"></i> Enter Payment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbPayment::model()->getCreateURLNormalized(), 'visible' => $quotation_canAdd), '---', array('label' => Yii::t('lang', 'Outstanding Invoices and Quotations'), 'linkOptions' => array('href' => LbInvoice::model()->getActionURL('dashboard'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbInvoice::model()->getActionURL('dashboard'), 'visible' => $invoice_canView), array('label' => Yii::t('lang', 'All Invoices'), 'linkOptions' => array('href' => LbInvoice::model()->getActionURL('admin'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbInvoice::model()->getActionURL('admin'), 'visible' => $invoice_canView), array('label' => Yii::t('lang', 'All Quotations'), 'linkOptions' => array('href' => LbQuotation::model()->getActionURL('admin'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbQuotation::model()->getActionURL('admin'), 'visible' => $quotation_canView))), array('label' => Yii::t('lang', 'Expenses'), 'items' => array(array('label' => Yii::t('lang', 'All Expenses'), 'linkOptions' => array('href' => LbExpenses::model()->getActionURL('expenses'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbExpenses::model()->getActionURL('expenses'), 'visible' => $expenses_canView), array('label' => Yii::t('lang', 'All Payment voucher'), 'linkOptions' => array('href' => LbExpenses::model()->getActionURL('paymentVoucher'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbExpenses::model()->getActionURL('paymentVoucher'), 'visible' => $expenses_canView))), array('label' => Yii::t('lang', 'Bills'), 'url' => LbVendor::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbVendor'), 'items' => array(array('label' => Yii::t('lang', 'Outstanding'), 'url' => LbVendor::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canView), array('label' => Yii::t('lang', 'Make Payment'), 'url' => LbVendor::model()->getActionModuleURL('vendor', 'addPayment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canAdd))), array('label' => Yii::t('lang', 'Payroll'), 'url' => LbEmployee::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbVendor'), 'items' => array(array('label' => Yii::t('lang', 'All Employees'), 'url' => LbEmployee::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canView), array('label' => Yii::t('lang', 'Make Payment'), 'url' => LbEmployee::model()->getActionURL('EnterPayment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canAdd), array('label' => Yii::t('lang', 'All Payment'), 'url' => LbEmployee::model()->getActionURL('ListPayment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canView))), array('label' => Yii::t('lang', 'Report'), 'url' => array('/lbReport/default/index'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbReport'), 'items' => array(array('label' => Yii::t('lang', 'All'), 'url' => array('/lbReport/default/index?tab=all'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Aging Report'), 'url' => array('/lbReport/default/index?tab=aging_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Cash Receipt'), 'url' => array('/lbReport/default/index?tab=cash_receipt'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Invoice Journal'), 'url' => array('/lbReport/default/index?tab=invoice_journal'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'GST Report'), 'url' => array('/lbReport/default/index?tab=gst_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Sales Report'), 'url' => array('/lbReport/default/index?tab=sales_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Customer Statement'), 'url' => array('/lbReport/default/index?tab=customer_statement'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Employee Report'), 'url' => array('/lbReport/default/index?tab=employee_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Payment Report'), 'url' => array('/lbReport/default/index?tab=payment_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView)))))), 'htmlOptions' => array('class' => 'navbar')));
?>
		</div>
    
<div id="lb-top-shortcuts">
        <?php 
$onwSubcriptAccount = AccountSubscription::model()->getSubscriptionOwnerID(LBApplication::getCurrentlySelectedSubscription());
$onwSubcrip = false;
if ($onwSubcriptAccount == Yii::app()->user->id) {
    $onwSubcrip = true;
}
$linx_app_menu_subscription_items = array();
$selected_subscription_label = 'Subscription';
if (!Yii::app()->user->isGuest) {
    $linx_app_account_subscriptions = AccountSubscription::model()->findSubscriptions(Yii::app()->user->id);
    foreach ($linx_app_account_subscriptions as $sub_id => $subscription) {
Esempio n. 4
0
<?php

$m = $this->module->id;
$canList = BasicPermission::model()->checkModules($m, 'list');
$this->Widget('bootstrap.widgets.TbGridView', array('id' => 'lb_expenses_gridview', 'dataProvider' => LbEmployee::model()->searchEmployeeByName($name), 'template' => "{items}\n{pager}\n{summary}", 'columns' => array(array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{delete}', 'afterDelete' => 'function(link,success,data){ ' . 'if(data){ responseJSON = jQuery.parseJSON(data);' . '     alert(responseJSON.error); }' . '}'), array('header' => Yii::t('lang', 'Name'), 'type' => 'raw', 'value' => 'LBApplication::workspaceLink($data->employee_name,$data->getViewURLNormalized("update",array("id"=>$data->lb_record_primary_key)))', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Birthday'), 'type' => 'raw', 'value' => 'date("d-m-Y", strtotime($data->employee_birthday))', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Phone 1'), 'type' => 'raw', 'value' => '$data->employee_phone_1', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Email 1'), 'type' => 'raw', 'value' => '$data->employee_email_1', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Salary'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->lb_record_primary_key)-LbEmployeeBenefits::model()->caculatorBenefitByEmployee($data->lb_record_primary_key),2)', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Note'), 'type' => 'raw', 'value' => '$data->employee_note', 'htmlOptions' => array('width' => '130')))));
echo '</div>';
Esempio n. 5
0
<?php

echo '<div id="show_payment">';
$date_now = date_format(date_create('01-' . $date), 'Y-m-d');
$month_default = date('m', strtotime($date_now));
$year_default = date('Y', strtotime($date_now));
$model = LbEmployeePayment::model()->search($name, $month_default, $year_default);
$this->Widget('bootstrap.widgets.TbGridView', array('id' => 'lb_expenses_gridview', 'dataProvider' => $model, 'type' => 'striped bordered condensed', 'columns' => array(array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{delete}', 'htmlOptions' => array('width' => '10'), 'deleteButtonUrl' => '"' . LbEmployee::model()->getActionURLNormalized("ajaxDeletePayment") . '" .
                                                "?id={$data->lb_record_primary_key}"', 'afterDelete' => 'function(link,success,data){ ' . 'if(data){ responseJSON = jQuery.parseJSON(data);' . '     alert(responseJSON.error); }' . '}'), array('header' => Yii::t('lang', 'Paid For Month'), 'type' => 'raw', 'value' => '$data->payment_month."/".$data->payment_year', 'htmlOptions' => array('width' => '90')), array('header' => Yii::t('lang', 'Date'), 'type' => 'raw', 'value' => 'date("d-m-Y", strtotime($data->payment_date))', 'htmlOptions' => array('width' => '90')), array('header' => Yii::t('lang', 'Name'), 'type' => 'raw', 'value' => ' LbEmployee::model()->getInfoEmployee($data->employee_id)["employee_name"];', 'htmlOptions' => array('width' => '130')), array('header' => Yii::t('lang', 'Total Salary($)'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->employee_id),2)', 'htmlOptions' => array('width' => '80', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'Paid($)'), 'type' => 'raw', 'value' => 'number_format(LbEmployeePayment::model()->totalPaidByDate($data->payment_month,$data->employee_id,$data->payment_year,$data->payment_date),2);', 'htmlOptions' => array('width' => '80', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'Balance($)'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->employee_id)-LbEmployeePayment::model()->totalPaidByDate($data->payment_month,$data->employee_id,$data->payment_year,$data->payment_date),2)', 'htmlOptions' => array('width' => '80', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'New Payment($)'), 'type' => 'raw', 'value' => 'LbEmployeePayment::model()->getEmployeePayment(false,$data->lb_record_primary_key)["payment_paid"];', 'htmlOptions' => array('width' => '80', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'Note'), 'type' => 'raw', 'value' => 'LbEmployeePayment::model()->getEmployeePayment(false,$data->lb_record_primary_key)["payment_note"];', 'htmlOptions' => array('width' => '130')))));
echo '</div><br/>';
<?php

$m = $this->module->id;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canList = BasicPermission::model()->checkModules($m, 'list');
//echo $m;
$canAddQuotation = BasicPermission::model()->checkModules('lbQuotation', 'add');
$canListQuotation = BasicPermission::model()->checkModules('lbQuotation', 'list');
$canAddPayment = BasicPermission::model()->checkModules('lbPayment', 'add');
$canView = BasicPermission::model()->checkModules($m, 'view');
$model = new LbEmployee();
echo '<div id="lb-container-header">';
echo '<div style="margin-left: -10px" class="lb-header-right"><h4>Employees</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 Employee'), 'url' => LbEmployee::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="panel">
    <div style="margin-top: 10px;" class="panel-header-title">
        <div class="panel-header-title-left">
            <span style="font-size: 16px;"><b><?php 
echo Yii::t('lang', 'Enter Payment');
?>
</b></span>
        </div>
        <div class="panel-header-title-right" style="margin-left:-54px;margin-top:-8px;">
            <?php 
if ($canAdd) {
Esempio n. 7
0
    function delete_item_benefit(id)
    {
        
        $('#tr_row_benefits_'+id).remove();
    
    }

    function printPDF_SalaryEmployee(){
        window.open('printPDF_DetailSalaryEmployee?employee_id=<?php 
echo $employee_id;
?>
','_target');
    }
    function Make_Payment(){
        $.post("<?php 
echo LbEmployee::model()->getActionURLNormalized('EnterPayment', array('employee_id' => $employee_id));
?>
");
    }
    function deleteComment(comment_id)
    {
    $.post("<?php 
echo LbComment::model()->getActionURLNormalized('deleteComment', array());
?>
",
                {id:comment_id},
                function(response){
                    var responseJSON = jQuery.parseJSON(response);
                    if(responseJSON.success === 1)
                    {
                        $('#comment-root'+comment_id).remove();
Esempio n. 8
0
 public function getInfoEmployee($employee_id)
 {
     $infoEmployee = LbEmployee::model()->findByPk($employee_id);
     return $infoEmployee;
 }
Esempio n. 9
0
<?php

$m = $this->module->id;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canList = BasicPermission::model()->checkModules($m, 'list');
if (isset($_GET['employee_id']) && $_GET['employee_id'] > 0) {
    $employee_id = $_GET['employee_id'];
}
$employee = LbEmployee::model()->getInfoEmployee($employee_id);
$PDFSalaryEmployee = '<table border="0" style="margin:auto; width:100%;" cellpading="0" cellpacing="0">' . '<tr><td>
                <table border="0" style="margin:auto; width:100%" cellpadding="0" cellpacing="0" >
                    <tr><td>
                        <span style="font-size:20px; font-weight:bold;">Employee Salary:&nbsp;' . $employee->employee_name . '</span>
                    </td></tr>
                </table>
            </td></tr>' . '<tr><td>
                <table border="0" style="margin:auto; width:100%" cellpadding="0" cellpacing="0">
                    <tr><td>
                        <span style="margin-top:5px;">Address:&nbsp;&nbsp;' . $employee->employee_address . '  </span><br/>
                        <span style="margin-top:5px;">Email:&nbsp;&nbsp;' . $employee->employee_email_1 . '  </span><br/>
                        <span style="margin-top:5px;">Phone:&nbsp;&nbsp;' . $employee->employee_phone_1 . '  </span>
                        <span style="margin-top:20px;"></span>
                    </td></tr>
                </table>
                </td></tr>' . '</table>
            <h4 style="margin-left:20px;">Salary Components:</h4>
             <table border="1" style="width:100%;margin-top:20px;margin-left:10px;" cellpadding="0" cellspacing="0">';
$PDFSalaryEmployee .= '<thead>
                    
                        <tr style="font-weight:bold;" align="center">                        
                           
Esempio n. 10
0
                            <td width="150" class="lb-grid-header">' . Yii::t('lang', 'Name') . '</td>
                            <td width="100" class="lb-grid-header">' . Yii::t('lang', 'Total Salary') . '</td>
                            <td width="100" class="lb-grid-header">' . Yii::t('lang', 'Payment') . '</td>
                            <td width="100" class="lb-grid-header">' . Yii::t('lang', 'Amount') . '</td>
                            <td width="200" class="lb-grid-header">' . Yii::t('lang', 'Note') . '</td>
                        </tr>
                </thead>';
$month = dateMY($month_year)[0];
$year = dateMY($month_year)[1];
$model = LbEmployeePayment::model()->getAllByMonthYear($month, $year);
$totalAllAmount = 0;
$totalAllSalary = 0;
$totalAllPayment = 0;
foreach ($model as $key) {
    //Employee name
    $employee = LbEmployee::model()->getInfoEmployee($key['employee_id'])["employee_name"];
    // total salary
    $salary = LbEmployeeSalary::model()->totalSalaryEmployee($key['employee_id']);
    $benefit = LbEmployeeBenefits::model()->caculatorBenefitByEmployee($key['employee_id']);
    $totalSalary = $salary - $benefit;
    $totalAllSalary += $totalSalary;
    //total Payment
    //$totalPaid = 0;
    $payment_salary = LbEmployeePayment::model()->getPaidByEmployee($key['employee_id'], $month, $year);
    //$totalPaid += $payment_salary;
    $payment = $payment_salary;
    $totalAllPayment += $payment;
    //amount
    //   $amount = number_format(LbEmployeePayment::model()->caculatorAmount($key['employee_id']),2);
    $amount = $salary - $benefit - $payment_salary;
    $totalAllAmount += $amount;
Esempio n. 11
0
            <span style="font-size: 20px;"><b><?php 
echo Yii::t('lang', ' Employee Report');
?>
</b></span>
        </div>
       
        
    </div>

    <div style="margin-bottom: 15px; margin-left: 170px;">
        <span style="font-size: 16px;"><?php 
echo Yii::t('lang', 'Employee Name');
?>
:</span>
        <?php 
echo CHtml::dropDownList('employee', '', CHtml::listData(LbEmployee::model()->findAll(array('order' => 'employee_name')), 'lb_record_primary_key', 'employee_name'), array('empty' => 'All'));
?>
 
        &nbsp;&nbsp;
        <span style="font-size: 16px;"><?php 
echo Yii::t('lang', 'Choose year');
?>
:</span>
        <?php 
echo CHtml::dropDownList('payment_year', '', CHtml::listData(LbEmployeePayment::model()->findAll(array('group' => 'payment_year', 'order' => 'payment_year')), 'lb_record_primary_key', 'payment_year'), array('empty' => 'All', 'class' => 'span2'));
?>
 &nbsp;&nbsp;&nbsp;&nbsp;
        <?php 
echo CHtml::button(Yii::t('lang', 'Search'), array('onclick' => 'load_search_aging_report();return false;', 'class' => 'btn', 'style' => 'margin-top:-9px;'));
?>
        
Esempio n. 12
0
        </div>
    </div>

<?php 
$date_now = date('Y-m-d');
$month_default = date('m', strtotime($date_now));
$year_default = date('Y', strtotime($date_now));
echo '<div align="right">   
  
    <span><b>Paid For Month:</b></span>
    <input type="text" id="paidForDate" class="text" value="' . date('m-Y') . '"/>
    </div>';
$create_by = AccountProfile::model()->getFullName(Yii::app()->user->id);
//echo date('d', strtotime('12-08-3012'));
echo '<div id="show_payment">';
$this->Widget('bootstrap.widgets.TbGridView', array('id' => 'lb_expenses_gridview', 'dataProvider' => $model->search(false, $month_default, $year_default), 'template' => "{items}\n{pager}\n{summary}", 'columns' => array(array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{delete}', 'htmlOptions' => array('width' => '10', 'height' => '40px'), 'deleteButtonUrl' => '"' . LbEmployee::model()->getActionURLNormalized("ajaxDeletePayment") . '" .
                                                "?id={$data->lb_record_primary_key}"', 'afterDelete' => 'function(link,success,data){ ' . 'if(data){ responseJSON = jQuery.parseJSON(data);' . '     alert(responseJSON.error); }' . '}'), array('header' => Yii::t('lang', 'Paid For Month'), 'type' => 'raw', 'value' => '$data->payment_month."/".$data->payment_year', 'htmlOptions' => array('width' => '90', 'height' => '40px')), array('header' => Yii::t('lang', 'Date'), 'type' => 'raw', 'value' => 'date("d-m-Y", strtotime($data->payment_date))', 'htmlOptions' => array('width' => '90', 'height' => '40px')), array('header' => Yii::t('lang', 'Name'), 'type' => 'raw', 'value' => ' LbEmployee::model()->getInfoEmployee($data->employee_id)["employee_name"];', 'htmlOptions' => array('width' => '130', 'height' => '40px')), array('header' => Yii::t('lang', 'Total Salary($)'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->employee_id)-LbEmployeeBenefits::model()->caculatorBenefitByEmployee($data->employee_id),2)', 'htmlOptions' => array('width' => '80', 'height' => '40px', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'Paid($)'), 'type' => 'raw', 'value' => 'number_format(LbEmployeePayment::model()->totalPaidByDate($data->payment_month,$data->employee_id,$data->payment_year,$data->payment_date),2);', 'htmlOptions' => array('width' => '80', 'height' => '40px', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'Balance($)'), 'type' => 'raw', 'value' => 'number_format(LbEmployeeSalary::model()->totalSalaryEmployee($data->employee_id)-LbEmployeeBenefits::model()->caculatorBenefitByEmployee($data->employee_id)-LbEmployeePayment::model()->totalPaidByDate($data->payment_month,$data->employee_id,$data->payment_year,$data->payment_date),2)', 'htmlOptions' => array('width' => '80', 'height' => '40px', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'New Payment($)'), 'type' => 'raw', 'value' => 'LbEmployeePayment::model()->getEmployeePayment(false,$data->lb_record_primary_key)["payment_paid"];', 'htmlOptions' => array('width' => '80', 'height' => '40px', 'style' => 'text-align:right;')), array('header' => Yii::t('lang', 'Note'), 'type' => 'raw', 'value' => 'LbEmployeePayment::model()->getEmployeePayment(false,$data->lb_record_primary_key)["payment_note"];', 'htmlOptions' => array('width' => '130', 'height' => '40px')))));
echo '</div><br/>';
?>
    
</div>
<script lang="javascript">
    $(function () {
            $('#paidForDate').datepicker({
               
                format: 'mm-yyyy',
                viewMode:'months',
                minViewMode:'years',
                onClose: function (dateText, inst) {

                    //Get the selected month value