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


PHP grocery_CRUD::getStateInfo方法代码示例

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


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

示例1: configuracion

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

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

示例3: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('flexigrid');
     $crud->set_table('hotels');
     $crud->set_subject('Hotels');
     //        $crud->set_relation('hotel_agent_id', 'io_users', '{first_name} {last_name}');
     $agent_id = $this->ion_auth->user()->row()->id;
     $crud->where('hotel_agent_id', $agent_id);
     $crud->field_type('hotel_agent_id', 'hidden', $agent_id);
     //        $crud->display_as('hotel_agent_id', 'Agent Name');
     $crud->display_as('hotel_name', 'Hotel Name');
     $crud->display_as('hotel_rooms', 'rooms');
     $crud->display_as('hotel_tariffs', 'tariffs');
     $crud->display_as('hotel_country', 'Country');
     $crud->display_as('hotel_city', 'City');
     $crud->display_as('hotel_street', 'Street');
     $crud->display_as('hotel_state', 'State');
     $crud->display_as('hotel_postCode', 'PostCode');
     $crud->display_as('hotel_phoneNumber', 'Phone Number');
     $crud->display_as('hotel_emailId', 'Email ID');
     $crud->display_as('hotel_website', 'Website');
     $crud->display_as('hotel_facebook', 'Facebook');
     $crud->display_as('hotel_googleMap', 'GoogleMap');
     $crud->display_as('hotel_status', 'Status');
     $crud->columns('hotel_name', 'hotel_phoneNumber', 'hotel_website', 'hotel_facebook', 'hotel_googleMap', 'hotel_status');
     $crud->callback_column('hotel_image', array($this, 'set_image'));
     $crud->set_field_upload('hotel_image', $this->upload_path);
     /*
      * For related hotels
      * on add list all the hotels
      * on edit, list all except own name
      */
     if ($crud->getState() == 'edit') {
         $hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_agent_id' => $this->ion_auth->get_user_id(), 'hotel_id !=' => $crud->getStateInfo()->primary_key), 'hotel_id');
     } else {
         $hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_agent_id' => $this->ion_auth->get_user_id()), 'hotel_id');
     }
     // empty data for multiselect field generates error
     if (empty($hrf)) {
         $hrf = array('');
     } else {
         $hrf = $this->generic_model->array_from_db($hrf, 'hotel_id, hotel_name');
     }
     $crud->field_type('hotel_related', 'multiselect', $hrf);
     $hf = $this->generic_model->get_by('hotel_facilities', array('hf_status' => 1), 'hf_id');
     $hf = $this->generic_model->array_from_db($hf, 'hf_id, hf_facility');
     $crud->field_type('hotel_facilities', 'multiselect', $hf);
     $hrf = $this->generic_model->get_by('hotel_room_facilities', array('hrf_status' => 1), 'hrf_id');
     $hrf = $this->generic_model->array_from_db($hrf, 'hrf_id, hrf_facility');
     $crud->field_type('hotel_room_facilities', 'multiselect', $hrf);
     $crud->add_action('Photo Gallery', '', 'agents/hotels/gallery', 'ui-icon ui-icon-image');
     $output = $crud->render();
     $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Hotels', 'pagedesc' => 'Hotels', 'contenttitle' => 'Hotels List Records', 'left_menu' => 'agents_menu');
     $this->load->view('gc_admin_wrapper', $data);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:56,代码来源:hotels.php

示例4: getStateInfo

 public function getStateInfo()
 {
     $state_code = $this->getStateCode();
     $segment_object = $this->get_state_info_from_url();
     $first_parameter = $segment_object->first_parameter;
     $second_parameter = $segment_object->second_parameter;
     $third_parameter = $segment_object->third_parameter;
     $state_info = (object) array();
     switch ($state_code) {
         case 101:
             //ajax_extension
             $state_info->target_field_name = $first_parameter;
             $state_info->relation_field_on_source_table = $second_parameter;
             $state_info->filter_value = $third_parameter;
             break;
         default:
             $state_info = parent::getStateInfo();
     }
     return $state_info;
 }
