本文整理汇总了PHP中grocery_CRUD::callback_after_update方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::callback_after_update方法的具体用法?PHP grocery_CRUD::callback_after_update怎么用?PHP grocery_CRUD::callback_after_update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::callback_after_update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('bootstrap');
$crud->set_table('user');
$crud->set_subject('Gebruiker');
// hide fields
$crud->columns('is_super_user', 'is_active', 'screen_name', 'email', 'gebruikersgroepen');
// new_password and new_password repeat are needed to make formvalidation work
// id is needed to make the email unique check work
$crud->fields('id', 'is_active', 'screen_name', 'email', 'gebruikersgroepen', 'password', 'new_password', 'new_password_repeat');
$crud->required_fields('email', 'screen_name', 'is_active');
$crud->set_relation_n_n('gebruikersgroepen', 'user_x_user_group', 'user_group', 'user_id', 'user_group_id', 'name');
$crud->field_type('id', 'hidden');
$crud->field_type('new_password_repeat', 'hidden');
$crud->field_type('password', 'hidden');
$crud->display_as('is_active', 'Actief');
$crud->display_as('screen_name', 'Schermnaam');
$crud->display_as('is_super_user', '');
$crud->display_as('new_password', 'Wachtwoord');
if ($crud->getState() == 'read') {
$crud->field_type('new_password', 'hidden');
} else {
$crud->callback_field('new_password', array($this, 'edit_field_callback_new_password'));
}
$crud->field_type('is_active', 'dropdown', array('yes' => 'ja', 'no' => 'nee'));
$crud->callback_column('is_active', array($this, 'callback_list_is_active'));
$crud->callback_column('is_super_user', array($this, 'callback_list_is_super_user'));
$crud->callback_before_insert(array($this, 'before_insert_update_callback'));
$crud->callback_before_update(array($this, 'before_insert_update_callback'));
$crud->callback_after_insert(array($this, 'after_insert_callback'));
$crud->callback_after_update(array($this, 'after_update_callback'));
if ($crud->getState() === 'update_validation' or $crud->getState() === 'insert_validation') {
$crud->set_rules('email', 'E-mail', 'required|valid_email|callback_email_unique_check');
$crud->set_rules('screen_name', 'Schermnaam', 'required');
if ($this->input->post('new_password') != '' or !$this->input->post('id')) {
$crud->set_rules('new_password', 'Nieuw wachtwoord', 'required|min_length[10]|matches[new_password_repeat]');
$crud->set_rules('new_password_repeat', 'Herhaal nieuw wachtwoord', '');
}
$this->form_validation->set_message('matches', 'De wachtwoorden zijn niet aan elkaar gelijk.');
}
// render the crud HTML
$crud_output = $crud->render();
//get the needed css and javascript files
$this->javascript_files = $crud->get_js_files();
$this->css_files = $crud->get_css_files();
// put the crud content in the right position
$this->views['content'] = $crud_output->output;
$this->css[] = $this->load->view('admin/user/css/index.css', array(), true);
// add javascript and css to make the password generate and change function possible
if ($crud->getState() === 'add' or $crud->getState() === 'edit') {
$this->css[] = $this->load->view('admin/user/css/edit_user.css', array(), true);
$this->javascript[] = $this->load->view('admin/user/js/edit_user.js', array(), true);
}
// create the layout-HTML and show it to the user
$this->_layout();
}
示例2: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('gallery');
$crud->columns('subject', 'publish', 'creator', 'last_update');
$crud->required_fields('subject', 'publish');
$crud->callback_after_insert(array($this, 'log_user'));
$crud->callback_after_update(array($this, 'log_user'));
$crud->set_subject('Gallery Album');
$crud->fields('subject', 'deskripsi', 'publish');
$crud->add_action('Smileys', base_url() . 'assets/uploads/pictures.png', 'adminpanel/gallery/uploadPicture');
$output = $crud->render();
$data['subject'] = 'Gallery Album';
$data['content'] = $this->load->view('crud.php', $output, true);
$this->load->view('base_theme', $data);
}
示例3: principal
function principal()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('tp_logos');
$crud->set_subject('logo');
$crud->set_language('spanish');
$crud->fields('logo_gobierno', 'vinculacion_logo_gobierno', 'logo_opcional', 'vinculacion_logo_opcional');
$crud->display_as('logo_gobierno', 'Logotipo principal');
$crud->display_as('vinculacion_logo_gobierno', 'Vínculo del logotipo principal');
$crud->display_as('logo_opcional', 'Logotipo secundario (opcional)');
$crud->display_as('vinculacion_logo_opcional', 'Vínculo del logotipo secundario');
$crud->unset_add();
$crud->unset_export();
$crud->unset_print();
$crud->unset_delete();
$crud->unset_list();
$crud->where('id_logo', 1);
$crud->set_field_upload('logo_gobierno', 'archivos/logos');
$crud->set_field_upload('logo_opcional', 'archivos/logos');
$crud->callback_after_upload(array($this, 'obtener_imagen_upload'));
$crud->callback_after_update(array($this, 'redireccionar'));
$output = $crud->render();
$data['opcion'] = '';
$data['cambiar_logos'] = '';
$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);
$this->load->view('nuevos_logos', $output);
$this->load->view('pie');
} catch (Exception $e) {
if ($e->getCode() == 14) {
redirect('medios/principal');
} else {
show_error($e->getMessage());
}
}
}
示例4: administration
function administration()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('tags');
$crud->set_subject('Palabras Claves de Sitios');
$crud->set_language('spanish');
$crud->unset_export();
$crud->display_as('tag', 'Palabra Clave');
$crud->callback_after_insert(array($this, 'after_insert_log'));
$crud->callback_before_delete(array($this, 'before_delete_log'));
$crud->callback_after_update(array($this, 'after_update_log'));
$output = $crud->render();
$this->load->view('includes/template', $output);
} catch (Exception $e) {
/* Si algo sale mal cachamos el error y lo mostramos */
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例5: principal
function principal($id)
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('tp_desglose_presupuesto');
$crud->set_subject('Desglose');
$crud->set_language('spanish');
$crud->fields('id_desglose_presupuesto', 'presupuesto', 'id_concepto', 'concepto', 'cantidad', 'porcentaje');
$crud->columns('id_concepto', 'concepto', 'cantidad', 'porcentaje');
$crud->display_as('id_concepto', 'Clave del concepto');
$crud->required_fields('id_concepto', 'concepto', 'cantidad');
$crud->unset_add();
$crud->unset_export();
$crud->unset_print();
$crud->edit_fields('id_concepto', 'concepto', 'cantidad');
$crud->where('presupuesto', $id);
$crud->callback_after_update(array($this, 'actualizar_porcentaje'));
$crud->callback_column('cantidad', array($this, 'formato_dinero'));
$output = $crud->render();
$data['opcion'] = 'presupuesto';
$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_presupuesto'] = 'desglose';
$this->load->view('opciones_presupuesto', $data);
$data['nuevo_desglose'] = '';
$data['id'] = $id;
$this->load->view('opciones_banner_imagen_otros', $data);
//$data['output'] = $output;
//$data['opcion_medios'] = 'ver_todos';
$this->load->view('presupuesto', $output);
$this->load->view('regresar');
$this->load->view('pie');
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例6: 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());
}
}
示例7: administration
function administration()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('owners');
$crud->set_subject('Propietarios de Sitios');
$crud->set_language('spanish');
$crud->unset_export();
$crud->display_as('name', 'Nombre')->display_as('description', 'Descripción')->display_as('email', 'Correo')->display_as('phone', 'Teléfono');
$crud->add_fields('name', 'email', 'phone', 'description');
$crud->callback_after_insert(array($this, 'after_insert_log'));
$crud->callback_before_delete(array($this, 'before_delete_log'));
$crud->callback_after_update(array($this, 'after_update_log'));
$output = $crud->render();
$this->load->view('includes/template', $output);
} catch (Exception $e) {
/* Si algo sale mal cachamos el error y lo mostramos */
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例8: administration
function administration()
{
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('sites');
$crud->set_subject('Directorio de Sitios');
$crud->set_language('spanish');
$crud->unset_export();
$crud->columns('name', 'url', 'owner', 'active', 'fk_language');
// $crud->required_fields('name', 'url', 'description', 'fk_type', 'fk_owner');
$crud->set_relation('fk_type', 'types_site', 'type');
$crud->set_relation('fk_language', 'languages', 'language');
$crud->set_relation_n_n('parent', 'parents_site', 'sites', 'child_site', 'parent_site', 'name');
$crud->set_relation_n_n('owner', 'site_owner', 'owners', 'fk_site', 'fk_owner', 'name');
$crud->set_relation_n_n('icon', 'site_icon', 'icons', 'fk_site', 'fk_icon', 'icon');
$crud->set_relation_n_n('text', 'site_text', 'text', 'fk_site', 'fk_text', 'text');
$crud->set_relation_n_n('category', 'sites_categories', 'categories', 'fk_site', 'fk_category', 'category');
$crud->set_relation_n_n('tags', 'sites_tags', 'tags', 'fk_site', 'fk_tag', 'tag');
$crud->change_field_type('description', 'text');
// $crud->callback_add_field('text', array($this, 'field_add_text_callback'));
// $crud->callback_add_field('icon', array($this, 'field_icon_callback'));
$crud->display_as('name', 'Nombre')->display_as('url', 'URL')->display_as('description', 'Descripción')->display_as('active', 'Estado')->display_as('date_publication', 'Inicio de Publicidad')->display_as('published_to_date', 'Fin de Publicidad')->display_as('priority', 'Prioridad')->display_as('category', 'Categoría')->display_as('owner', 'Propietario')->display_as('parent', 'Sitios Padre')->display_as('tags', 'Palabras Claves')->display_as('icon', 'Icono')->display_as('text', 'Texto Adicional')->display_as('fk_language', 'Idioma')->display_as('fk_type', 'Tipo de sitio');
//$crud->change_field_type('name','file');
/**
* Insertando campos en las tablas "icons_site" y "add_text"
*/
$crud->callback_after_insert(array($this, 'after_insert'));
$crud->callback_before_delete(array($this, 'before_delete_log'));
$crud->callback_after_update(array($this, 'after_update_log'));
$output = $crud->render();
$this->load->view('includes/template', $output);
} catch (Exception $e) {
/* Si algo sale mal mostramos error */
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例9: callback_after_update
public function callback_after_update($callback = null,$override_all=0){
if(!$override_all){
$this->callback_after_update_ext[] = $callback;
if($this->callback_after_update == null){
$this->callback_after_update = array($this,'extended_callback_after_update');
}
}else{
parent::callback_after_update($callback);
}
return $this;
}
示例10: index
//.........这里部分代码省略.........
$crud->set_relation_n_n('consequences_psychologiques', 'sos_relation_consequences_psychologiques_ecoute', 'sos_gen_consequences_psychologiques', 'id_from_violences', 'id_from_consequences_psychologiques', 'name_consequences_psychologiques', 'priority');
$crud->set_relation_n_n('consequences_administratives', 'sos_relation_consequences_administratives_ecoute', 'sos_gen_consequences_administratives', 'id_from_violences', 'id_from_consequences_administratives', 'name_consequences_administratives', 'priority');
//Master/child relations
$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_ecoute', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/home/index/', 'ajax_loader' => base_url() . 'img/ajax-loader.gif', '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();
$fields_demarche = array('first' => array('table_name' => 'sos_gen_demarche_first', 'title' => 'name_demarche_first', 'relate' => null), 'second' => array('table_name' => 'sos_gen_demarche_second', 'title' => 'name_demarche_second', 'id_field' => 'id_demarche_second', 'relate' => 'id_from_demarche_first', 'data-placeholder' => 'Préciser'), 'third' => array('table_name' => 'sos_gen_demarche_third', 'title' => 'name_demarche_third', 'id_field' => 'id_demarche_third', 'relate' => 'id_from_demarche_second', 'data-placeholder' => 'Préciser'));
// 'url' => base_url() . 'index.php/demarche/window_demarche/'. $this->id_femme.'/',
$config_demarche = array('main_table' => 'sos_ecoute', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/ecoute/index/', 'ajax_loader' => base_url() . 'img/ajax-loader.gif', 'segment_name' => 'first');
$categories_demarche = new gc_dependent_select($crud, $fields_demarche, $config_demarche);
$js_demarche = $categories_demarche->get_js();
$fields_demarche1 = array('first1' => array('table_name' => 'sos_gen_demarche_first', 'title' => 'name_demarche_first', 'relate' => null), 'second1' => array('table_name' => 'sos_gen_demarche_second', 'title' => 'name_demarche_second', 'id_field' => 'id_demarche_second', 'relate' => 'id_from_demarche_first', 'data-placeholder' => 'Préciser'), 'third1' => array('table_name' => 'sos_gen_demarche_third', 'title' => 'name_demarche_third', 'id_field' => 'id_demarche_third', 'relate' => 'id_from_demarche_second', 'data-placeholder' => 'Préciser'));
// 'url' => base_url() . 'index.php/demarche/window_demarche/'. $this->id_femme.'/',
$config_demarche1 = array('main_table' => 'sos_ecoute', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/ecoute/index/', 'ajax_loader' => base_url() . 'img/ajax-loader.gif', 'segment_name' => 'first1');
$categories_demarche1 = new gc_dependent_select($crud, $fields_demarche1, $config_demarche1);
$js_demarche1 = $categories_demarche1->get_js();
$fields_demarche2 = array('first2' => array('table_name' => 'sos_gen_demarche_first', 'title' => 'name_demarche_first', 'relate' => null), 'second2' => array('table_name' => 'sos_gen_demarche_second', 'title' => 'name_demarche_second', 'id_field' => 'id_demarche_second', 'relate' => 'id_from_demarche_first', 'data-placeholder' => 'Préciser'), 'third2' => array('table_name' => 'sos_gen_demarche_third', 'title' => 'name_demarche_third', 'id_field' => 'id_demarche_third', 'relate' => 'id_from_demarche_second', 'data-placeholder' => 'Préciser'));
// 'url' => base_url() . 'index.php/demarche/window_demarche/'. $this->id_femme.'/',
$config_demarche2 = array('main_table' => 'sos_ecoute', 'main_table_primary' => 'id_femme', "url" => base_url() . 'index.php/ecoute/index/', 'ajax_loader' => base_url() . 'img/ajax-loader.gif', 'segment_name' => 'first2');
$categories_demarche2 = new gc_dependent_select($crud, $fields_demarche2, $config_demarche2);
$js_demarche2 = $categories_demarche2->get_js();
$crud->set_relation('first', 'sos_gen_demarche_first', 'name_demarche_first');
$crud->set_relation('second', 'sos_gen_demarche_second', 'name_demarche_second');
$crud->set_relation('third', 'sos_gen_demarche_third', 'name_demarche_third');
$crud->set_relation('first1', 'sos_gen_demarche_first', 'name_demarche_first');
$crud->set_relation('second1', 'sos_gen_demarche_second', 'name_demarche_second');
$crud->set_relation('third1', 'sos_gen_demarche_third', 'name_demarche_third');
$crud->set_relation('first2', 'sos_gen_demarche_first', 'name_demarche_first');
$crud->set_relation('second2', 'sos_gen_demarche_second', 'name_demarche_second');
$crud->set_relation('third2', 'sos_gen_demarche_third', 'name_demarche_third');
//Visual
$crud->display_as('nationalite', 'Nationalité')->display_as('premier_contact', 'Date')->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('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('situation_actuelle_detailles', 'Situation actuelle détaillée')->display_as('emplois', 'Situation professionnelle')->display_as('commentaire', 'Commentaires')->display_as('partenaire', 'Orienteur')->display_as('rep_accueil', 'Réponse')->display_as('rep_informations', 'Réponse')->display_as('rep_conseil', 'Réponse')->display_as('rep_orientation', 'Réponse')->display_as('rep_rdv', 'Réponse')->display_as('rep_hebergement', 'Réponse')->display_as('rep_soutien', 'Réponse')->display_as('rep_aide_materielle', 'Réponse')->display_as('rep_ecoute', 'Réponse')->display_as('consequences', 'Conséquences')->display_as('consequences_administratives', 'Conséquences administratives et économiques')->display_as('violences_economiques', 'Violences économiques')->display_as('consequences_physiques', 'Conséquences physiques')->display_as('consequences_psychologiques', 'Conséquences psychologiques')->display_as('consequences_administratives', 'Conséquences administratives')->display_as('de_la_part_enfants', 'Violences sur enfants par')->display_as('temps_ecoute', "Temps d'écoute")->display_as('age', 'Age de la femme')->display_as('logement_dem', 'Demande de logement')->display_as('rep_logement_dem', 'Réponse')->display_as('violences_enfants_directes', 'ENFANTS - Violences directes')->display_as('violences_enfants_indirectes', 'ENFANTS - Violences indirectes')->display_as('frequence', 'Fréquence')->display_as('demandes', 'Demandes/Réponses');
$crud->display_as('first', 'Type de démarche 1');
$crud->display_as('second', 'Type d\'intervention 1');
$crud->display_as('third', 'Suites 1');
$crud->display_as('first1', 'Type de démarche 2');
$crud->display_as('second1', 'Type d\'intervention 2');
$crud->display_as('third1', 'Suites 2');
$crud->display_as('first2', 'Type de démarche 3');
$crud->display_as('second2', 'Type d\'intervention 3');
$crud->display_as('third2', 'Suites 3');
$crud->display_as('demarche', 'Démarches');
//unsets
if ($this->session->userdata('status') == '1' or $this->session->userdata('status') == '2' or $this->session->userdata('status') == '3') {
$crud->fields('premier_contact', 'interlocuteur', 'appel', 'partenaire', 'temps_ecoute', 'age', 'enfants', 'enceinte', 'ville', 'nationalite', 'situation_familiale', 'depuis', 'duree_de_la_relation', 'emplois', 'logement', 'situation_actuelle', 'situation_actuelle_detailles', 'situation_actuelle_depuis', 'ressources', 'allocations_familiales', 'dettes', 'soutien', 'rep_soutien', 'ecoute', 'rep_ecoute', 'accueil', 'rep_accueil', 'informations', 'rep_informations', 'conseil', 'rep_conseil', 'orientation', 'rep_orientation', 'rdv', 'rep_rdv', 'hebergement', 'rep_hebergement', 'logement_dem', 'rep_logement_dem', 'aide_materielle', 'rep_aide_materielle', 'violences_physiques', 'violences_psychologiques', 'violences_sexuelles', 'violences_economiques', 'violences_administratives', 'violences_sociales', 'violences_privations', 'violences_juridiques', 'de_la_part', 'raisons', 'violences_enfants_directes', 'violences_enfants_indirectes', 'de_la_part_enfants', 'consequences_physiques', 'consequences_psychologiques', 'consequences_administratives', 'frequence', 'commencement', 'first', 'second', 'third', 'first1', 'second1', 'third1', 'first2', 'second2', 'third2', 'commentaire');
} else {
$crud->fields('interlocuteur', 'appel', 'partenaire', 'temps_ecoute', 'age', 'enfants', 'enceinte', 'ville', 'nationalite', 'situation_familiale', 'depuis', 'duree_de_la_relation', 'emplois', 'logement', 'situation_actuelle', 'situation_actuelle_detailles', 'situation_actuelle_depuis', 'ressources', 'allocations_familiales', 'dettes', 'soutien', 'rep_soutien', 'ecoute', 'rep_ecoute', 'accueil', 'rep_accueil', 'informations', 'rep_informations', 'conseil', 'rep_conseil', 'orientation', 'rep_orientation', 'rdv', 'rep_rdv', 'hebergement', 'rep_hebergement', 'logement_dem', 'rep_logement_dem', 'aide_materielle', 'rep_aide_materielle', 'violences_physiques', 'violences_psychologiques', 'violences_sexuelles', 'violences_economiques', 'violences_administratives', 'violences_sociales', 'violences_privations', 'violences_juridiques', 'de_la_part', 'raisons', 'violences_enfants_directes', 'violences_enfants_indirectes', 'de_la_part_enfants', 'consequences_physiques', 'consequences_psychologiques', 'consequences_administratives', 'frequence', 'commencement', 'first', 'second', 'third', 'first1', 'second1', 'third1', 'first2', 'second2', 'third2', 'commentaire');
}
$crud->unset_add_fields('par');
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('premier_contact', 'appel', 'temps_ecoute', 'interlocuteur');
$crud->columns('premier_contact', 'infos', 'situation', 'demandes', 'violences', 'de_la_part', 'commencement', 'consequences', 'demarche');
//Callbacks
$crud->callback_column('ouvertures', array($this, 'ouvertures'));
$crud->callback_column('premier_contact', array($this, 'premier_contact'));
$crud->callback_column('infos', array($this, 'infos'));
$crud->callback_column('situation', array($this, 'situation'));
$crud->callback_column('demandes', array($this, 'demandes'));
$crud->callback_column('commentaire', array($this, 'commentaire'));
$crud->callback_column('demarche', array($this, 'demarche'));
$crud->callback_after_update(array($this, 'insert_after_update'));
$crud->callback_after_insert(array($this, 'insert_after_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->callback_column('de_la_part', array($this, 'de_la_part'));
$crud->callback_column('raisons', array($this, 'raisons'));
$crud->callback_column('violences', array($this, 'violences'));
$crud->callback_column('consequences', array($this, 'consequences'));
//field Types
//$crud->callback_edit_field('accueil', array($this, 'edit_field_callback_1'));
//$crud->callback_add_field('accueil', array($this, 'add_field_callback_1'));
//field Types
$crud->field_type('dettes', 'enum', array('OUI', 'NON'));
$crud->field_type('enceinte', 'enum', array('OUI', 'NON'));
// $crud->field_type('appel', 'dropdown', array('0' => '', '1' => '1er appel', '2' => 'Appel suivi', '3' => 'Autres appels'));
$crud->field_type('enfants', 'enum', array('Aucun', '1 enfant', '2 enfants', '3 enfants', '4 enfants', '5 et +'));
// $crud->field_type('interlocuteur', 'dropdown', array('0' => '', '1' => 'Elle-même', '2' => 'Professionnel', '3' => 'Entourage'));
// Actions
// Renders
$output = $crud->render();
$output->output .= $js_situation_actuelle . $js_demarche . $js_demarche1 . $js_demarche2;
$menu = new stdClass();
$menu->status = $this->session->userdata('status');
if ($menu->status != 5) {
$menu->n1 = true;
} else {
$menu->n0 = true;
}
$header = $this->navigation->home_f($menu);
$data = array('output' => $output, 'header' => $header);
$this->_example_output($data);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例11: 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();
}
示例12: suivie_window
public function suivie_window($id)
{
$this->id_psy = $id;
$this->db->select('sos_psy.id_from_femme');
$this->db->where('id_psy', $this->id_psy);
$query = $this->db->get('sos_psy');
$row_psy = $query->row();
$this->id_femme = $row_psy->id_from_femme;
try {
// General
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->where('id_from_femme', $this->id_femme);
$crud->where('rdv', 4);
$crud->set_table('sos_demande');
$crud->set_subject('Demande');
//relations
//Master/child relations
//Visual
$crud->columns('date_entry', 'visite', 'commentaire_psy');
//unsets
$crud->unset_fields('id_demande', 'date_entry', 'dump', 'visite', 'accueil', 'informations', 'conseil', 'orientation', 'rdv', 'hebergement', 'logement', 'aide_materielle', 'adresse_postale', 'accompagnement_exterieur', 'commentaire');
$crud->unset_delete();
$crud->unset_add();
if (!$this->session->userdata('status')) {
$crud->unset_export();
$crud->unset_print();
}
//Requireds
//$crud->required_fields('visite');
//Callbacks
$crud->callback_column('date_entry', array($this, 'date_entry'));
$crud->callback_column('commentaire_psy', array($this, 'commentaire_psy'));
$crud->callback_after_update(array($this, 'insert_after'));
$crud->callback_after_insert(array($this, 'insert_after_insert'));
//field Types
$crud->field_type('id_from_femme', 'hidden', $this->id_femme);
$crud->field_type('id_user', 'hidden', $this->session->userdata('userid'));
// Actions
// Renders
$output = $crud->render();
$menu = new stdClass();
$menu->id = $this->id_femme;
if ($this->session->userdata('status') != '0') {
$menu->lien1 = true;
$menu->lien1_2 = true;
$menu->lien2 = true;
$menu->lien2_1 = true;
$menu->lien3 = true;
$menu->lien3_1 = true;
$menu->lien3_1_1 = true;
$menu->lien3_1_2 = true;
$menu->lien3_1_3 = true;
$menu->lien3_1_4 = true;
$menu->lien3_1_5 = true;
$menu->lien3_2 = true;
$menu->lien3_2_1 = true;
$menu->lien3_2_2 = true;
$menu->lien3_2_3 = true;
} else {
$menu->lien1 = true;
$menu->lien1_2 = true;
$menu->lien2 = true;
$menu->lien2_1 = true;
}
$header = $this->navigation->home_f($menu);
$data = array('output' => $output, 'header' => $header);
$this->_example_output($data);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例13: demande_window
public function demande_window($id)
{
$this->id_femme = $id;
try {
// General
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->where('id_from_femme', $id);
$crud->set_table('sos_demande');
$crud->set_subject('Intervention');
$crud->display_as('date_entry', 'Date de saisie');
$crud->display_as('accueil_dem', 'Accueil');
$crud->display_as('accompagnement_specialise', 'Accompagnement spécialisé');
//relations
$crud->set_relation('femme', 'sos_gen_demande_femme', 'name_demande_femme');
$crud->set_relation('accueil_dem', 'sos_gen_demande_accueil', 'name_demande_accueil');
$crud->set_relation_n_n('lieu_ressource', 'sos_relation_demande_lieu_ressource', 'sos_gen_demande_lieu_ressource', 'id_from_demande', 'id_from_lieu_ressource', 'name_demande_lieu_ressource');
$crud->set_relation_n_n('accompagnement_specialise', 'sos_relation_demande_accompagnement_specialise', 'sos_gen_demande_accompagnement_specialise', 'id_from_demande', 'id_from_accompagnement_specialise', 'name_demande_accompagnement_specialise');
$crud->set_relation('hbgt', 'sos_gen_demande_hbgt', 'name_demande_hbgt');
$crud->set_relation('service', 'sos_gen_service', 'nom_service', null, 'nom_service DESC');
//Master/child relations
//Visual
$crud->columns('date_entry', 'visite', 'accompagnement_specialise', 'lieu_ressource', 'commentaire');
//unsets
$crud->unset_fields('id_demande', 'date_entry', 'dump');
if (!$this->session->userdata('status')) {
$crud->unset_export();
$crud->unset_print();
}
//Requireds
$crud->required_fields('visite', 'accueil_dem', 'femme', 'service');
//Callbacks
$crud->callback_column('date_entry', array($this, 'date_entry'));
$crud->callback_column('visite', array($this, 'visite'));
$crud->callback_column('commentaire', array($this, 'commentaire'));
$crud->callback_column('commentaire_psy', array($this, 'commentaire_psy'));
$crud->callback_column('lieu_ressource', array($this, 'lieu_ressource'));
$crud->callback_column('accompagnement_specialise', array($this, 'accompagnement_specialise'));
$crud->callback_after_update(array($this, 'insert_after'));
$crud->callback_after_insert(array($this, 'insert_after_insert'));
//field Types
$crud->field_type('id_from_femme', 'hidden', $this->id_femme);
$crud->field_type('id_user', 'hidden', $this->session->userdata('userid'));
// Actions
$crud->add_action('Enfants', '', 'enfants/enfants_window', 'ui-icon-person');
//$crud->add_action('Enfants', base_url('img/pictos/enfants.png'), 'kids/kids_window', 'ui-icon-person');
// $crud->add_action('Enfants', base_url('img/pictos/enfants.png'), 'enfants/enfants_window', 'ui-icon-person');
// Renders
$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());
}
}
示例14: followup
function followup()
{
$crud = new grocery_CRUD();
//verifica daca get este setata sa previn eroarea "undefine index variable" si verifica daca are valoare
if (isset($_GET["p_id"]) != NULL) {
// setez o variabila sesiune
$this->session->set_userdata('patient_id', $_GET['p_id']);
$pid = $this->session->userdata('patient_id');
//print_r("ID_pacient: ".$pid);
//echo $_GET['pacient_id'].' sesiune settata';
} else {
$pid = $this->session->userdata('patient_id');
//echo "hau".$pid."nu are";
//print_r("ID_pacient: ".$pid);
}
//aici fac filtrarea pentru pacient a spitalizarilor dupa variabila sesiune
$crud->where('patient_id', $pid);
// Configurez modelul pentru afisare
$crud->set_theme('datatables');
$crud->set_table('follow_up');
$crud->set_subject('PCI Follow-Up');
//Configurare coloane
$crud->columns('date', 'survival_status', 'date_of_death', 'status', 'signature');
$crud->required_fields('signature', 'status');
// Formatare cod
$crud->field_type('patient_id', 'hidden', $pid);
// $crud->field_type('user_id', 'hidden');
// $crud->field_type('edit_user', 'hidden');
// $crud->field_type('edit_time', 'hidden');
$crud->set_relation('signature', 'user', 'user_name');
// User Level Unset
$drp = $this->session->userdata('user_type');
//print_r($drp);
if ($drp == "user") {
$crud->unset_delete();
$crud->unset_export();
$crud->unset_print();
}
// log- user activities
$crud->callback_after_insert(array($this, 'log_user_after_insert_followup'));
$crud->callback_after_update(array($this, 'log_user_after_update_followup'));
$crud->callback_after_delete(array($this, 'log_user_after_delete_followup'));
// Afisare nume formular follow-up
//-- 1. Follow Up (30 days and 12 months)
$crud->display_as('date', 'Date of follow up');
$crud->field_tip('date', 'Indicate the date of last follow up alive. This may be the date of follow up or the date the patient is last seen alive by verifiable sources');
$crud->display_as('survival_status', 'Survival status at folow up');
$crud->field_tip('survival_status', 'Indicate vital status at follow up');
$crud->display_as('death_cause', 'Primary cause of death');
$crud->field_tip('death_cause', 'If the patient died indicate the cause of death');
$crud->display_as('anginal_status', 'Anginal status');
$crud->field_tip('anginal_status', 'Indicate the patients anginal status at the time of follow-up');
$crud->display_as('date_readmission', 'Date of first hospital readmission since discharge');
$crud->field_tip('date_readmission', 'If the patient is readmitted to hospital for a cardiovascular cause, indicate the date');
$crud->field_tip('dyspnoea', 'Grade breathing status according to the New York Heart Association (NYHA) functional classification.');
$crud->display_as('mi', 'Myocardial infarction [MI]');
$crud->field_tip('mi', 'Indicate if the patient was diagnosed as having an MI since discharge');
$crud->display_as('mi_date', 'Myocardial infarction date [MI]');
$crud->field_tip('mi_date', 'Indicate the date the patient had the myocardial infarction');
$crud->display_as('stroke', 'Stroke');
$crud->field_tip('stroke', 'Indicate if the patient was diagnosed as having a stroke since discharge, as evidenced by persistent loss of neurological function caused by an ischaemic event.');
$crud->field_tip('stroke_date', 'Indicate the date of stroke');
$crud->display_as('pci', 'Percutaneous coronary intervention date [PCI]');
$crud->field_tip('pci', 'Indicate if the patient had a percutaneous coronary intervention since the date of discharge');
$crud->display_as('pci_date', 'Percutaneous coronary intervention date [PCI] date');
$crud->field_tip('pci_date', 'Indicate the date of PCI');
$crud->display_as('coronary_bypass', 'Coronary artery bypass graft [CABG]');
$crud->field_tip('coronary_bypass', 'Indicate if the patient had a coronary artery bypass graft [CABG] since the date of discharge');
$crud->display_as('coronary_bypass_date', 'Coronary artery bypass graft [CABG] date');
$crud->field_tip('coronary_bypass_date', 'Indicate the date of CABG');
$crud->display_as('cardiac_rehabilitation', 'Cardiac rehabilitation program');
$crud->field_tip('cardiac_rehabilitation', 'Indicate if the patient attended or is attending a cardiac rehabilitation programme since discharge');
//-- 1. Follow Up (30 days and 12 months)
$crud->field_tip('aspirin', 'On follow-up indicate if the patient is taking aspirin regularly');
$crud->field_tip('other_antiplatelet', 'On follow-up indicate if the patient is taking antiplatelet medication (other than aspirin) regularly ');
$crud->field_tip('anticoagulants', 'On follow-up indicate if the patient is taking anticoagulant medication regularly');
$crud->field_tip('beta_blockers', 'On follow-up indicate if the patient is taking Beta-blockers regularly');
$crud->field_tip('ace_inhibitors', 'On follow-up indicate if the patient is taking ACE inhibitors regularly');
$crud->display_as('angiotensin', 'Angiotensin II receptor blockers');
$crud->field_tip('angiotensin', 'On follow-up indicate if the patient is taking angiotensin II receptor blockers regularly');
$crud->field_tip('diabetic_control', 'On follow-up indicate the main method of diabetic control the patient is regularly receiving');
$crud->field_tip('statins', 'On follow-up indicate if the patient is taking statins regularly');
$crud->display_as('non_statin', 'Non statin lipid lowering agents');
$crud->field_tip('non_statin', 'On follow-up indicate if the patient is non-statin lipid lowering agents regularly');
$crud->field_tip('status', 'Indicate status of intervention insert data process');
$crud->field_tip('notes', 'Indicate notes of intervention insert data process');
// Dropdown menu
// -- 1. Follow Up (30 days and 12 months)
$crud->field_type('survival_status', 'dropdown', array('Alive' => 'Alive', 'Dead' => 'Dead', 'Unknown' => 'Unknown'));
$crud->field_type('death_cause', 'dropdown', array('Cardiovascular' => 'Cardiovascular', 'Non-Cardiovascular' => 'Non-Cardiovascular', 'Unknown' => 'Unknown'));
$crud->field_type('anginal_status', 'dropdown', array('CCS 0' => 'CCS 0', 'CCS I' => 'CCS I', 'CCS II' => 'CCS II', 'CCS III' => 'CCS III', 'CCS IV' => 'CCS IV', 'Unknown' => 'Unknown'));
$crud->field_type('dyspnoea', 'dropdown', array('NYHA I' => 'NYHA I', 'NYHA II' => 'NYHA II', 'NYHA III' => 'NYHA III', 'NYHA IV' => 'NYHA IV', 'Unknown' => 'Unknown'));
$crud->field_type('mi', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown'));
$crud->field_type('stroke', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown'));
$crud->field_type('pci', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown'));
$crud->field_type('coronary_bypass', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown'));
$crud->field_type('cardiac_rehabilitation', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown'));
// -- 2. Medication at follow Up (30 days and 12 months)
$crud->field_type('aspirin', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown'));
$crud->field_type('other_antiplatelet', 'dropdown', array('No' => 'No', 'Clopidogrel' => 'Clopidogrel', 'Ticagrelor' => 'Ticagrelor', 'Prasugrel' => 'Prasugrel', 'Other antiplatelet agent' => 'Other antiplatelet agent', 'Unknown' => 'Unknown'));
//.........这里部分代码省略.........
示例15: upload_window
public function upload_window($id)
{
$this->id_femme = $id;
try {
// General
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->where('id_from_femme', $id);
$crud->set_table('sos_upload');
$crud->set_subject('Document');
$crud->field_type('id_from_femme', 'hidden', $this->id_femme);
//relations
$crud->set_relation('type_uploads', 'sos_gen_type_uploads_parrent', 'name_type_uploads_parrent');
$crud->set_relation('detailles', 'sos_gen_type_uploads_child', 'name_type_uploads_child');
//Master/child relations
//Visual
$crud->columns('type_uploads', 'detailles', 'file_url', 'date_entry');
//unsets
$crud->unset_fields('date_entry');
$crud->unset_export();
$crud->unset_print();
//Requireds
$crud->required_fields('type_uploads', 'file_url');
//Visual
$crud->display_as('type_uploads', 'Type de document')->display_as('detailles', 'Détail')->display_as('date_entry', 'Date d\'envoi')->display_as('file_url', 'Document');
//Callbacks
$crud->callback_after_update(array($this, 'after_update'));
$crud->callback_before_upload(array($this, 'before_upload'));
$crud->callback_before_delete(array($this, 'before_delete'));
$crud->callback_after_insert(array($this, 'insert_after'));
$crud->callback_before_update(array($this, 'before_update'));
//field Types
if (!is_dir($path = 'assets/uploads/files/image_' . $this->id_femme)) {
mkdir($path = 'assets/uploads/files/image_' . $this->id_femme);
}
$crud->set_field_upload('file_url', 'assets/uploads/files/image_' . $this->id_femme);
$fields_type_uploads = array('type_uploads' => array('table_name' => 'sos_gen_type_uploads_parrent', 'title' => 'name_type_uploads_parrent', 'relate' => null), 'detailles' => array('table_name' => 'sos_gen_type_uploads_child', 'title' => 'name_type_uploads_child', 'id_field' => 'id_type_uploads_child', 'relate' => 'id_parrent_from_type_uploads_parrent', 'data-placeholder' => 'Precisé'));
$config_type_uploads = array('main_table' => 'sos_upload', 'main_table_primary' => 'id_upload', "url" => base_url() . 'index.php/upload/upload_window/', 'segment_name' => "type_uploads");
$categories_type_uploads = new gc_dependent_select($crud, $fields_type_uploads, $config_type_uploads);
$js_type_uploads = $categories_type_uploads->get_js();
// Actions
$this->db->where('id_femme', $this->id_femme);
$query = $this->db->get('sos_femme');
if ($query->num_rows == 1) {
$row_femme = $query->row();
}
// Renders
$output = $crud->render();
$output->output .= $js_type_uploads;
$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());
}
}