当前位置: 首页>>代码示例>>PHP>>正文


PHP grocery_CRUD::unset_fields方法代码示例

本文整理汇总了PHP中grocery_CRUD::unset_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::unset_fields方法的具体用法?PHP grocery_CRUD::unset_fields怎么用?PHP grocery_CRUD::unset_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grocery_CRUD的用法示例。


在下文中一共展示了grocery_CRUD::unset_fields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 /**
  * function ni digunakan untuk kv urus maklumat pengguna pada crud
  * input: -
  * author: Mior Mohd Hanif
  * Date: 28 Jun 2013
  * Modification Log:
  */
 function user_management()
 {
     $user_login = $this->ion_auth->user()->row();
     $col_id = $user_login->col_id;
     $crud = new grocery_CRUD();
     $crud->where('user.col_id', $col_id);
     $crud->set_theme('flexigrid');
     $crud->set_subject('Pengguna');
     $crud->set_table('user');
     $crud->display_as('user_name', 'Nama Pengguna')->display_as('user_username', 'Katanama')->display_as('user_password', 'Katalaluan')->display_as('user_email', 'Email')->display_as('col_id', 'Kolej')->display_as('created_on', 'Tarikh Daftar')->display_as('last_login', 'Tarikh Log Masuk')->display_as('active', 'Status')->display_as('phone', 'No. Telefon');
     $crud->set_relation('col_id', 'college', 'col_name');
     $crud->required_fields('user_name', 'user_username', 'user_password', 'user_email', 'active', 'phone');
     $crud->set_rules('user_username', 'Katanama', 'trim|required');
     $crud->set_rules('phone', 'No. Telefon', 'trim|required|numeric');
     $crud->set_rules('user_email', 'Email', 'trim|required|valid_email');
     $crud->unset_columns('ip_address', 'user_password', 'salt', 'activation_code', 'forgotten_password_code', 'forgotten_password_time', 'remember_code');
     $crud->unset_fields('ip_address', 'activation_code', 'forgotten_password_code', 'forgotten_password_time', 'remember_code', 'last_login');
     $crud->change_field_type('user_password', 'password');
     $crud->change_field_type('created_on', 'invisible');
     $crud->change_field_type('salt', 'invisible');
     $crud->change_field_type('col_id', 'invisible');
     $crud->callback_before_insert(array($this, 'callback_for_time_and_encrypt_password'));
     $crud->callback_column('created_on', array($this, 'strtotime_convert_to_date'));
     $crud->callback_column('last_login', array($this, 'strtotime_convert_to_date'));
     $output = $crud->render();
     $header = "<legend><h4>Penyelenggaraan Pengguna</h4></legend>";
     $this->_main_output($output, $header);
 }
开发者ID:NeroJz,项目名称:ekv,代码行数:35,代码来源:management.php

示例2: index

 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);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:29,代码来源:refund.php

示例3: array

 function list_all()
 {
     $crud = new grocery_CRUD();
     $crud->set_table('student');
     $crud->set_subject('Student');
     $crud->unset_fields('cc_id', 'stu_group');
     $crud->columns('stu_name', 'stu_mykad', 'stu_matric_no', 'callback_course', 'stu_gender', 'stu_race', 'stu_religion');
     $crud->callback_column('callback_course', array($this, 'fcallback_course'));
     $crud->display_as('callback_course', 'Course');
     $output = $crud->render();
     $this->_main_output($output, null);
 }
开发者ID:NeroJz,项目名称:ekv,代码行数:12,代码来源:student_management.php

示例4: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('datatables');
     $crud->set_table('banner')->set_subject('Banners')->columns('imagen');
     $crud->required_fields('imagen');
     $crud->set_field_upload('imagen', 'assets/uploads/files');
     $crud->unset_fields('fecha');
     $crud->unset_print();
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:facundonegoci,项目名称:mtkstock,代码行数:12,代码来源:banners.php

示例5: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('datatables');
     $crud->set_table('categoria')->set_subject('categoria')->columns('nombre');
     $crud->required_fields('nombre');
     $crud->unique_fields('nombre');
     $crud->unset_texteditor('descripcion', 'full_text');
     $crud->unset_fields('fecharegistro');
     $crud->unset_print();
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:facundonegoci,项目名称:mtkstock,代码行数:13,代码来源:categorias.php

