本文整理汇总了PHP中grocery_CRUD::add_action方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::add_action方法的具体用法?PHP grocery_CRUD::add_action怎么用?PHP grocery_CRUD::add_action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::add_action方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mostrar_busqueda
public function mostrar_busqueda()
{
$grocery = new grocery_CRUD();
$grocery->set_theme('bootstrap');
$grocery->set_table('denuncias');
$grocery->set_language('spanish');
$grocery->set_relation('idEstatus', 'estatus', 'descripcion');
$grocery->set_relation('idRecepcion', 'recepcion', 'descripcion');
$grocery->set_relation('idDependencia', 'dependencias', 'dependencia');
$grocery->set_relation('idCiudadano', 'ciudadanos', '{nombre} \\n{apellidoPa} \\n{apellidoMa}');
$grocery->set_relation('idDireccion', 'direcciones', 'colonia');
$grocery->set_relation('idAsunto', 'asuntos', 'descripcion');
$grocery->set_relation('idMedios', 'medios', 'descripcion');
$grocery->display_as('idDependencia', 'Dependencia');
$grocery->display_as('idCiudadano', 'Ciudadano');
$grocery->display_as('idDireccion', 'Dirección');
$grocery->display_as('idRecepcion', 'Recepción');
$grocery->display_as('idEstatus', 'Estatus');
$grocery->display_as('idAsunto', 'Asunto');
$grocery->display_as('idMedios', 'Medios');
$grocery->unset_add();
$grocery->unset_export();
//$grocery->unset_edit();
$grocery->edit_fields('fecha', 'idDependencia', 'idEstatus', 'idRecepcion', 'idMedios');
$grocery->add_action('Editar ciudadano', '', 'ciudadanos/editar_ciudadano');
$grocery->add_action('Editar Direccion', '', 'direcciones/editar_direccion');
$grocery->add_action('Editar Asunto', '', 'asuntos/editar_asunto');
$grocery->columns('fecha', 'idDependencia', 'idCiudadano', 'idEstatus', 'idRecepcion', 'idDireccion', 'idAsunto');
$output = $grocery->render();
$this->_example_output($output);
}
示例2: listarNeumonias
public function listarNeumonias()
{
$sub = $this->frontend_model->buscarDiresas();
$subr = array();
foreach ($sub as $dato) {
$subr[$dato->codigo] = $dato->nombre;
}
$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('neumonias');
$crud->columns('diresa', 'e_salud', 'apepat', 'apemat', 'nombres', 'sexo', 'fecha_reg', 'fecha_def', 'usuario');
$crud->set_subject('Ficha');
$nivelUsuario = $this->session->userdata("nivel");
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"), 'diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '6':
$where = array('red' => $this->session->userdata("red"), 'diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '5':
$where = array('diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
}
$crud->field_type('sexo', 'dropdown', array('M' => 'Masculino', 'F' => 'Femenino'));
$crud->field_type('diresa', 'dropdown', $subr);
$crud->field_type('e_salud', 'dropdown', $estab);
$crud->display_as("apepat", "Apellido Paterno");
$crud->display_as("apemat", "Apellido Materno");
$crud->display_as("fecha_reg", "Registro");
$crud->display_as("fecha_def", "Defunción");
$crud->display_as("e_salud", "Establecimiento");
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();
$crud->unset_export();
//$crud->unset_print();
$crud->callback_after_delete(array($this, 'log_usuario_before_delete'));
$crud->add_action_peru('', '', 'RegfichaNeum', 'add-icon');
$crud->add_action('Modificar Ficha', '', 'modulos3/ModfichaNeum', 'edit-icon');
$crud->add_action('Ver Ficha', '', 'modulos3/VerfichaNeum', 'read-icon');
$output = $crud->render();
$this->_example_output($output);
}
示例3: listar_transito
public function listar_transito()
{
/*$establecimiento = $this->mantenimiento_transito->listarEstablecimiento();
foreach($establecimiento as $dato){
$est[$dato->cod_est] = $dato->raz_soc;
} */
$crud = new grocery_CRUD();
//$crud->set_theme('bootstrap');
$crud->set_table('trans_lesacctra');
$crud->columns('id', 'ano', 'ap_nm1', 'ap_nm2', 'nom_les', 'edad', 'tipo_edad', 'diresa', 'eess');
$crud->set_subject('Ficha Transito');
$nivelUsuario = $this->session->userdata("nivel");
switch ($nivelUsuario) {
case '8':
$where = array('cod_eess' => $this->session->userdata("establecimiento"));
$crud->where($where);
break;
case '7':
//$where = "where cod_eess in(select cod_est FROM renace where subregion = '$diresa' and red = '$red' and microred = '$microred')";
$where = array('microred' => $this->session->userdata("microred"), 'red' => $this->session->userdata("red"), 'cod_dir' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '6':
//$where = "where cod_eess in(select cod_est FROM renace where subregion = '$diresa' and red = '$red')";
$where = array('red' => $this->session->userdata("red"), 'cod_dir' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '5':
$where = array('cod_dir' => $this->session->userdata("diresa"));
$crud->where($where);
break;
}
//$crud->field_type('establec', 'dropdown', $est);
$crud->display_as("id", "ID")->display_as("ano", "AÑO")->display_as("ap_nm1", "APELLIDO PATERNO")->display_as("ap_nm2", "APELLIDO MATERNO")->display_as("nom_les", "NOMBRES")->display_as("edad", "EDAD")->display_as("tipo_edad", "TIPO")->display_as("diresa", "DIRESA")->display_as("eess", "ESTABLECIENTO DE SALUD");
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();
$crud->unset_print();
$crud->unset_export();
$crud->unset_delete();
$crud->order_by('id', 'desc');
$crud->add_action('Eliminar Ficha', base_url() . 'assets/images/close.png', 'modulotransito/borrarFichatransito', 'borrar-icon');
$crud->add_action('Vista previa', '', 'modulotransito/ver_ficha_transito', 'read-icon');
$crud->add_action('Editar Ficha Transito', '', 'modulotransito/modificacion_transito', 'edit-icon');
$output = $crud->render();
$usuario = $this->session->userdata("usuario");
$accion = 'Listar Casos Accidentes de Transito';
$this->login_model->auditoriaOperador($usuario, $accion);
$this->layout->view('listar_transito', $output);
}
示例4: database
function database()
{
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('patients');
$crud->set_subject('Patient');
//$crud->display_as('compartiment_name','Compartiment');
$crud->columns('cnp', 'first_name', 'last_name', 'date_of_birth', 'sex', 'city', 'height', 'weight');
$crud->field_type('sex', 'dropdown', array('Male' => 'Male', 'Female' => 'Female'));
$crud->add_action('Interventions', '', '', 'ui-icon-heart', array($this, 'go_intervention'));
$crud->add_action('Follow-Up', '', '', 'ui-icon-calculator', array($this, 'go_followup'));
$output = $crud->render();
$this->_admin_output($output);
}
示例5: database
function database()
{
$drp = $this->session->userdata('user_type');
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('patients');
$crud->set_subject('Patient');
$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', 'Dead' => 'Dead', 'Delete' => 'Delete'));
//$extra = "info";
//$output = $crud->render($extra);
$output = $crud->render();
// $output->extra = '<h3>Pacient</h3>'; Adauga valori extra pentru view
$this->_admin_output($output);
}
示例6: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['lo'] = 2;
//value used to identify section movie or celebrity
$data['categoryid'] = $categoryid;
//value used to identify section movie or celebrity
if ($categoryid != 0) {
$data['cat_id'] = $categoryid;
$cat_title = $this->category->getTitle($categoryid);
$data['cat_title'] = $cat_title . " - Movies";
$form_subject = $cat_title;
$crud = new grocery_CRUD();
$crud->set_table('dbx_movies');
$crud->where('catid', $categoryid);
$crud->set_subject('Movie');
$crud->required_fields('title', 'year');
$crud->columns('title');
// $crud->callback_column('name',array($this,'link_title'));
// $crud->set_rules('title','Title','trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Large Image', '', '', 'custom_icon limg-icon img_crop', array($this, 'set_imgurl'));
$crud->add_action('Small Image', '', '', 'custom_icon simg-icon img_crop', array($this, 'set_imgurl'));
$crud->fields('catid', 'title', 'year', 'release_date', 'cast', 'director', 'producer', 'music', 'writer', 'lyrics', 'synopsis', 'seo_url', 'ownerid', 'created_date', 'lastupdate_date');
// $crud->field_type('catid', 'hidden', $categoryid);
$crud->set_relation('catid', 'dbx_categories', 'title', array('type' => 'M'), null, $categoryid);
$crud->display_as('catid', 'Category');
//
$crud->callback_add_field('cast', array($this, 'add_field_cast'));
$crud->callback_add_field('synopsis', array($this, 'add_field_synopsis'));
$crud->callback_edit_field('cast', array($this, 'edit_field_cast'));
$crud->callback_edit_field('synopsis', array($this, 'edit_field_synopsis'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->change_field_type('seo_url', 'invisible');
$crud->change_field_type('lastupdate_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->callback_after_insert(array($this, 'after_insert'));
$crud->unset_jquery();
$state = $crud->getState();
// echo($state);
$data['state'] = $state;
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('movies_view', $output);
$this->load->view('footer_view', $data);
}
}
示例7: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['cat_id'] = $categoryid;
// $form_subject = ($categoryid==0 ? "Category" : "Sub Category");
if ($categoryid == 0) {
$form_subject = "Category";
$data['cat_title'] = "Categories";
} else {
$this->category->getTitle($categoryid);
$data['cat_title'] = $this->category->getTitle($categoryid) . " - Sub Categories";
$form_subject = "Sub Category";
}
$crud = new grocery_CRUD();
$crud->set_table('dbx_categories');
$crud->where('pid', $categoryid);
$crud->set_subject($form_subject);
$crud->required_fields('title');
$crud->columns('title');
$crud->callback_column('title', array($this, 'link_title'));
$crud->set_rules('title', 'Title', 'trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Sub Categories', '', '', 'cat-icon', array($this, 'goto_sub'));
$crud->fields('title', 'desc', 'published', 'type', 'pid', 'ownerid', 'created_date');
$crud->field_type('pid', 'hidden', $categoryid);
$crud->field_type('published', 'dropdown', array('0' => 'No', '1' => 'Yes'));
$crud->field_type('type', 'dropdown', array('C' => 'Celebrity', 'M' => 'Movie', 'P' => 'Parent'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('categories_view', $output);
$this->load->view('footer_view', $data);
}
示例8: index
public function index()
{
$this->pagina_saida((object) array('output' => '', 'js_files' => array(), 'css_files' => array()));
$this->load->view('template/navbar.php');
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('cliente_produto');
$crud->set_subject('codorc');
$crud->required_fields('codorc', 'codpro');
$crud->display_as('codorc', 'Cód. Orçamento');
$crud->display_as('tiporc', 'Tipo');
$crud->display_as('numcpf', 'CPF');
$crud->display_as('plavei', 'Placa');
$crud->display_as('datent', 'Data Início');
$crud->display_as('datsai', 'Data Saída');
// $crud->columns('NomeCliente');
$crud->add_action('Smileys', 'http://www.grocerycrud.com/assets/uploads/general/smiley.png', 'demo/action_smiley');
$output = $crud->render();
$this->pagina_saida($output);
$this->load->view('template/footer');
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例9: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('hotels');
$crud->set_subject('Hotels');
$agents = $this->ion_auth->get_all_agents();
$user = $this->ion_auth->user()->row();
$agents += array($user->id => $user->first_name . " " . $user->last_name);
$crud->field_type('hotel_agent_id', 'dropdown', $agents);
//var_dump($agents);
// $crud->set_relation('hotel_agent_id', 'io_users', '{first_name} {last_name}', array('active' => 1));
$crud->display_as('hotel_agent_id', 'Agent Name');
$crud->display_as('hotel_name', 'Hotel Name');
$crud->display_as('hotel_rooms', 'Rooms');
$crud->display_as('hotel_tariffs', 'Tariffs');
$crud->display_as('hotel_country', 'Country');
$crud->display_as('hotel_city', 'City');
$crud->display_as('hotel_street', 'Street');
$crud->display_as('hotel_state', 'State');
$crud->display_as('hotel_postCode', 'PostCode');
$crud->display_as('hotel_phoneNumber', 'Phone Number');
$crud->display_as('hotel_emailId', 'Email ID');
$crud->display_as('hotel_website', 'Website');
$crud->display_as('hotel_facebook', 'Facebook');
$crud->display_as('hotel_googleMap', 'Google Map');
$crud->display_as('hotel_related', 'Related Hotels');
$crud->display_as('hotel_status', 'Status');
$crud->columns('hotel_name', 'hotel_agent_id', 'hotel_phoneNumber', 'hotel_website', 'hotel_facebook', 'hotel_googleMap', 'hotel_status');
$crud->required_fields('hotel_agent_id');
$crud->field_type('hotel_stars', 'dropdown', range(0, 5));
/*
* For related hotels
* on add list all the hotels
* on edit, list all except own name
*/
$hrf = array();
if ($crud->getState() == 'edit') {
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_id !=' => $crud->getStateInfo()->primary_key), 'hotel_id');
} else {
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1), 'hotel_id');
}
$hrf = $this->generic_model->array_from_db($hrf, 'hotel_id, hotel_name');
$crud->field_type('hotel_related', 'multiselect', $hrf);
$crud->callback_column('hotel_image', array($this, 'set_image'));
$crud->set_field_upload('hotel_image', $this->upload_path);
$hf = $this->generic_model->get_by('hotel_facilities', array('hf_status' => 1), 'hf_id');
$hf = $this->generic_model->array_from_db($hf, 'hf_id, hf_facility');
$crud->field_type('hotel_facilities', 'multiselect', $hf);
$hrf = $this->generic_model->get_by('hotel_room_facilities', array('hrf_status' => 1), 'hrf_id');
$hrf = $this->generic_model->array_from_db($hrf, 'hrf_id, hrf_facility');
$crud->field_type('hotel_room_facilities', 'multiselect', $hrf);
$crud->unique_fields('hotel_slug');
$crud->add_action('Photo Gallery', '', 'hotels/gallery', 'ui-icon ui-icon-image');
$output = $crud->render();
$data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Hotels', 'pagedesc' => 'Hotels', 'contenttitle' => 'Hotels List Records');
$this->load->view('gc_admin_wrapper', $data);
}
示例10: listarMnp
public function listarMnp()
{
$crud = new grocery_CRUD();
$crud->set_table('mnp');
$crud->columns('registroId', 'ape_nom', 'sexo', 'fecha_nac', 'fecha_mte', 'fecha_reg', 'usuario');
$crud->set_subject('Ficha');
$nivelUsuario = $this->session->userdata("nivel");
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"), 'diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '6':
$where = array('red' => $this->session->userdata("red"), 'diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '5':
$where = array('diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
}
$crud->field_type('sexo', 'dropdown', array('M' => 'Masculino', 'F' => 'Femenino', 'I' => 'Indeterminado'));
$crud->display_as("registroId", "Ficha");
$crud->display_as("ape_nom", "Apellidos y Nombres");
$crud->display_as("fecha_nac", "Fecha de Nacimiento");
$crud->display_as("fecha_mte", "Defunción");
$crud->display_as("fecha_reg", "Fecha de Registro");
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();
$crud->unset_export();
$crud->unset_delete();
//$crud->unset_print();
$crud->add_action_peru('', '', 'RegfichaMnp', 'add-icon');
$crud->add_action('Eliminar Ficha', base_url() . 'assets/images/close.png', 'modulosmnp/delFichaMnp', 'borrar-icon');
$crud->add_action('Modificar Ficha', '', 'modulosmnp/ModfichaMnp', 'edit-icon');
$crud->add_action('Ver Ficha', '', 'modulosmnp/VerfichaMnp', 'read-icon');
$output = $crud->render();
$this->_example_output($output);
}
示例11: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('hotels');
$crud->set_subject('Hotels');
// $crud->set_relation('hotel_agent_id', 'io_users', '{first_name} {last_name}');
$agent_id = $this->ion_auth->user()->row()->id;
$crud->where('hotel_agent_id', $agent_id);
$crud->field_type('hotel_agent_id', 'hidden', $agent_id);
// $crud->display_as('hotel_agent_id', 'Agent Name');
$crud->display_as('hotel_name', 'Hotel Name');
$crud->display_as('hotel_rooms', 'rooms');
$crud->display_as('hotel_tariffs', 'tariffs');
$crud->display_as('hotel_country', 'Country');
$crud->display_as('hotel_city', 'City');
$crud->display_as('hotel_street', 'Street');
$crud->display_as('hotel_state', 'State');
$crud->display_as('hotel_postCode', 'PostCode');
$crud->display_as('hotel_phoneNumber', 'Phone Number');
$crud->display_as('hotel_emailId', 'Email ID');
$crud->display_as('hotel_website', 'Website');
$crud->display_as('hotel_facebook', 'Facebook');
$crud->display_as('hotel_googleMap', 'GoogleMap');
$crud->display_as('hotel_status', 'Status');
$crud->columns('hotel_name', 'hotel_phoneNumber', 'hotel_website', 'hotel_facebook', 'hotel_googleMap', 'hotel_status');
$crud->callback_column('hotel_image', array($this, 'set_image'));
$crud->set_field_upload('hotel_image', $this->upload_path);
/*
* For related hotels
* on add list all the hotels
* on edit, list all except own name
*/
if ($crud->getState() == 'edit') {
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_agent_id' => $this->ion_auth->get_user_id(), 'hotel_id !=' => $crud->getStateInfo()->primary_key), 'hotel_id');
} else {
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_agent_id' => $this->ion_auth->get_user_id()), 'hotel_id');
}
// empty data for multiselect field generates error
if (empty($hrf)) {
$hrf = array('');
} else {
$hrf = $this->generic_model->array_from_db($hrf, 'hotel_id, hotel_name');
}
$crud->field_type('hotel_related', 'multiselect', $hrf);
$hf = $this->generic_model->get_by('hotel_facilities', array('hf_status' => 1), 'hf_id');
$hf = $this->generic_model->array_from_db($hf, 'hf_id, hf_facility');
$crud->field_type('hotel_facilities', 'multiselect', $hf);
$hrf = $this->generic_model->get_by('hotel_room_facilities', array('hrf_status' => 1), 'hrf_id');
$hrf = $this->generic_model->array_from_db($hrf, 'hrf_id, hrf_facility');
$crud->field_type('hotel_room_facilities', 'multiselect', $hrf);
$crud->add_action('Photo Gallery', '', 'agents/hotels/gallery', 'ui-icon ui-icon-image');
$output = $crud->render();
$data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Hotels', 'pagedesc' => 'Hotels', 'contenttitle' => 'Hotels List Records', 'left_menu' => 'agents_menu');
$this->load->view('gc_admin_wrapper', $data);
}
示例12: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['lo'] = 1;
//value used to identify section movie or celebrity
if ($categoryid != 0) {
$data['cat_id'] = $categoryid;
$cat_title = $this->category->getTitle($categoryid);
$data['cat_title'] = $cat_title . " ";
$form_subject = $cat_title;
$crud = new grocery_CRUD();
$crud->set_table('dbx_celebrities');
$crud->where('catid', $categoryid);
$crud->set_subject($form_subject);
$crud->required_fields('name');
$crud->columns('name');
// $crud->callback_column('name',array($this,'link_title'));
// $crud->set_rules('title','Title','trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Large Image', '', '', 'custom_icon limg-icon img_crop', array($this, 'set_imgurl'));
$crud->add_action('Small Image', '', '', 'custom_icon simg-icon img_crop', array($this, 'set_imgurl'));
$crud->fields('catid', 'name', 'alt_name1', 'alt_name2', 'alt_name3', 'alt_name4', 'title', 'desc', 'sign', 'birth_date', 'birth_place', 'first_film', 'awards', 'height', 'weight', 'seo_url', 'ownerid', 'created_date', 'lastupdate_date');
// $crud->field_type('catid', 'hidden', $categoryid);
$crud->set_relation('catid', 'dbx_categories', 'title', array('type' => 'C'), null, $categoryid);
$crud->display_as('catid', 'Category');
$crud->callback_add_field('desc', array($this, 'add_field_desc'));
$crud->callback_add_field('awards', array($this, 'add_field_awards'));
$crud->callback_edit_field('desc', array($this, 'edit_field_desc'));
$crud->callback_edit_field('awards', array($this, 'edit_field_awards'));
$crud->field_type('sign', 'dropdown', array('Aries' => 'Aries', 'Taurus' => 'Taurus', 'Gemini1' => 'Gemini', 'Cancer' => 'Cancer', 'Leo' => 'Leo', 'Virgo' => 'Virgo', 'Libra' => 'Libra', 'Scorpio' => 'Scorpio', 'Sagittarius' => 'Sagittarius', 'Capricorn' => 'Capricorn', 'Aquarius' => 'Aquarius', 'Pisces' => 'Pisces'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->change_field_type('seo_url', 'invisible');
$crud->change_field_type('lastupdate_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->unset_jquery();
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('celebrities_view', $output);
$this->load->view('footer_view', $data);
}
}
示例13: article
public function article()
{
$crud = new grocery_CRUD();
$crud->set_table('blog_article');
$crud->columns('article_title', 'content', 'Categories', 'author_user_id', 'date', 'allow_comment');
$crud->edit_fields('article_title', 'article_url', 'content', 'Categories', 'date', 'author_user_id', 'allow_comment');
$crud->add_fields('article_title', 'article_url', 'content', 'Categories', 'date', 'author_user_id', 'allow_comment');
$crud->display_as('article_title', 'Title')->display_as('article_url', 'URL')->display_as('content', 'Content')->display_as('date', 'Date Created')->display_as('author_user_id', 'Author');
$crud->set_subject('Article');
$crud->callback_before_insert(array($this, 'before_insert_article'));
$crud->callback_before_update(array($this, 'before_insert_article'));
$crud->set_relation_n_n('Categories', 'blog_category_article', 'blog_category', 'article_id', 'category_id', 'category_name');
$crud->set_relation('author_user_id', 'cms_user', 'real_name');
$crud->change_field_type('author_user_id', 'hidden');
$crud->change_field_type('date', 'hidden');
$crud->change_field_type('article_url', 'hidden');
$crud->change_field_type('allow_comment', 'true_false');
$crud->add_action('Photos', base_url() . 'modules/blog/assets/images/photo.png', 'blog/photo');
$crud->add_action('Comments', base_url() . 'modules/blog/assets/images/comment.png', 'blog/comment');
$output = $crud->render();
$this->view('grocery_CRUD', $output, 'blog_article');
}
示例14: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('bookings');
$crud->set_subject('Bookings');
// $agents = $this->ion_auth->get_all_agents();
// $user = $this->ion_auth->user()->row();
// $agents += array($user->id => $user->first_name . " " . $user->last_name);
// $crud->field_type('hotel_agent_id', 'dropdown', $agents);
$crud->set_relation('booking_agent', 'io_users', '{first_name} {last_name} [{email}]', array('active' => 1));
$crud->set_relation('agent_id', 'io_users', '{first_name} {last_name} [{email}]', array('active' => 1));
$crud->set_relation('booking_to', 'io_users', '{first_name} {last_name} [{email}]', array('active' => 1));
$crud->display_as('agent_id', 'Agent of Hotel/Package');
$crud->display_as('booking_company_commission', 'Company Commission');
$crud->display_as('booking_status', 'Status (Change Status)');
$crud->display_as('booking_agent', 'Booked By');
// $crud->display_as('hotel_name', 'Hotel Name');
// $crud->display_as('hotel_rooms', 'Rooms');
// $crud->display_as('hotel_tariffs', 'Tariffs');
$crud->field_type('booking_ref_no', 'readonly');
$crud->field_type('paypal_transaction_id', 'readonly');
$crud->field_type('booking_agent_commission', 'readonly');
$crud->field_type('booking_company_commission', 'readonly');
$crud->field_type('booking_type', 'readonly');
$crud->field_type('booking_item_title', 'readonly');
$crud->field_type('booking_date', 'readonly');
$crud->field_type('booking_payment_type', 'readonly');
$crud->field_type('booking_total', 'readonly');
$crud->field_type('booking_agent', 'readonly');
$crud->field_type('agent_id', 'readonly');
$crud->field_type('booking_to', 'readonly');
$crud->unset_columns('booking_item', 'booking_subitem', 'booking_paymethod_tax', 'ip_address', 'booking_nights');
$crud->unset_fields('booking_item', 'booking_subitem', 'booking_paymethod_tax', 'ip_address', 'booking_nights');
$crud->where('agent_id', $this->ion_auth->get_user_id());
// $crud->columns('hotel_name', 'hotel_agent_id', 'hotel_phoneNumber', 'hotel_website', 'hotel_facebook' ,'hotel_googleMap', 'hotel_status');
// $state = $crud->getState();
//
// if($state =='list' || $state =='ajax_list')
// {
$crud->set_js("assets/frontend/js/custom_functions_sam.js");
// }
$crud->add_action('Conversation', 'http://www.grocerycrud.com/assets/uploads/general/smiley.png', '', 'ui-icon-image', array($this, '_booking_conversation'));
$crud->callback_column('booking_ref_no', array($this, '_show_invoice'));
$crud->callback_edit_field('booking_status', array($this, '_edit_field_callback'));
$crud->callback_column('booking_status', array($this, '_booking_status'));
$crud->unset_add();
$output = $crud->render();
$data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Bookings', 'pagedesc' => 'Bookings', 'contenttitle' => 'Booking List Records', 'left_menu' => 'agents_menu');
$this->load->view('gc_admin_wrapper', $data);
}
示例15: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('gallery');
$crud->columns('subject', 'publish', 'creator', 'last_update');
$crud->required_fields('subject', 'publish');
$crud->callback_after_insert(array($this, 'log_user'));
$crud->callback_after_update(array($this, 'log_user'));
$crud->set_subject('Gallery Album');
$crud->fields('subject', 'deskripsi', 'publish');
$crud->add_action('Smileys', base_url() . 'assets/uploads/pictures.png', 'adminpanel/gallery/uploadPicture');
$output = $crud->render();
$data['subject'] = 'Gallery Album';
$data['content'] = $this->load->view('crud.php', $output, true);
$this->load->view('base_theme', $data);
}