本文整理汇总了PHP中grocery_CRUD::change_field_type方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::change_field_type方法的具体用法?PHP grocery_CRUD::change_field_type怎么用?PHP grocery_CRUD::change_field_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::change_field_type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: get_crud
private function get_crud()
{
$this->data['message'] = $this->session->flashdata('message');
$crud = new grocery_CRUD();
$crud->set_theme(GROCERY_CRUD_THEME);
$crud->set_table('usuario');
$crud->set_subject('Usuário');
$crud->unset_columns('id', 'senha', 'senha_anterior1', 'senha_anterior2', 'senha_anterior3', 'ultima_troca', 'cadastro');
$crud->fields('id', 'nome', 'login', 'email', 'grupos', 'tipo_usuario_id', 'situacao_usuario_id', 'senha', 'senha_anterior1', 'senha_anterior2', 'senha_anterior3');
$crud->unset_texteditor('id', 'senha', 'senha_anterior1', 'senha_anterior2', 'senha_anterior3', 'ultima_troca', 'cadastro');
$crud->change_field_type('id', 'invisible');
$crud->change_field_type('senha', 'invisible');
$crud->change_field_type('senha_anterior1', 'invisible');
$crud->change_field_type('senha_anterior2', 'invisible');
$crud->change_field_type('senha_anterior3', 'invisible');
$crud->set_relation('situacao_usuario_id', 'situacao_usuario', 'descricao');
$crud->display_as('situacao_usuario_id', 'Situacao');
$crud->set_relation('tipo_usuario_id', 'tipo_usuario', 'descricao');
$crud->display_as('tipo_usuario_id', 'Tipo de Usuário');
$crud->set_relation_n_n('grupos', 'grupo_usuario_x_usuario', 'grupo_usuario', 'usuario_id', 'grupo_usuario_id', 'descricao');
/* regras e campos obrigatórios */
$crud->required_fields('login', 'grupos', 'tipo_usuario_id', 'situacao_usuario_id');
$crud->set_rules('login', 'Login', 'required|min_length[2]');
$crud->set_rules('grupos', 'Grupos', 'required');
$crud->set_rules('tipo_usuario_id', 'Tipo de Usuário', 'required');
$crud->set_rules('situacao_usuario_id', 'Situação do Usuário', 'required');
$crud->callback_before_insert(array($this, 'checking_new_user'));
return $crud->render();
}
示例3: array
/**
* function ni digunakan untuk kv urus maklumat pengguna pada crud
* input: -
* author: Mior Mohd Hanif
* Date: 28 Jun 2013
* Modification Log:
*/
function user_management()
{
$user_login = $this->ion_auth->user()->row();
$col_id = $user_login->col_id;
$crud = new grocery_CRUD();
$crud->where('user.col_id', $col_id);
$crud->set_theme('flexigrid');
$crud->set_subject('Pengguna');
$crud->set_table('user');
$crud->display_as('user_name', 'Nama Pengguna')->display_as('user_username', 'Katanama')->display_as('user_password', 'Katalaluan')->display_as('user_email', 'Email')->display_as('col_id', 'Kolej')->display_as('created_on', 'Tarikh Daftar')->display_as('last_login', 'Tarikh Log Masuk')->display_as('active', 'Status')->display_as('phone', 'No. Telefon');
$crud->set_relation('col_id', 'college', 'col_name');
$crud->required_fields('user_name', 'user_username', 'user_password', 'user_email', 'active', 'phone');
$crud->set_rules('user_username', 'Katanama', 'trim|required');
$crud->set_rules('phone', 'No. Telefon', 'trim|required|numeric');
$crud->set_rules('user_email', 'Email', 'trim|required|valid_email');
$crud->unset_columns('ip_address', 'user_password', 'salt', 'activation_code', 'forgotten_password_code', 'forgotten_password_time', 'remember_code');
$crud->unset_fields('ip_address', 'activation_code', 'forgotten_password_code', 'forgotten_password_time', 'remember_code', 'last_login');
$crud->change_field_type('user_password', 'password');
$crud->change_field_type('created_on', 'invisible');
$crud->change_field_type('salt', 'invisible');
$crud->change_field_type('col_id', 'invisible');
$crud->callback_before_insert(array($this, 'callback_for_time_and_encrypt_password'));
$crud->callback_column('created_on', array($this, 'strtotime_convert_to_date'));
$crud->callback_column('last_login', array($this, 'strtotime_convert_to_date'));
$output = $crud->render();
$header = "<legend><h4>Penyelenggaraan Pengguna</h4></legend>";
$this->_main_output($output, $header);
}
示例4: 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);
}
}
示例5: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('pengumuman');
$crud->columns('isi', 'created_at', 'updated_at', 'status');
$crud->unset_export();
$crud->unset_print();
$crud->unset_texteditor('isi');
$crud->change_field_type('created_at', 'invisible');
$crud->change_field_type('updated_at', 'invisible');
$crud->callback_before_insert(array($this, "_timestamp"));
$output = $crud->render();
$output->title = 'Kelola Pengumuman';
$this->template->load('template/template_main', 'admin/pengumuman', $output);
}
示例6: master
private function master()
{
$crud = new grocery_CRUD();
$crud->set_table('contents');
$crud->unset_columns('jenis', 'slug', 'isi');
$crud->callback_before_insert(array($this, "_timestamp"));
$crud->callback_before_update(array($this, "_timestamp"));
$crud->unset_export();
$crud->unset_print();
$crud->unset_read();
$crud->change_field_type('jenis', 'invisible');
$crud->change_field_type('slug', 'invisible');
$crud->change_field_type('created_at', 'invisible');
$crud->change_field_type('updated_at', 'invisible');
return $crud;
}
示例7: index
public function index()
{
$this->authlibrary->hasPrivilege("announcement");
$crud = new grocery_CRUD();
$crud->set_table('announcement');
$crud->columns('isi', 'created_at', 'updated_at', 'status');
$crud->unset_export();
$crud->unset_print();
$crud->unset_texteditor('isi');
$crud->change_field_type('created_at', 'invisible');
$crud->change_field_type('updated_at', 'invisible');
$crud->callback_before_insert(array($this, "_timestamp"));
$output = $crud->render();
$output->menu = "announcement";
$output->title = 'Announcement';
$this->template->load('backend/template', 'backend/grocery_crud_view', $output);
}
示例8: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('admin');
$crud->columns('nama', 'username', 'email', 'last_login', 'role');
$crud->unset_export();
$crud->unset_print();
$crud->unset_read();
$crud->unset_edit_fields('password');
$crud->callback_before_insert(array($this, "_timestamp"));
$crud->change_field_type('created_at', 'invisible');
$crud->change_field_type('updated_at', 'invisible');
$crud->change_field_type('last_login', 'invisible');
$output = $crud->render();
$output->title = 'Kelola Admin';
$this->template->load('template/template_main', 'admin/contents', $output);
}
示例9: 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);
}
}
示例10: index1
public function index1()
{
$crud = new grocery_CRUD();
$crud->set_theme('twitter-bootstrap');
// $crud->set_theme('datatables');
// $crud->set_theme('flexigrid');
$crud->set_table('users');
$crud->change_field_type('email', 'text');
$output = $crud->render();
$this->_example_output($output);
}
示例11:
function users_management()
{
$crud = new grocery_CRUD();
$crud->set_table('operarios');
$crud->set_subject('Usuario');
$crud->set_theme('datatables');
$crud->columns('id', 'nombre');
$crud->edit_fields('nombre', 'clave', 'eliminado');
$crud->add_fields('id', 'nombre', 'clave');
$crud->required_fields('id', 'nombre', 'clave');
$crud->change_field_type('clave', 'password');
$crud->callback_before_insert(array($this, '_encrypt_password_callback'));
$crud->callback_before_update(array($this, '_encrypt_password_callback'));
$crud->unset_delete();
$output = $crud->render();
$this->_output_crud($output, 'Usuarios');
}
示例12: index
public function index($stat = '')
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
switch ($stat) {
case '':
default:
$user_ward_id = $this->session->userdata('nw_id');
$crud->set_table('nus_bed');
$crud->where('nus_bed.nw_id', $user_ward_id);
$crud->columns('nb_bed_no', 'np_pmi_id', 'nbs_id', 'nb_datetime', 'ns_id');
$crud->display_as('nb_bed_no', 'Bed No.')->display_as('np_pmi_id', 'Patient Name')->display_as('nbs_id', 'Remarks')->display_as('nb_datetime', 'Date/Time Registered')->display_as('ns_id', 'Nurse');
$crud->set_relation('nbs_id', 'nus_bed_status', 'nbs_desc');
$crud->set_relation('ns_id', 'nus_staff', 'ns_fullname');
$crud->set_relation('np_pmi_id', 'nus_patient', 'np_fullname');
// $crud->unset_add();
// $crud->unset_delete();
$crud->edit_fields('np_pmi_id', 'nbs_id', 'nb_datetime', 'ns_id');
$crud->add_fields('nb_bed_no', 'nw_id', 'nbs_id');
$crud->field_type('nw_id', 'hidden');
// $crud->field_type('nbs_id', 'hidden');
$crud->required_fields('nb_bed_no');
$crud->unset_read();
// $crud->change_field_type('nb_bed_no', 'readonly');
$crud->change_field_type('ns_id', 'readonly');
$crud->callback_before_update(array($this, 'autoRegisterBed'));
$crud->callback_before_insert(array($this, 'addBed'));
break;
case 'patient':
$crud->set_table('nus_patient');
$crud->set_relation('np_gender', 'nus_patient_gender', 'npg_desc');
$crud->required_fields('np_pmi_no', 'np_fullname', 'np_ic', 'np_passport', 'np_gender');
$crud->fields('np_pmi_id', 'np_fullname', 'np_ic', 'np_passport', 'np_gender');
$crud->field_type('np_pmi_id', 'hidden');
$crud->display_as('np_pmi_id', 'PMI No.')->display_as('np_fullname', 'Full Name')->display_as('np_ic', 'IC No.')->display_as('np_passport', 'Passport No.')->display_as('np_gender', 'Gender');
$crud->callback_before_insert(array($this, 'autoInsertPriKeyPatient'));
break;
}
$output = $crud->render();
$this->viewpage('v_mainpage', $output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例13: generarCobertura
public function generarCobertura()
{
if ($this->session->userdata('institucion') != 'A') {
$this->session->set_flashdata('error', 'Su nivel de usuario no le permite realizar este proceso');
redirect(site_url("index/principal"), 301);
}
$tipo = array('0' => 'No Notificó', '1' => 'Notificó', '2' => 'Not. Negativa');
$crud = new grocery_CRUD();
$crud->columns('ano', 'semana', 'ndiresa', 'nred', 'nmicrored', 'nestablec', 'notificacion', 'fecha', 'hora');
$crud->set_table('cobertura');
$crud->set_subject('Proceso');
switch ($this->session->userdata('nivel')) {
case 5:
$where = array('diresa' => $this->session->userdata('diresa'));
break;
case 6:
$where = array('diresa' => $this->session->userdata('diresa'), 'red' => $this->session->userdata('red'));
break;
case 7:
$where = array('diresa' => $this->session->userdata('diresa'), 'red' => $this->session->userdata('red'), 'microred' => $this->session->userdata('microred'));
break;
default:
$this->session->set_flashdata('error', 'Este proceso no está permitido para su nivel de usuario');
redirect(site_url("index/principal"), 301);
break;
}
$crud->field_type('notificacion', 'dropdown', $tipo);
$crud->display_as('establec', 'Establecimiento');
$crud->display_as('notificacion', 'Notificación');
$crud->display_as('ndiresa', 'Diresa');
$crud->display_as('nred', 'Red');
$crud->display_as('nmicrored', 'Microred');
$crud->display_as('nestablec', 'Establecimiento');
$crud->where($where);
$crud->change_field_type('ano', 'readonly');
$crud->change_field_type('semana', 'readonly');
$crud->change_field_type('diresa', 'readonly');
$crud->change_field_type('red', 'readonly');
$crud->change_field_type('microred', 'readonly');
$crud->change_field_type('establec', 'readonly');
//$crud->unset_read();
//$crud->unset_edit();
$crud->unset_delete();
$crud->unset_print();
$crud->unset_add();
///////////////////////////////////////////////////////////////////////////////
$crud->add_action_peru('Añadir Proceso', '', 'proceso', 'add-icon');
///////////////////////////////////////////////////////////////////////////////
$output = $crud->render();
$this->_example_output1($output);
}
示例14: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('usrmgr');
$crud->change_field_type('password', 'password');
$crud->callback_edit_field('password', array($this, 'decrypt_password_callback'));
$crud->columns('username', 'nama_lengkap', 'email', 'level', 'blokir');
$crud->callback_before_insert(array($this, 'encrypt_password_callback'));
$crud->callback_before_update(array($this, 'encrypt_password_callback'));
$crud->set_subject('Users');
$crud->fields('nama_lengkap', 'username', 'password', 'email', 'level', 'access_control', 'blokir');
$crud->required_fields('nama_lengkap', 'username', 'level', 'blokir');
$crud->set_relation_n_n('access_control', 'usrmgr_access', 'modul', 'id_users', 'id_modul', 'nama_modul', 'priority');
//$crud->set_relation('salesRepEmployeeNumber','employees','lastName');
$output = $crud->render();
$data['subject'] = 'Pengaturan Pengguna';
$data['content'] = $this->load->view('crud.php', $output, true);
$this->load->view('base_theme', $data);
}
示例15: data_topic
public function data_topic()
{
$crud = new grocery_CRUD();
// table name
$crud->set_table("help_topic");
// displayed columns on list
$crud->columns('title', 'group_id', 'content');
// displayed columns on edit operation
$crud->edit_fields('title', 'group_id', 'content');
// displayed columns on add operation
$crud->add_fields('title', 'url', 'group_id', 'content');
// caption of each columns
$crud->display_as('group_id', 'Group')->display_as('title', 'Title')->display_as('content', 'Content');
$crud->change_field_type('url', 'hidden');
$crud->set_relation('group_id', 'help_group', 'name');
$crud->callback_before_insert(array($this, 'before_insert_topic'));
// render
$output = $crud->render();
$this->view("grocery_CRUD", $output, "help_topic");
}