示例6: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('datatables');
     $crud->set_table('clientes')->set_subject('Clientes')->columns('nombre');
     $crud->required_fields('nombre');
     $crud->unique_fields('nombre');
     $crud->unset_fields('fecharegistro');
     $crud->unset_print();
     $crud->set_field_upload('imagen', 'assets/uploads/files');
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:facundonegoci,项目名称:mtkstock,代码行数:13,代码来源:clientes.php

示例7: 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);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:51,代码来源:bookings.php

示例8: index

 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);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:48,代码来源:clients.php

示例9: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('datatables');
     $crud->set_table('pedidos')->set_subject('Pedidos')->columns('fecharegistro', 'idcliente', 'formadepago', 'montototal');
     //$crud -> required_fields('titulo', 'fechainicio', 'habilitado');
     //$crud -> unique_fields('nombre','categoria');
     //$crud -> set_field_upload('imagen', 'assets/uploads/files');
     $crud->unset_texteditor('descripcion', 'full_text');
     $crud->set_relation_n_n('productos', 'items', 'producto', 'idpedido', 'idproducto', 'nombre', 'priority');
     $crud->display_as('montototal', 'Monto');
     $crud->display_as('nombrecliente', 'Nombre cliente');
     $crud->display_as('apellido', 'Apellido cliente');
     $crud->display_as('formadepago', 'Forma de pago');
     $crud->display_as('idcliente', 'Cliente');
     $crud->unset_fields('fecharegistro');
     $crud->unset_print();
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:facundonegoci,项目名称:mtkstock,代码行数:20,代码来源:pedidos.php

示例10:

 function enable_crud($table = '')
 {
     // get config file
     $this->config->load('crud');
     $params = $this->config->item('grocery_crud');
     // create CRUD object
     $this->load->library('grocery_CRUD');
     $crud = new grocery_CRUD();
     // basic settings
     if (!empty($table)) {
         $crud->set_table($table);
         $crud->set_subject(humanize(singular($table)));
     }
     // general settings
     $crud->unset_jquery();
     $crud->unset_print();
     $crud->unset_export();
     // hide fields from CRUD form
     $crud->unset_fields($params['unset_fields']);
     // other custom logic to be done in child controllers
     return $crud;
 }
开发者ID:hansenmakangiras,项目名称:ci_bootstrap,代码行数:22,代码来源:MY_Controller.php

