You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.4 KiB

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Event_venue_photos_model extends CI_Model {
public function __construct() {
parent::__construct();
$this->db->query("SET @@group_concat_max_len =30000");
}
public function save_photo($venue) {
$data = array(
'photo' => $venue['photo'],
'event_id' => $venue['event_id']
);
$this->db->insert('event_venue_photos', $data);
}
public function get_venue_photos_by_event_id($event_id) {
$this->db->select('*');
$this->db->where('event_id', $event_id);
$this->db->where('status', 1);
return $this->db->get('event_venue_photos')->result();
}
public function get_venue_photo_by_id($id) {
$this->db->select('*');
$this->db->where('id', $id);
$this->db->where('status', 1);
return $this->db->get('event_venue_photos')->num_rows();
}
public function update_venue_photo($photo_id, $venue) {
$data = array(
'photo' => $venue['photo']
);
$this->db->where('id', $photo_id);
$this->db->update('event_venue_photos', $data);
}
public function delete_venue_photo($id) {
$data = array(
'status' => 0
);
$this->db->where('id', $id);
$this->db->update('event_venue_photos', $data);
}
}