function configuracion() { $crud = new grocery_CRUD(); $crud->set_table('usuarios'); $crud->set_theme('datatables'); $crud->set_language('spanish'); $crud->set_subject('Usuario'); $state = $crud->getState(); $state_info = $crud->getStateInfo(); if ($state == 'list' || $state == 'success') { redirect('user/dashboard'); } else { $crud->unset_add(); $crud->unset_delete(); $crud->field_type('usuario', 'readonly'); $crud->field_type('clave', 'password'); $crud->field_type('id_cliente', 'hidden'); $crud->field_type('id_nivel', 'hidden'); $crud->field_type('row_id', 'hidden'); $crud->field_type('id_estatus', 'hidden'); $crud->set_field_upload('foto', 'assets/uploads/users/'); $output = $crud->render(); $data['titulo'] = "CONFIGURACION DE USUARIO"; $this->load->view('include/head', $output); $this->load->view('include/header', $data); $this->load->view('admin/output'); $this->load->view('include/footer', $data); $this->load->view('admin/librerias'); } }
public function index() { //$data['main_content'] = 'login_form'; //$this->load->view('includes/template',$data); //$this->load->view('admin/configuration'); //$this->load->view('admin/homepage'); $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('ips_ordertracking'); $crud->set_subject('Sales Tracking'); $crud->required_fields('NAME'); $crud->columns('ordertrackingid', 'orderid', 'name', 'orderdate'); // $crud->columns('fullfillment','orderdate','orderid','returnid','itemrece','caseid','product','status'); //$crud->fields('ordertrackingid','orderid','name','orderdate'); $crud->callback_column('ordertrackingid', array($this, '_callback_webpage_url')); $crud->callback_column('orderdate', array($this, '_callback_dateformat')); // $crud->fields('NAME'); // $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); // $crud->callback_after_insert(array($this, 'fullfillmentid_generation')); $output = $crud->render(); $state = $crud->getState(); if ($state == 'add') { redirect('store/addtracking'); } // $this->grocery_crud->set_table('ips_login'); // $output = $this->grocery_crud->render(); $this->_example_output($output); }
function perfil() { $crud = new grocery_CRUD(); $crud->where('row_id', $this->session->userdata('user_id')); $crud->set_table('usuarios'); $crud->set_theme('datatables'); $crud->set_language('spanish'); $crud->set_subject('Usuario'); $state = $crud->getState(); if ($state == 'list' || $state == 'success') { redirect('user/dashboard'); } else { $crud->unset_add(); $crud->unset_delete(); $crud->field_type('usuario', 'readonly'); $crud->field_type('clave', 'password'); $crud->field_type('id_nivel', 'hidden'); $crud->field_type('row_id', 'hidden'); $crud->field_type('id_estatus', 'hidden'); $crud->set_field_upload('foto', 'assets/uploads/users/'); $output = $crud->render(); $data['titulo'] = "Configuración de Usuario"; $this->load->view('include/head'); $this->load->view('include/header'); $this->load->view('include/sidebar'); $this->load->view('admin/main', $data); $this->load->view('admin/grocery_crud', $output); $this->load->view('include/footer'); } }
public function index() { //$data['main_content'] = 'login_form'; //$this->load->view('includes/template',$data); //$this->load->view('admin/configuration'); //$this->load->view('admin/homepage'); $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('ips_disposition'); $crud->set_subject('Disposition'); $crud->required_fields('NAME'); $crud->columns('NAME', 'DISABLE'); $crud->fields('NAME'); // $crud->unset_add(); // $crud->unset_edit(); $crud->unset_delete(); $crud->set_lang_string('insert_success_message', 'Your data has been successfully stored into the database.<br/>Please wait while you are redirecting to the list page. <script type="text/javascript"> window.location = "' . site_url('admin/disposition') . '"; </script> <div style="display:none"> '); $crud->callback_after_insert(array($this, 'disposition_generation')); $output = $crud->render(); // $this->grocery_crud->set_table('ips_login'); // $output = $this->grocery_crud->render(); $this->_example_output($output); }
public function enfants_window($id) { $this->id_demande = $id; try { $crud = new grocery_CRUD(); $crud->set_language("french"); $crud->set_theme('bootstrap'); $crud->where('id_from_demande', $this->id_demande); $crud->set_table('sos_enfants'); $crud->set_subject('Enfant'); $crud->unset_add(); $crud->unset_delete(); $crud->field_type('id_from_demande', 'hidden', $this->id_demande); $crud->unset_edit_fields('id_from_kids'); $crud->set_relation('id_from_kids', 'sos_kids', "id_kid"); $crud->set_relation('recu', 'sos_gen_recu', "name_recu", null, 'name_recu ASC'); $crud->set_relation_n_n('accompagniement', 'sos_relation_accompagniement_kid', 'sos_gen_accompagniement_kid', 'id_from_enfants', 'id_from_accompagniement_kid', 'name_accompagniement_kid'); $crud->set_relation_n_n('activite', 'sos_relation_activite_kid', 'sos_gen_activite_kid', 'id_from_enfants', 'id_from_activite_kid', 'name_activite_kid'); $crud->columns('enfant', 'recu', 'activite', 'accompagniement', 'commentaire_enfant'); //$crud->display_as('id_from_kids', 'Enfants'); $crud->display_as('accompagniement', 'Accompagnement'); $crud->display_as('activite', 'Activité'); $crud->display_as('recu', 'Reçu'); $crud->display_as('id_from_kids', 'Enfant(s)'); $crud->display_as('commentaire_enfant', 'Commentaire enfant'); $crud->callback_column('accompagniement', array($this, 'accompagniement')); $crud->callback_column('activite', array($this, 'activite')); $crud->callback_column('enfant', array($this, 'enfant')); $crud->required_fields('recu'); $output = $crud->render(); $this->db->where('id_demande', $this->id_demande); $query = $this->db->get('sos_demande'); if ($query->num_rows == 1) { $row_demande = $query->row(); } // $my_demande = $row_demande->id_from_demande; $menu = new stdClass(); $menu->n3 = true; //$menu->id_1 = $my_demande; $menu->id = $row_demande->id_from_femme; $menu->status = $this->session->userdata('status'); $this->db->where('id_femme', $menu->id); $query = $this->db->get('sos_femme'); if ($query->num_rows == 1) { $row_femme = $query->row(); } $header = $this->navigation->home_f($menu) . ' ' . '<p><pre>' . $row_femme->prenom . ' ' . $row_femme->nom . ' ' . $row_femme->nom_marital . '</pre></p>'; $data = array('output' => $output, 'header' => $header); $this->_example_output($data); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
public function index() { $bol_del_before_date = $this->m_conndb->dateBeforeDelete(); try { $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('tempahan'); $crud->set_subject('Booking Room'); $crud->set_relation('m_id', 'masa', 'm_desc'); $crud->set_relation('bm_id', 'bilik_meeting', 'bm_desc'); $crud->display_as('t_datereg', 'Date Reg.')->display_as('t_date', 'Book Date')->display_as('t_day', 'Book Day')->display_as('m_id', 'Time')->display_as('t_perkara', 'Club / Item')->display_as('bm_id', 'Meeting Room')->display_as('t_status', 'Status'); $crud->columns('t_date', 't_day', 'm_id', 't_perkara', 'bm_id'); $crud->fields('t_date', 'm_id', 't_perkara', 'bm_id', 't_datereg', 't_day'); $crud->field_type('t_datereg', 'hidden'); $crud->field_type('t_day', 'hidden'); $crud->required_fields('t_date', 'm_id', 't_perkara', 'bm_id'); $umaq = $this->uri->segment(3); if (!($this->uri->segment(3) && $umaq == 'umaqkacak')) { $crud->unset_delete(); $crud->unset_edit(); } $crud->callback_before_insert(array($this, 'setAutoTempahan')); $output = $crud->render(); $this->viewpage('v_bookroom', $output); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
public function index() { try { // General $crud = new grocery_CRUD(); $crud->set_language("french"); $crud->set_theme('bootstrap'); $crud->set_table('sos_gen_service'); $crud->set_subject('Service'); //relations //Master/child relations //Visual $crud->columns('id_service', 'nom_service'); $crud->display_as('nom_service', 'Service'); $crud->order_by('nom_service', 'desc'); //unsets //Requireds $crud->required_fields('nom_service'); //Callbacks //field Types // Actions $crud->unset_delete(); // Renders $output = $crud->render(); $menu = new stdClass(); $menu->n1 = true; $menu->lien3_6 = false; $menu->status = $this->session->userdata('status'); $header = $this->navigation->home_f($menu); $data = array('output' => $output, 'header' => $header); $this->_example_output($data); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
public function index($nombre_tabla = null) { $this->is_login(); $id_grupo_usuario = (array) reset($this->ion_auth->get_users_groups($this->user->id)->result()); // donde 1 es admin, 2 es ministerio, 3 el coordinador, 4 digitador, 5 externo if (in_array($id_grupo_usuario['id'], array(1, 2, 3, 4))) { if (!empty($nombre_tabla)) { // correr el procedimiento almacenado $this->load->model('tabla_model'); $this->tabla_model->correr_procedimiento_almacenado($nombre_tabla); try { $crud = new grocery_CRUD(); $crud->set_theme('flexigrid-inline-edit'); $crud->set_table($nombre_tabla); // $crud->unset_edit(); $crud->unset_delete(); $output = $crud->render(); $this->_example_output($output); } catch (Exception $e) { echo "el nombre de tabla no es valida"; } } else { redirect('/', 'refresh'); } } else { redirect('/', 'refresh'); } }
public function index() { $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->set_table('booking_refunds'); $crud->set_subject('Booking Refund'); $crud->unset_add(); $crud->unset_delete(); // $crud->unset_columns('booking_ref_no'); $crud->unset_fields('booking_ref_no'); $crud->field_type('refund_status', 'dropdown', array('1' => 'Requested', '0' => 'Rejected', '2' => 'Refunded')); // $crud->field_type('refund_status', 'dropdown', array('1'=>'Requested', '0'=>'Rejected', '2' => 'Refunded')); // $crud->callback_column('refund_status', function($value, $primary_key){ // $status = array('1'=>'Requested', '0'=>'Rejected', '2' => 'Refunded'); // return $status[$value]; // }); $crud->field_type('item_type', 'readonly'); $crud->callback_column('item_type', function ($value, $primary_key) { return ucfirst($value); }); $crud->callback_edit_field('item_type', function ($value, $primary_key) { return ucfirst($value); }); // $crud->callback_before_update(array($this, 'modified_date_callback')); $crud->callback_column('booking_ref_no', array($this, '_show_invoice')); $output = $crud->render(); $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Booking Refund', 'pagedesc' => 'Booking Refund', 'contenttitle' => 'Booking Refund List Records'); $this->load->view('gc_admin_wrapper', $data); }
function timeslots_categories_management() { $crud = new grocery_CRUD(); $crud->set_table('bloques_categorias'); $crud->set_subject('Categoria'); $crud->columns('nombre', 'ab'); $crud->unset_delete(); $output = $crud->render(); $this->_output_crud($output, 'Categorias'); }
function stages_management() { $crud = new grocery_CRUD(); $crud->set_table('procesos'); $crud->set_subject('Proceso'); $crud->unset_delete(); $crud->unset_edit(); $output = $crud->render(); $this->_output_crud($output, 'Procesos'); }
public function orders_management() { $crud = new grocery_CRUD(); $crud->set_relation('customerNumber', 'customers', '{contactLastName} {contactFirstName}'); $crud->display_as('customerNumber', 'Customer'); $crud->set_table('orders'); $crud->set_subject('Order'); $crud->unset_add(); $crud->unset_delete(); $output = $crud->render(); $this->_example_output($output); }
function shift_management() { $crud = new grocery_CRUD(); $crud->set_table('turnos_tipos'); $crud->set_subject('Trunos'); $crud->columns('nombre', 'desde', 'hasta'); $crud->display_as('desde', 'Desde 24 Hrs'); $crud->display_as('hasta', 'Hasta 24 Hrs'); $crud->required_fields('nombre', 'desde', 'hasta'); $crud->unset_delete(); $output = $crud->render(); $this->_output_crud($output, 'Turnos'); }
function ventas() { $crud = new grocery_CRUD(); $crud->set_table('ventas'); $crud->set_relation('producto', 'productos', 'item_name'); $crud->set_relation('unitario', 'productos', 'precio'); $crud->display_as('valor', 'Total'); $crud->unset_add(); $crud->unset_delete(); $crud->unset_edit(); $output = $crud->render(); $this->load->view('main/ventas', $output); }
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); }
function machines_management() { $crud = new grocery_CRUD(); $crud->set_table('maquinas'); $crud->set_theme('datatables'); $crud->columns('nombre', 'procesos'); $crud->edit_fields('nombre', 'procesos'); $crud->add_fields('nombre', 'procesos'); $crud->set_subject('Maquina'); $crud->set_relation_n_n('procesos', 'maquinas_procesos', 'procesos', 'id_maquina', 'id_proceso', 'nombre'); $crud->unset_delete(); $output = $crud->render(); $this->_output_crud($output, 'Maquinas'); }
public function index() { $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->set_table('ratings'); $crud->set_subject('Ratings'); $crud->display_as('rating_id', 'Package / Hotel Name'); $crud->callback_column('rating_id', array($this, 'set_package_or_hotel')); $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); $output = $crud->render(); $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Ratings', 'pagedesc' => 'Ratings'); $this->load->view('gc_admin_wrapper', $data); }
public function index() { $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->set_table('clients'); $crud->set_subject('Clients'); $crud->unset_fields('client_id'); $crud->unset_columns('client_id'); // $crud->unset_columns('package_thingsToConsider'); // $crud->unset_columns('package_weatherCondition'); // $crud->unset_columns('package_itinerary'); // $crud->display_as('client_postcode', 'Post Code'); $crud->display_as('client_phoneNumber', 'Phone Number'); $crud->display_as('client_emailId', 'Email ID'); $crud->display_as('client_firstName', 'First Name'); $crud->display_as('client_lastName', 'Last Name'); // $crud->set_field_upload('package_image', $this->upload_path); // $crud->unique_fields('package_slug'); // // $crud->set_relation('package_agent', 'agents', '{agent_companyName}'); // // $crud->callback_column('package_image', array($this, 'set_image')); // $crud->callback_column('package_cost', array($this, 'set_price')); // // $crud->callback_add_field('package_cost', array($this, 'add_price1')); // $crud->callback_edit_field('package_cost', array($this, 'edit_price1')); // $crud->callback_column('package_status', array($this, 'set_change_status')); // $crud->unset_columns('package_status'); // $crud->add_action('change Status', '', '/change_status'); // $crud->add_action('Change Status', './assets/grocery_crud/themes/flexigrid/css/images/add.png', 'packages/change_status'); // $crud->add_action('package_status', '', '','ui-icon-image',array($this,'just_a_test')); // $crud->add_action('package_status', '', '','ui-icon-image',array($this,'just_a_test')); // $crud->set_lang_string('insert_success_message', // 'Your data has been successfully stored into the database.<br/>Please wait while you are redirecting to the list page. // <script type="text/javascript"> // window.location = "'.site_url(strtolower(__CLASS__).'/'.strtolower(__FUNCTION__)).'"; // </script> // <div style="display:none"> // ' // ); $crud->unset_add(); $crud->unset_delete(); $output = $crud->render(); $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Clients', 'pagedesc' => 'Clients', 'contenttitle' => 'Clients List Records'); // redirect(base_url()); $this->load->view('gc_admin_wrapper', $data); }
public function pengaturan() { $crud = new grocery_CRUD(); $crud->set_table('pengaturan'); $crud->unset_add(); $crud->unset_delete(); $crud->unset_read(); $output = $crud->render(); //Config Halaman $output->judul_besar = 'Pengaturan'; $output->judul_kecil = 'Manage Pengaturan'; $output->m_pengaturan = TRUE; // echo $this->Absensi_model->get_status_mesin(); //$this->Absensi_model->get_data_absen(); $this->_example_output($output); }
public function history() { $crud = new grocery_CRUD(); $crud->set_table('pengiriman'); // $crud->columns('nama','username','email'); $crud->set_relation('id_member', 'members', 'username'); $crud->display_as('id_member', 'Username'); $crud->unset_export(); $crud->unset_print(); $crud->unset_add(); $crud->unset_delete(); $crud->unset_edit(); $output = $crud->render(); $output->title = 'History Pengiriman'; $this->template->load('template/template_main', 'admin/history_pengiriman', $output); }
public function createtable($db) { $this->db = $this->load->database($db, true); $crud = new grocery_CRUD(); $crud->set_table('alert_logger'); $crud->set_primary_key('id'); $crud->columns('alert', 'all_alg_data', 'all_alg_file_data', 'toa', 'alert_name', 'status', 'del'); $crud->display_as('alert', 'Alert')->display_as('all_alg_file_data', 'ALG File.')->display_as('all_alg_data', 'ALG Ref.')->display_as('toa', 'Date')->display_as('alert_name', 'Name')->display_as('del', 'Deletion date'); $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); $crud->callback_column('status', array($this, '_column_status')); $output = $crud->render(); $this->db->close(); $this->_example_output($output); }
public function generarCobertura() { $tipo = array('0' => 'No Notificó', '1' => 'Notificó', '2' => 'Not. Negativa'); $crud = new grocery_CRUD(); $crud->columns('ano', 'semana', 'ndiresa', 'nred', 'nmicrored', 'nestablec', 'notificacion', 'fecha', 'hora'); $crud->set_table('cobertura'); $crud->set_subject('Proceso'); switch ($this->session->userdata('nivel')) { case 5: $where = array('diresa' => $this->session->userdata('diresa')); break; case 6: $where = array('diresa' => $this->session->userdata('diresa'), 'red' => $this->session->userdata('red')); break; case 7: $where = array('diresa' => $this->session->userdata('diresa'), 'red' => $this->session->userdata('red'), 'microred' => $this->session->userdata('microred')); break; default: $this->session->set_flashdata('error', 'Este proceso no está permitido para su nivel de usuario'); redirect(site_url("backend/index/principal"), 301); break; } $crud->field_type('notificacion', 'dropdown', $tipo); $crud->display_as('establec', 'Establecimiento'); $crud->display_as('notificacion', 'Notificación'); $crud->display_as('ndiresa', 'Diresa'); $crud->display_as('nred', 'Red'); $crud->display_as('nmicrored', 'Microred'); $crud->display_as('nestablec', 'Establecimiento'); $crud->where($where); $crud->change_field_type('ano', 'readonly'); $crud->change_field_type('semana', 'readonly'); $crud->change_field_type('diresa', 'readonly'); $crud->change_field_type('red', 'readonly'); $crud->change_field_type('microred', 'readonly'); $crud->change_field_type('establec', 'readonly'); //$crud->unset_read(); //$crud->unset_edit(); $crud->unset_delete(); $crud->unset_print(); $crud->unset_add(); /////////////////////////////////////////////////////////////////////////////// $crud->add_action_peru('Añadir Proceso', '', 'proceso', 'add-icon'); /////////////////////////////////////////////////////////////////////////////// $output = $crud->render(); $this->_example_output1($output); }
public function orders_management() { $crud = new grocery_CRUD(); $crud->set_relation('customerNumber', 'customers', '{contactLastName} {contactFirstName}'); $crud->display_as('customerNumber', 'Customer'); $crud->set_table('orders'); $crud->set_subject('Order'); $crud->unset_add(); $crud->unset_delete(); $crud->unset_columns('comments'); $output = $crud->render(); $data['judul'] = 'Orders'; $data['crumb'] = array('Orders' => ''); $template = 'admin_template'; $view = 'grocery'; $this->outputview->output_admin($view, $template, $data, $output); }
public function psy_window($id) { $this->id_femme = $id; try { // General $crud = new grocery_CRUD(); $crud->set_language("french"); $crud->set_theme('bootstrap'); $crud->where('id_from_femme', $this->id_femme); $crud->set_table('sos_psy'); $crud->set_subject('Accompagnement Psychologique'); //relations $crud->set_relation_n_n('troubles_physiologiques', 'sos_relation_troubles_physiologiques', 'sos_gen_troubles_physiologiques', 'id_from_psy', 'id_from_troubles_physiologiques', 'name_troubles_physiologiques', 'priority'); $crud->set_relation_n_n('troubles_cognitifs', 'sos_relation_troubles_cognitifs', 'sos_gen_troubles_cognitifs', 'id_from_psy', 'id_from_troubles_cognitifs', 'name_troubles_cognitifs', 'priority'); $crud->set_relation_n_n('troubles_emotionnels', 'sos_relation_troubles_emotionnels', 'sos_gen_troubles_emotionnels', 'id_from_psy', 'id_from_troubles_emotionnels', 'name_troubles_emotionnels', 'priority'); //Visual $crud->columns('troubles_physiologiques', 'troubles_cognitifs', 'troubles_emotionnels'); $crud->display_as('troubles_emotionnels', 'Troubles émotionnels'); //unsets $crud->unset_delete(); $crud->unset_add(); //Requireds //Callbacks $crud->callback_column('troubles_physiologiques', array($this, 'troubles_physiologiques')); $crud->callback_column('troubles_cognitifs', array($this, 'troubles_cognitifs')); $crud->callback_column('troubles_emotionnels', array($this, 'troubles_emotionnels')); //field Types $crud->field_type('id_from_femme', 'hidden', $this->id_femme); // Actions // Renders $output = $crud->render(); $menu = new stdClass(); $menu->n1 = true; $menu->status = $this->session->userdata('status'); $this->db->where('id_femme', $this->id_femme); $query = $this->db->get('sos_femme'); if ($query->num_rows == 1) { $row_femme = $query->row(); } $header = $this->navigation->home_f($menu) . ' ' . '<p><pre>' . $row_femme->prenom . ' ' . $row_femme->nom . ' ' . $row_femme->nom_marital . '</pre></p>'; $data = array('output' => $output, 'header' => $header); $this->_example_output($data); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
function users_management() { $crud = new grocery_CRUD(); $crud->set_table('operarios'); $crud->set_subject('Usuario'); $crud->set_theme('datatables'); $crud->columns('id', 'nombre'); $crud->edit_fields('nombre', 'clave', 'eliminado'); $crud->add_fields('id', 'nombre', 'clave'); $crud->required_fields('id', 'nombre', 'clave'); $crud->change_field_type('clave', 'password'); $crud->callback_before_insert(array($this, '_encrypt_password_callback')); $crud->callback_before_update(array($this, '_encrypt_password_callback')); $crud->unset_delete(); $output = $crud->render(); $this->_output_crud($output, 'Usuarios'); }
function users($page) { try { $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('users'); $crud->set_relation('ut_id', 'user_type', 'ut_desc'); $crud->set_relation('u_status', 'stats', 's_desc'); $crud->display_as('u_fullname', 'Full Name')->display_as('u_username', 'Username')->display_as('u_password', 'Password')->display_as('ut_id', 'User Type')->display_as('u_status', 'Status'); $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); $output = $crud->render(); $this->_example_output($page, $output); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
function receipts() { session_start(); if (!is_null($_SESSION['fromLogin']) && in_array($_SESSION['email'], array('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**'))) { } else { header("Location: http://www.faizstudents.com/users/login.php"); } $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('receipts'); if ($_SESSION['email'] == '*****@*****.**') { $crud->unset_edit(); $crud->unset_delete(); } $crud->columns('Receipt_No', 'Thali_No', 'Amount', 'Date'); $output = $crud->render(); $this->_example_output($output); }
public function index() { $crud = new grocery_CRUD(); $crud->set_table('web_identitas'); $crud->columns('nama_website', 'meta_deskripsi', 'meta_keyword', 'favicon', 'theme', 'logo'); $crud->required_fields('nama_website', 'meta_deskripsi', 'meta_keyword'); $crud->set_subject('Identitas Website'); $crud->fields('nama_website', 'meta_deskripsi', 'meta_keyword', 'copyright', 'favicon', 'theme', 'logo', 'google_analytics', 'profil'); $crud->set_field_upload('favicon', 'assets/uploads/identitas'); $crud->set_field_upload('logo', 'assets/uploads/identitas'); $crud->unset_texteditor('google_analytics', 'full_text'); $crud->unset_add(); $crud->unset_delete(); $output = $crud->render(); $data['subject'] = 'Identitas Website'; $data['content'] = $this->load->view('crud.php', $output, true); $this->load->view('base_theme', $data); }
function salidas() { if ($this->session->userdata('id')) { try { /* Creamos el objeto */ $crud = new grocery_CRUD(); /* Seleccionamos el tema */ $crud->set_theme('flexigrid'); /* Seleccionmos el nombre de la tabla de nuestra base de datos*/ $crud->set_table('salida'); /* Le asignamos un nombre */ $crud->set_subject('Salidas de productos'); $crud->set_relation('producto', 'productos', 'nombre'); $crud->set_relation('cliente', 'clientes', 'nombre'); //$crud->display_as('proveedor','Proveedor'); //$crud->set_subject('productos'); /* Asignamos el idioma español */ $crud->set_language('spanish'); /* Aqui le decimos a grocery que estos campos son obligatorios */ $crud->required_fields('producto', 'cantidad', 'cliente', 'folio', 'comentarios', 'precio', 'total'); /* Aqui le indicamos que campos deseamos mostrar */ $crud->columns('id', 'producto', 'cantidad', 'cliente', 'folio', 'comentarios', 'precio', 'total'); $crud->callback_column('precio', array($this, 'valuePeso')); $crud->callback_column('total', array($this, 'valuePeso')); $crud->callback_before_insert(array($this, 'checking_post_cantidad')); $crud->unset_delete(); $crud->unset_edit(); $crud->unset_export(); //$crud->add_action('Smileys', 'http://www.grocerycrud.com/assets/uploads/general/smiley.png', 'demo/action_smiley'); //$crud->callback_edit_field('cantidad',array($this,'edit_field_callback_1')); //$crud->callback_add_field('cantidad',array($this,'edit_field_callback_2')); /* Generamos la tabla */ $output = $crud->render(); /* La cargamos en la vista situada en /applications/views/productos/administracion.php */ $this->_example_output($output); } catch (Exception $e) { /* Si algo sale mal cachamos el error y lo mostramos */ show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } } else { redirect('Login'); } }
public function index($log_type = NULL) { $this->load->model('shared/log_model'); $this->config->load('grocery_crud'); $this->config->set_item('grocery_crud_character_limiter', 0); $crud = new grocery_CRUD(); if ($crud->getState() == 'list') { // get all known log types $log_types = $this->log_model->get_log_types(); $this->views['content'] = $this->load->view('admin/log/action_selector', array('log_types' => $log_types, 'selected_log_type' => $log_type), TRUE); $this->javascript[] = $this->load->view('admin/log/js/action_selector.js', NULL, TRUE); } if (!is_null($log_type) && $log_type != 'ajax_list' && $log_type != 'export' && $log_type != 'print' && $log_type != 'ajax_list_info') { $crud->where(array('action' => $log_type)); $crud->unset_columns('action'); } $crud->set_theme('bootstrap'); $crud->set_table('log'); $crud->set_subject('Logs'); // Op twee velden orderen. Grocerycrud houd zich niet aan de Codeigniter active record // maar dit werkt. $crud->order_by('date_created desc, id', 'desc'); $crud->columns('date_created', 'action', 'message', 'user_id'); $crud->set_relation('user_id', 'user', 'screen_name'); $crud->display_as('user_id', 'Gebruiker'); $crud->display_as('date_created', 'Tijd'); $crud->display_as('action', 'Actie'); $crud->display_as('message', 'Bericht'); $crud->display_as('ip_hash', 'IP-hash'); $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); // render the crud HTML $crud_output = $crud->render(); //get the needed css and javascript files $this->javascript_files = $crud->get_js_files(); $this->css_files = $crud->get_css_files(); if (isset($this->views['content'])) { $this->views['content'] .= $crud_output->output; } else { $this->views['content'] = $crud_output->output; } $this->_layout(); }