本文整理汇总了PHP中grocery_CRUD::unset_edit_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::unset_edit_fields方法的具体用法?PHP grocery_CRUD::unset_edit_fields怎么用?PHP grocery_CRUD::unset_edit_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::unset_edit_fields方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enfants_window
public function enfants_window($id)
{
$this->id_demande = $id;
try {
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->where('id_from_demande', $this->id_demande);
$crud->set_table('sos_enfants');
$crud->set_subject('Enfant');
$crud->unset_add();
$crud->unset_delete();
$crud->field_type('id_from_demande', 'hidden', $this->id_demande);
$crud->unset_edit_fields('id_from_kids');
$crud->set_relation('id_from_kids', 'sos_kids', "id_kid");
$crud->set_relation('recu', 'sos_gen_recu', "name_recu", null, 'name_recu ASC');
$crud->set_relation_n_n('accompagniement', 'sos_relation_accompagniement_kid', 'sos_gen_accompagniement_kid', 'id_from_enfants', 'id_from_accompagniement_kid', 'name_accompagniement_kid');
$crud->set_relation_n_n('activite', 'sos_relation_activite_kid', 'sos_gen_activite_kid', 'id_from_enfants', 'id_from_activite_kid', 'name_activite_kid');
$crud->columns('enfant', 'recu', 'activite', 'accompagniement', 'commentaire_enfant');
//$crud->display_as('id_from_kids', 'Enfants');
$crud->display_as('accompagniement', 'Accompagnement');
$crud->display_as('activite', 'Activité');
$crud->display_as('recu', 'Reçu');
$crud->display_as('id_from_kids', 'Enfant(s)');
$crud->display_as('commentaire_enfant', 'Commentaire enfant');
$crud->callback_column('accompagniement', array($this, 'accompagniement'));
$crud->callback_column('activite', array($this, 'activite'));
$crud->callback_column('enfant', array($this, 'enfant'));
$crud->required_fields('recu');
$output = $crud->render();
$this->db->where('id_demande', $this->id_demande);
$query = $this->db->get('sos_demande');
if ($query->num_rows == 1) {
$row_demande = $query->row();
}
// $my_demande = $row_demande->id_from_demande;
$menu = new stdClass();
$menu->n3 = true;
//$menu->id_1 = $my_demande;
$menu->id = $row_demande->id_from_femme;
$menu->status = $this->session->userdata('status');
$this->db->where('id_femme', $menu->id);
$query = $this->db->get('sos_femme');
if ($query->num_rows == 1) {
$row_femme = $query->row();
}
$header = $this->navigation->home_f($menu) . ' ' . '<p><pre>' . $row_femme->prenom . ' ' . $row_femme->nom . ' ' . $row_femme->nom_marital . '</pre></p>';
$data = array('output' => $output, 'header' => $header);
$this->_example_output($data);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例2: 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);
}
示例3: kids_window
public function kids_window($id)
{
$this->id_femme = $id;
try {
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->where('id_femme', $id);
$crud->set_table('sos_kids');
$crud->set_subject('Enfant(s)');
$crud->unset_edit_fields('id_kid');
$crud->unset_add_fields('id_kid');
$crud->field_type('id_femme', 'hidden', $this->id_femme);
$crud->columns('prenom', 'nom', 'age', 'sex', 'commentaire');
$crud->display_as('prenom', 'Prénom');
$crud->display_as('sex', 'Sexe');
$crud->display_as('commentaire', 'Commentaires');
$crud->set_relation('age', 'sos_gen_kids_age', 'name_kids_age');
if (!$this->session->userdata('status')) {
$crud->unset_export();
$crud->unset_print();
}
$crud->callback_after_update(array($this, 'after_update'));
$crud->callback_after_insert(array($this, 'insert_after'));
$crud->field_type('sex', 'enum', array('Fille', 'Garçon'));
$output = $crud->render();
$menu = new stdClass();
$menu->n1 = true;
$menu->status = $this->session->userdata('status');
$this->db->where('id_femme', $this->id_femme);
$query = $this->db->get('sos_femme');
if ($query->num_rows == 1) {
$row_femme = $query->row();
}
$header = $this->navigation->home_f($menu) . ' ' . '<p><pre>' . $row_femme->prenom . ' ' . $row_femme->nom . ' ' . $row_femme->nom_marital . '</pre></p>';
$data = array('output' => $output, 'header' => $header);
$this->_example_output($data);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例4: cadastro
public function cadastro()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('pessoa');
$crud->set_subject('Cadastro de Cidadão');
$crud->required_fields('nome');
$crud->columns('foto_frente', 'nome', 'artigos', 'id', 'naturalidade', 'telefone_1', 'obs');
$crud->set_relation_n_n('artigos', 'artigo_has_pessoa', 'artigo', 'pessoa_id', 'artigo_id', 'artigo_penal');
$crud->set_field_upload('foto_frente', 'assets/uploads/files');
$crud->set_field_upload('foto_lado_esquerdo', 'assets/uploads/files');
$crud->set_field_upload('foto_lado_direito', 'assets/uploads/files');
$crud->set_field_upload('foto_costas', 'assets/uploads/files');
$crud->set_relation('cor_pele_id', 'cor_pele', '{nome_cor}');
$crud->unset_texteditor('tatuagens');
$crud->unset_edit_fields('cadastrado_em');
$crud->add_action('Fotos Extras', '', '', 'ui-icon-image', array($this, 'pessoa_fotos_call'));
$output = $crud->render();
$this->_example_output($output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例5: cards
public function cards()
{
$crud = new grocery_CRUD('default');
$crud->set_table('card');
$crud->set_subject('Card');
$crud->set_field_upload('iss_org_logo', 'assets/uploads');
$crud->unset_columns('created_date');
$crud->unset_add_fields('created_date');
$crud->unset_edit_fields('created_date');
$data = $crud->render();
$this->load->view('admin/crud_view', $data);
}
示例6: administracion
function administracion($ID = NULL, $parent_table = NULL, $fieldID = NULL, $field_show = NULL)
{
if (!$this->tank_auth->is_logged_in()) {
redirect('/auth/login/');
}
try {
/* Creamos el objeto */
$crud = new grocery_CRUD();
/* Seleccionamos el tema */
//$crud->set_theme('flexigrid');
$crud->set_theme('datatables');
/* Seleccionamos el nombre de la tabla de nuestra base de datos*/
$crud->set_table('product');
/* Le asignamos un nombre */
$crud->set_subject('Producto');
/* Asignamos el idioma español */
$crud->set_language('spanish');
/* ALA - 10/11/2015 : Condiciona invocación maestro detalle */
$state = $crud->getState();
//echo " ID = " . $ID . ", state = " . $state . ", parent_table = " . $parent_table . "FieldID = " . $fieldID;
switch ($state) {
case 'success':
if (is_numeric($ID)) {
//echo "success ID = " . $ID . ", state = " . $state;
$crud->where($fieldID, $ID);
}
$crud->set_relation('PrClientID', 'client', 'Ident');
$crud->set_relation('PrVendorID', 'vendor', '{Name} {Lastname}');
break;
case 'list':
if (is_numeric($ID)) {
//echo "list ID = " . $ID . ", state = " . $state;
$crud->where($fieldID, $ID);
}
$crud->set_relation('PrClientID', 'client', 'Ident');
$crud->set_relation('PrVendorID', 'vendor', '{Name} {Lastname}');
break;
case 'add':
if ($parent_table == NULL) {
$crud->set_relation('PrClientID', 'client', 'Ident');
$crud->set_relation('PrVendorID', 'vendor', '{Name} {Lastname}');
} elseif ($parent_table == 'client') {
$crud->field_type('PrClientID', 'hidden', $ID);
$crud->set_relation('PrVendorID', 'vendor', '{Name} {Lastname}');
} elseif ($parent_table == 'vendor') {
$crud->field_type('PrVendorID', 'hidden', $ID);
$crud->set_relation('PrClientID', 'client', 'Ident');
}
//echo "add ID = " . $ID . ", state = " . $state;
break;
case "read":
$crud->set_relation('PrClientID', 'client', 'Ident');
$crud->set_relation('PrVendorID', 'vendor', '{Name} {Lastname}');
}
$crud->set_relation('PrProductCatalogID', 'productcatalog', 'Description');
/* Aqui le decimos a grocery que estos campos son obligatorios */
$crud->required_fields('ProductID', 'PrProductCatalogID', 'Contract', 'PrClientID', 'PrVendorID', 'StartDate', 'EndDate', 'Balance');
/* Aqui le indicamos que campos deseamos mostrar */
$crud->columns('ProductID', 'PrProductCatalogID', 'Contract', 'PrClientID', 'PrVendorID', 'StartDate', 'EndDate', 'Balance');
$crud->display_as('ProductID', 'ID');
$crud->display_as('PrProductCatalogID', 'Producto');
$crud->display_as('Contract', 'Contrato');
$crud->display_as('PrClientID', 'Cliente');
$crud->display_as('PrVendorID', 'Vendedor');
$crud->display_as('StartDate', 'Fecha Inicio Vigencia');
$crud->display_as('EndDate', 'Fecha Fin Vigencia');
$crud->display_as('Balance', 'Saldo');
$crud->set_rules('EndDate', 'Fecha Vigencia', 'callback_ValidProd');
//http://www.grocerycrud.com/documentation/options_functions/set_rules
$crud->unset_add_fields('Balance');
$crud->unset_edit_fields('Balance');
$crud->add_action('Beneficiarios', base_url() . 'assets/uploads/detalle.png', 'Beneficiary/administracion');
$crud->add_action('Movimientos', base_url() . 'assets/uploads/money.png', 'Charge/administracion');
// Procesos posteriores a la venta
$crud->callback_after_insert(array($this, 'Process_Sale'));
/* Generamos la tabla */
$output = $crud->render();
/* La cargamos en la vista situada en
/applications/views/product/administracion.php */
$this->load->view('Product/administracion', $output);
} catch (Exception $e) {
/* Si algo sale mal cachamos el error y lo mostramos */
//log_message($e->getMessage().' --- '.$e->getTraceAsString());
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例7: index
public function index()
{
try {
// General
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->set_table('sos_femme');
if (!$this->session->userdata('status')) {
$crud->where('archiver', FALSE);
}
$crud->set_subject('Femme');
//relations
$crud->set_relation('situation_familiale', 'sos_gen_situation_familiale_parrent', 'name_situation_familiale_parrent');
$crud->set_relation('detailles', 'sos_gen_situation_familiale_child', 'name_situation_familiale_child');
$crud->set_relation('emplois', 'sos_gen_emplois_parrent', 'name_emplois');
$crud->set_relation('emplois_detailles', 'sos_gen_emplois_child', 'name_emplois_detaille');
$crud->set_relation('emplois_more_detailles', 'sos_gen_emplois_child_child', 'name_emplois_child_child');
$crud->set_relation('age', 'sos_gen_femme_age', 'name_femme_age');
$crud->set_relation('duree_de_la_relation', 'sos_gen_duree_de_la_relation', 'name_duree_de_la_relation', null, 'id_duree_de_la_relation ASC');
$crud->set_relation('service', 'sos_gen_service', 'nom_service', null, 'nom_service DESC');
$crud->set_relation('ville', 'sos_gen_villes', '{nom_ville}, {code_postal}', null, 'nom_ville ASC');
$crud->set_relation('pays', 'sos_gen_pays', '{nom_pays} - {continent}', null, 'nom_pays ASC');
$crud->set_relation('nationalite', 'sos_gen_nationalite', 'name_nationalite');
$crud->set_relation('nationalite_detailles', 'sos_gen_nationalite_detailles', 'name_nationalite_detailles');
$crud->set_relation('ressources', 'sos_gen_ressources', 'name_ressources');
$crud->set_relation('provenance', 'sos_gen_provenance', 'name_provenance');
$crud->set_relation('allocations_familiales', 'sos_gen_allocations_familiales', 'name_allocations_familiales');
$crud->set_relation('percues_par', 'sos_gen_percues_par', 'name_percues_par');
$crud->set_relation('logement', 'sos_gen_logement_parent', 'name_logement');
$crud->set_relation('logement_detailles', 'sos_gen_logement_child', 'name_logement_child');
$crud->set_relation('situation_actuelle_depuis', 'sos_gen_situation_actuelle_depuis', 'name_situation_actuelle_depuis', null, 'id_situation_actuelle_depuis ASC');
$crud->set_relation('situation_actuelle', 'sos_gen_situation_actuelle', 'name_situation_actuelle');
$crud->set_relation('situation_actuelle_detailles', 'sos_gen_situation_actuelle_detailles', 'name_situation_actuelle_detailles');
$crud->set_relation('partenaire', 'sos_gen_partenaire', 'name_partenaire');
$crud->set_relation('informations', 'sos_gen_informations', 'name_informations');
$crud->set_relation('rdv', 'sos_gen_rdv', 'name_rdv');
$crud->set_relation('hebergement', 'sos_gen_hebergement', 'name_hebergement');
$crud->set_relation('departs_anterieurs', 'sos_gen_departs_anterieurs', 'name_departs_anterieurs');
$crud->set_relation('depuis', 'sos_gen_depuis', 'name_depuis');
//Master/child relations
$fields_situation_familialle = array('situation_familiale' => array('table_name' => 'sos_gen_situation_familiale_parrent', 'title' => 'name_situation_familiale_parrent', 'relate' => null), 'detailles' => array('table_name' => 'sos_gen_situation_familiale_child', 'title' => 'name_situation_familiale_child', 'id_field' => 'id_situation_familiale_child', 'relate' => 'id_parrent_from_situation_familiale_parrent', 'data-placeholder' => 'Préciser'));
$config_situation_familialle = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "situation_familialle");
$categories_situation_familialle = new gc_dependent_select($crud, $fields_situation_familialle, $config_situation_familialle);
$js_situation_familialle = $categories_situation_familialle->get_js();
$fields_nationalite = array('nationalite' => array('table_name' => 'sos_gen_nationalite', 'title' => 'name_nationalite', 'relate' => null), 'nationalite_detailles' => array('table_name' => 'sos_gen_nationalite_detailles', 'title' => 'name_nationalite_detailles', 'id_field' => 'id_nationalite_detailles', 'relate' => 'id_from_nationalite', 'data-placeholder' => 'Préciser'));
$config_nationalite = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "nationalite");
$categories_nationalite = new gc_dependent_select($crud, $fields_nationalite, $config_nationalite);
$js_nationalite = $categories_nationalite->get_js();
$fields_emplois = array('emplois' => array('table_name' => 'sos_gen_emplois_parrent', 'title' => 'name_emplois', 'relate' => null), 'emplois_detailles' => array('table_name' => 'sos_gen_emplois_child', 'title' => 'name_emplois_detaille', 'id_field' => 'id_emplois_detailles', 'relate' => 'id_from_emplois', 'data-placeholder' => 'Préciser'), 'emplois_more_detailles' => array('table_name' => 'sos_gen_emplois_child_child', 'title' => 'name_emplois_child_child', 'id_field' => 'id_emplois_child_child', 'relate' => 'id_emplois_from_child', 'data-placeholder' => 'Préciser'));
$config_emplois = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "emplois");
$categories_emplois = new gc_dependent_select($crud, $fields_emplois, $config_emplois);
$js_emplois = $categories_emplois->get_js();
$fields_ressources = array('ressources' => array('table_name' => 'sos_gen_ressources', 'title' => 'name_ressources', 'relate' => null), 'provenance' => array('table_name' => 'sos_gen_provenance', 'title' => 'name_provenance', 'id_field' => 'id_provenance', 'relate' => 'id_from_ressources', 'data-placeholder' => 'Préciser'));
$config_ressources = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "ressources");
$categories_ressources = new gc_dependent_select($crud, $fields_ressources, $config_ressources);
$js_ressources = $categories_ressources->get_js();
$fields_allocations_familiales = array('allocations_familiales' => array('table_name' => 'sos_gen_allocations_familiales', 'title' => 'name_allocations_familiales', 'relate' => null), 'percues_par' => array('table_name' => 'sos_gen_percues_par', 'title' => 'name_percues_par', 'id_field' => 'id_percues_par', 'relate' => 'id_from_allocations_familiales', 'data-placeholder' => 'Préciser'));
$config_allocations_familiales = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "allocations_familiales");
$categories_allocations_familiales = new gc_dependent_select($crud, $fields_allocations_familiales, $config_allocations_familiales);
$js_allocations_familiales = $categories_allocations_familiales->get_js();
$fields_logement = array('logement' => array('table_name' => 'sos_gen_logement_parent', 'title' => 'name_logement', 'relate' => null), 'logement_detailles' => array('table_name' => 'sos_gen_logement_child', 'title' => 'name_logement_child', 'id_field' => 'id_logement_child', 'relate' => 'id_from_logement_parent', 'data-placeholder' => 'Préciser'));
$config_logement = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "logement");
$categories_logement = new gc_dependent_select($crud, $fields_logement, $config_logement);
$js_logement = $categories_logement->get_js();
$fields_situation_actuelle = array('situation_actuelle' => array('table_name' => 'sos_gen_situation_actuelle', 'title' => 'name_situation_actuelle', 'relate' => null), 'situation_actuelle_detailles' => array('table_name' => 'sos_gen_situation_actuelle_detailles', 'title' => 'name_situation_actuelle_detailles', 'id_field' => 'id_situation_actuelle_detailles', 'relate' => 'id_from_situation_actuelle', 'data-placeholder' => 'Préciser'));
$config_situation_actuelle = array('main_table' => 'sos_femme', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'segment_name' => "situation_actuelle");
$categories_situation_actuelle = new gc_dependent_select($crud, $fields_situation_actuelle, $config_situation_actuelle);
$js_situation_actuelle = $categories_situation_actuelle->get_js();
//Visual
if ($this->session->userdata('status') == '0' or $this->session->userdata('status') == '4') {
$crud->columns('prenom', 'nom', 'nom_marital', 'age', 'date_naissance', 'telephone', 'ville', 'nombre_denfants', 'ouvertures', 'premier_contact', 'nombre_passages');
} else {
$crud->columns('archiver', 'prenom', 'nom', 'nom_marital', 'age', 'date_naissance', 'telephone', 'ville', 'nombre_denfants', 'ouvertures', 'premier_contact', 'nombre_passages');
}
$crud->display_as('pays', 'Originaire de')->display_as('archiver', 'Archivage')->display_as('prenom', 'Prénom')->display_as('telephone', 'Téléphone')->display_as('nationalite', 'Nationalité')->display_as('rue', 'Adresse')->display_as('oriente_par_SMS', 'Orientée par SMS')->display_as('departs_anterieurs', 'Départs antérieurs')->display_as('nationalite_detailles', 'Situation administrative')->display_as('detailles', 'Situation familiale en détail')->display_as('duree_de_la_relation', 'Durée de la relation')->display_as('emplois_detailles', 'Détails de l\'emploi')->display_as('emplois_more_detailles', 'Plus de détails de l\'emploi')->display_as('ouvertures', 'Dernière modification')->display_as('hebergement', 'Demande d\'hébergement')->display_as('aide_materielle', 'Demande d\'aide matérielle')->display_as('accompagnement_exterieur', 'Demande d\'accompagnement extérieur')->display_as('adresse_postale', 'Demande d\'adresse postale')->display_as('accueil', 'Demande d\'accueil')->display_as('informations', 'Demande d\'informations')->display_as('conseil', 'Demande de conseil')->display_as('orientation', 'Demande d\'orientation')->display_as('rdv', 'Demande de rdv')->display_as('hebergement', 'Demande d\'hébergement')->display_as('logement_dem', 'Demande de logement')->display_as('logement_detailles', 'Logement détaillé')->display_as('situation_actuelle_detailles', 'Situation actuelle détaillée')->display_as('emplois', 'Situation professionnelle')->display_as('emplois_detailles', 'Situation professionnelle détaillée')->display_as('emplois_more_detailles', 'Autres infos emploi')->display_as('percues_par', 'Perçues par')->display_as('commentaire', 'Commentaires')->display_as('partenaire', 'Orienteur')->display_as('nombre_passages', 'Nombre passages')->display_as('arrivee_en_france', 'Arrivée en France')->display_as('parle_pas_francais', 'Parle pas français')->display_as('ism', 'Utilisation ISM');
$crud->order_by('prenom', 'asc');
//unsets
if ($this->session->userdata('status') == '1' or $this->session->userdata('status') == '2' or $this->session->userdata('status') == '3') {
$crud->unset_edit_fields('service', 'par', 'archiver');
} else {
$crud->unset_edit_fields('service', 'premier_contact', 'par');
}
$crud->unset_add_fields('par', 'archiver');
if ($this->session->userdata('status') == '0' or $this->session->userdata('status') == '4') {
$crud->unset_delete();
$crud->unset_export();
$crud->unset_print();
}
//Requireds
$crud->required_fields('service', 'premier_contact', 'prenom');
//Callbacks
$crud->callback_column('ouvertures', array($this, 'ouvertures'));
$crud->callback_column('premier_contact', array($this, 'premier_contact'));
$crud->callback_column('nombre_denfants', array($this, 'enfants'));
$crud->callback_after_update(array($this, 'insert_after_update'));
$crud->callback_after_insert(array($this, 'insert_after_insert'));
$crud->callback_after_delete(array($this, 'after_delete'));
$crud->callback_column('archiver', array($this, 'archiver'));
$crud->callback_column('nombre_passages', array($this, 'nombre_passages'));
//.........这里部分代码省略.........
示例8: sub_Category
public function sub_Category()
{
$crud = new grocery_CRUD('default');
$crud->set_table('subcategories_master');
$crud->set_subject('SubCategory');
$crud->display_as('category', 'SubCategory')->display_as('category_id', 'Select Category');
$crud->unset_add_fields('flag', 'created_date');
$crud->unset_edit_fields('flag', 'created_date');
$crud->callback_before_insert(array($this, 'callback_getmax_app_cat_id'));
$crud->unset_columns('applicable_category_id', 'flag', 'created_date');
$crud->set_relation('category_id', 'categories_master', 'category');
$crud->field_type('applicable_category_id', 'invisible');
//$crud->unset_add();
//$crud->unset_edit();
//$crud->unset_delete();
$data = $crud->render();
$this->load->view('admin/crud_view', $data);
}
示例9: isset
function peserta_kkn_management_all()
{
$session = isset($_SESSION['username_belajar']) ? $_SESSION['username_belajar'] : '';
if ($session != "") {
$pecah = explode("|", $session);
$data["NIM"] = $pecah[0];
$data["NAMA"] = $pecah[1];
$data["STATUS"] = $pecah[3];
if ($data["STATUS"] == "Admin") {
try {
/* This is only for the autocompletion */
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
//$crud->where('SUDAH','2');
$crud->set_table('KKN_MHS');
$crud->set_language("indonesian");
$crud->display_as('NIM', 'Data Pribadi');
$crud->set_relation('NIM', 'D_MAHASISWA', 'Nim :{NIM}, Angkatan :{ANGKATAN},Nama :{NAMA},Jk: {J_KELAMIN},Asal: {ALAMAT_MHS}, Golongan Darah: {GOL_DARAH},HP Mhs: {HP_MHS},Telp Keluarga: {TELP_MHS}');
$crud->display_as('FAK', 'Fakultas')->display_as('NO', 'No Pendaftaran')->display_as('ALAMAT_JOGJA', 'Alamat di Jogja')->display_as('NM_KEC_JOGJA', 'Kec di Jogja')->display_as('NM_KAB_JOGJA', 'Kab di Jogja')->display_as('PRESTASI', 'Keahlian')->display_as('RT_JOGJA', 'RT di Jogja')->display_as('DESA_JOGJA', 'Desa di Jogja')->display_as('KODE_POS_JOGJA', 'Kod Pos di Jogja')->display_as('TRANSPORTASI', 'Transportasi')->display_as('PATH_SK_DOKTER', 'Upload SK Dokter')->display_as('PATH_SK_GOLONGAN_DARAH', 'Upload SK Gol Darah')->display_as('PATH_SK_CUTI', 'Upload SK Cuti Kerja')->display_as('PATH_SK_TIDAK_HAMIL', 'Upload SK Tidak Hamil');
$crud->unset_edit();
$crud->unset_delete();
$crud->unset_edit_fields('SUDAH');
$crud->unset_add();
$crud->unset_add_fields('NO', 'SUDAH');
$crud->set_subject('Peserta KKN');
$crud->required_fields('ALAMAT_JOGJA');
$crud->columns('NIM', 'FAK', 'ALAMAT_JOGJA', 'PRESTASI', 'NM_KEC_JOGJA', 'NM_KAB_JOGJA');
$crud->set_field_upload('PATH_SK_DOKTER', 'assets/kesehatan');
$crud->set_field_upload('PATH_SK_GOLONGAN_DARAH', 'assets/goldarah');
$crud->set_field_upload('PATH_SK_CUTI', 'assets/cutikerja');
$crud->set_field_upload('PATH_SK_TIDAK_HAMIL', 'assets/tidakhamil');
//$crud->edit_fields('NIM','KD_FAK','ALAMAT_JOGJA','PRESTASI','KD_KEC','KD_KAB');
$crud->callback_edit_field('NIM', array($this, 'edit_field_callback_nim'));
$crud->callback_edit_field('NO', array($this, 'edit_field_callback_no'));
$output = $crud->render();
$this->_manage_output($output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
} else {
?>
<script type="text/javascript" language="javascript">
alert("Anda tidak berhak masuk ke Control Panel Admin...!!!");
</script>
<?php
echo "<meta http-equiv='refresh' content='0; url=" . base_url() . "kkn'>";
}
} else {
?>
<script type="text/javascript" language="javascript">
alert("Anda belum Log In...!!!\nAnda harus Log In untuk mengakses halaman ini...!!!");
</script>
<?php
echo "<meta http-equiv='refresh' content='0; url=" . base_url() . "kkn'>";
}
}
示例10: assignment
function assignment()
{
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('assignment');
$crud->set_subject('Assignment');
//$crud->columns('customerName','phone','addressLine1','creditLimit');
$crud->display_as('patient_name', 'Last and First name');
//$crud->field_tip('patient_name', 'info');
$crud->set_relation('respondent', 'user', 'user_name');
$crud->field_type('status', 'dropdown', array('New' => 'New', 'In progress' => 'In progress', 'Finished' => 'Finished'));
$crud->required_fields('date', 'respondent', 'status');
$crud->unique_fields('cnp');
$drp = $this->session->userdata('user_type');
//print_r($drp);
if ($drp != "admin") {
$crud->unset_add();
$crud->unset_delete();
$crud->unset_edit_fields('date', 'cnp', 'patient_name', 'pci_date_time', 'respondent');
}
$output = $crud->render();
$this->_admin_output($output);
}
示例11: complain
function complain($user = -1, $status = 0, $priority = 0)
{
$userid = $this->tank_auth->get_user_id();
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('complain');
//$crud->set_relation('member_id','members','{member_id}- {firstname} {lastname}',null,'member_id');
$crud->set_relation('category', 'complain_category', '{id}- {name}');
$crud->set_relation('status', 'complain_status', '{id}- {name}');
$crud->set_relation('assigned_to', 'users', '{username}-{id}', array('activated' => '1'));
$crud->set_relation('created_by', 'users', '{id}-{username}');
$crud->columns('id', 'member_id', 'status', 'complain', 'category', 'priority', 'follow_up', 'created_by', 'assigned_to', 'received_on', 'last_updated', 'resolution_comment');
$crud->add_fields('member_id', 'complain', 'category', 'priority', 'assigned_to');
// $crud->fields('member_id', 'status', 'complain', 'category', 'priority', 'follow_up', 'created_by', 'assigned_to', 'received_on','resolution_comment');
$crud->unset_edit_fields('member_id', 'created_by');
$crud->callback_before_update(array($this, 'backup_complain'));
$crud->add_action('History', '', '', '', array($this, 'complain_histoy_link'));
$crud->field_type('created_by', 'hidden', $userid);
$crud->order_by('id', 'desc');
if ($user == 0) {
} else {
if ($user == -1) {
$crud->where('assigned_to', $userid);
} else {
if ($user > 0) {
$crud->where('assigned_to', $user);
}
}
}
if ($status) {
$crud->where('complain.status', $status);
} else {
$crud->where('complain.status <=', 4);
}
if ($priority) {
$crud->where('complain.priority', $priority);
}
$crud->unset_print();
$crud->unset_export();
//$crud->unset_add();
// $crud->unset_edit();
$crud->unset_delete();
$output = $crud->render();
$this->_example_output($output);
}
示例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();
}