Skip to content

Commit f764ab5

Browse files
changed functionality
1 parent f2452e4 commit f764ab5

File tree

228 files changed

+137
-140921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+137
-140921
lines changed

.htaccess

Lines changed: 0 additions & 4 deletions
This file was deleted.

application/config/config.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ function _autoloader($className){
3131
| a PHP script and you can easily do that on your own.
3232
|
3333
*/
34-
$config['base_url'] = 'http://localhost/elearn';
34+
$config['base_url'] = 'http://localhost:8000/elearn/index.php/';
35+
$config['baseurl'] = 'http://localhost:8000/elearn/';
36+
3537

3638
/*
3739
|--------------------------------------------------------------------------
@@ -388,7 +390,7 @@ function _autoloader($className){
388390
$config['sess_driver'] = 'files';
389391
$config['sess_cookie_name'] = 'ci_session';
390392
$config['sess_expiration'] = 7200;
391-
$config['sess_save_path'] = NULL;
393+
$config['sess_save_path'] = APPPATH.'cache\session';;
392394
$config['sess_match_ip'] = FALSE;
393395
$config['sess_time_to_update'] = 300;
394396
$config['sess_regenerate_destroy'] = FALSE;

application/config/database.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@
7575

7676
$db['default'] = array(
7777
'dsn' => '',
78-
'hostname' => 'localhost',
79-
'username' => 'root',
80-
'password' => '',
81-
'database' => 'elearnnew',
82-
'dbdriver' => 'mysqli',
78+
'hostname' => 'DESKTOP-JINSON\SQLSERVER2019',
79+
'username' => 'sa',
80+
'password' => 'sa#123',
81+
'database' => 'elearn',
82+
'dbdriver' => 'sqlsrv',
8383
'dbprefix' => '',
8484
'pconnect' => FALSE,
8585
'db_debug' => (ENVIRONMENT !== 'production'),

application/config/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@
5252
$route['default_controller'] = 'auth';
5353
$route['404_override'] = '';
5454
$route['translate_uri_dashes'] = FALSE;
55-
$route['admin'] = 'admin/user/login';
55+
//$route['admin'] = 'admin/user/login';

application/controllers/Auth.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ public function __construct()
99

1010
public function index()
1111
{
12-
if($this->session->userdata('name')){
12+
/*if($this->session->userdata('name')){
1313
$this->load->view('student/home');
1414
}else{
1515
echo "Not Authenticated";
16-
}
17-
16+
}*/
17+
$this->load->view('student/home');
1818
}
1919
public function login(){
20-
$retunr_login = $this->User_model->login();
20+
//$this->User_model->login();
2121
$this->load->view('student/page/login');
2222
}
2323

application/controllers/admin/Dashboard.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
defined('BASEPATH') OR exit('No direct script access allowed');
33
class Dashboard extends LB_Admin_Controller
44
{
5-
public function __construct()
5+
public $user_model;
6+
7+
public function __construct()
68
{
79
parent::__construct();
810
#redirect(config_item('admin_folder').'/dashboard/welcome');
911
$this->data['link_map']['controller'] = 'Dashboard';
1012
$this->load->model('user_model');
11-
}
13+
$this->load->model(config_item('admin_folder') . '/User_model');
14+
//echo "<pre>";print_r($this->user_model);die;
15+
}
1216
public function index()
1317
{
1418

@@ -18,7 +22,7 @@ public function welcome()
1822
{
1923
$this->data['link_map']['method'] = 'Welcome';
2024
$this->data['site_content'] = 'admin/pages/home';
21-
$this->load->view('admin/section', $this->data);
25+
$this->load->view('admin/section', $this->data);
2226

2327
}
2428
public function change_password()
@@ -42,17 +46,16 @@ public function change_password()
4246
)
4347
));
4448
$this->form_validation->set_rules($validationRules);
45-
if ($this->form_validation->run() == TRUE) {
49+
if ($this->form_validation->run()) {
4650
$this->load->model(config_item('admin_folder') . '/User_model');
47-
$result = $this->User_model->check_recovery_key_expired();
48-
if ($this->User_model->change_password()) {
51+
$this->user_model->check_recovery_key_expired();
52+
if ($this->user_model->change_password()) {
4953
$this->session->set_flashdata('success', 'Your account password changed successfully.');
50-
$this->data['alert'] = $this->alertMessage() ?: '';
51-
} else {
54+
} else {
5255
$this->session->set_flashdata('error', 'Your account password change unsuccessful.');
53-
$this->data['alert'] = $this->alertMessage() ?: '';
54-
}
55-
}
56+
}
57+
$this->data['alert'] = $this->alertMessage() ?: '';
58+
}
5659
$this->data['site_content'] = config_item('admin_folder') . '/page/change_password';
5760
$this->load->view(config_item('admin_folder') . '/section', $this->data);
5861
}

application/controllers/admin/Home.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
class Home extends MY_Controller
2+
defined('BASEPATH') OR exit('No direct script access allowed');
3+
class Home extends LB_Admin_Controller
34
{
45
public function __construct()
56
{

application/controllers/admin/Student.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
class Student extends LB_Admin_Controller
66
{
7+
protected $student_model;
78
public function __construct()
89
{
910
parent::__construct();

application/controllers/admin/User.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function login() {
8585
)
8686
);
8787
$this->form_validation->set_rules($validationRules);
88-
if ($this->form_validation->run() == TRUE) {
88+
if ($this->form_validation->run()) {
8989
$result = $this->user_model->login();
9090
if (count($result) > 0) {
9191
if($result->role=='A'){
@@ -124,7 +124,7 @@ public function forgot_password(){
124124
)
125125
);
126126
$this->form_validation->set_rules($validationRules);
127-
if ($this->form_validation->run() == TRUE) {
127+
if ($this->form_validation->run()) {
128128
$result=$this->user_model->recover_by_email();
129129
if(count($result)>0){
130130
if($result->user_account_status=='D'){

application/core/LB_Admin_Controller.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
defined('BASEPATH') OR exit('No direct script access allowed');
33
class LB_Admin_Controller extends LB_Controller{
44
// setting default values in the data variable
5+
public $data;
56
function __construct() {
67
parent::__construct();
78
// calling migration class to create table
8-
$this->data['admin_logged_in'] = $this->session->admin_logged_in?:FALSE;
9+
$this->data['admin_logged_in'] = $this->session->admin_logged_in?:TRUE;
910
$this->data['pagination'] = '';
1011
$this->get_admin_segment();
1112
$this->check_admin_logged_in();
@@ -46,7 +47,7 @@ public function alertMessage() {
4647
}
4748
// checking admin logged in redirecting based on it
4849
private function check_admin_logged_in() {
49-
if ($this->data['admin_logged_in'] == TRUE) {
50+
if ($this->data['admin_logged_in']) {
5051
$this->data['admin_username'] = $this->session->userdata('admin_username')?:'NA';
5152
if ($this->data['segment']['admin_controller'] == 'user') {
5253
redirect('admin/dashboard/welcome',$this->data);

0 commit comments

Comments
 (0)