本文整理汇总了PHP中grocery_CRUD::callback_delete方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::callback_delete方法的具体用法?PHP grocery_CRUD::callback_delete怎么用?PHP grocery_CRUD::callback_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::callback_delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: crud
public function crud()
{
$crud = new grocery_CRUD();
$crud->set_theme(THEMA_CRUD);
$crud->set_table('quadra');
$crud->set_subject('Quadra');
//@todo$crud->where('situacao_id', 2); //apenas ativos
$crud->required_fields('descricao', 'tipo_quadra_id', '');
$crud->columns('id', 'descricao', 'tipo_quadra_id', 'situacao_quadra_id');
$crud->edit_fields('descricao', 'tipo_quadra_id', 'situacao_quadra_id');
$crud->add_fields('descricao', 'tipo_quadra_id', 'situacao_quadra_id');
//relacionamentos
$crud->set_relation('situacao_quadra_id', 'situacao_quadra', 'descricao');
$crud->set_relation('tipo_quadra_id', 'tipo_quadra', 'descricao');
$crud->callback_insert(array($this, 'create'));
$crud->callback_delete(array($this, 'delete'));
$contents = $crud->render();
$this->template->set('titulo', 'Manter Quadra');
$this->template->set('subtitle', 'Quadra');
$this->template->load('template_teste', 'crudpage', $contents);
}
示例2: crud
public function crud()
{
$crud = new grocery_CRUD();
$crud->set_theme(THEMA_CRUD);
$crud->set_table('usuario');
$crud->set_subject('Usuarios');
$crud->required_fields('nome', 'login', 'email', 'tipo_usuario_id', 'situacao_id');
$crud->columns('nome', 'login', 'email', 'tipo_usuario_id', 'situacao_id');
$crud->edit_fields('nome', 'login', 'email', 'tipo_usuario_id', 'situacao_id');
$crud->add_fields('nome', 'login', 'email', 'tipo_usuario_id');
$crud->set_relation('tipo_usuario_id', 'tipo_usuario', 'descricao');
$crud->set_relation('situacao_id', 'situacao', 'descricao');
$crud->callback_insert(array($this, 'create'));
$crud->callback_delete(array($this, 'delete'));
$crud->callback_update(array($this, 'update'));
$crud->where('situacao_id', 1);
$crud->or_where('situacao_id', 2);
$contents = $crud->render();
// $this->load->view('template_crud', $contents);
$this->template->set('titulo', 'Manter Usuário');
$this->template->set('subtitle', 'Usuário');
// nome do template , nome da view
$this->template->load('template_teste', 'crudpage', $contents);
}
示例3: main
function main()
{
$user_login = $this->ion_auth->user()->row();
$colid = $user_login->col_id;
$userId = $user_login->user_id;
$state_id = $user_login->state_id;
$user_groups = $this->ion_auth->get_users_groups($userId)->row();
$ul_type = $user_groups->ul_type;
$user_id = $this->session->userdata('user_id');
$crud = new grocery_CRUD();
$crud->set_table('announcement');
$crud->set_subject('pengumuman');
$crud->unset_delete();
$crud->callback_delete(array($this, 'delete_ann'));
$crud->unset_columns('ann_status_push');
if ($ul_type == 'KV') {
$crud->set_primary_key('ann_id', 'announcement_college');
$crud->set_relation('user_id', 'user', 'user_name');
$crud->set_relation('ann_id', 'announcement_college', 'col_id');
$crud->set_relation_n_n('Kolej', 'announcement_college', 'college', 'ann_id', 'col_id', 'col_name');
// $crud->callback_add_field('Kolej',array($this,'add_field_kolej'));
$crud->callback_after_insert(array($this, 'insert_announcement_college'));
$crud->field_type('ann_open_date', 'date');
$crud->field_type('ann_close_date', 'date');
$crud->field_type('user_id', 'hidden', $userId);
$crud->field_type('ann_status_push', 'hidden', 1);
$crud->field_type('ann_status', 'dropdown', array('1' => 'Aktif', '0' => 'Tak Aktif'));
$crud->display_as('ann_title', 'Perkara')->display_as('ann_id', 'Id')->display_as('ann_content', 'Pengumuman')->display_as('ann_open_date', 'Tarikh Mula')->display_as('ann_close_date', 'Tarikh Akhir')->display_as('ann_status', 'Status Pengumuman')->display_as('user_id', 'Pengguna')->display_as('college', 'Kolej Vokasional');
// $crud->callback_field('ann_title',array($this,'fc_ann_tite')); - FDP
// $crud->callback_field('ann_content',array($this,'fc_ann_content')); - FDP
// $crud->callback_field('ann_open_date',array($this,'fc_ann_open_date')); - FDP
// $crud->callback_field('ann_close_date',array($this,'fc_ann_close_date')); - FDP
// $crud->callback_field('ann_status',array($this,'fc_ann_status')); - FDP
// $crud->callback_field('college',array($this,'fc_college')); - FDP
$crud->where('j7f822d59.col_id', $colid);
$crud->unset_fields('Kolej');
$crud->required_fields('ann_title', 'ann_content', 'ann_open_date', 'ann_close_date', 'ann_status');
} elseif ($ul_type == 'LP') {
$crud->set_relation('user_id', 'user', 'user_name');
$crud->set_relation_n_n('Kolej', 'announcement_college', 'college', 'ann_id', 'col_id', 'col_name');
$crud->callback_after_insert(array($this, 'insert_announcement_college'));
$crud->field_type('ann_open_date', 'date');
$crud->field_type('ann_close_date', 'date');
$crud->field_type('user_id', 'hidden', $user_id);
$crud->field_type('ann_status_push', 'hidden', 1);
$crud->field_type('ann_status', 'dropdown', array('1' => 'Aktif', '0' => 'Tak Aktif'));
$crud->display_as('ann_title', 'Perkara')->display_as('ann_content', 'Pengumuman')->display_as('ann_open_date', 'Tarikh Mula')->display_as('ann_close_date', 'Tarikh Akhir')->display_as('ann_status', 'Status Pengumuman')->display_as('user_id', 'Pengguna')->display_as('college', 'Kolej Vokasional');
// $crud->callback_field('ann_title',array($this,'fc_ann_tite')); - FDP
// $crud->callback_field('ann_content',array($this,'fc_ann_content')); - FDP
// $crud->callback_field('ann_open_date',array($this,'fc_ann_open_date')); - FDP
// $crud->callback_field('ann_close_date',array($this,'fc_ann_close_date')); - FDP
// $crud->callback_field('ann_status',array($this,'fc_ann_status')); - FDP
// $crud->callback_field('college',array($this,'fc_college')); - FDP
$crud->required_fields('ann_title', 'ann_content', 'ann_open_date', 'ann_close_date', 'ann_status');
}
$output = $crud->render();
$js = '<script>$(document).ready(function()
{
$("#addStudent").validationEngine();
});</script>';
$header = $js . "<legend><h3>Penyenggaraan Pengumuman</h3></legend>";
$this->_main_output($output, $header);
}
示例4: add_receivable_amount
public function add_receivable_amount($primary_key)
{
$_SESSION['receivable_id'] = NULL;
//select the next receivable amount number
$result = $this->max_receivable_amount_number();
if ($result != NULL) {
foreach ($result as $row) {
$number = $row->number;
$number++;
//go to the next number
if ($number == 1) {
$number = "UT0001";
}
$receivable_amount_number = $number;
}
} else {
//start generating receivable_amount numbers
$receivable_amount_number = "UT0001";
}
$where = array("receivable_id" => $primary_key, "receivable_amount_status" => 0);
$crud = new grocery_CRUD();
$crud->where($where);
$crud->set_subject('Receivable Amount');
$crud->set_table('receivable_amount');
$crud->columns('receivable_amount_date', 'receivable_amount_number', 'receivable_amount_name', 'receivable_amount_amount');
$crud->fields('receivable_amount_name', 'receivable_amount_amount', 'receivable_amount_number', 'receivable_id');
$crud->field_type('receivable_amount_number', 'hidden', $receivable_amount_number);
$crud->field_type('receivable_id', 'hidden', $primary_key);
$crud->add_action('Print', base_url() . 'img/icons/icon-48-print.png', 'front_office/print_receivable_amount');
$crud->display_as('receivable_amount_date', 'Date');
$crud->display_as('receivable_amount_name', 'Item');
$crud->display_as('receivable_amount_amount', 'Amount');
$crud->display_as('receivable_amount_number', 'Receipt Number');
$crud->required_fields("receivable_amount_name", "receivable_amount_amount");
$_SESSION['receivable_id'] = $primary_key;
$_SESSION['table'] = "receivable_amount";
$crud->callback_delete(array($this, 'delete_log'));
$output = $crud->render();
$this->_example_output3($output);
}