131 lines
1.5 KiB
PHP
131 lines
1.5 KiB
PHP
<?php
|
|
|
|
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Models\User_model;
|
|
|
|
use App\Models\Dashboard_model;
|
|
|
|
use App\Models\Common_model;
|
|
|
|
use App\Models\Member_model;
|
|
|
|
class Common_controller extends BaseController
|
|
|
|
{
|
|
|
|
public $session;
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->session = session();
|
|
|
|
$this->MemberModel = new Member_model();
|
|
|
|
$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'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function check_if_mail_exists()
|
|
|
|
{
|
|
|
|
if($this->request->getVar('table'))
|
|
{
|
|
|
|
if($this->request->getVar('table') == 'member')
|
|
{
|
|
$data = $this->MemberModel->where('email', $this->request->getVar('email'))->find();
|
|
}else if($this->request->getVar('table') == 'users'){
|
|
$data = $this->UserModel->where('email', $this->request->getVar('email'))->find();
|
|
}
|
|
if ($data)
|
|
{
|
|
echo true;
|
|
}
|
|
else
|
|
{
|
|
echo false;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------
|
|
|
|
}
|
|
|