<?php
class Forms_model extends CI_Model{

    public function get_batch($where_clause = NULL)
    {
        if ($where_clause != NULL) {
            $this->db->where($where_clause);
        }
            $this->db->order_by("form_id asc, orderofelements asc");

        return $this->db->get('form_questions')->result_array();




    }

    public function getserviceedropdown()
    {

        $this->db->order_by("id asc");

        return $this->db->get('ea_forms')->result_array();




    }

    public function get_row($form_id)
    {
        if ( ! is_numeric($form_id))
        {
            throw new Exception('$form_id argument is not an numeric (value: "' . $form_id . '")');
        }
         $this->db->get_where('ea_forms', ['id' => $form_id])->row_array();
        $this->db->join('form_questions', 'ea_forms.id = form_questions.form_id', 'inner');
        return $this->db->get('form_questions')->row_array();

    }
}