本文整理汇总了PHP中grocery_CRUD::or_where方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::or_where方法的具体用法?PHP grocery_CRUD::or_where怎么用?PHP grocery_CRUD::or_where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::or_where方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: crud
public function crud()
{
$crud = new grocery_CRUD();
$crud->set_theme(THEMA_CRUD);
$crud->set_table('usuario');
$crud->set_subject('Usuarios');
$crud->required_fields('nome', 'login', 'email', 'tipo_usuario_id', 'situacao_id');
$crud->columns('nome', 'login', 'email', 'tipo_usuario_id', 'situacao_id');
$crud->edit_fields('nome', 'login', 'email', 'tipo_usuario_id', 'situacao_id');
$crud->add_fields('nome', 'login', 'email', 'tipo_usuario_id');
$crud->set_relation('tipo_usuario_id', 'tipo_usuario', 'descricao');
$crud->set_relation('situacao_id', 'situacao', 'descricao');
$crud->callback_insert(array($this, 'create'));
$crud->callback_delete(array($this, 'delete'));
$crud->callback_update(array($this, 'update'));
$crud->where('situacao_id', 1);
$crud->or_where('situacao_id', 2);
$contents = $crud->render();
// $this->load->view('template_crud', $contents);
$this->template->set('titulo', 'Manter Usuário');
$this->template->set('subtitle', 'Usuário');
// nome do template , nome da view
$this->template->load('template_teste', 'crudpage', $contents);
}
示例2: listarCasos
public function listarCasos()
{
$nivelUsuario = $this->session->userdata("nivel");
$enfermedad = array('diagnostic' => 'A92.0');
$enfermedad1 = array('diagnostic' => 'A92.5');
$tipo = array('C' => 'Confirmado', 'P' => 'Probable', 'D' => 'Descartado', 'S' => 'Sospechoso');
$est = $this->frontend_model->listaEstablec();
$estab = array();
foreach ($est as $dato) {
$estab[$dato->cod_est] = $dato->raz_soc;
}
$crud = new grocery_CRUD();
$crud->set_table('individual');
//$crud->set_theme('datatables');
$crud->columns('semana', 'diagnostic', 'tipo_dx', 'e_salud', 'ubigeo', 'apepat', 'apemat', 'nombres', 'dni', 'fecha_inv');
$crud->set_subject('Ficha');
switch ($nivelUsuario) {
case '8':
$where = array('e_salud' => $this->session->userdata("establecimiento"));
$crud->where($where);
break;
case '7':
$where = array('microred' => $this->session->userdata("microred"), 'red' => $this->session->userdata("red"), 'sub_reg_nt' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '6':
$where = array('red' => $this->session->userdata("red"), 'sub_reg_nt' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '5':
$where = array('sub_reg_nt' => $this->session->userdata("diresa"));
$crud->where($where);
break;
}
$crud->where($enfermedad);
$crud->or_where($enfermedad1);
$crud->display_as("apepat", "Ap. Paterno");
$crud->display_as("apemat", "Ap. Materno");
$crud->display_as("ubigeo", "Distrito");
$crud->display_as("diagnostic", "Enfermedad");
$crud->display_as("e_salud", "Establecimiento");
$crud->display_as("fecha_inv", "Investigación");
$crud->set_relation('ubigeo', 'distrito', 'nombre');
$crud->set_relation('diagnostic', 'diagno', 'diagno');
$crud->field_type('e_salud', 'dropdown', $estab);
$crud->field_type('tipo_dx', 'dropdown', $tipo);
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();
$crud->unset_export();
$crud->unset_delete();
$crud->unset_print();
$crud->add_action('Registrar Ficha', base_url() . 'assets/images/more.png', 'modulos/RegfichaChik', '');
$output1 = $crud->render();
$this->_notificados_output($output1);
}
示例3: listarCasos
public function listarCasos()
{
$establecimiento = $this->mantenimiento_model->listarEstablecimiento();
foreach ($establecimiento as $dato) {
$est[$dato->cod_est] = $dato->raz_soc;
}
$diagnostico = $this->mantenimiento_model->listarDiagnostico();
foreach ($diagnostico as $dato) {
$diagno[$dato->cie_10] = $dato->diagno;
}
$crud = new grocery_CRUD();
//$crud->set_theme("datatables");
$crud->set_table('individual');
$crud->columns('diagnostic', 'e_salud', 'apepat', 'apemat', 'nombres', 'dni');
$crud->set_subject('Ficha');
$nivelUsuario = $this->session->userdata("nivel");
switch ($nivelUsuario) {
case '8':
$where = array('diagnostic' => 'O98.1', 'e_salud' => $this->session->userdata("establecimiento"));
$or_where = array('diagnostic' => 'A50');
$crud->where($where);
$crud->or_where($or_where);
break;
case '7':
$where = array('diagnostic' => 'O98.1', 'microred' => $this->session->userdata("microred"), 'redes' => $this->session->userdata("red"), 'diresa' => $this->session->userdata("diresa"));
$or_where = array('diagnostic' => 'A50');
$crud->where($where);
$crud->or_where($or_where);
break;
case '6':
$where = array('diagnostic' => 'O98.1', 'redes' => $this->session->userdata("red"), 'diresa' => $this->session->userdata("diresa"));
$or_where = array('diagnostic' => 'A50');
$crud->where($where);
$crud->or_where($or_where);
break;
case '5':
$where = array('diagnostic' => 'O98.1', 'sub_reg_nt' => $this->session->userdata("diresa"));
$or_where = array('diagnostic' => 'A50');
$crud->where($where);
$crud->or_where($or_where);
break;
default:
$where = array('diagnostic' => 'O98.1');
$or_where = array('diagnostic' => 'A50');
$crud->where('diagnostic', 'O98.1');
$crud->or_where($or_where);
break;
}
$crud->field_type('e_salud', 'dropdown', $est);
$crud->display_as("e_salud", "Establecimiento");
$crud->field_type('diagnostic', 'dropdown', $diagno);
$crud->display_as("diagnostic", "Enfermedad");
$crud->display_as("apepat", "Paterno");
$crud->display_as("apemat", "Materno");
$crud->display_as("fecha_not", "Notificación");
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
$crud->unset_read();
$crud->unset_print();
$crud->unset_export();
$crud->add_action('Registrar Ficha', '', 'modulos2/RegfichaSif', 'edit-icon');
$output = $crud->render();
$this->layout->view('listarCasos', $output);
}
示例4: irasCampos
public function irasCampos()
{
if (empty($this->session_id)) {
redirect(site_url("index/login"), 301);
}
$reporta = array('ano' => date('Y'), 'semana' => date('W') - 2);
$this->reportes_model->registraCalidad($reporta);
$this->calidad_model->edasCampos();
$crud = new grocery_CRUD();
$crud->set_table('irasDefunciones');
$crud->columns('ano', 'semana', 'sub_reg_nt', 'red', 'microred', 'e_salud', 'ubigeo', 'ira_m2', 'ira_2_11', 'ira_1_4a', 'neu_2_11', 'neu_1_4a', 'ngr_m2', 'ngr_2_11', 'ngr_1_4a');
$crud->display_as('ano', 'Año');
switch ($this->session->userdata('nivel')) {
case 4:
$accesar = $this->session->userdata('equipo');
break;
case 5:
$accesar = $this->session->userdata('diresa');
$crud->or_where(array('sub_reg_nt' => $accesar));
break;
case 6:
$accesar = $this->session->userdata('diresa');
$accesar1 = $this->session->userdata('red');
$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');
$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->order_by('semana');
$crud->unset_add();
$crud->unset_read();
$crud->unset_edit();
//$crud->unset_delete();
//$crud->unset_export();
$crud->unset_print();
$crud->add_action('Editar', '', 'calidad/modIras', 'edit-icon');
$crud->callback_after_delete(array($this, 'log_iras_registro_after_delete'));
$output = $crud->render();
$this->layout->view('irasCampos.php', $output);
}
示例5: 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();
//.........这里部分代码省略.........
示例6: patients
function patients()
{
$drp = $this->session->userdata('user_type');
//primesc data din calendar
$day_get = $_GET["day"];
// setez data din calendar variabila sesiune
// $this->session->set_userdata('data_cal',$_GET['data']);
$ids_ui_ses = $this->session->userdata('ids_ui');
$date_cal = array(96, 95, 89);
// var_dump($date_cal);
// echo "<br>";
// var_dump($ids_ui_ses);
// print_r($day_get);
//die();
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
//nu merge cu asta
//$crud->or_where('productName','Car');
//$id = 95;
$crud->set_table('patients');
$crud->set_subject('Patient');
foreach ($ids_ui_ses as $key => $id) {
$pat_fup = $this->date_followup($id);
$zi_fup = $this->day($pat_fup);
// extrag luna si anul din data follow-up-lui pentru cumparare
$luna_fup = $this->month($pat_fup);
// formatez ziua pentru afisare in calendar
$zi_fup = $this->good_day($zi_fup);
if ($zi_fup == $day_get) {
$crud->or_where('patients.id', $id);
}
}
//$crud->or_where('patients.id', $id);
// aici pun filtrele pt admin
//$crud->where('admin',1);
$crud->display_as('fo_nr', 'Medical Record number');
$crud->field_tip('fo_nr', 'eg: 1234/2016');
$crud->display_as('city', 'City or Locality');
$crud->display_as('gp_phone', 'GP Phone');
$crud->display_as('GP_info', 'Notes');
// User Level Unset
if ($drp == "user") {
$crud->unset_delete();
$crud->unset_export();
$crud->unset_print();
// afisare fara statistici // data 24.01.2017
$crud->columns('id', 'fo_nr', 'cnp', 'last_name', 'first_name', 'follow_up_date', 'status', 'signature');
}
// afisare in admin coloane cu statistici // data 24.01.2017
$crud->columns('id', 'cnp', 'last_name', 'first_name', 'No_of_PCIs', 'Completed_FU_events', 'follow_up_date', 'status', 'signature', 'admin');
$crud->field_tip('cnp', 'Personal ID No.');
$crud->field_tip('gender', 'The gender of the patient');
$crud->field_tip('height', 'Height in cm');
$crud->field_tip('weight', 'Weight in kg');
$crud->required_fields('cnp', 'first_name', 'last_name', 'admin', 'status');
$crud->field_type('gender', 'dropdown', array('Male' => 'Male', 'Female' => 'Female'));
$crud->field_type('country', 'dropdown', array('Romania' => 'Romania', 'Other' => 'Other', 'Unknown' => 'Unknown'));
$crud->set_relation('county', 'county', 'county');
$crud->set_relation('signature', 'user', 'user_name');
$crud->set_relation('admin', 'user', 'user_name');
$crud->add_action('Interventions', '', '', 'ui-icon-heart', array($this, 'go_intervention'));
$crud->add_action('Follow-Up', '', '', 'ui-icon-calculator', array($this, 'go_followup'));
$crud->callback_column('follow_up_date', array($this, '_followup'));
$crud->callback_column('Completed_FU_events', array($this, '_nofollowup'));
$crud->callback_column('No_of_PCIs', array($this, '_nointerv'));
/*// log- user activities
$crud->callback_after_insert(array($this, 'log_user_after_insert_patient'));
$crud->callback_after_update(array($this, 'log_user_after_update_patient'));
$crud->callback_after_delete(array($this, 'log_user_after_delete_patient'));
*/
$crud->unique_fields('cnp');
$crud->field_type('status', 'dropdown', array('New' => 'New', 'In progress' => 'In progress', 'Finished' => 'Finished', 'Delete' => 'Delete'));
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
//$extra = "info";
//$output = $crud->render($extra);
$output = $crud->render();
// $output->extra = '<h3>Pacient</h3>'; Adauga valori extra pentru view
$this->_admin_output($output);
}