本文整理汇总了PHP中grocery_CRUD::edit_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::edit_fields方法的具体用法?PHP grocery_CRUD::edit_fields怎么用?PHP grocery_CRUD::edit_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::edit_fields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mostrar_busqueda
public function mostrar_busqueda()
{
$grocery = new grocery_CRUD();
$grocery->set_theme('bootstrap');
$grocery->set_table('denuncias');
$grocery->set_language('spanish');
$grocery->set_relation('idEstatus', 'estatus', 'descripcion');
$grocery->set_relation('idRecepcion', 'recepcion', 'descripcion');
$grocery->set_relation('idDependencia', 'dependencias', 'dependencia');
$grocery->set_relation('idCiudadano', 'ciudadanos', '{nombre} \\n{apellidoPa} \\n{apellidoMa}');
$grocery->set_relation('idDireccion', 'direcciones', 'colonia');
$grocery->set_relation('idAsunto', 'asuntos', 'descripcion');
$grocery->set_relation('idMedios', 'medios', 'descripcion');
$grocery->display_as('idDependencia', 'Dependencia');
$grocery->display_as('idCiudadano', 'Ciudadano');
$grocery->display_as('idDireccion', 'Dirección');
$grocery->display_as('idRecepcion', 'Recepción');
$grocery->display_as('idEstatus', 'Estatus');
$grocery->display_as('idAsunto', 'Asunto');
$grocery->display_as('idMedios', 'Medios');
$grocery->unset_add();
$grocery->unset_export();
//$grocery->unset_edit();
$grocery->edit_fields('fecha', 'idDependencia', 'idEstatus', 'idRecepcion', 'idMedios');
$grocery->add_action('Editar ciudadano', '', 'ciudadanos/editar_ciudadano');
$grocery->add_action('Editar Direccion', '', 'direcciones/editar_direccion');
$grocery->add_action('Editar Asunto', '', 'asuntos/editar_asunto');
$grocery->columns('fecha', 'idDependencia', 'idCiudadano', 'idEstatus', 'idRecepcion', 'idDireccion', 'idAsunto');
$output = $grocery->render();
$this->_example_output($output);
}
示例2: biodata
public function biodata()
{
try {
$crud = new grocery_CRUD();
$crud->set_table('tbl_user');
$crud->set_subject('Biodata');
$crud->set_relation('id_wilayah', 'tbl_wilayah', 'wilayah');
$crud->set_relation('id_pendidikan', 'tbl_pendidikan', 'pendidikan');
$crud->set_relation('id_jenjang_auditor', 'tbl_jenjang_auditor', 'jenjang_auditor');
$crud->set_relation('id_jenjang_jabatan', 'tbl_jenjang_jabatan', 'jenjang_jabatan');
$crud->set_relation('id_jenjang_golongan', 'tbl_jenjang_golongan', 'jenjang_golongan');
$state = $crud->getState();
if ($state == 'list' or $state == 'success') {
redirect('penilai/biodata/edit/' . $this->get_user_login());
}
$crud->edit_fields('id_wilayah', 'nama_depan', 'nama_tengah', 'nama_belakang', 'jenis_kelamin', 'email');
$crud->display_as('id_wilayah', 'Wilayah')->display_as('id_pendidikan', 'Pendidikan')->display_as('unit_kerja_telp', 'Telp. Unit Kerja')->display_as('id_jenjang_auditor', 'Jenjang Auditor')->display_as('id_jenjang_jabatan', 'Jenjang Jabatan')->display_as('id_jenjang_golongan', 'Jenjang Golongan');
$crud->change_field_type('id_jenjang_auditor', 'readonly');
$crud->change_field_type('id_jenjang_jabatan', 'readonly');
$crud->change_field_type('id_jenjang_golongan', 'readonly');
$crud->change_field_type('id_pendidikan', 'readonly');
$crud->unset_save();
$crud->unset_add();
$crud->unset_read();
$sitemap = $this->get_sitemap();
$output = $crud->render($sitemap);
$this->load->view('theme/theme_pegawai.php', $output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例3: manage_posts
public function manage_posts()
{
if (!$this->session->is_admin || !$this->session->is_admin_loggedin) {
redirect('admin');
}
$crud = new grocery_CRUD();
$crud->set_theme('datatables')->set_table('post')->set_subject('Post')->columns('title', 'post', 'date_posted');
// the columns from the table to be displayed in particular
/* display_as('field_name', 'Label') function is use if you want to customize your field names on the table */
$crud->display_as('title', 'Post Title')->display_as('post', 'User\'s Post')->display_as('date_posted', 'Date');
/*
add_fields() function is very useful when you want to add a new record to a table
but only with the specific fields. Say, you don't need to set an `id` field
because id is already set to auto_increment. So, here in Grocery CRUD, when you want to
add a new record, you can customize what particular fields you want to be displayed.
edit_fields() function is use when you want to edit a record from a table
but you only want specific fields to be updated because there are fields
that is not neccessary to be updated. In this case, we only want the fields:
'id','user_id', 'title', 'post', 'slug' to be editable from a table and date_posted is not neccessary.
required_fields() function simply a rule when you add or update a record from a table
which fields must not be null or in other words, in the add/edit form which fields are required.
*/
$crud->add_fields('user_id', 'title', 'post', 'slug');
$crud->edit_fields('id', 'user_id', 'title', 'post', 'slug');
$crud->required_fields('id', 'user_id', 'title', 'post', 'slug');
$output = $crud->render();
$this->load->view('admin/admin_header_view', $output);
$this->load->view('admin/admin_nav_view');
$this->load->view('admin/admin_panel_view', $output);
$this->load->view('admin/admin_footer_view');
}
示例4: 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('tipo_orcamento');
$crud->set_subject('Tipo de Orçamento');
$crud->columns('id', 'descricao');
$crud->edit_fields('descricao');
$crud->add_fields('descricao');
return $crud->render();
}
示例5: 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('fase_projeto');
$crud->set_subject('Fase de Projeto');
$crud->columns('id', 'descricao');
$crud->edit_fields('descricao');
$crud->add_fields('descricao');
$crud->required_fields('descricao');
return $crud->render();
}
示例6: category
public function category()
{
$crud = new grocery_CRUD();
$crud->set_table('blog_category');
$crud->columns('category_name', 'description');
$crud->edit_fields('category_name', 'description');
$crud->add_fields('category_name', 'description');
$crud->display_as('category_name', 'Category')->display_as('description', 'Description');
$crud->set_subject('Category');
$crud->set_relation_n_n('Articles', 'blog_category_article', 'blog_article', 'category_id', 'article_id', 'article_title');
$output = $crud->render();
$this->view('grocery_CRUD', $output, 'blog_category');
}
示例7:
function machines_management()
{
$crud = new grocery_CRUD();
$crud->set_table('maquinas');
$crud->set_theme('datatables');
$crud->columns('nombre', 'procesos');
$crud->edit_fields('nombre', 'procesos');
$crud->add_fields('nombre', 'procesos');
$crud->set_subject('Maquina');
$crud->set_relation_n_n('procesos', 'maquinas_procesos', 'procesos', 'id_maquina', 'id_proceso', 'nombre');
$crud->unset_delete();
$output = $crud->render();
$this->_output_crud($output, 'Maquinas');
}
示例8: incidencias
public function incidencias()
{
$crud = new grocery_CRUD();
$crud->set_table('incidencias');
$crud->set_subject('Incidents');
$crud->set_relation('idtipo', 'tipos_incidencias', 'descripcion_incidencia');
$crud->field_type('idusuario', 'hidden');
$crud->field_type('fecha_alta', 'hidden');
$crud->field_type('fecha_fin', 'hidden');
$crud->field_type('numero', 'hidden');
$crud->edit_fields("descripcion", "estado", "numero", "fecha_fin");
$crud->callback_before_insert(array($this, "new_incident_callback"));
$crud->callback_before_update(array($this, "edit_incident_callback"));
return $crud->render();
}
示例9: 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('tipo_insumo');
$crud->set_subject('Tipo de Insumo');
$crud->columns('id', 'descricao');
$crud->edit_fields('descricao');
$crud->add_fields('descricao');
/* regras e campos obrigatórios */
$crud->required_fields('descricao');
$crud->set_rules('descricao', 'Descrição', 'required|min_length[3]');
return $crud->render();
}
示例10:
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');
}
示例11: 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('grupo_servico');
$crud->set_subject('Grupo de Serviço');
$crud->columns('id', 'grupo_id', 'codigo', 'descricao');
$crud->edit_fields('grupo_id', 'codigo', 'descricao');
$crud->add_fields('grupo_id', 'codigo', 'descricao');
$crud->set_relation('grupo_id', 'grupo_servico', 'codigo');
$crud->display_as('grupo_id', 'Grupo Pai');
$crud->required_fields('codigo', 'descricao');
$crud->set_rules('codigo', 'Código', 'required|min_length[3]');
$crud->set_rules('descricao', 'Descrição', 'required|min_length[3]');
return $crud->render();
}
示例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: 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('familia_servico');
$crud->set_subject('Família de Serviço');
$crud->columns('id', 'cla_servico_id', 'codigo', 'descricao');
$crud->set_relation('cla_servico_id', 'cla_servico', 'codigo');
$crud->display_as('cla_servico_id', 'Clã');
$crud->edit_fields('cla_servico_id', 'codigo', 'descricao');
$crud->add_fields('cla_servico_id', 'codigo', 'descricao');
/* regras e campos obrigatórios */
$crud->required_fields('cla_servico_id', 'codigo', 'descricao');
$crud->set_rules('cla_servico_id', 'Clã', 'required');
$crud->set_rules('codigo', 'Código', 'required|min_length[2]');
$crud->set_rules('descricao', 'Descrição', 'required|min_length[3]');
return $crud->render();
}
示例14: projects
public function projects()
{
try {
$crud = new grocery_CRUD();
//$crud->set_theme('datatables');
$crud->set_table('t05_proyecto_ma');
$crud->set_subject('Proyecto');
$crud->columns('Nombre_TXT', 'Resumen_TXT', 'ImagenProyecto_TXT', 'VideoProyecto_TXT', 'Descripcion_TXT');
$crud->fields('Nombre_TXT', 'Resumen_TXT', 'ImagenProyecto_TXT', 'VideoProyecto_TXT', 'Descripcion_TXT');
$crud->display_as('Nombre_TXT', 'Nombre del proyecto')->display_as('Resumen_TXT', 'Resumen')->display_as('ImagenProyecto_TXT', 'Imagen')->display_as('VideoProyecto_TXT', 'Video')->display_as('Descripcion_TXT', 'Descripción');
$crud->set_field_upload('ImagenProyecto_TXT', 'assets/uploads/proyectos');
$crud->set_field_upload('VideoProyecto_TXT', 'assets/uploads/proyectos');
$crud->required_fields('Nombre_TXT', 'Resumen_TXT', 'Descripcion_TXT');
$crud->edit_fields('Resumen_TXT', 'Descripcion_TXT');
$output = $crud->render();
$this->_example_output($output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例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");
}