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


PHP grocery_CRUD::callback_column方法代码示例

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


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

示例1: enfants_window

 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());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:53,代码来源:enfants.php

示例2: index

 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);
 }
开发者ID:selva316,项目名称:trackingtool,代码行数:30,代码来源:managingtrack.php

示例3: 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

示例4: get_crud_propuesta

 public function get_crud_propuesta()
 {
     $this->config->load('grocery_crud');
     $this->config->set_item('grocery_crud_dialog_forms', true);
     $crud = new grocery_CRUD();
     $crud->set_theme('datatables2');
     $crud->set_relation('id_periodo', 'gp_periodo', 'siglas');
     $crud->set_relation('id_departamento', 'gp_departamentos', 'nombre_depart', array('estado_dep' => '1'));
     $crud->set_relation('id_persona', 'gp_persona', '{nombres} {apellidos}');
     $crud->display_as('id_periodo', 'Periodo')->display_as('id_departamento', 'Departamento')->display_as('id_persona', 'Usuario');
     // $crud->set_relation('id_persona', 'gp_tipopersona', 'typo_persona');
     //$crud->set_relation('id_estado', 'gp_estados', 'valor');
     $crud->callback_column('estado', array($this, 'color_estado'));
     $crud->callback_column('tipo_persona', array($this, 'tipo_persona'));
     $crud->callback_column('asignacion_tutor', array($this, 'asigna_tutor'));
     $crud->callback_column('tutor', array($this, 'view_tutor'));
     $crud->callback_column('historial', array($this, 'get_historial'));
     $cols = array('titulo', 'contenido', 'id_periodo', 'id_departamento', 'id_persona', 'tipo_persona', 'fecha_post', 'estado', 'tutor', 'asignacion_tutor', 'historial');
     $crud->columns2($cols);
     $crud->set_table('gp_propuesta');
     $crud->set_subject('Tesis');
     $crud->unset_add()->unset_delete()->unset_edit();
     $output = $crud->render();
     $this->load->view('crud/crud_view_datatable', $output);
 }
开发者ID:RooseveltJavier,项目名称:Proyecto,代码行数:25,代码来源:crt_propuestas.php

示例5: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('bootstrap');
     $crud->set_table('user');
     $crud->set_subject('Gebruiker');
     // hide fields
     $crud->columns('is_super_user', 'is_active', 'screen_name', 'email', 'gebruikersgroepen');
     // new_password and new_password repeat are needed to make formvalidation work
     // id is needed to make the email unique check work
     $crud->fields('id', 'is_active', 'screen_name', 'email', 'gebruikersgroepen', 'password', 'new_password', 'new_password_repeat');
     $crud->required_fields('email', 'screen_name', 'is_active');
     $crud->set_relation_n_n('gebruikersgroepen', 'user_x_user_group', 'user_group', 'user_id', 'user_group_id', 'name');
     $crud->field_type('id', 'hidden');
     $crud->field_type('new_password_repeat', 'hidden');
     $crud->field_type('password', 'hidden');
     $crud->display_as('is_active', 'Actief');
     $crud->display_as('screen_name', 'Schermnaam');
     $crud->display_as('is_super_user', '');
     $crud->display_as('new_password', 'Wachtwoord');
     if ($crud->getState() == 'read') {
         $crud->field_type('new_password', 'hidden');
     } else {
         $crud->callback_field('new_password', array($this, 'edit_field_callback_new_password'));
     }
     $crud->field_type('is_active', 'dropdown', array('yes' => 'ja', 'no' => 'nee'));
     $crud->callback_column('is_active', array($this, 'callback_list_is_active'));
     $crud->callback_column('is_super_user', array($this, 'callback_list_is_super_user'));
     $crud->callback_before_insert(array($this, 'before_insert_update_callback'));
     $crud->callback_before_update(array($this, 'before_insert_update_callback'));
     $crud->callback_after_insert(array($this, 'after_insert_callback'));
     $crud->callback_after_update(array($this, 'after_update_callback'));
     if ($crud->getState() === 'update_validation' or $crud->getState() === 'insert_validation') {
         $crud->set_rules('email', 'E-mail', 'required|valid_email|callback_email_unique_check');
         $crud->set_rules('screen_name', 'Schermnaam', 'required');
         if ($this->input->post('new_password') != '' or !$this->input->post('id')) {
             $crud->set_rules('new_password', 'Nieuw wachtwoord', 'required|min_length[10]|matches[new_password_repeat]');
             $crud->set_rules('new_password_repeat', 'Herhaal nieuw wachtwoord', '');
         }
         $this->form_validation->set_message('matches', 'De wachtwoorden zijn niet aan elkaar gelijk.');
     }
     // 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();
     // put the crud content in the right position
     $this->views['content'] = $crud_output->output;
     $this->css[] = $this->load->view('admin/user/css/index.css', array(), true);
     // add javascript and css to make the password generate and change function possible
     if ($crud->getState() === 'add' or $crud->getState() === 'edit') {
         $this->css[] = $this->load->view('admin/user/css/edit_user.css', array(), true);
         $this->javascript[] = $this->load->view('admin/user/js/edit_user.js', array(), true);
     }
     // create the layout-HTML and show it to the user
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:57,代码来源:TT_user.php

