<?php

namespace App\Controllers;

class Dash extends BaseUsersController
{
    public function index()
    {
        $data['page_title'] ='Dashboard';
        return view('bko/dash',$data);
    }

    public function contacts(){

        $db = \Config\Database::connect('mermsemr_site');
        $query = $db->query(
            'SELECT * FROM myfit_contact ORDER BY id DESC LIMIT 10'
        );
        $data['contact_data'] = $query->getResultArray();;
        $data['page_title'] ='Contacts';
        return view('bko/contacts',$data);
    }

    public function faq(){
        $db = \Config\Database::connect('mermsemr_site');
      //  foreach($faq_data as $sr){
          //  $db->table('myfit_faq')->insert($sr);
      //  }
        $query = $db->query(
            'SELECT * FROM myfit_faq ORDER BY id ASC LIMIT 15'
        );
        $data['faq_data'] = $query->getResultArray();
       // $data['faq_data'] = $faq_data;
        $data['page_title'] ='Frequent Questions';
        return view('bko/faq',$data);
    }


}
