Пример #1
0
 function edit_place($mode = '')
 {
     if ($mode == 'adcom') {
         $s = new Staff_entitlement_m();
         $s->where('id', Input::get('rowid'));
         $s->get();
         if (Input::get('colid') == 'effectivity_date') {
             $s->effectivity_date = Input::get('new');
         }
         if (Input::get('colid') == 'ineffectivity_date') {
             $s->ineffectivity_date = Input::get('new');
         }
         if (Input::get('colid') == 'amount') {
             $s->amount = Input::get('new');
         }
         $s->save();
         exit;
     }
 }
Пример #2
0
foreach ($rows as $row) {
    ?>
	<?php 
    $s->where('employee_id', $row->id);
    $s->where('additional_compensation_id', $additional_compensation_id);
    $s->get();
    if ($s->exists()) {
        $id = $s->id;
        //echo 'hehe';
    } else {
        $s->employee_id = $row->id;
        $s->additional_compensation_id = $additional_compensation_id;
        $s->effectivity_date = '';
        $s->ineffectivity_date = '';
        $s->amount = '';
        $s->save();
        $id = $s->id;
    }
    // last param of dg_editCell is the size of the textbox
    $onclick0 = "onClick=\"dg_editCell(offices,'" . $id . "','effectivity_date','offices.0.{$i}', 'adcom', '8')\"";
    $onclick1 = "onClick=\"dg_editCell(offices,'" . $id . "','ineffectivity_date','offices.1.{$i}', 'adcom', '8')\"";
    $onclick2 = "onClick=\"dg_editCell(offices,'" . $id . "','amount','offices.2.{$i}', 'adcom', '8')\"";
    $onclick3 = "onClick=\"dg_editCell(offices,'" . $id . "','sg','offices.3.{$i}', 'adcom', '5')\"";
    $onclick4 = "onClick=\"dg_editCell(offices,'" . $id . "','amount','offices.4.{$i}', 'adcom', '10')\"";
    ?>
	<?php 
    $bg = $this->Helps->set_line_colors();
    ?>
	<tr bgcolor="<?php 
    echo $bg;
    ?>
 function staff_entitlement_save($id = '', $employee_id = '')
 {
     $data['page_name'] = '<b>Save Staff Entitlement</b>';
     $data['msg'] = '';
     $di = new Staff_entitlement_m();
     $data['deduction'] = $di->get_by_id($id);
     $data['employee_id'] = $employee_id;
     if (Input::get('op')) {
         // Add employee id if insert only
         if ($id == 0) {
             $di->employee_id = $employee_id;
         }
         $di->additional_compensation_id = Input::get('additional_compensation_id');
         $di->effectivity_date = Input::get('effectivity_date');
         $di->ineffectivity_date = Input::get('ineffectivity_date');
         $di->amount = Input::get('amount');
         $di->save();
         return Redirect::to('payroll/additional_compensation/staff_entitlement/' . $employee_id, 'refresh');
     }
     $d = new Additional_compensation_m();
     $d->order_by('name');
     //$d->where('type', 'loan');
     $data['informations'] = $d->get();
     $data['main_content'] = 'additional_compensation/staff_entitlement/staff_entitlement_save';
     return View::make('includes/template', $data);
 }