2024-07-16 12:29:59 +00:00
|
|
|
<?php
|
|
|
|
class Publish_model extends CI_Model {
|
|
|
|
|
|
|
|
// Method to update form details including is_published status
|
|
|
|
public function update_form($form_id, $data) {
|
|
|
|
$this->db->where('id', $form_id);
|
|
|
|
return $this->db->update('forms', $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Method to retrieve published forms by user
|
|
|
|
public function get_published_forms_by_user($user_id) {
|
|
|
|
$this->db->where('user_id', $user_id);
|
2024-07-19 10:46:18 +00:00
|
|
|
$this->db->where('is_published', 1);
|
2024-07-16 12:29:59 +00:00
|
|
|
$query = $this->db->get('forms');
|
|
|
|
return $query->result();
|
|
|
|
}
|
|
|
|
}
|