示例11: demarche_window

 public function demarche_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_demarche', $id);
         $crud->set_table('sos_demarche');
         $crud->set_subject('Démarche');
         //relations
         //
         $crud->set_relation('first', 'sos_gen_demarche_first', 'name_demarche_first');
         $crud->set_relation('second', 'sos_gen_demarche_second', 'name_demarche_second');
         $crud->set_relation('third', 'sos_gen_demarche_third', 'name_demarche_third');
         $crud->set_relation_n_n('ordonnance_de_protection', 'sos_relation_ordonnance_de_protection', 'sos_gen_ordonnance_de_protection', 'id_from_demarche', 'id_from_ordonnance_de_protection', 'name_ordonnance_de_protection');
         $crud->set_relation_n_n('suites_de_plainte', 'sos_relation_suites_de_plainte', 'sos_gen_suites_de_plainte', 'id_from_demarche', 'id_from_suites_de_plainte', 'name_suites_de_plainte', 'priority');
         //Master/child relations
         //
         $fields_demarche = array('first' => array('table_name' => 'sos_gen_demarche_first', 'title' => 'name_demarche_first', 'relate' => null), 'second' => array('table_name' => 'sos_gen_demarche_second', 'title' => 'name_demarche_second', 'id_field' => 'id_demarche_second', 'relate' => 'id_from_demarche_first', 'data-placeholder' => 'Préciser'), 'third' => array('table_name' => 'sos_gen_demarche_third', 'title' => 'name_demarche_third', 'id_field' => 'id_demarche_third', 'relate' => 'id_from_demarche_second', 'data-placeholder' => 'Préciser'));
         // 'url' => base_url() . 'index.php/demarche/window_demarche/'. $this->id_femme.'/',
         $config_demarche = array('main_table' => 'sos_demarche', 'main_table_primary' => 'id_demarche', 'url' => base_url() . 'index.php/demarche/demarche_window/');
         $categories_demarche = new gc_dependent_select($crud, $fields_demarche, $config_demarche);
         $js_demarche = $categories_demarche->get_js();
         //Visual
         $crud->columns('date_entry', 'date_evenement', 'demarche', 'commentaire', 'upload', 'file_url', 'ordonnance_de_protection', 'suites_de_plainte');
         $crud->display_as('upload', 'Type du Document');
         $crud->display_as('file_url', 'Document');
         $crud->display_as('date_evenement', 'Date évenement');
         $crud->display_as('first', 'Type de démarche');
         $crud->display_as('second', 'Type d\'intervention');
         $crud->display_as('third', 'Suites');
         $crud->display_as('date_entry', 'Date de saisie');
         //unsets
         $crud->unset_fields('file_url', 'date_entry');
         if (!$this->session->userdata('status')) {
             $crud->unset_export();
             $crud->unset_print();
         }
         //Requireds
         $crud->required_fields('first');
         //Callbacks
         $crud->callback_before_update(array($this, 'before_update'));
         $crud->callback_after_update(array($this, 'insert_after_update'));
         $crud->callback_after_insert(array($this, 'insert_after_insert'));
         $crud->callback_column('demarche', array($this, 'demarche'));
         $crud->callback_column('commentaire', array($this, 'commentaire'));
         $crud->callback_column('ordonnance_de_protection', array($this, 'ordonnance_de_protection'));
         $crud->callback_column('suites_de_plainte', array($this, 'suites_de_plainte'));
         $crud->callback_column('date_entry', array($this, 'date_entry'));
         //field Types
         $crud->field_type('id_from_femme_demarche', 'hidden', $this->id_femme);
         $crud->field_type('id_user', 'hidden', $this->session->userdata('userid'));
         if (!is_dir($path = 'assets/uploads/files/image_' . $this->id_femme)) {
             mkdir($path = 'assets/uploads/files/image_' . $this->id_femme);
         }
         $crud->set_field_upload('file_url', 'assets/uploads/files/image_' . $this->id_femme);
         $this->db->where('id_from_femme', $this->id_femme);
         $results = $this->db->get('sos_upload')->result();
         $upload_multiselect = array();
         foreach ($results as $result) {
             $text_to_show = "";
             $this->db->where('id_type_uploads_parrent', $result->type_uploads);
             $query_type_uploads = $this->db->get('sos_gen_type_uploads_parrent');
             if ($query_type_uploads->num_rows == 1) {
                 $row_type_uploads = $query_type_uploads->row();
                 $text_to_show .= $row_type_uploads->name_type_uploads_parrent;
             }
             $this->db->where('id_type_uploads_child', $result->detailles);
             $query_type_uploads_child = $this->db->get('sos_gen_type_uploads_child');
             if ($query_type_uploads_child->num_rows == 1) {
                 $row_type_uploads_child = $query_type_uploads_child->row();
                 $text_to_show .= '->' . $row_type_uploads_child->name_type_uploads_child;
             }
             $text_to_show .= ' le ' . $result->date_entry;
             $upload_multiselect[$result->id_upload] = $text_to_show;
         }
         if (count($upload_multiselect)) {
             $crud->field_type('upload', 'dropdown', $upload_multiselect);
         } else {
             $crud->field_type('upload', 'hidden', '');
         }
         // Actions
         // Renders
         $output = $crud->render();
         $output->output .= $js_demarche;
         $menu = new stdClass();
         $menu->n1 = true;
         $menu->status = false;
         $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) {
//.........这里部分代码省略.........
开发者ID:simplonco,项目名称:sos_femmes,代码行数:101,代码来源:demarche.php

示例12: demande_window

 public function demande_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', $id);
         $crud->set_table('sos_demande');
         $crud->set_subject('Intervention');
         $crud->display_as('date_entry', 'Date de saisie');
         $crud->display_as('accueil_dem', 'Accueil');
         $crud->display_as('accompagnement_specialise', 'Accompagnement spécialisé');
         //relations
         $crud->set_relation('femme', 'sos_gen_demande_femme', 'name_demande_femme');
         $crud->set_relation('accueil_dem', 'sos_gen_demande_accueil', 'name_demande_accueil');
         $crud->set_relation_n_n('lieu_ressource', 'sos_relation_demande_lieu_ressource', 'sos_gen_demande_lieu_ressource', 'id_from_demande', 'id_from_lieu_ressource', 'name_demande_lieu_ressource');
         $crud->set_relation_n_n('accompagnement_specialise', 'sos_relation_demande_accompagnement_specialise', 'sos_gen_demande_accompagnement_specialise', 'id_from_demande', 'id_from_accompagnement_specialise', 'name_demande_accompagnement_specialise');
         $crud->set_relation('hbgt', 'sos_gen_demande_hbgt', 'name_demande_hbgt');
         $crud->set_relation('service', 'sos_gen_service', 'nom_service', null, 'nom_service DESC');
         //Master/child relations
         //Visual
         $crud->columns('date_entry', 'visite', 'accompagnement_specialise', 'lieu_ressource', 'commentaire');
         //unsets
         $crud->unset_fields('id_demande', 'date_entry', 'dump');
         if (!$this->session->userdata('status')) {
             $crud->unset_export();
             $crud->unset_print();
         }
         //Requireds
         $crud->required_fields('visite', 'accueil_dem', 'femme', 'service');
         //Callbacks
         $crud->callback_column('date_entry', array($this, 'date_entry'));
         $crud->callback_column('visite', array($this, 'visite'));
         $crud->callback_column('commentaire', array($this, 'commentaire'));
         $crud->callback_column('commentaire_psy', array($this, 'commentaire_psy'));
         $crud->callback_column('lieu_ressource', array($this, 'lieu_ressource'));
         $crud->callback_column('accompagnement_specialise', array($this, 'accompagnement_specialise'));
         $crud->callback_after_update(array($this, 'insert_after'));
         $crud->callback_after_insert(array($this, 'insert_after_insert'));
         //field Types
         $crud->field_type('id_from_femme', 'hidden', $this->id_femme);
         $crud->field_type('id_user', 'hidden', $this->session->userdata('userid'));
         // Actions
         $crud->add_action('Enfants', '', 'enfants/enfants_window', 'ui-icon-person');
         //$crud->add_action('Enfants', base_url('img/pictos/enfants.png'), 'kids/kids_window', 'ui-icon-person');
         // $crud->add_action('Enfants', base_url('img/pictos/enfants.png'), 'enfants/enfants_window', 'ui-icon-person');
         // 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());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:65,代码来源:demande.php

示例13: ops

 public function ops($page = 'crud_view')
 {
     $data['title'] = "AA Planetica";
     $data['activepage'] = "Clients Page";
     if (!$this->ion_auth->logged_in()) {
         // redirect them to the login page
         $this->session->set_userdata('last_page', current_url());
         redirect('users/admin/login', 'refresh');
         //echo "Redirect to Login";
     } elseif ($this->ion_auth->is_admin()) {
         $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
         $crud = new grocery_CRUD();
         $crud->set_theme('flexigrid');
         $crud->set_table('siteinfo');
         $crud->set_subject('Site Info');
         //$crud->columns('lastName','firstName','email','jobTitle');
         $crud->unset_columns('id');
         $crud->unset_fields('id', 'userid', 'date');
         $crud->field_type('description', 'text');
         $crud->field_type('name', 'string');
         $crud->display_as('userid', 'User ID');
         $crud->unset_delete();
         $crud->field_type('status', 'dropdown', array('1' => 'New', '2' => 'Current', '3' => 'Done'));
         //$crud->callback_column('buyPrice',array($this,'valueToEuro'));
         $this->data['output'] = $crud->render();
         $this->load->view('aries_admin/apps/crud_view', $this->data);
         //var_dump($this->data['test']);
         //$this->load->view('aries_admin/apps/'.$page, $this->data);
     } else {
         $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
         //echo "Rest of the work as an Admin";
         $data = $this->yapps_model->client_passport_check('AB12345684');
         if ($data == 'true') {
             var_dump($this->sms);
             return show_error('Duplicate Accounts, Search in the Clients Section');
         }
         if (isset($this->sms)) {
             echo $this->sms['msg'] . '</br>' . $this->sms['error'];
         }
     }
 }
开发者ID:ahmedakter05,项目名称:yapps,代码行数:41,代码来源:siteinfo.php

示例14: main

    function main()
    {
        $user_login = $this->ion_auth->user()->row();
        $colid = $user_login->col_id;
        $userId = $user_login->user_id;
        $state_id = $user_login->state_id;
        $user_groups = $this->ion_auth->get_users_groups($userId)->row();
        $ul_type = $user_groups->ul_type;
        $user_id = $this->session->userdata('user_id');
        $crud = new grocery_CRUD();
        $crud->set_table('announcement');
        $crud->set_subject('pengumuman');
        $crud->unset_delete();
        $crud->callback_delete(array($this, 'delete_ann'));
        $crud->unset_columns('ann_status_push');
        if ($ul_type == 'KV') {
            $crud->set_primary_key('ann_id', 'announcement_college');
            $crud->set_relation('user_id', 'user', 'user_name');
            $crud->set_relation('ann_id', 'announcement_college', 'col_id');
            $crud->set_relation_n_n('Kolej', 'announcement_college', 'college', 'ann_id', 'col_id', 'col_name');
            // $crud->callback_add_field('Kolej',array($this,'add_field_kolej'));
            $crud->callback_after_insert(array($this, 'insert_announcement_college'));
            $crud->field_type('ann_open_date', 'date');
            $crud->field_type('ann_close_date', 'date');
            $crud->field_type('user_id', 'hidden', $userId);
            $crud->field_type('ann_status_push', 'hidden', 1);
            $crud->field_type('ann_status', 'dropdown', array('1' => 'Aktif', '0' => 'Tak Aktif'));
            $crud->display_as('ann_title', 'Perkara')->display_as('ann_id', 'Id')->display_as('ann_content', 'Pengumuman')->display_as('ann_open_date', 'Tarikh Mula')->display_as('ann_close_date', 'Tarikh Akhir')->display_as('ann_status', 'Status Pengumuman')->display_as('user_id', 'Pengguna')->display_as('college', 'Kolej Vokasional');
            // $crud->callback_field('ann_title',array($this,'fc_ann_tite')); - FDP
            // $crud->callback_field('ann_content',array($this,'fc_ann_content')); - FDP
            // $crud->callback_field('ann_open_date',array($this,'fc_ann_open_date')); - FDP
            // $crud->callback_field('ann_close_date',array($this,'fc_ann_close_date')); - FDP
            // $crud->callback_field('ann_status',array($this,'fc_ann_status')); - FDP
            // $crud->callback_field('college',array($this,'fc_college')); - FDP
            $crud->where('j7f822d59.col_id', $colid);
            $crud->unset_fields('Kolej');
            $crud->required_fields('ann_title', 'ann_content', 'ann_open_date', 'ann_close_date', 'ann_status');
        } elseif ($ul_type == 'LP') {
            $crud->set_relation('user_id', 'user', 'user_name');
            $crud->set_relation_n_n('Kolej', 'announcement_college', 'college', 'ann_id', 'col_id', 'col_name');
            $crud->callback_after_insert(array($this, 'insert_announcement_college'));
            $crud->field_type('ann_open_date', 'date');
            $crud->field_type('ann_close_date', 'date');
            $crud->field_type('user_id', 'hidden', $user_id);
            $crud->field_type('ann_status_push', 'hidden', 1);
            $crud->field_type('ann_status', 'dropdown', array('1' => 'Aktif', '0' => 'Tak Aktif'));
            $crud->display_as('ann_title', 'Perkara')->display_as('ann_content', 'Pengumuman')->display_as('ann_open_date', 'Tarikh Mula')->display_as('ann_close_date', 'Tarikh Akhir')->display_as('ann_status', 'Status Pengumuman')->display_as('user_id', 'Pengguna')->display_as('college', 'Kolej Vokasional');
            // $crud->callback_field('ann_title',array($this,'fc_ann_tite')); - FDP
            // $crud->callback_field('ann_content',array($this,'fc_ann_content')); - FDP
            // $crud->callback_field('ann_open_date',array($this,'fc_ann_open_date')); - FDP
            // $crud->callback_field('ann_close_date',array($this,'fc_ann_close_date')); - FDP
            // $crud->callback_field('ann_status',array($this,'fc_ann_status')); - FDP
            // $crud->callback_field('college',array($this,'fc_college')); - FDP
            $crud->required_fields('ann_title', 'ann_content', 'ann_open_date', 'ann_close_date', 'ann_status');
        }
        $output = $crud->render();
        $js = '<script>$(document).ready(function() 
			{
				$("#addStudent").validationEngine();
			});</script>';
        $header = $js . "<legend><h3>Penyenggaraan Pengumuman</h3></legend>";
        $this->_main_output($output, $header);
    }
