google_forms/application/models/Preview_model.php

26 lines
706 B
PHP
Raw Permalink Normal View History

2024-07-16 12:29:59 +00:00
<?php
2024-08-09 12:04:48 +00:00
class preview_model extends CI_Model
{
public function get_form($form_id)
{
2024-07-22 09:49:37 +00:00
$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
2024-08-09 12:04:48 +00:00
public function get_questions($form_id)
{
2024-07-22 09:49:37 +00:00
$this->db->where('form_id', $form_id);
$query = $this->db->get('questions');
return $query->result(); // Ensure this returns objects with the 'is_required' field
}
2024-08-09 12:04:48 +00:00
public function get_options($question_id)
{
2024-07-22 09:49:37 +00:00
$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
}
2024-08-09 12:04:48 +00:00
}