golf_backend/app/Controllers/Common_controller.php
2023-05-08 10:28:08 +05:30

50 lines
939 B
PHP

<?php
namespace App\Controllers;
use App\Models\User_model;
use App\Models\Dashboard_model;
use App\Models\Common_model;
class Common_controller extends BaseController
{
public $session;
public function __construct()
{
$this->session = session();
$this->UserModel = new User_model();
$this->dModel = new Dashboard_model();
$this->cModel = new Common_model();
helper(['form']);
}
public function index()
{
}
function fetch_country()
{
echo $this->cModel->fetch_country();
}
function fetch_state()
{
if($this->request->getVar('country_id'))
{
echo $this->cModel->fetch_state($this->request->getVar('country_id'));
}
}
function fetch_city()
{
if($this->request->getVar('state_id'))
{
echo $this->cModel->fetch_city($this->request->getVar('state_id'));
}
}
// -----------------------------------------------
}