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


PHP grocery_CRUD::unset_add_fields方法代码示例

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


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

示例1: 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());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:41,代码来源:kids.php

示例2: salacontrol

 public function salacontrol()
 {
     try {
         $crud = new grocery_CRUD();
         //$crud->set_theme('datatables');
         $crud->set_table('salas');
         $crud->set_subject('Sala');
         $crud->required_fields('campus', 'numero', 'tipo', 'capacidade');
         $crud->display_as('campus', 'Campus');
         $crud->display_as('numero', 'Número da Sala');
         $crud->display_as('cidadeID', 'Campus');
         $crud->unset_columns('disponibilidade');
         $crud->unset_add_fields('disponibilidade');
         $crud->set_relation('campus', 'cidades', 'nome');
         $crud->set_relation('tipo', 'tipos', 'nome');
         //$crud->set_rules('numero', 'Número da Sala', 'Integer');
         $crud->change_field_type('disponibilidade', 'true_false');
         $output = $crud->render();
         $this->_sala_output($output);
     } catch (Exception $e) {
         show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
     }
 }
开发者ID:rpv201201,项目名称:RP5_UNIPAMPA,代码行数:23,代码来源:salas.php

示例3: 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);
 }
开发者ID:vzagde,项目名称:maxit,代码行数:12,代码来源:rules.php

示例4: 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());
     }
 }
开发者ID:aloewens,项目名称:vacan,代码行数:86,代码来源:Product.php

示例5: 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'));
//.........这里部分代码省略.........
开发者ID:simplonco,项目名称:sos_femmes,代码行数:101,代码来源:home.php

示例6: 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);
 }
开发者ID:vzagde,项目名称:maxit,代码行数:18,代码来源:admin.php

示例7: 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'>";
        }
    }
开发者ID:rischanlab,项目名称:SI_KKN,代码行数:56,代码来源:manage.php

示例8: paragraph

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


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