2024-07-16 12:29:59 +00:00
|
|
|
<?php
|
|
|
|
class preview_model extends CI_Model {
|
|
|
|
|
2024-07-22 09:49:37 +00:00
|
|
|
public function get_form($form_id) {
|
|
|
|
$this->db->where('id', $form_id);
|
|
|
|
$query = $this->db->get('forms');
|
|
|
|
return $query->row();
|
2024-07-16 12:29:59 +00:00
|
|
|
}
|
2024-07-22 09:49:37 +00:00
|
|
|
|
|
|
|
public function get_questions($form_id) {
|
|
|
|
$this->db->where('form_id', $form_id);
|
|
|
|
$query = $this->db->get('questions');
|
|
|
|
return $query->result(); // Ensure this returns objects with the 'is_required' field
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_options($question_id) {
|
|
|
|
$this->db->where('question_id', $question_id);
|
|
|
|
$query = $this->db->get('options');
|
|
|
|
return $query->result(); // Ensure this returns the options related to the question
|
2024-07-16 12:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|