开发者ID:puneetarora2000,项目名称:POWER-GCrud,代码行数:20,代码来源:ajax_grocery_crud.php

示例5: switch

 function _callback_province($value, $primarykey)
 {
     $html = '<link type="text/css" rel="stylesheet" href="' . base_url() . '/assets/grocery_crud/css/jquery_plugins/chosen/chosen.css" />';
     $html .= '<script src="' . base_url() . '/assets/grocery_crud/js/jquery_plugins/jquery.chosen.min.js"></script>';
     $html .= '<script src="' . base_url() . '/assets/grocery_crud/js/jquery_plugins/config/jquery.chosen.config.js"></script>';
     $empty_select = '<select name="province" class="chosen-select" data-placeholder="Select Province" style="width: 300px; display: none;">';
     $empty_select_closed = '</select>';
     $segs = $this->uri->segment_array();
     $province = null;
     $listingID = null;
     $crud = new grocery_CRUD();
     //CHECK FOR A URI VALUE AND MAKE SURE ITS ON THE EDIT STATE
     if (in_array("edit", $segs)) {
         $state_info = $crud->getStateInfo();
         $listingID = $state_info->primary_key;
         switch ($segs[array_search("edit", $segs) - 1]) {
             case 'irrigationhistory':
                 $table_name = 'irr_history';
                 $table_pk = 'irrhist_id';
                 break;
             case 'inventory':
                 $table_name = 'inventory';
                 $table_pk = 'agri_id';
                 break;
                 break;
             default:
                 break;
         }
         $placeID = $this->shared_model->get_place_id($listingID, $table_name, $table_pk);
         $data = $this->shared_model->get_by_place_id($placeID);
         $province = $data->province;
     }
     $empty_select .= '<option value=""></option>';
     $db = $this->shared_model->get_province();
     //APPEND THE OPTION FIELDS WITH VALUES FROM THE STATES PER THE COUNTRY ID
     foreach ($db->result() as $row) {
         if ($row->province == $province) {
             $empty_select .= '<option value="' . $row->province . '" selected="selected">' . $row->province . '</option>';
         } else {
             $empty_select .= '<option value="' . $row->province . '">' . $row->province . '</option>';
         }
     }
     //RETURN SELECTION COMBO
     return $html . $empty_select . $empty_select_closed;
 }
开发者ID:louiej,项目名称:lidar2,代码行数:45,代码来源:agri.php

示例6: user

 public function user()
 {
     $crud = new grocery_CRUD();
     $crud->set_table('cms_user');
     $crud->set_subject('User');
     $crud->required_fields('user_name');
     $crud->columns('user_name', 'email', 'real_name', 'active', 'groups');
     $crud->edit_fields('user_name', 'email', 'real_name', 'active', 'groups');
     $crud->add_fields('user_name', 'email', 'password', 'real_name', 'active', 'groups');
     $crud->change_field_type('active', 'true_false');
     $crud->display_as('user_name', 'User Name')->display_as('email', 'E mail')->display_as('real_name', 'Real Name')->display_as('active', 'Active')->display_as('groups', 'Groups');
     $crud->set_relation_n_n('groups', 'cms_group_user', 'cms_group', 'user_id', 'group_id', 'group_name');
     $crud->callback_before_insert(array($this, 'before_insert_user'));
     $crud->callback_before_delete(array($this, 'before_delete_user'));
     if ($crud->getState() == 'edit') {
         $state_info = $crud->getStateInfo();
         $primary_key = $state_info->primary_key;
         if ($primary_key == $this->cms_userid() || $primary_key == 1) {
             $crud->callback_edit_field('active', array($this, 'read_only_user_active'));
         }
     }
     $crud->set_lang_string('delete_error_message', 'You cannot delete super admin user or your own account');
     $output = $crud->render();
     $this->view('main/user', $output, 'main_user_management');
 }
