本文整理汇总了PHP中grocery_CRUD::callback_add_field方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::callback_add_field方法的具体用法?PHP grocery_CRUD::callback_add_field怎么用?PHP grocery_CRUD::callback_add_field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::callback_add_field方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['lo'] = 2;
//value used to identify section movie or celebrity
$data['categoryid'] = $categoryid;
//value used to identify section movie or celebrity
if ($categoryid != 0) {
$data['cat_id'] = $categoryid;
$cat_title = $this->category->getTitle($categoryid);
$data['cat_title'] = $cat_title . " - Movies";
$form_subject = $cat_title;
$crud = new grocery_CRUD();
$crud->set_table('dbx_movies');
$crud->where('catid', $categoryid);
$crud->set_subject('Movie');
$crud->required_fields('title', 'year');
$crud->columns('title');
// $crud->callback_column('name',array($this,'link_title'));
// $crud->set_rules('title','Title','trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Large Image', '', '', 'custom_icon limg-icon img_crop', array($this, 'set_imgurl'));
$crud->add_action('Small Image', '', '', 'custom_icon simg-icon img_crop', array($this, 'set_imgurl'));
$crud->fields('catid', 'title', 'year', 'release_date', 'cast', 'director', 'producer', 'music', 'writer', 'lyrics', 'synopsis', 'seo_url', 'ownerid', 'created_date', 'lastupdate_date');
// $crud->field_type('catid', 'hidden', $categoryid);
$crud->set_relation('catid', 'dbx_categories', 'title', array('type' => 'M'), null, $categoryid);
$crud->display_as('catid', 'Category');
//
$crud->callback_add_field('cast', array($this, 'add_field_cast'));
$crud->callback_add_field('synopsis', array($this, 'add_field_synopsis'));
$crud->callback_edit_field('cast', array($this, 'edit_field_cast'));
$crud->callback_edit_field('synopsis', array($this, 'edit_field_synopsis'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->change_field_type('seo_url', 'invisible');
$crud->change_field_type('lastupdate_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->callback_after_insert(array($this, 'after_insert'));
$crud->unset_jquery();
$state = $crud->getState();
// echo($state);
$data['state'] = $state;
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('movies_view', $output);
$this->load->view('footer_view', $data);
}
}
示例3: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['lo'] = 1;
//value used to identify section movie or celebrity
if ($categoryid != 0) {
$data['cat_id'] = $categoryid;
$cat_title = $this->category->getTitle($categoryid);
$data['cat_title'] = $cat_title . " ";
$form_subject = $cat_title;
$crud = new grocery_CRUD();
$crud->set_table('dbx_celebrities');
$crud->where('catid', $categoryid);
$crud->set_subject($form_subject);
$crud->required_fields('name');
$crud->columns('name');
// $crud->callback_column('name',array($this,'link_title'));
// $crud->set_rules('title','Title','trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Large Image', '', '', 'custom_icon limg-icon img_crop', array($this, 'set_imgurl'));
$crud->add_action('Small Image', '', '', 'custom_icon simg-icon img_crop', array($this, 'set_imgurl'));
$crud->fields('catid', 'name', 'alt_name1', 'alt_name2', 'alt_name3', 'alt_name4', 'title', 'desc', 'sign', 'birth_date', 'birth_place', 'first_film', 'awards', 'height', 'weight', 'seo_url', 'ownerid', 'created_date', 'lastupdate_date');
// $crud->field_type('catid', 'hidden', $categoryid);
$crud->set_relation('catid', 'dbx_categories', 'title', array('type' => 'C'), null, $categoryid);
$crud->display_as('catid', 'Category');
$crud->callback_add_field('desc', array($this, 'add_field_desc'));
$crud->callback_add_field('awards', array($this, 'add_field_awards'));
$crud->callback_edit_field('desc', array($this, 'edit_field_desc'));
$crud->callback_edit_field('awards', array($this, 'edit_field_awards'));
$crud->field_type('sign', 'dropdown', array('Aries' => 'Aries', 'Taurus' => 'Taurus', 'Gemini1' => 'Gemini', 'Cancer' => 'Cancer', 'Leo' => 'Leo', 'Virgo' => 'Virgo', 'Libra' => 'Libra', 'Scorpio' => 'Scorpio', 'Sagittarius' => 'Sagittarius', 'Capricorn' => 'Capricorn', 'Aquarius' => 'Aquarius', 'Pisces' => 'Pisces'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->change_field_type('seo_url', 'invisible');
$crud->change_field_type('lastupdate_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->unset_jquery();
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('celebrities_view', $output);
$this->load->view('footer_view', $data);
}
}
示例4: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('hotel_tariffs');
$crud->set_subject('Hotel Tariffs');
// $crud->unset_fields('ht_id');
$crud->display_as('hotels_hotel_id', 'Hotel Name');
$crud->display_as('ht_hotelRoom', 'Hotel Room');
$crud->display_as('ht_hotelTariffs', 'Hotel Tariffs');
$crud->callback_column('ht_hotelTariffs', array($this, 'set_price'));
$crud->callback_read_field('ht_hotelTariffs', array($this, 'set_price'));
// crud library modified SAM for read_field
$crud->callback_add_field('ht_hotelTariffs', array($this, 'add_price1'));
$crud->callback_edit_field('ht_hotelTariffs', array($this, 'edit_price1'));
$crud->set_relation('hotels_hotel_id', 'hotels', '{hotel_name}');
$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);
}
示例5: buscar
function buscar()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('tp_dependencia');
$crud->set_subject('dependencia');
$crud->set_language('spanish');
$crud->fields('id_dependencia', 'dependencia');
$crud->required_fields('dependencia', 'tipo');
$crud->columns('dependencia');
$crud->edit_fields('dependencia', 'tipo');
$crud->unset_add();
$crud->unset_export();
$crud->unset_print();
$crud->add_action('Campañas de la dependencia', base_url() . 'imagenes/campa.png', '', '', array($this, 'modificar_url_campa'));
$crud->add_action('Contratos de la dependencia', base_url() . 'imagenes/contratos.png', '', '', array($this, 'modificar_url_contratos'));
$crud->callback_add_field('tipo', array($this, 'agregar_tipo'));
$crud->callback_edit_field('tipo', array($this, 'editar_tipo'));
$crud->callback_column('dependencia', array($this, 'nombre_completo'));
$dato = $this->input->post('buscar');
$crud->like('dependencia', "{$dato}");
$crud->callback_before_delete(array($this, 'eliminar_dependencia'));
$output = $crud->render();
$data['opcion'] = 'dependencias';
$data['nombre_usuario'] = $this->modelo->nombre_usuario($this->session->userdata('id_usuario'));
$data['logo'] = $this->modelo->logo();
$data['url_logo'] = $this->modelo->url_logo();
$data['logo_opcional'] = $this->modelo->logo_opcional();
$data['url_logo_opcional'] = $this->modelo->url_logo_opcional();
$this->load->view('cabecera', $data);
$data['opcion_dependencia'] = 'buscar';
$this->load->view('opciones_dependencia', $data);
$this->load->view('dependencias', $output);
$this->load->view('pie');
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例6: hotel_rooms
public function hotel_rooms()
{
$agent_id = $this->ion_auth->user()->row()->id;
$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->columns(array('room_hotel', 'room_title', '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_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'>";
});
$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);
$agent_hotels = $this->db->select('hotel_id')->get_where('hotels', array('hotel_status' => 1, 'hotel_agent_id' => $agent_id))->result();
// var_dump($agent_hotels);
//getting only rooms that belong to hotels of the agent
foreach ($agent_hotels as $k => $v) {
$hotels_id[] = $v->hotel_id;
}
$ids = '(0)';
if (!empty($hotels_id)) {
$ids = '(';
$ids .= implode(',', $hotels_id);
$ids .= ')';
}
//custom where_in function like in CI
$crud->in_where('room_hotel', $ids);
// $crud->set_relation('room_hotel', 'hotels', '{hotel_name}');
/*
* for hotels list added by agent
*/
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_agent_id' => $this->ion_auth->get_user_id()), 'hotel_id');
$hrf = $this->generic_model->array_from_db($hrf, 'hotel_id, hotel_name');
$crud->field_type('room_hotel', 'dropdown', $hrf);
$output = $crud->render();
$data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Hotel Rooms', 'pagedesc' => 'Hotel Rooms', 'contenttitle' => 'Hotel Room List Records', 'left_menu' => 'agents_menu');
$this->load->view('gc_admin_wrapper', $data);
}
示例7: array
function supervisor_management()
{
$id = $this->ion_auth->user()->row()->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->set_table('users');
$crud->set_subject('Supervisor');
$crud->columns('username', 'password_visible', 'su_branch_id', 'su_can_uploadhotdeal');
$crud->required_fields('username', 'password_visible', 'su_branch_id');
$crud->fields('username', 'password_visible', 'su_branch_id', 'su_can_uploadhotdeal');
$crud->display_as('password_visible', 'Password');
$crud->display_as('su_branch_id', 'Branch');
$crud->display_as('su_can_uploadhotdeal', 'Able to upload food & beverage');
$crud->callback_add_field('su_branch_id', array($this, '_selected_branch_callback'));
//For add page set pre-selected value if got pass in brach id
$crud->field_type('su_branch_id', 'dropdown', $this->ion_auth->get_merchant_branch_list($id));
//For view show the branch list text
$crud->callback_insert(array($this, 'supervisor_insert_callback'));
$crud->callback_update(array($this, 'supervisor_update_callback'));
$crud->set_rules('username', 'Username', 'trim|required|callback_supervisor_username_check');
$crud->field_type('su_can_uploadhotdeal', 'true_false');
$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("/supervisor/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("/supervisor/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 Supervisor');
$crud->set_lang_string('form_update_and_go_back', 'Update and View Supervisor');
$crud->unset_export();
$crud->unset_print();
$crud->unset_read();
$state = $crud->getState();
//filter that this is supervisor type user and it is under this merchant
$crud->where('su_merchant_id', $id);
$crud->where('main_group_id', $this->group_id_supervisor);
$output = $crud->render();
return $output;
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例8: kegiatan_butir
public function kegiatan_butir()
{
try {
$this->load->model("kegiatan_m");
$data = $this->kegiatan_m->get_kegiatan_subunsur(array("id_kegiatan_subunsur" => $this->uri->segment(4)));
$subunsur = isset($data[0]->subunsur) ? $data[0]->subunsur : "";
$subjek = ' <a href="' . base_url() . 'admin/kegiatan_subunsur/' . $this->uri->segment(3) . '">
Butir Kegiatan </a>: ' . $subunsur . '';
$crud = new grocery_CRUD();
$state = $crud->getState();
$crud->where('tbl_kegiatan_butir.id_kegiatan_subunsur', $this->uri->segment(4));
$crud->set_table('tbl_kegiatan_butir');
$crud->set_subject($subjek);
//$crud->getModel()->set_add_value('order_date', date("Y-m-d"));
$crud->set_relation('change_by', 'tbl_user', 'email');
$crud->set_relation('id_kegiatan_subunsur', 'tbl_kegiatan_subunsur', 'subunsur');
$crud->set_relation_n_n('Jenjang', 'tbl_kegiatan_jenjang', 'tbl_jenjang_jabatan', 'id_kegiatan_butir', 'id_jenjang_jabatan', 'jenjang_jabatan', NULL, array('id_jenjang_auditor' => $this->uri->segment(3)));
$crud->required_fields('Jenjang ', 'butir', 'angka_kredit', 'satuan_hasil');
//$crud->unique_fields('butir');
$crud->fields('Jenjang', 'id_kegiatan_subunsur', 'kode', 'butir', 'angka_kredit', 'satuan_hasil');
$crud->columns('Jenjang', 'id_kegiatan_subunsur', 'kode', 'butir', 'angka_kredit', 'satuan_hasil');
$crud->display_as('id_kegiatan_subunsur', 'Sub Unsur');
$crud->order_by('id_kegiatan_butir', 'asc');
$crud->callback_before_update(array($this, 'get_change_by_callback'));
$crud->callback_before_insert(array($this, 'kegiatan_butir_before_insert_callback'));
$crud->callback_field('change_date', array($this, 'format_date_callback'));
$crud->change_field_type('change_by', 'readonly');
$crud->change_field_type('change_date', 'readonly');
$crud->callback_add_field('id_kegiatan_subunsur', array($this, 'kegiatan_butir_form_callback'));
$crud->callback_edit_field('id_kegiatan_subunsur', array($this, 'kegiatan_butir_form_callback'));
$crud->unset_read();
$crud->unset_save();
$sitemap = $this->get_sitemap();
$output = $crud->render($sitemap);
$this->load->view('theme/theme_default', $output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例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);
}
示例10: 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);
}
示例11: daftar_kegiatan_transaksi
public function daftar_kegiatan_transaksi()
{
try {
$this->load->model("kegiatan_m");
$id_kegiatan_butir = $this->uri->segment(4);
$kegiatan_butir = $this->kegiatan_m->detail_kegiatan_butir(array("id_kegiatan_butir" => $id_kegiatan_butir));
$unsur = isset($kegiatan_butir[0]->unsur) ? $kegiatan_butir[0]->unsur : "";
$subunsur = isset($kegiatan_butir[0]->subunsur) ? $kegiatan_butir[0]->subunsur : "";
$butir = isset($kegiatan_butir[0]->butir) ? $kegiatan_butir[0]->butir : "";
$crud = new grocery_CRUD();
$state = $crud->getState();
$crud->set_table('tbl_kegiatan_transaksi');
$crud->set_relation('change_by', 'tbl_user', 'email');
$crud->set_relation('id_kegiatan_butir', 'tbl_kegiatan_butir', 'butir');
if ($this->uri->segment(3) == 2) {
$crud->required_fields('tanggal_kegiatan', 'tanggal_kegiatan_selesai');
$crud->set_rules('tanggal_kegiatan', 'Tanggal Mulai', 'required|callback_tanggal_mulai_check');
} else {
$crud->required_fields('tanggal_kegiatan', 'tanggal_kegiatan_selesai');
}
$crud->required_fields('tanggal_kegiatan', 'tanggal_kegiatan_selesai');
$crud->set_primary_key('id_kegiatan_transaksi');
$crud->where("tbl_kegiatan_transaksi.id_kegiatan_butir", $id_kegiatan_butir);
$crud->where("tbl_kegiatan_transaksi.id_user", $this->get_user_login());
//$crud->where("id_jenjang", $id_jenjang);
$subjek = '
<a href="' . base_url() . 'pegawai/daftar_kegiatan/' . $this->uri->segment(3) . '">
' . $unsur . ' </a> <i class="fa fa-angle-double-right"></i>
' . $subunsur . ' <i class="fa fa-angle-double-right"></i>
' . $butir . '';
$crud->set_subject($subjek);
//$crud->set_field_upload('bukti','assets/uploads/berkas');
$crud->columns('tanggal_kegiatan', 'tanggal_kegiatan_selesai', 'keterangan', 'angka_kredit', 'status');
if (strtolower($unsur) != 'pengawasan') {
$crud->fields('id_kegiatan_butir', 'tanggal_kegiatan', 'tanggal_kegiatan_selesai', 'lembur', 'keterangan', 'angka_kredit', 'status', 'id_user');
} else {
$crud->fields('id_kegiatan_butir', 'tanggal_kegiatan', 'tanggal_kegiatan_selesai', 'lembur', 'keterangan', 'angka_kredit', 'status', 'id_user');
}
$crud->add_action('Form Spmt', '', 'pegawai/form_spmt/' . $id_kegiatan_butir, 'fa fa-file-archive-o');
$crud->add_action('Unggah Bukti', '', 'pegawai/daftar_kegiatan_berkas', 'fa fa-upload');
$crud->display_as("id_kegiatan_butir", "Butir Kegiatan")->display_as("tanggal_kegiatan", "Tanggal Mulai")->display_as("tanggal_kegiatan_selesai", "Tanggal Selesai")->display_as("id_user", "Oleh")->display_as("change_date", "Tanggal")->display_as("id_periode", "Periode")->display_as("id_kegiatan_jabatan", "Bertindak Sebagai");
$crud->callback_add_field('id_kegiatan_butir', array($this, '_form_get_butir_callback'));
$crud->callback_edit_field('id_kegiatan_butir', array($this, '_form_get_butir_callback'));
$crud->callback_before_update(array($this, 'get_change_by_callback'));
//$crud->callback_before_insert(array($this,'_daftar_kegiatan_transaksi_form_callback'));
$crud->callback_add_field('id_user', array($this, '_form_get_user_callback'));
$crud->callback_edit_field('id_user', array($this, '_form_get_user_callback'));
$crud->change_field_type('change_by', 'readonly');
$crud->change_field_type('change_date', 'readonly');
$crud->change_field_type('status', 'readonly');
$crud->change_field_type('angka_kredit', 'readonly');
//$crud->unset_delete();
//$crud->unset_edit();
//$crud->unset_add();
$crud->unset_read();
$sitemap = $this->get_sitemap();
$output = $crud->render($sitemap);
$this->load->view('theme/theme_pegawai', $output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例12: bitacora
public function bitacora()
{
if ($this->session->userdata('nivel') < 5) {
$this->session->set_flashdata('error', 'Su nivel no le permite realizar este proceso');
redirect(site_url("index/principal"), 301);
}
$anio = array();
for ($i = date('Y'); $i >= date("Y") - 1; $i--) {
$anio[$i] = $i;
}
$semana = array();
for ($i = 1; $i <= 53; $i++) {
$semana[$i] = $i;
}
$where = array('diresa' => $this->session->userdata('diresa'));
$crud = new grocery_CRUD();
$crud->set_table('bitacora');
$crud->columns('ano', 'semana', 'diresa', 'individual', 'edas', 'iras', 'brotes', 'inmuno', 'cobertura', 'usuario', 'fechaReg');
$crud->where($where);
$crud->display_as('ano', 'Año')->display_as('inmuno', 'Inmunoprevenibles')->display_as('fechaReg', 'Registro');
$crud->set_subject('Anexo');
$crud->set_relation('diresa', 'diresas', 'nombre', array('codigo' => $this->session->userdata('diresa')));
$crud->field_type('ano', 'dropdown', $anio);
$crud->field_type('semana', 'dropdown', $semana);
$crud->set_rules('diresa', 'DIRESA', 'required|xss');
$crud->set_rules('ano', 'Año', 'required|numeric|xss');
$crud->set_rules('semana', 'Semana', 'required|numeric|xss');
$crud->set_rules('individual', 'Individual', 'required|xss');
$crud->set_rules('edas', 'EDAs', 'required|xss');
$crud->set_rules('iras', 'IRAs', 'required|xss');
$crud->set_rules('brotes', 'Sección Brotes', 'required|xss');
$crud->set_rules('inmuno', 'Sección Inmunoprevenibles', 'required|xss');
$crud->set_rules('cobertura', 'Cobertura', 'required|xss');
$crud->callback_add_field('individual', array($this, 'insertarIndividual'));
$crud->callback_add_field('edas', array($this, 'insertarEdas'));
$crud->callback_add_field('iras', array($this, 'insertarIras'));
$crud->callback_add_field('cobertura', array($this, 'insertarCobertura'));
$crud->callback_add_field('usuario', array($this, 'insertarUsuario'));
$crud->callback_add_field('fechaReg', array($this, 'insertarFecha'));
$crud->callback_after_insert(array($this, 'ingresaBitacora'));
$output = $crud->render();
$this->_example_output4($output);
}
示例13: 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();
}
示例14: ordenes
public function ordenes()
{
$crud = new grocery_CRUD();
$crud->set_table('ordenes');
$crud->columns('Fecha', 'idCliente', 'idproducto', 'cantidad', 'precio', 'iva', 'subTotal', 'total');
$crud->display_as('idCliente', 'cliente');
$crud->display_as('idproducto', 'producto');
$crud->set_subject('ordenes');
$crud->set_relation('idCliente', 'clientes', 'escuela');
$crud->set_relation('idproducto', 'producto', 'nombre');
$crud->set_relation('precio', 'producto', 'precio');
$crud->required_fields('idCliente', 'idproducto', 'iva', 'precio');
$crud->callback_add_field('cantidad', array($this, 'add_field_callback_1'));
//$crud->callback_add_field('GANANCIA',array($this,'add_field_callback_2'));
//$crud->callback_add_field('PRECIO_NETO',array($this,'add_field_callback_3'));
// $crud->callback_add_field('IVA',array($this,'add_field_callback_4'));
//$crud->callback_add_field('TOTAL',array($this,'add_field_callback_5'));
$output = $crud->render();
$this->_menu_output($output);
}
示例15: buscar
function buscar()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('tp_medios');
$crud->set_subject('medios');
$crud->set_language('spanish');
$crud->fields('razon_social', 'nombre_comercial', 'padron_proveedor', 'clasificacion', 'clasificacion_aux', 'cobertura');
$crud->columns('razon_social', 'nombre_comercial', 'padron_proveedor', 'clasificacion_aux', 'cobertura');
$crud->display_as('razon_social', 'Razón social')->display_as('nombre_comercial', 'Nombre comercial')->display_as('padron_proveedor', 'Número de proveedor')->display_as('clasificacion_aux', 'Clasificación')->display_as('cobertura', 'Cobertura')->display_as('perfil_demografico', 'Perfil demográfico')->display_as('tarifario', 'Tarifario')->display_as('ver_tarifario', '¿publicar tarifario?')->display_as('acta_constitutiva', 'Acta constitutiva')->display_as('curriculum_empresarial', 'Currículum empresarial')->display_as('ficha_tecnica', 'Ficha técnica')->display_as('ver_ficha_tecnica', '¿publicar ficha técnica?');
$crud->required_fields('razon_social', 'nombre_comercial', 'padron_proveedor', 'clasificacion', 'cobertura');
$crud->edit_fields('razon_social', 'nombre_comercial', 'padron_proveedor', 'clasificacion', 'cobertura', 'perfil_demografico', 'tarifario', 'ver_tarifario', 'acta_constitutiva', 'curriculum_empresarial', 'ficha_tecnica', 'ver_ficha_tecnica');
$crud->set_subject('medio');
$crud->unset_add();
$crud->unset_export();
$crud->unset_print();
$crud->set_relation('clasificacion', 'tp_clasificacion', 'descripcion_clasificacion');
$crud->set_relation('cobertura', 'tp_cobertura', 'cobertura');
$crud->set_field_upload('acta_constitutiva', 'archivos/actas_constitutivas');
$crud->set_field_upload('curriculum_empresarial', 'archivos/curriculum_empresarial');
$crud->set_field_upload('tarifario', 'archivos/tarifarios');
$crud->set_field_upload('ficha_tecnica', 'archivos/fichas_tecnica');
$crud->callback_after_upload(array($this, 'obtener_imagen_upload'));
$crud->callback_column('clasificacion_aux', array($this, 'columna_clasificacion'));
$crud->add_action('Contratos del medio', base_url() . 'imagenes/contratos.png', '', '', array($this, 'modificar_url_contratos'));
$crud->add_action('Facturas del medio', base_url() . 'imagenes/facturas.png', '', '', array($this, 'modificar_url_facturas'));
$crud->add_action('ver todos los datos', base_url() . 'imagenes/lupa.gif', '', '', array($this, 'modificar_url_detalle_registro'));
$dato = $this->input->post('buscar');
$crud->like('razon_social', "{$dato}");
$crud->or_like('nombre_comercial', "{$dato}");
$crud->or_like('descripcion_clasificacion', "{$dato}");
$crud->callback_add_field('ver_tarifario', array($this, 'agregar_ver_tarifario'));
$crud->callback_edit_field('ver_tarifario', array($this, 'editar_ver_tarifario'));
$crud->callback_add_field('ver_ficha_tecnica', array($this, 'agregar_ver_ficha_tecnica'));
$crud->callback_edit_field('ver_ficha_tecnica', array($this, 'editar_ver_ficha_tecnica'));
$crud->callback_before_delete(array($this, 'eliminar_medio'));
$output = $crud->render();
$data['opcion'] = 'medios';
$data['nombre_usuario'] = $this->modelo->nombre_usuario($this->session->userdata('id_usuario'));
$data['logo'] = $this->modelo->logo();
$data['url_logo'] = $this->modelo->url_logo();
$data['logo_opcional'] = $this->modelo->logo_opcional();
$data['url_logo_opcional'] = $this->modelo->url_logo_opcional();
$this->load->view('cabecera', $data);
$data['opcion_medio'] = 'buscar';
$this->load->view('opciones_medios', $data);
$this->load->view('medios', $output);
$this->load->view('pie');
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}