示例6: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('flexigrid');
     $crud->set_table('hotel_rooms');
     $crud->set_subject('Hotel Rooms');
     //        $crud->unset_fields('ht_id');
     $crud->display_as('room_hotel', 'Hotel Name');
     $crud->display_as('hotel_title', 'Room Name');
     $crud->display_as('room_desc', 'Room Description');
     $crud->display_as('room_basic_price', 'Selling Price');
     $crud->display_as('room_cost_price', 'Cost Price');
     $crud->display_as('room_market_price', 'Market Price');
     $crud->display_as('room_service_charge', 'Service Charge');
     $crud->display_as('room_vat', 'VAT');
     $crud->columns(array('room_hotel', 'room_title', 'room_vat', 'room_service_charge', 'room_cost_price', 'room_basic_price', 'room_basic_discount', 'room_order', 'room_quantity', 'room_added_on', 'room_status'));
     $crud->callback_column('room_basic_price', array($this, 'set_price'));
     //
     $crud->callback_read_field('room_basic_price', array($this, 'set_price'));
     // crud library modified SAM for read_field
     $crud->callback_column('room_basic_discount', array($this, 'set_price'));
     //
     $crud->callback_read_field('room_basic_discount', array($this, 'set_price'));
     // crud library modified SAM for read_field
     $crud->callback_add_field('room_cost_price', function ($value, $primary_key) {
         return "USD <input id='field-room_cost_price' class='form-control' name='room_cost_price' type='text' value='' maxlength='20'>";
     });
     $crud->callback_add_field('room_market_price', function ($value, $primary_key) {
         return "USD <input id='field-room_market_price' class='form-control' name='room_market_price' type='text' value='' maxlength='20'>";
     });
     $crud->callback_edit_field('room_cost_price', function ($value, $primary_key) {
         return "USD <input id='field-room_cost_price' class='form-control' name='room_cost_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_edit_field('room_market_price', function ($value, $primary_key) {
         return "USD <input id='field-room_market_price' class='form-control' name='room_market_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_add_field('room_basic_price', function ($value, $primary_key) {
         return "USD <input id='field-room_basic_price' class='form-control' name='room_basic_price' type='text' value='' maxlength='20'>";
     });
     $crud->callback_edit_field('room_basic_price', function ($value, $primary_key) {
         return "USD <input id='field-room_basic_price' class='form-control' name='room_basic_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_add_field('room_basic_discount', function ($value, $primary_key) {
         return "USD <input id='field-room_basic_discount' class='form-control' name='room_basic_discount' type='text' value='' maxlength='20'>";
     });
     $crud->callback_edit_field('room_basic_discount', function ($value, $primary_key) {
         return "USD <input id='field-room_basic_discount' class='form-control' name='room_basic_discount' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->set_relation('room_hotel', 'hotels', '{hotel_name}');
     $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('room_facilities', 'multiselect', $hrf);
     $output = $crud->render();
     $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Hotel Tariffs', 'pagedesc' => 'Hotel Tariffs', 'contenttitle' => 'Hotel Tariffs List Records');
     $this->load->view('gc_admin_wrapper', $data);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:56,代码来源:hotel_rooms.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: 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);
 }
开发者ID:tibioltean,项目名称:pcireg,代码行数:49,代码来源:dashboard.php

示例9: index

 public function index()
 {
     //        $data = array(
     //            'main_content' => 'clients_wishlist',
     //            'output' => $this->db->get_where('clients_wishlist', array('wish_user' => $this->ion_auth->get_user_id()))->result(),
     //            'pagetitle' => 'Wishlist',
     //            'pagedesc' => 'Wishlist',
     //            'contenttitle' => 'Wishlist  Records',
     //            'left_menu' => 'clients_menu'
     //        );
     //        $this->load->view('gc_client_wrapper', $data);
     $this->load->library('grocery_CRUD');
     //        $this->upload_path = '../assets/uploads/' . 'packages';
     //        $this->wrapper = 'gc_admin_wrapper';
     $this->load->model('generic_model');
     $crud = new grocery_CRUD();
     $crud->set_theme('flexigrid');
     $crud->set_table('clients_wishlist');
     $crud->set_subject('Client Wishlist');
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_read();
     $crud->where('wish_user', $this->ion_auth->get_user_id());
     $crud->display_as('wish_title', 'Wish Title');
     $crud->display_as('wish_date', 'Wish Date');
     $crud->callback_column('wish_title', array($this, 'set_change_status'));
     $crud->unset_columns('wish_url', 'wish_user');
     $output = $crud->render();
     $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Client Wishlist', 'pagedesc' => 'Client Wishlist', 'contenttitle' => 'Wishlist Records', 'left_menu' => 'clients_menu');
     $this->load->view('gc_admin_wrapper', $data);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:31,代码来源:wishlist.php

示例10: 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);
 }
开发者ID:sali141,项目名称:bportal,代码行数:35,代码来源:categories.php

示例11: psy_window

 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());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:46,代码来源:psy.php

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

示例13: salidas

 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');
     }
 }
开发者ID:jalomo,项目名称:sisin,代码行数:44,代码来源:Salidas.php

示例14: unit

 public function unit()
 {
     $crud = new grocery_CRUD();
     $crud->set_table('unit');
     //$crud->columns('namaGroup');
     $crud->callback_column('namaGroup', array($this, '_linkSurat'));
     //$crud->columns('nomorSurat','perihal','tanggal');
     $output = $crud->render();
     $this->_outputs($output);
 }
开发者ID:bondeto,项目名称:persuratanBasic-CI,代码行数:10,代码来源:frontPage.php

示例15: products_management

 public function products_management()
 {
     $crud = new grocery_CRUD();
     $crud->set_table('products');
     $crud->set_subject('Product');
     $crud->unset_columns('productDescription');
     $crud->callback_column('buyPrice', array($this, 'valueToEuro'));
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:tibioltean,项目名称:pcireg,代码行数:10,代码来源:~Examples.php


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