开发者ID:rado-tsvetkov,项目名称:No-CMS,代码行数:25,代码来源:main.php

示例7:

 function generate_coupon()
 {
     $crud = new grocery_CRUD();
     //$this->load->library('controllers/admin');
     $crud->set_theme('datatables');
     $crud->set_table('coupon_code');
     $crud->set_subject('Coupon Code');
     $output = $crud->render();
     $state = $crud->getState();
     $state_info = $crud->getStateInfo();
     if ($state == 'add') {
         //$this->load->view('generate_coupon_code.php');
         $this->generate_coupon_code();
     } else {
         $this->_example_output($output);
     }
 }
开发者ID:ajayvisionitlabs,项目名称:test,代码行数:17,代码来源:admin.php

示例8: array

 function office_management()
 {
     if ($this->userconfig->perfil == 'ADMIN') {
         $crud = new grocery_CRUD();
         $this->load->library('googlemaps');
         $crud->set_theme('datatables');
         $crud->set_table('sucursales');
         $crud->set_subject('sucursales');
         $crud->columns('nombre');
         $crud->fields('nombre', 'latitud', 'longitud');
         $crud->required_fields('nombre');
         $crud->display_as('nombre', 'Nombre sucursal');
         $output = $crud->render();
         $output->op = 'office_management';
         $state = $crud->getState();
         $state_info = $crud->getStateInfo();
         $primary_key = '-1';
         if ($state == 'edit') {
             $this->load->model('sqlexteded');
             $primary_key = $state_info->primary_key;
             $sucursal = $this->sqlexteded->getLatLngOficce($primary_key);
             $config['center'] = $sucursal->latitud . ', ' . $sucursal->longitud;
             $config['zoom'] = '14';
             $config['map_width'] = '98%';
             //$config['onclick'] = 'alert(\'You just clicked at: \' + event.latLng.lat() + \', \' + event.latLng.lng());';
             $this->googlemaps->initialize($config);
             $marker = array();
             $marker['position'] = $config['center'];
             $marker['draggable'] = TRUE;
             $marker['animation'] = 'DROP';
             $marker['icon'] = base_url() . 'assets/images/colegio.png';
             $marker['ondragend'] = "\$('#field-latitud').val(event.latLng.lat()); \$('#field-longitud').val(event.latLng.lng());";
             $this->googlemaps->add_marker($marker);
             $output->map = $this->googlemaps->create_map();
         }
         $output->state = $state;
         $output->primary_key = $primary_key;
         $this->_admin_output($output);
     } else {
         $this->close();
     }
 }
开发者ID:pmoitech,项目名称:sfa,代码行数:42,代码来源:admin.php

