示例#1
0
文件: admin.php 项目: jesgac/Nomisoft
    if ($data->tipo_bono == '5') {
        return "Sabado";
    }
    if ($data->tipo_bono == '6') {
        return "Bono Alimentacion";
    }
    if ($data->tipo_bono == '7') {
        return "Seguro Social Obligatorio";
    }
    if ($data->tipo_bono == '8') {
        return "Seguro Paro Forzoso";
    }
    if ($data->tipo_bono == '9') {
        return "Fondo de Ahorro Obligatorio para la Vivienda";
    }
}, 'filter' => CHtml::listData(Conceptos::getOnoffs(), 'id', 'title')), array('header' => 'Valor', 'name' => 'bono', 'value' => '$data->bono'), array('class' => 'CButtonColumn', 'htmlOptions' => buttonWidth(), 'template' => template(), 'buttons' => viewVisible()))));
?>

<div class="col-sm-6">
    <div class="list-group">
      <a href="#" class="list-group-item active">
        Menú
      </a>
      <a href="index.php?r=conceptos/create" class="list-group-item">Nuevo Conceptos</a>
</div>
<?php 
function viewVisible()
{
    return array('view' => array('label' => '', 'imageUrl' => '', 'options' => array('class' => 'fa fa-search  fa-fw')), 'update' => array('label' => '', 'imageUrl' => '', 'options' => array('class' => 'fa fa-pencil  fa-fw')), 'delete' => array('label' => '', 'imageUrl' => '', 'options' => array('class' => 'fa fa-trash-o  fa-fw')));
}
function template()
示例#2
0
 public function lph($seguro, $id)
 {
     $criteria = new CDbCriteria();
     $criteria->order = 'Fecha DESC';
     $empleado = Empleados::model()->findByAttributes(array('id' => $id));
     $cargo = Cargos::model()->findByAttributes(array('id' => $empleado->id_cargo));
     $concepto = Conceptos::model()->findByAttributes(array('tipo_bono' => 9), $criteria);
     if ($seguro == 0) {
         return $seguro;
     } else {
         if ($cargo->tipo_sueldo == 1) {
             $sueldo = $cargo->sueldo;
         } else {
             $sueldo = $cargo->sueldo / 2;
         }
         $lph = $sueldo * ($concepto->bono / 100);
         return $lph;
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     $parametros = Input::get();
     $reglas = array('id' => 'required|integer');
     $validator = Validator::make($parametros, $reglas);
     if (!$validator->fails()) {
         Conceptos::destroy($parametros['id']);
         $res['data'] = Conceptos::All();
         $respuesta = json_encode(array('error' => false, 'mensaje' => '', 'respuesta' => $res));
     } else {
         $respuesta = json_encode(array('error' => true, 'mensaje' => 'No hay parametros o estan mal.', 'respuesta' => null));
     }
     $final_response = Response::make($respuesta, 200);
     $final_response->header('Content-Type', "application/json; charset=utf-8");
     return $final_response;
 }
示例#4
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Conceptos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Conceptos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }