File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/application/modules/event_booking/models/Participant_group_model.php
Back
<?php Class Participant_group_Model extends CI_Model{ function get_groups() { $data = $this->db->get_where('participant_group')->result_array(); foreach ($data as $key => $value) { $data[$key]['is_delete'] = 1; //$this->db->order_by('participant_group.title','asc'); $check = $this->db->get_where('participants_has_groups',array('group_id' => $value['id']))->row_array(); if(!empty($check)) $data[$key]['is_delete'] = 0; } return $data; } function addGroup($data) { return $this->db->insert('participant_group',$data); } function editGroup($data,$id) { return $this->db->update('participant_group',$data,array('id' => $id)); } function get_group($id) { $data = $this->db->get_where('participant_group',array('id' => $id))->row_array(); $data['is_delete'] = 1; $check = $this->db->get_where('participants_has_groups',array('group_id' => $id))->row_array(); if(!empty($check)) $data['is_delete'] = 0; return $data; } function get_group_by_name($title) { $data = $this->db->get_where('participant_group',array('title' => $title))->row_array(); return $data; } function delete_group($id) { return $this->db->delete('participant_group',array('id' => $id)); } } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 1 |
proxy
|
phpinfo
|
Settings