示例9: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $user_id = $this->ion_auth->user()->row()->id;
     $crud->set_table('packages');
     $crud->set_subject('Packages');
     $crud->unset_fields('package_id');
     $crud->unset_columns('package_id');
     $crud->unset_columns('package_thingsToConsider');
     $crud->unset_columns('package_weatherCondition');
     $crud->unset_columns('package_itinerary');
     $crud->display_as('package_weatherCondition', 'Weather Condition');
     $crud->display_as('package_thingsToConsider', 'Things to consider');
     $crud->display_as('package_adventureRegion', 'Adventure Region');
     $crud->display_as('package_basic_price', 'Price');
     $crud->display_as('package_basic_before_discount', 'Before Discount Price');
     $crud->display_as('package_related', 'Related Packages');
     $crud->set_field_upload('package_image', $this->upload_path);
     $crud->unique_fields('package_slug');
     $crud->where('package_agent', $user_id);
     $crud->set_relation('package_category', 'packages_types_settings', 'sett_name', 'sett_type = "ttypes"', 'sett_id');
     $crud->field_type('package_agent', 'hidden', $user_id);
     $this->load->model('agents_m');
     /*
      * For related packages
      * on add list all the packages created by the agent
      * on edit, list all except own name
      */
     if ($crud->getState() == 'edit') {
         $hrf = $this->db->select('package_id, package_title')->get_where('packages', array('package_status' => 1, 'package_agent' => $user_id, 'package_id !=' => $crud->getStateInfo()->primary_key))->result();
     } else {
         $hrf = $this->db->select('package_id, package_title')->get_where('packages', array('package_status' => 1, 'package_agent' => $user_id))->result();
     }
     $hrf = $this->agents_m->array_from_db($hrf, 'package_id, package_title');
     // empty data for multiselect field generates error
     if (empty($hrf)) {
         $hrf = array('');
     } else {
         $hrf = $this->generic_model->array_from_db($hrf, 'hotel_id, hotel_name');
     }
     $crud->field_type('package_related', 'multiselect', $hrf);
     $crud->callback_column('package_image', array($this, 'set_image'));
     $crud->callback_read_field('package_basic_price', array($this, 'set_price'));
     $crud->callback_read_field('package_basic_discount', array($this, 'set_price'));
     $crud->callback_column('package_basic_price', array($this, 'set_price'));
     $crud->callback_column('package_basic_discount', array($this, 'set_price'));
     $crud->callback_add_field('package_basic_price', function ($value, $primary_key) {
         return "USD <input id='field-package_basic_price' class='form-control' name='package_basic_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_add_field('package_basic_discount', function ($value, $primary_key) {
         return "USD <input id='field-package_basic_discount' class='form-control' name='package_basic_discount' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_edit_field('package_basic_price', function ($value, $primary_key) {
         return "USD <input id='field-package_basic_price' class='form-control' name='package_basic_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_edit_field('package_basic_discount', function ($value, $primary_key) {
         return "USD <input id='field-package_basic_discount' class='form-control' name='package_basic_discount' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->add_action('Photo Gallery', '', 'agents/packages/gallery', 'ui-icon ui-icon-image');
     $output = $crud->render();
     $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Packages', 'pagedesc' => 'Packages', 'contenttitle' => 'Packages List Records', 'left_menu' => 'agents_menu');
     $this->load->view('gc_admin_wrapper', $data);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:63,代码来源:packages.php

示例10: foreach

 function _callback_province()
 {
     $html = '<link type="text/css" rel="stylesheet" href="' . base_url() . '/assets/grocery_crud/css/jquery_plugins/chosen/chosen.css" />';
     $html .= '<script src="' . base_url() . '/assets/grocery_crud/js/jquery_plugins/jquery.chosen.min.js"></script>';
     $html .= '<script src="' . base_url() . '/assets/grocery_crud/js/jquery_plugins/config/jquery.chosen.config.js"></script>';
     //CREATE THE EMPTY SELECT STRING
     $empty_select = '<select name="province" onchange="this.form.submit()" class="chosen-select" data-placeholder="province" style="width: 300px; display: none;">';
     $empty_select_closed = '</select>';
     //GET THE ID OF THE LISTING USING URI
     $listingID = $this->uri->segment(4);
     $empty_select = '<select name="province" class="chosen-select" data-placeholder="Province" style="width: 300px; display: none;">';
     $empty_select_closed = '</select>';
     $province = null;
     $listingID = null;
     $crud = new grocery_CRUD();
     $state = $crud->getState();
     //CHECK FOR A URI VALUE AND MAKE SURE ITS ON THE EDIT STATE
     if ($state == 'edit') {
         $state_info = $crud->getStateInfo();
         $listingID = $state_info->primary_key;
         $placeID = $this->shared_model->get_place_id($listingID, 'place_history', 'placehist_id');
         $data = $this->shared_model->get_by_place_id($placeID);
         $province = $data->province;
     }
     $db = $this->shared_model->get_province();
     $empty_select .= '<option value=""></option>';
     //APPEND THE OPTION FIELDS WITH VALUES FROM THE STATES PER THE COUNTRY ID
     foreach ($db->result() as $row) {
         if ($row->province == $province) {
             $empty_select .= '<option value="' . $row->province . '" selected="selected">' . $row->province . '</option>';
         } else {
             $empty_select .= '<option value="' . $row->province . '">' . $row->province . '</option>';
         }
     }
     //RETURN SELECTION COMBO
     return $html . $empty_select . $empty_select_closed;
 }
开发者ID:louiej,项目名称:lidar2,代码行数:37,代码来源:place.php

示例11: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_table('packages');
     $crud->set_subject('Packages');
     $crud->unset_fields('package_id');
     $crud->unset_columns('package_id');
     $crud->unset_columns('package_thingsToConsider');
     $crud->unset_columns('package_weatherCondition');
     $crud->unset_columns('package_itinerary');
     $crud->display_as('package_weatherCondition', 'Weather Condition');
     $crud->display_as('package_thingsToConsider', 'Things to consider');
     $crud->display_as('package_adventureRegion', 'Adventure Region');
     $crud->display_as('package_cost_price', 'Cost Price');
     $crud->display_as('package_basic_price', 'Selling Price');
     $crud->display_as('package_market_price', 'Market Price');
     $crud->display_as('package_service_charge', 'Service Charge');
     $crud->display_as('package_vat', 'VAT');
     $crud->display_as('package_basic_price', 'Price');
     $crud->display_as('package_basic_before_discount', 'Before Discount Price');
     $crud->display_as('package_related', 'Related Packages');
     $crud->set_field_upload('package_image', $this->upload_path);
     $crud->unique_fields('package_slug');
     $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('package_agent', 'dropdown', $agents);
     $crud->required_fields('package_agent');
     /*
      * For related packages
      * on add list all the packages
      * on edit, list all except own name
      */
     if ($crud->getState() == 'edit') {
         $hrf = $this->generic_model->get_by('packages', array('package_status' => 1, 'package_id !=' => $crud->getStateInfo()->primary_key), 'package_id');
     } else {
         $hrf = $this->generic_model->get_by('packages', array('package_status' => 1), 'package_id');
     }
     $hrf = $this->generic_model->array_from_db($hrf, 'package_id, package_title');
     $crud->field_type('package_related', 'multiselect', $hrf);
     //        $crud->set_relation('package_agent', 'agents', '{agent_companyName}');
     //$agents = $this->ion_auth->get_all_agents();
     //        $crud->field_type('package_agent', 'dropdown', $agents);
     //        $crud->field_type('package_agent', 'hidden', $this->ion_auth->user()->row()->id);
     $crud->field_type('package_difficulty', 'dropdown', array('1' => 'Easy', '2' => 'Basic', '3' => 'Beginner', '4' => 'Intermediate', '5' => 'Advanced'));
     $crud->set_relation('package_category', 'packages_types_settings', 'sett_name', 'sett_type = "ttypes"', 'sett_id');
     $crud->callback_column('package_image', array($this, 'set_image'));
     $crud->callback_column('package_basic_price', array($this, 'set_price'));
     $crud->callback_column('package_basic_discount', array($this, 'set_price'));
     $crud->callback_read_field('package_basic_price', array($this, 'set_price'));
     $crud->callback_read_field('package_basic_discount', array($this, 'set_price'));
     $crud->callback_add_field('package_cost_price', function ($value, $primary_key) {
         return "USD <input id='field-package_cost_price' class='form-control' name='package_cost_price' type='text' value='' maxlength='20'>";
     });
     /*$crud->callback_add_field('package_difficulty', function ($value, $primary_key) {
           return '<select id="field-package_difficulty" class="form-control" name="package_difficulty">
             <option value="1" data-html="Easy">Easy</option>
             <option value="2" data-html="Basic">Basic</option>
             <option value="3" data-html="Beginner">Beginner</option>
             <option value="3" data-html="Intermediate">Intermediate</option>
             <option value="3" data-html="Advanced">Advanced</option>
           </select>';
       });*/
     $crud->callback_add_field('package_market_price', function ($value, $primary_key) {
         return "USD <input id='field-package_market_price' class='form-control' name='package_market_price' type='text' value='' maxlength='20'>";
     });
     $crud->callback_edit_field('package_cost_price', function ($value, $primary_key) {
         return "USD <input id='field-package_cost_price' class='form-control' name='package_cost_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_edit_field('package_market_price', function ($value, $primary_key) {
         return "USD <input id='field-package_market_price' class='form-control' name='package_market_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_add_field('package_basic_price', function () {
         return "USD <input id='field-package_basic_price' class='form-control' name='package_basic_price' type='text' value='' maxlength='20'>";
     });
     $crud->callback_add_field('package_basic_discount', function () {
         return "USD <input id='field-package_basic_discount' class='form-control' name='package_basic_discount' type='text' value='' maxlength='20'>";
     });
     $crud->callback_edit_field('package_basic_price', function ($value, $primary_key) {
         return "USD <input id='field-package_basic_price' class='form-control' name='package_basic_price' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->callback_edit_field('package_basic_discount', function ($value, $primary_key) {
         return "USD <input id='field-package_basic_discount' class='form-control' name='package_basic_discount' type='text' value='{$value}' maxlength='20'>";
     });
     $crud->unique_fields('package_slug');
     $crud->add_action('Photo Gallery', '', 'packages/gallery', 'ui-icon ui-icon-image');
     $output = $crud->render();
     $data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Packages', 'pagedesc' => 'Packages', 'contenttitle' => 'Packages List Records');
     $this->load->view('gc_admin_wrapper', $data);
 }
开发者ID:beingjungshahi,项目名称:theexcursionnepal,代码行数:90,代码来源:packages.php

示例12: paragraph

 public function paragraph()
 {
     if (!is_super_user()) {
         redirect(site_url('admin/help'));
     }
     $this->load->config('grocery_crud');
     $this->config->set_item('grocery_crud_text_editor_type', 'minimal');
     $crud = new grocery_CRUD();
     $crud->set_theme('bootstrap');
     $crud->set_table('help_paragraph');
     $crud->set_subject("Documentatie alinea's");
     $crud->unset_add_fields('date_modified');
     $crud->unset_edit_fields('page_id', 'date_modified');
     $crud->field_type('date_created', 'invisible');
     $crud->field_type('user_id', 'invisible');
     $crud->field_type('order', 'hidden');
     $crud->callback_add_field('page_id', array($this, 'paragraph_callback_add_field_page_id'));
     $crud->callback_before_insert(array($this, 'paragraph_callback_before_insert'));
     $crud->callback_before_update(array($this, 'paragraph_callback_before_update'));
     $crud->callback_after_insert(array($this, 'save_to_sql'));
     $crud->callback_after_update(array($this, 'save_to_sql'));
     $crud->callback_after_delete(array($this, 'save_to_sql'));
     $crud->required_fields('key', 'title', 'content', 'is_visible');
     // render the crud HTML
     $crud_output = $crud->render();
     if ($crud->getState() == 'list') {
         redirect(site_url('admin/help'));
     } else {
         if ($crud->getState() == 'success') {
             $this->session->set_flashdata('form_submit', 'success');
             $this->session->set_flashdata('form_message', 'Alinea met succes opgeslagen.');
             $state = $crud->getStateInfo();
             $this->load->model('admin/help_model');
             $paragraph = $this->help_model->get_paragraph($state->primary_key, 'off');
             redirect(site_url('admin/help/index/' . $paragraph['page_id'] . '#' . $paragraph['key']));
         }
     }
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     $this->views['content'] = $crud_output->output;
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:42,代码来源:TT_help.php


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