Commit 77f192f5 by Manoj

changes

parent f2248571
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
/*
| ------------------------------------------------------------------------- $route['default_controller'] = 'AuthController/';
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/userguide3/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = 'DashboardController/';
$route['404_override'] = ''; $route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE; $route['translate_uri_dashes'] = FALSE;
//auth
$route['login'] = 'AuthController/login';
$route['logout'] = 'AuthController/logout';
$route['recover'] = 'auth/forgetpassword';
$route['verification'] = 'auth/recovery_verification';
$route['privacy'] = 'auth/privacy_policy';
\ No newline at end of file
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class AuthController extends CI_Controller
{
class AuthController extends CI_Controller {
public function index() public function index()
{ {
$view_data[''] = ''; $view_data[''] = '';
$this->load->view('auth/login', $view_data); $this->load->view('auth/login', $view_data);
} }
public function register() public function login()
{ {
$view_data[''] = '';
$email = $this->input->post('email');
$this->load->view('auth/register', $view_data); $password = $this->input->post('password');
$user = $this->mcommon->specific_row('users',array('email'=>$email));
if ($user['user_id'] != '' && password_verify($password, $user['passwd'])) {
$this->session->set_flashdata('alert_success', 'Login successfully!');
$userArray = array(
"user_id" => $user['user_id'],
"email" => $user['email'],
"mobile" => $user['mobile'],
"name" => $user['name'],
"auth_level" => $user['auth_level'],
"logged_in" => true,
);
$this->session->set_userdata($userArray);
redirect('DashboardController');
} else {
$this->session->set_flashdata('alert_danger', 'Email or Password Wrong!');
redirect('login');
}
} }
public function forget() // public function register()
// {
// if (isset($_POST['submit'])) {
// $user_array = array(
// 'first_name' => $first_name,
// // 'last_name' => $last_name,
// 'username' => $username,
// 'name' => $name,
// 'email' => $email,
// 'mobile' => $mobile_number,
// 'auth_level' => 1, // 1->customer,9->admin
// 'passwd' => password_hash($password, PASSWORD_DEFAULT),
// 'created_at' => date("Y-m-d h:i:s"),
// 'banned' => 0
// );
// //insert values in database
// $insert = $this->mcommon->common_insert('users', $user_array);
// } else {
// $view_data[''] = '';
// $this->load->view('auth/register', $view_data);
// }
// }
public function forget()
{ {
$view_data[''] = ''; $view_data[''] = '';
$this->load->view('auth/forget', $view_data); $this->load->view('auth/forget', $view_data);
} }
public function logout()
{
$this->session->unset_userdata('logged_in');
$this->authentication->logout();
// Set redirect protocol
$redirect_protocol = USE_SSL ? 'https' : null;
redirect(site_url(LOGIN_PAGE . '?logout=1', $redirect_protocol));
}
} }
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class DashboardController extends CI_Controller
{
class DashboardController extends CI_Controller {
public function index() public function index()
{ {
...@@ -17,18 +18,60 @@ class DashboardController extends CI_Controller { ...@@ -17,18 +18,60 @@ class DashboardController extends CI_Controller {
$this->db->from('applications'); $this->db->from('applications');
$this->db->where('payment_status', 2); $this->db->where('payment_status', 2);
$completed = $this->db->count_all_results(); $completed = $this->db->count_all_results();
$currentYear = date('Y');
$this->db->select('MONTH(a.created_at) as month, COUNT(*) as count');
$this->db->from('applications as a');
$this->db->join('accomodation_info as ai', 'ai.application_id = a.id', 'left');
$this->db->where('a.status', 1);
$this->db->where('YEAR(a.created_at)', $currentYear); // Ensure filtering by the same date field used for grouping
$this->db->group_by('MONTH(a.created_at)');
$query = $this->db->get();
$monthlyCounts = array_fill(0, 12, 0); // Start indices from 0 to 11 for months Jan-Dec
foreach ($query->result() as $row) {
$monthlyCounts[$row->month - 1] = (int) $row->count; // Adjust index by 1 to match array indexing
}
$view_data['monthlyCounts'] = $monthlyCounts;
$view_data['drafted'] = $drafted; // print_r($view_data['monthlyCounts']);
$view_data['pending'] = $pending; // exit;
$view_data['completed'] = $completed;
$this->db->from('applications as a');
$data = array( $this->db->where('a.payment_status', 2);
$completed_count = $this->db->count_all_results();
$total_amount = $completed_count * 1260;
$view_data['courses'] = $this->mcommon->records_all('course');
$this->db->select('*, applications.id as appid, applications.status as apstatus,ai.payment_mode,applications.email as appEmail');
$this->db->from('applications');
$this->db->join('course', 'course.id = applications.course_id', 'left');
$this->db->join('users', 'users.user_id = applications.user_id','left');
$this->db->join('accomodation_info as ai', 'ai.application_id = applications.id','left');
$this->db->join('application_other_info as athinfo', 'athinfo.application_id = applications.id','left');
// $this->db->where('athinfo.tab_status', '1');
$this->db->where('applications.status', '1');
$query = $this->db->get();
$view_data['records'] = $query->result();
$view_data['drafted'] = $drafted;
$view_data['pending'] = $pending;
$view_data['completed'] = $completed;
$view_data['total_amount'] = $total_amount;
$data = array(
'title' => "Home", 'title' => "Home",
'content' => $this->load->view('dashboard/home', $view_data, true), 'content' => $this->load->view('dashboard/home', $view_data, true),
); );
$this->load->view('base/base_template', $data); $this->load->view('base/base_template', $data);
} }
} }
...@@ -415,6 +415,15 @@ class Common_model extends CI_Model ...@@ -415,6 +415,15 @@ class Common_model extends CI_Model
return true; return true;
} }
public function getUser($email){
$this->db->select('*');
$this->db->from('users');
$this->db->where('email',$email);
$result = $this->db->get()->row_array();
return $result;
}
......
...@@ -4,22 +4,36 @@ ...@@ -4,22 +4,36 @@
<head> <head>
<!-- Title --> <!-- Title -->
<title>Login ACJ</title> <title>Login ACJ</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Mobile Specific --> <!-- Mobile Specific -->
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicon icon --> <!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="<?= base_url('') ?>assets/images/favicon.png"> <link rel="icon" type="image/png" sizes="16x16" href="<?= base_url('') ?>assets/images/favicon.png">
<link href="<?= base_url('') ?>assets/css/style.css" rel="stylesheet"> <link href="<?= base_url('') ?>assets/css/style.css" rel="stylesheet">
<style>
.login-image {
height: 440px !important;
width: 362px;
margin-left: -65px;
}
.tab-content {
margin-left: -82px !important;
}
</style>
</head> </head>
<body class="body h-100"> <body class="body h-100">
<div class="authincation d-flex flex-column flex-lg-row flex-column-fluid"> <div class="authincation d-flex flex-column flex-lg-row flex-column-fluid">
<div class="login-aside text-center d-flex flex-column flex-row-auto"> <div class="login-aside text-center d-flex flex-column flex-row-auto">
...@@ -34,35 +48,38 @@ ...@@ -34,35 +48,38 @@
<img class="img1 move-1" src="<?= base_url('') ?>assets/images/background/pic3.png" alt=""> <img class="img1 move-1" src="<?= base_url('') ?>assets/images/background/pic3.png" alt="">
<img class="img2 move-2" src="<?= base_url('') ?>assets/images/background/pic4.png" alt=""> <img class="img2 move-2" src="<?= base_url('') ?>assets/images/background/pic4.png" alt="">
<img class="img3 move-3" src="<?= base_url('') ?>assets/images/background/pic5.png" alt=""> <img class="img3 move-3" src="<?= base_url('') ?>assets/images/background/pic5.png" alt="">
</div> </div>
</div> </div>
<div class="container flex-row-fluid d-flex flex-column justify-content-center position-relative overflow-hidden p-7 mx-auto"> <div class="container flex-row-fluid d-flex flex-column justify-content-center position-relative overflow-hidden p-7 mx-auto">
<div class="d-flex justify-content-center h-100 align-items-center"> <div class="d-flex justify-content-center h-100 align-items-center">
<div class="authincation-content style-2"> <div class="authincation-content style-2">
<div class="row no-gutters"> <div class="row no-gutters">
<div class="col-xl-12 tab-content"> <div class="col-xl-12 d-flex tab-content">
<div id="sign-up" class="auth-form tab-pane fade show active form-validation"> <div class="col-md-8" >
<form action="https://akademi.dexignlab.com/codeigniter/demo/index"> <img src="<?php echo base_url(); ?>assets/images/asian_logo.jpg" alt="" width="300px" class="login-image">
</div>
<div style=" border:1px solid grey;" id="sign-up" class="auth-form tab-pane fade show active form-validation col-md-11 ">
<form action="<?= base_url("login") ?> " method="post">
<div class="text-center mb-4"> <div class="text-center mb-4">
<h3 class="text-center mb-2 text-black">Sign In</h3> <h3 class="text-center mb-2 text-black">Sign In</h3>
<span>Your Social Campaigns</span> <!-- <span>Your Social Campaigns</span> -->
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="exampleFormControlInput1" class="form-label mb-2 fs-13 label-color font-w500">Email address</label> <label for="exampleFormControlInput1" class="form-label mb-2 fs-13 label-color font-w500">Email Id</label>
<input type="email" class="form-control" id="exampleFormControlInput1" value="hello@example.com"> <input type="text" name="email" class="form-control" id="email">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="exampleFormControlInput1" class="form-label mb-2 fs-13 label-color font-w500">Password</label> <label for="exampleFormControlInput1" class="form-label mb-2 fs-13 label-color font-w500">Password</label>
<input type="password" class="form-control" id="exampleFormControlInput2" value="Password"> <input type="password" name="password" class="form-control" id="password">
</div> </div>
<a href="<?= base_url('AuthController/forget') ?>" class="text-primary float-end mb-4">Forgot Password ?</a> <a href="<?= base_url('AuthController/forget') ?>" class="text-primary float-end mb-4">Forgot Password ?</a>
<button class="btn btn-block btn-primary">Sign In</button> <button class="btn btn-block btn-primary">Sign In</button>
</form> </form>
<div class="new-account mt-3 text-center"> <div class="new-account mt-3 text-center">
<p class="font-w500">Don't have an account? <a class="text-primary" href="<?= base_url('AuthController/register') ?>" data-toggle="tab">Sign Up</a></p> <!-- <p class="font-w500">Don't have an account? <a class="text-primary" href="<?= base_url('AuthController/register') ?>" data-toggle="tab">Sign Up</a></p> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -73,13 +90,13 @@ ...@@ -73,13 +90,13 @@
</div> </div>
<!--********************************** <!--**********************************
Scripts Scripts
***********************************--> ***********************************-->
<!-- Required vendors --> <!-- Required vendors -->
<script src="<?= base_url('') ?>assets/vendor/global/global.min.js"></script> <script src="<?= base_url('') ?>assets/vendor/global/global.min.js"></script>
<script src="<?= base_url('') ?>assets/js/custom.min.js"></script> <script src="<?= base_url('') ?>assets/js/custom.min.js"></script>
<script src="<?= base_url('') ?>assets/js/dlabnav-init.js"></script> <script src="<?= base_url('') ?>assets/js/dlabnav-init.js"></script>
</body> </body>
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
</ul> </ul>
</li> </li>
<li><a href="<?php echo base_url(); ?>EmailTemplateController/" aria-expanded="false"> <!-- <li><a href="<?php echo base_url(); ?>EmailTemplateController/" aria-expanded="false">
<i class="material-symbols-outlined">email</i> <i class="material-symbols-outlined">email</i>
<span class="nav-text">Email Template</span> <span class="nav-text">Email Template</span>
</a> </a>
</li> </li> -->
<li><a class="has-arrow " href="javascript:void(0);" aria-expanded="false"> <li><a class="has-arrow " href="javascript:void(0);" aria-expanded="false">
<i class="material-icons"> settings </i> <i class="material-icons"> settings </i>
......
...@@ -21495,7 +21495,8 @@ Fixing Order => Base + Typography >> General Layout + Grid >> Page Layout + Comp ...@@ -21495,7 +21495,8 @@ Fixing Order => Base + Typography >> General Layout + Grid >> Page Layout + Comp
.input-group > .bootstrap-select:not(:last-child) .dropdown-toggle { .input-group > .bootstrap-select:not(:last-child) .dropdown-toggle {
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; } border-bottom-right-radius: 0;
height : 42px ;}
:root { :root {
--primary: #FC9003; --primary: #FC9003;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment