本文整理汇总了PHP中grocery_CRUD::limit方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::limit方法的具体用法?PHP grocery_CRUD::limit怎么用?PHP grocery_CRUD::limit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::limit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listadoEdas
public function listadoEdas()
{
$sub = $this->frontend_model->buscarDiresas();
$subr = array();
foreach ($sub as $dato) {
$subr[$dato->codigo] = $dato->nombre;
}
$dist = $this->frontend_model->listarDistritos();
$ubigeo = array();
foreach ($dist as $dato) {
$ubigeo[$dato->ubigeo] = $dato->nombre;
}
$est = $this->frontend_model->listaEstablec();
$establec = array();
foreach ($est as $dato) {
$establec[$dato->cod_est] = $dato->raz_soc;
}
$filtro = array();
$this->input->post('diresa') ? $filtro['sub_reg_nt'] = $this->input->post('diresa') : '';
$this->input->post('redes') ? $filtro['red'] = $this->input->post('redes') : '';
$this->input->post('microred') ? $filtro['microred'] = $this->input->post('microred') : '';
$this->input->post('establec') ? $filtro['e_salud'] = $this->input->post('establec') : '';
$this->input->post('departamento') ? $filtro['substr(ubigeo,1,2)'] = $this->input->post('departamento') : '';
$this->input->post('provincia') ? $filtro['substr(ubigeo,1,4)'] = $this->input->post('provincia') : '';
$this->input->post('distrito') ? $filtro['ubigeo'] = $this->input->post('distrito') : '';
$this->input->post('ano') ? $filtro['ano'] = $this->input->post('ano') : '';
$this->input->post('semana') ? $filtro['semana'] = $this->input->post('semana') : '';
$crud = new grocery_CRUD();
$crud->set_theme("datatables");
$crud->set_table('edas');
$crud->columns('ano', 'semana', 'sub_reg_nt', 'e_salud', 'ubigeo', 'daa_c1', 'daa_c1_4', 'daa_c5', 'dis_c1', 'dis_c1_4', 'dis_c5');
$crud->display_as('ano', 'Año')->display_as('e_salud', 'Establecimiento')->display_as('sub_reg_nt', 'Diresa');
$crud->field_type('sub_reg_nt', 'dropdown', $subr);
$crud->field_type('e_salud', 'dropdown', $establec);
$crud->field_type('ubigeo', 'dropdown', $ubigeo);
if ($this->input->post()) {
if ($this->session->userdata('institucion') == 'A') {
$crud->where($filtro);
} else {
$crud->where($filtro);
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion')));
}
} else {
$crud->where(array('ano' => date('Y')));
switch ($this->session->userdata('nivel')) {
case 4:
$accesar = $this->session->userdata('equipo');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion')));
}
break;
case 5:
$accesar = $this->session->userdata('diresa');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar));
} else {
$crud->where(array('sub_reg_nt' => $accesar));
}
break;
case 6:
$accesar = $this->session->userdata('diresa');
$accesar1 = $this->session->userdata('red');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar, 'red' => $accesar1));
} else {
$crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1));
}
break;
case 7:
$accesar = $this->session->userdata('diresa');
$accesar1 = $this->session->userdata('red');
$accesar2 = $this->session->userdata('microred');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
} else {
$crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
}
break;
case 8:
$accesar = $this->session->userdata('establecimiento');
$crud->where(array('e_salud' => $accesar));
break;
}
}
$crud->limit(1000);
$crud->order_by('semana', 'DESC');
$crud->set_subject('Atenciones');
$crud->unset_add();
$crud->unset_read();
$crud->unset_edit();
$crud->unset_export();
$crud->unset_print();
$crud->callback_after_delete(array($this, 'log_usuario_before_delete'));
$crud->add_action('Editar', '', 'edas/modEdas', 'ui-icon-pencil');
///////////////////////////////////////////////////////////////////////////////
//$crud->add_action_peru('Añadir EDAS', '', 'regEdas','add-icon');
///////////////////////////////////////////////////////////////////////////////
$output = $crud->render();
$this->_example_output1($output);
}
示例2: listadoIndividual
public function listadoIndividual()
{
$sub = $this->frontend_model->buscarDiresas();
$subr = array();
foreach ($sub as $dato) {
$subr[$dato->codigo] = $dato->nombre;
}
$dist = $this->frontend_model->listarDistritos();
$ubigeo = array();
foreach ($dist as $dato) {
$ubigeo[$dato->ubigeo] = $dato->nombre;
}
$enf = $this->frontend_model->mostrarDiagnostico();
$enfermedad = array();
foreach ($enf as $dato) {
$enfermedad[$dato->cie_10] = $dato->diagno;
}
$tdx = $this->frontend_model->mostrarTipo();
$tipoDx = array();
foreach ($tdx as $dato) {
$tipoDx[$dato->codigo] = $dato->denominacion;
}
$filtro = array();
$this->input->post('diresa') ? $filtro['sub_reg_nt'] = $this->input->post('diresa') : '';
$this->input->post('redes') ? $filtro['red'] = $this->input->post('redes') : '';
$this->input->post('microred') ? $filtro['microred'] = $this->input->post('microred') : '';
$this->input->post('establec') ? $filtro['e_salud'] = $this->input->post('establec') : '';
$this->input->post('departamento') ? $filtro['substr(ubigeo,1,2)'] = $this->input->post('departamento') : '';
$this->input->post('provincia') ? $filtro['substr(ubigeo,1,4)'] = $this->input->post('provincia') : '';
$this->input->post('distrito') ? $filtro['ubigeo'] = $this->input->post('distrito') : '';
$this->input->post('diagno') ? $filtro['diagnostic'] = $this->input->post('diagno') : '';
$this->input->post('tipoDx') ? $filtro['tipo_dx'] = $this->input->post('tipoDx') : '';
$this->input->post('ano_ini') ? $filtro['ano'] = $this->input->post('ano_ini') : '';
$this->input->post('semana_ini') ? $filtro['semana'] = $this->input->post('semana_ini') : '';
$this->input->post('apepat') ? $filtro['apepat'] = $this->input->post('apepat') : '';
$crud = new grocery_CRUD();
$crud->set_theme("datatables");
$crud->set_table('individual');
$crud->columns('ano', 'semana', 'diagnostic', 'tipo_dx', 'subregion', 'sub_reg_nt', 'ubigeo', 'sexo', 'apepat', 'apemat', 'nombres');
$crud->display_as('ano', 'Año')->display_as('diagnostic', 'Diagnóstico')->display_as('subregion', 'Diresa')->display_as('sub_reg_nt', 'Notificante')->display_as('ubigeo', 'Distrito')->display_as('tipo_dx', 'Tipo')->display_as('apepat', 'Ap. Paterno')->display_as('apemat', 'Ap. Materno');
$crud->field_type('subregion', 'dropdown', $subr);
$crud->field_type('sub_reg_nt', 'dropdown', $subr);
$crud->field_type('ubigeo', 'dropdown', $ubigeo);
$crud->field_type('diagnostic', 'dropdown', $enfermedad);
$crud->field_type('tipo_dx', 'dropdown', $tipoDx);
$crud->field_type('sexo', 'dropdown', array('M' => 'Masculino', 'F' => 'Femenino'));
if ($this->input->post()) {
if ($this->session->userdata('institucion') == 'A') {
$crud->where($filtro);
} else {
$crud->where($filtro);
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion')));
}
} else {
$crud->where(array('ano' => date('Y')));
switch ($this->session->userdata('nivel')) {
case 4:
$accesar = $this->session->userdata('equipo');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion')));
}
break;
case 5:
$accesar = $this->session->userdata('diresa');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'subregion' => $accesar));
} else {
$crud->where(array('subregion' => $accesar));
$crud->or_where(array('sub_reg_nt' => $accesar));
}
break;
case 6:
$accesar = $this->session->userdata('diresa');
$accesar1 = $this->session->userdata('red');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar, 'red' => $accesar1));
} else {
$crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1));
}
break;
case 7:
$accesar = $this->session->userdata('diresa');
$accesar1 = $this->session->userdata('red');
$accesar2 = $this->session->userdata('microred');
if ($this->session->userdata('institucion') != 'A') {
$crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
} else {
$crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
}
break;
case 8:
$accesar = $this->session->userdata('establecimiento');
$crud->where(array('e_salud' => $accesar));
break;
}
}
$crud->limit(1000);
$crud->order_by('semana', 'DESC');
$crud->set_subject('Individual');
$crud->unset_add();
//.........这里部分代码省略.........
示例3: members
function members($start = 0, $end = 500)
{
$this->check_permission('admin');
$crud = new grocery_CRUD();
$crud->set_table('members');
$crud->set_theme('datatables');
$crud->columns('member_id', 'firstname', 'lastname', 'pt_test', 'mains_test', 'material', 'interview');
$crud->set_relation('optional_1', 'subjects', '{subject_id}-{subject_name}', null, 'subject_id');
$crud->set_relation('optional_2', 'subjects', '{subject_id}-{subject_name}', null, 'subject_id');
$crud->set_relation_n_n('mains_test', 'packages_students', 'mains_tests_packages', 'member_id', 'package_id', 'package_name');
$crud->set_relation_n_n('material', 'material_package_student', 'material_package', 'member_id', 'package_id', 'package_name');
$crud->set_relation_n_n('interview', 'interview_student', 'interview_packages', 'member_id', 'package_id', 'package_name');
$crud->set_relation_n_n('pt_test', 'pt_packages_students', 'pt_tests_packages', 'member_id', 'package_id', 'package_name');
$crud->set_relation('status', 'membership_status', '{status_id}-{status_name}');
$crud->set_relation('country_pr', 'country', '{name}', null, 'name asc');
$crud->set_relation('state_pr', 'state', '{name}', null, 'name asc');
//$crud->set_relation('city_pr', 'city','{name}-{state}',null,'name asc');
$crud->set_relation('country_pm', 'country', '{name}', null, 'name asc');
$crud->set_relation('state_pm', 'state', '{name}', null, 'name asc');
// $crud->set_relation('city_pm', 'city','{name}-{state}',null,'name asc');
$crud->set_relation('last_university', 'university', '{name}', null, 'name asc');
$crud->callback_before_insert(array($this, 'encrypt_password_callback'));
$crud->callback_after_insert(array($this, 'new_registration_email'));
//$crud->callback_before_update(array($this,'encrypt_password_callback'));
//$crud->add_fields('firstname');
$crud->fields('member_id', 'firstname', 'lastname');
$crud->add_fields('firstname', 'lastname', 'login', 'passwd', 'mains_test', 'material', 'interview', 'pt_test', 'dob', 'sex', 'qualification', 'last_university', 'about', 'designation', 'fathers_name', 'fathers_occupation', 'country_pr', 'state_pr', 'city_pr', 'pincode_pr', 'street_pr', 'country_pm', 'state_pm', 'city_pm', 'pincode_pm', 'street_pm', 'telephone_local', 'telephone_permanent', 'previous_attempts_count', 'previous_attempts_details', 'optional_1', 'optional_2', 'medium', 'status', 'time', 'mode', 'centre', 'payment_details', 'photo', 'fee_balance', 'fee_date', 'fee_comment', 'idproof');
$crud->edit_fields('member_id', 'firstname', 'lastname', 'priority', 'login', 'mains_test', 'material', 'interview', 'pt_test', 'dob', 'sex', 'qualification', 'last_university', 'about', 'designation', 'fathers_name', 'fathers_occupation', 'country_pr', 'state_pr', 'city_pr', 'pincode_pr', 'street_pr', 'country_pm', 'state_pm', 'city_pm', 'pincode_pm', 'street_pm', 'telephone_local', 'telephone_permanent', 'previous_attempts_count', 'previous_attempts_details', 'optional_1', 'optional_2', 'medium', 'status', 'time', 'mode', 'centre', 'payment_details', 'photo', 'fee_balance', 'fee_date', 'fee_comment', 'instruction', 'idproof');
$crud->set_field_upload('photo', 'assets/uploads/files/registration');
$crud->set_field_upload('idproof', 'assets/uploads/files/registration');
//$crud->set_field_upload('payment_slip','assets/uploads/files/registration');
$crud->add_action('schedule', '../../images/clock.jpg', 'admin/personal_schedule');
$crud->add_action('Change Password', '../../images/rp.jpg', 'admin/pwd_reset/edit');
//$crud->where('member_id >= ',$start);
//$crud->where('member_id <= ',$end);
if (isset($_POST['search'])) {
$crud->like('firstname', $_POST['search']);
$crud->or_like('lastname', $_POST['search']);
$crud->or_like('login', $_POST['search']);
$crud->or_like('member_id', $_POST['search']);
}
$crud->limit(100, 0);
$crud->unset_print();
$crud->unset_export();
//$crud->unset_add();
// $crud->unset_edit();
$crud->unset_delete();
$output = $crud->render();
$this->_example_output($output);
}