File: /home/cafsindia/crm_cafsindia_com/application/controllers/signup.php
<?php
class Signup extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model('Signups');
}
public function index(){
$this->load->view('signup');
}
// used to valid and check user exist
public function signup_check(){
$Status = $this->Signups->save_signup($this->input->post('eml'), $this->input->post('mob'));
$msg = $Status['msg'];
if($Status['sts'] === "2"){
echo json_encode(array('sts' => "2", 'message' => "SHOWLOGIN"));
}else{
echo json_encode(array('sts' => "1", 'message' => "SHOWOTP"));
}
}
//Validate otp
public function verify_otp(){
$verifySts = $this->Signups->save_customer($this->input->post('otp'), $this->input->post('pwd'));
if($verifySts['sts'] === "0"){
echo json_encode(array('sts' => "0", 'message' => "INV_OTP"));
}else{
echo json_encode(array('sts' => "1", 'message' => "Created account"));
}
//print_r($verifySts);
}
}
?>