本文整理汇总了PHP中grocery_CRUD::callback_after_insert方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::callback_after_insert方法的具体用法?PHP grocery_CRUD::callback_after_insert怎么用?PHP grocery_CRUD::callback_after_insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::callback_after_insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
//$data['main_content'] = 'login_form';
//$this->load->view('includes/template',$data);
//$this->load->view('admin/configuration');
//$this->load->view('admin/homepage');
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('ips_disposition');
$crud->set_subject('Disposition');
$crud->required_fields('NAME');
$crud->columns('NAME', 'DISABLE');
$crud->fields('NAME');
// $crud->unset_add();
// $crud->unset_edit();
$crud->unset_delete();
$crud->set_lang_string('insert_success_message', 'Your data has been successfully stored into the database.<br/>Please wait while you are redirecting to the list page.
<script type="text/javascript">
window.location = "' . site_url('admin/disposition') . '";
</script>
<div style="display:none">
');
$crud->callback_after_insert(array($this, 'disposition_generation'));
$output = $crud->render();
// $this->grocery_crud->set_table('ips_login');
// $output = $this->grocery_crud->render();
$this->_example_output($output);
}
示例2: 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();
}
示例3: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['lo'] = 2;
//value used to identify section movie or celebrity
$data['categoryid'] = $categoryid;
//value used to identify section movie or celebrity
if ($categoryid != 0) {
$data['cat_id'] = $categoryid;
$cat_title = $this->category->getTitle($categoryid);
$data['cat_title'] = $cat_title . " - Movies";
$form_subject = $cat_title;
$crud = new grocery_CRUD();
$crud->set_table('dbx_movies');
$crud->where('catid', $categoryid);
$crud->set_subject('Movie');
$crud->required_fields('title', 'year');
$crud->columns('title');
// $crud->callback_column('name',array($this,'link_title'));
// $crud->set_rules('title','Title','trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Large Image', '', '', 'custom_icon limg-icon img_crop', array($this, 'set_imgurl'));
$crud->add_action('Small Image', '', '', 'custom_icon simg-icon img_crop', array($this, 'set_imgurl'));
$crud->fields('catid', 'title', 'year', 'release_date', 'cast', 'director', 'producer', 'music', 'writer', 'lyrics', 'synopsis', 'seo_url', 'ownerid', 'created_date', 'lastupdate_date');
// $crud->field_type('catid', 'hidden', $categoryid);
$crud->set_relation('catid', 'dbx_categories', 'title', array('type' => 'M'), null, $categoryid);
$crud->display_as('catid', 'Category');
//
$crud->callback_add_field('cast', array($this, 'add_field_cast'));
$crud->callback_add_field('synopsis', array($this, 'add_field_synopsis'));
$crud->callback_edit_field('cast', array($this, 'edit_field_cast'));
$crud->callback_edit_field('synopsis', array($this, 'edit_field_synopsis'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->change_field_type('seo_url', 'invisible');
$crud->change_field_type('lastupdate_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->callback_after_insert(array($this, 'after_insert'));
$crud->unset_jquery();
$state = $crud->getState();
// echo($state);
$data['state'] = $state;
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('movies_view', $output);
$this->load->view('footer_view', $data);
}
}
示例4: 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);
}
示例5: 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());
}
}
示例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: index
public function index()
{
//$data['main_content'] = 'login_form';
//$this->load->view('includes/template',$data);
//$this->load->view('admin/configuration');
//$this->load->view('admin/homepage');
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('ips_brand');
$crud->set_subject('Brand');
$crud->required_fields('NAME');
$crud->columns('NAME', 'DISABLE');
$crud->fields('NAME', 'DISABLE');
// $crud->unset_add();
// $crud->unset_edit();
$crud->unset_delete();
$crud->callback_after_insert(array($this, 'brand_generation'));
$output = $crud->render();
// $this->grocery_crud->set_table('ips_login');
// $output = $this->grocery_crud->render();
$this->_example_output($output);
}
示例9: 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());
}
}
示例10: listadoNotificacion
public function listadoNotificacion()
{
if ($this->session->userdata('nivel') != 5 or $this->session->userdata('institucion') != 'A') {
$this->session->set_flashdata('error', 'Su nivel de usuario no le permite realizar este proceso');
redirect(site_url("index/principal"), 301);
}
$anio = array();
for ($i = date("Y") - 1; $i <= date("Y"); $i++) {
$anio[$i] = $i;
}
$semanas = array();
for ($i = 1; $i <= 53; $i++) {
$semanas[$i] = $i;
}
$usuario = $this->session->userdata('usuario');
$carpeta = getcwd() . "/uploads/" . $usuario . "/";
if (!file_exists($carpeta)) {
mkdir(getcwd() . "/uploads/" . $usuario, 0777);
}
$subr = $this->frontend_model->mostrarDiresa($this->session->userdata('diresa'));
$subregion = array();
foreach ($subr as $dato) {
$subregion[$dato->codigo] = $dato->nombre;
}
$rd = $this->frontend_model->buscarRedes($this->session->userdata('diresa'));
$red = array();
foreach ($rd as $dato) {
$red[$dato->codigo] = $dato->nombre;
}
$mrd = $this->frontend_model->buscaMicroredes($this->session->userdata('diresa'));
$microred = array();
foreach ($mrd as $dato) {
$microred[$dato->codigo] = $dato->nombre;
}
$crud = new grocery_CRUD();
$crud->set_table('telematica');
$crud->columns('ano', 'semana', 'diresa', 'red', 'microred', 'establecimiento', 'archivo', 'usuario', 'fecha', 'enviado');
$crud->fields('ano', 'semana', 'diresa', 'red', 'microred', 'establecimiento', 'archivo');
$crud->display_as('ano', 'Año');
$crud->display_as('enviado', 'Estado');
$crud->field_type('ano', 'dropdown', $anio);
$crud->field_type('semana', 'dropdown', $semanas);
$crud->field_type('diresa', 'dropdown', $subregion);
$crud->field_type('red', 'dropdown', $red);
//$crud->field_type('microred','dropdown',$microred);
$crud->field_type('enviado', 'dropdown', array('1' => 'Notificado', '2' => 'Pendiente'));
//$crud->where(array('ano'=>date('Y')));
$crud->where(array('diresa' => $this->session->userdata('diresa')));
$crud->order_by('ano', 'DESC');
$crud->set_subject('Notificación');
$crud->set_field_upload('archivo', 'uploads/' . $usuario);
$crud->unset_add();
$crud->unset_read();
//$crud->unset_delete();
$crud->unset_edit();
$crud->unset_export();
$crud->callback_after_insert(array($this, 'log_usuario_after_insert'));
///////////////////////////////////////////////////////////////////////////////
$crud->add_action_peru('Añadir Notificación', '', 'pntRegistro', 'add-icon');
///////////////////////////////////////////////////////////////////////////////
//$crud->add_action('Añadir información', base_url().'public/images/telematica.gif', 'pnt/adicionar','');
$crud->add_action('Efectuar notificación', base_url() . 'public/images/contact.png', 'pnt/envio', '');
$output = $crud->render();
$this->_example_output1($output);
}
示例11: 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());
}
}
示例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();
}
示例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: array
function personal_schedule($schedule_id = 5000, $memberid = '0', $test_id = '0', $chk = '0', $unchk = '0')
{
$crud = new grocery_CRUD();
$crud->set_table('personal_schedule');
//$crud->set_theme('datatables');
//$crud->set_relation('member_id', 'members', '{member_id}- {firstname} {lastname}');
//$crud->set_relation('test_id', 'mains_tests', '{test_id}-{test_name}');
$crud->set_relation('expert_id', 'users', '{username}', null, 'username');
$crud->set_relation('reviewer', 'users', '{username}', null, 'username');
$crud->callback_after_insert(array($this, 'add_test_for_user'));
$crud->set_field_upload('answer_script_unchecked', 'assets/uploads/files/answer_script/unchecked');
$crud->set_field_upload('answer_script_checked', 'assets/uploads/files/answer_script/checked');
$crud->set_field_upload('answer_script_rechecked1', 'assets/uploads/files/answer_script/checked');
$crud->set_field_upload('answer_script_rechecked2', 'assets/uploads/files/answer_script/checked');
// $crud->columns('schedule_id', 'test_id', 'member_id','time','answer_script_unchecked','answer_script_checked','marks_obtained','expert_id','receiving_date','receiving_track_no','go_to_expert', 'receiving_from_expert','dispatch_date','dispatch_track_no' );
$crud->columns('schedule_id', 'test_id', 'status', 'receiving_date', 'receiving_from_expert', 'member_id', 'answer_script_unchecked', 'answer_script_checked', 'marks_obtained');
$crud->add_action('Cover', '', '', '', array($this, 'print_cover_cb'));
$crud->add_action('add score', '../../images/add2.jpg', '', '', array($this, 'marks_callback'));
$crud->callback_before_update(array($this, 'send_mail_to_expert'));
$crud->add_action('add answer script to dispatch', '../../images/answer.jpg', '', '', array($this, 'answer_callback'));
$crud->add_action('add test to dispatch', '../../images/test.jpg', '', '', array($this, 'test_callback'));
$crud->unset_delete();
if ($schedule_id != 0) {
$crud->where('personal_schedule.schedule_id >=', $schedule_id);
}
if ($memberid != 0) {
$crud->where('personal_schedule.member_id', $memberid);
}
if ($test_id != 0) {
$crud->where('personal_schedule.test_id', $test_id);
}
if ($chk != 0) {
$crud->where('personal_schedule.answer_script_checked !=', '');
}
//if($unchk!=0)
$crud->where('personal_schedule.answer_script_unchecked !=', '');
$crud->order_by('time, personal_schedule.member_id ', 'asc');
if (isset($_REQUEST['at'])) {
$crud->fields('member_id', 'test_id', 'appeared_on', 'appeared_at', 'receiving_from_expert');
$crud->field_type('member_id', 'readonly');
$crud->field_type('test_id', 'readonly');
}
//$crud->order_by('member_id','asc');
$crud->unset_print();
$crud->unset_export();
//$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
$output = $crud->render();
$this->_example_output($output);
}