开发者ID:NeroJz,项目名称:ekv,代码行数:63,代码来源:announcement.php

示例15: array

    function branch_management()
    {
        $merchant_id = $this->ion_auth->user()->row()->id;
        //for supervisor view the branch of merchant
        if (check_correct_login_type($this->group_id_supervisor)) {
            $merchant_id = $this->ion_auth->user()->row()->su_merchant_id;
        }
        $this->load->library('grocery_CRUD');
        try {
            $crud = new grocery_CRUD();
            $this->load->library('user_agent');
            if ($this->agent->is_mobile() && $this->agent->is_tablet() === FALSE) {
                $crud->set_theme('bootstrap');
                $crud->unset_search();
            } else {
                $crud->set_theme('datatables');
                //datatables, flexigrid, bootstrap
                //$crud->add_action('Add Supervisor', '', 'merchant/supervisor/add','ui-icon-pencil');  //No use this because cannot open new tab
            }
            //($this->agent->is_tablet() === TRUE) ? $is_tablet = "Yes" : $is_tablet = "No"; echo "Using tablet: $is_tablet";
            $crud->set_table('merchant_branch');
            $crud->set_subject('Branch');
            $crud->columns('name', 'address', 'phone', 'state_id', 'supervisor');
            $crud->required_fields('name', 'address', 'state_id');
            $crud->fields('name', 'address', 'phone', 'state_id', 'google_map_url');
            $crud->display_as('state_id', 'State');
            $crud->display_as('google_map_url', 'Google Map Coordinate');
            $crud->unset_fields('merchant_id');
            $crud->unset_texteditor('address', 'google_map_url');
            $crud->field_type('state_id', 'dropdown', $this->ion_auth->get_static_option_list('state'));
            $crud->callback_insert(array($this, 'branch_insert_callback'));
            $crud->callback_add_field('phone', array($this, 'add_field_for_phone'));
            $crud->callback_column('name', array($this, '_branch_map'));
            $crud->callback_column('address', array($this, '_full_text'));
            $crud->callback_column('supervisor', array($this, '_branch_supervisor'));
            $controller = 'merchant';
            $function = 'profile';
            $crud->set_lang_string('insert_success_message', 'Your data has been successfully stored into the database.
		 <script type="text/javascript">
                 var originallocation = window.location.pathname;
                 if(originallocation.indexOf("/branch/add") > -1)
                {
		  window.location = "' . site_url($controller . '/' . $function) . '";
                }
		 </script>
		 <div style="display:none">
		 ');
            $crud->set_lang_string('update_success_message', 'Your data has been successfully stored into the database.
		 <script type="text/javascript">
                 var originallocation = window.location.pathname;
                 if(originallocation.indexOf("/branch/edit") > -1)
                {
                window.location = "' . site_url($controller . '/' . $function) . '";
                 }
		 </script>
		 <div style="display:none">
		 ');
            $crud->set_lang_string('form_save_and_go_back', 'Save and View Branch');
            $crud->set_lang_string('form_update_and_go_back', 'Update and View Branch');
            $crud->unset_export();
            $crud->unset_print();
            $state = $crud->getState();
            //Temporary use this to skip the bootstrap top right search not working bug after got $crud->where() function
            //            if ($state == 'ajax_list') {
            //                if (!empty($crud->getStateInfo())) {
            //                    $state_info = $crud->getStateInfo();
            //                    if (!empty($state_info->search->text)) {
            //
            //                    } else {
            //                        $crud->where('merchant_id', $id);
            //                    }
            //                }
            //            } else {
            $crud->where('merchant_id', $merchant_id);
            //            }
            if ($state == 'read') {
                $crud->set_relation('state_id', 'static_option', '{option_text}');
            }
            $output = $crud->render();
            return $output;
        } catch (Exception $e) {
            show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
        }
    }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:84,代码来源:Merchant.php


注:本文中的grocery_CRUD::unset_fields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。