Skip to content

Commit f3356a6

Browse files
committed
Added Uiniversity
1 parent c8f8bc9 commit f3356a6

40 files changed

+282
-7
lines changed

application/config/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
'hostname' => 'localhost',
7979
'username' => 'root',
8080
'password' => '',
81-
'database' => 'elearn',
81+
'database' => 'elearnnew',
8282
'dbdriver' => 'mysqli',
8383
'dbprefix' => '',
8484
'pconnect' => FALSE,

application/controllers/admin/Dashboard.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public function __construct()
77
parent::__construct();
88
#redirect(config_item('admin_folder').'/dashboard/welcome');
99
$this->data['link_map']['controller'] = 'Dashboard';
10-
$this->data['username'] = $this->session->userdata('admin_username');
1110
$this->load->model('user_model');
1211
}
1312
public function index()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
defined('BASEPATH') OR exit('No direct script access allowed');
3+
class University extends LB_Admin_Controller
4+
{
5+
public function __construct()
6+
{
7+
parent::__construct();
8+
$this->load->model('university_model');
9+
}
10+
11+
public function index()
12+
{
13+
$this->data['universitylists'] = $this->university_model->getApprovalList();
14+
$this->data['site_content'] = 'admin/pages/university_list';
15+
$this->load->view('admin/section', $this->data);
16+
}
17+
}

application/core/LB_Admin_Controller.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ public function alertMessage() {
4747
// checking admin logged in redirecting based on it
4848
private function check_admin_logged_in() {
4949
if ($this->data['admin_logged_in'] == TRUE) {
50-
if ($this->data['segment']['admin_controller'] == 'user') {
51-
redirect('admin/dashboard/welcome');
50+
$this->data['admin_username'] = $this->session->userdata('admin_username')?:'NA';
51+
if ($this->data['segment']['admin_controller'] == 'user') {
52+
redirect('admin/dashboard/welcome',$this->data);
5253
}
5354
} else if ($this->data['segment']['admin_controller'] != 'user') {
5455
redirect('admin/user/login');

application/core/LB_Controller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class LB_Controller extends CI_Controller{
77
function __construct() {
88
parent::__construct();
99
$this->load_migration();
10+
$this->data = array();
1011
$this->data['error'] = '';
1112
$this->data['alert'] = '';
1213
$this->data['website_title'] = config_item('website_title');
@@ -30,4 +31,4 @@ private function load_migration()
3031
$this->load->library('session');
3132
}
3233
}
33-
}
34+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
defined('BASEPATH') OR exit('No direct script access allowed');
3+
class University_model extends CI_Model
4+
{
5+
public function __construct()
6+
{
7+
parent::__construct();
8+
}
9+
public function getApprovalList(){
10+
$sql = $this->db->query("select * from unireg where 1");
11+
return $sql->result();
12+
}
13+
}

application/views/admin/common/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class="align-middle rounded-full focus:shadow-outline-purple focus:outline-none"
166166
>
167167
<img
168168
class="object-cover w-8 h-8 rounded-full"
169-
src="https://ui-avatars.com/api/?name=%3Cspan%20class="pl-ent"><?=$username?>"
169+
src="https://ui-avatars.com/api/?name=%3Cspan%20class="pl-ent"><?=$admin_username?>"
170170
alt=""
171171
aria-hidden="true"
172172
/>

application/views/admin/common/styles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
></script>
1212
<script src="<?=base_url('assets/js/init-alpine.js')?>"></script>
1313
<?php
14-
if($this->router->fetch_class() !== 'user'){?>
14+
if(FALSE){?>
1515
<link
1616
rel="stylesheet"
1717
href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.css"
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
<main class="h-full overflow-y-auto">
2+
<div class="container px-6 mx-auto grid">
3+
<h2
4+
class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"
5+
>
6+
University Approval
7+
</h2>
8+
<!-- CTA -->
9+
10+
<!-- Cards -->
11+
<!-- New Table -->
12+
<div class="w-full overflow-hidden rounded-lg shadow-xs">
13+
<div class="w-full overflow-x-auto">
14+
<table class="w-full whitespace-wrap">
15+
<thead>
16+
<tr
17+
class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
18+
>
19+
<th class="px-4 py-3">University Name</th>
20+
<th class="px-4 py-3">Address</th>
21+
<th class="px-4 py-3">District</th>
22+
<th class="px-4 py-3">Place</th>
23+
<th class="px-4 py-3">Contact</th>
24+
<th class="px-4 py-3">Email</th>
25+
<th class="px-4 py-3">Logo</th>
26+
<th class="px-4 py-3">Status</th>
27+
<th class="px-4 py-3">Action</th>
28+
</tr>
29+
</thead>
30+
<tbody
31+
class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
32+
>
33+
<?php if($universitylists):
34+
foreach ($universitylists as $university):
35+
$class = 'green';
36+
if($university->status == 0) $class='red';
37+
?>
38+
<tr class="text-gray-700 dark:text-gray-400">
39+
<td class="px-4 py-3 text-sm">
40+
<p class="font-semibold"><?=$university->uname?></p>
41+
</td>
42+
<td class="px-4 py-3 text-sm">
43+
<?=$university->offadd?>
44+
</td>
45+
<td class="px-4 py-3 text-sm">
46+
<?=$university->dis?>
47+
</td>
48+
<td class="px-4 py-3 text-sm">
49+
<?=$university->place?>
50+
</td>
51+
<td class="px-4 py-3 text-sm">
52+
<?=$university->contact?>
53+
</td>
54+
<td class="px-4 py-3 text-sm">
55+
<?=$university->email?>
56+
</td>
57+
<td class="px-4 py-3 text-sm">
58+
<img src="<?=base_url('assets/upload/'.$university->file)?>" alt="<?=$university->uname?>">
59+
</td>
60+
<td class="px-4 py-3 text-xs">
61+
<span
62+
class="px-2 py-1 font-semibold leading-tight text-<?=$class?>-700 bg-<?=$class?>-100 rounded-full dark:bg-<?=$class?>-700 dark:text-<?=$class?>-100"
63+
>
64+
<?=$university->status == 0?'Pending':'Approved'?>
65+
</span>
66+
</td>
67+
<td>
68+
<?php if($university->status == 0){?>
69+
<button class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
70+
Approve
71+
</button>
72+
<?php }else{ ?>
73+
<button
74+
class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
75+
Reject
76+
</button>
77+
<?php }?>
78+
79+
</td>
80+
</tr>
81+
<?php endforeach; endif;?>
82+
</tbody>
83+
</table>
84+
</div>
85+
<?php if(FALSE):?>
86+
<div
87+
class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"
88+
>
89+
<span class="flex items-center col-span-3">
90+
Showing 21-30 of 100
91+
</span>
92+
<span class="col-span-2"></span>
93+
<!-- Pagination -->
94+
<span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end">
95+
<nav aria-label="Table navigation">
96+
<ul class="inline-flex items-center">
97+
<li>
98+
<button
99+
class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple"
100+
aria-label="Previous"
101+
>
102+
<svg
103+
aria-hidden="true"
104+
class="w-4 h-4 fill-current"
105+
viewBox="0 0 20 20"
106+
>
107+
<path
108+
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
109+
clip-rule="evenodd"
110+
fill-rule="evenodd"
111+
></path>
112+
</svg>
113+
</button>
114+
</li>
115+
<li>
116+
<button
117+
class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
118+
>
119+
1
120+
</button>
121+
</li>
122+
<li>
123+
<button
124+
class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
125+
>
126+
2
127+
</button>
128+
</li>
129+
<li>
130+
<button
131+
class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple"
132+
>
133+
3
134+
</button>
135+
</li>
136+
<li>
137+
<button
138+
class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
139+
>
140+
4
141+
</button>
142+
</li>
143+
<li>
144+
<span class="px-3 py-1">...</span>
145+
</li>
146+
<li>
147+
<button
148+
class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
149+
>
150+
8
151+
</button>
152+
</li>
153+
<li>
154+
<button
155+
class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
156+
>
157+
9
158+
</button>
159+
</li>
160+
<li>
161+
<button
162+
class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple"
163+
aria-label="Next"
164+
>
165+
<svg
166+
class="w-4 h-4 fill-current"
167+
aria-hidden="true"
168+
viewBox="0 0 20 20"
169+
>
170+
<path
171+
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
172+
clip-rule="evenodd"
173+
fill-rule="evenodd"
174+
></path>
175+
</svg>
176+
</button>
177+
</li>
178+
</ul>
179+
</nav>
180+
</span>
181+
</div>
182+
<?php endif;?>
183+
</div>
184+
</div>
185+
</main>
186+
</div>
187+
</div>
188+

assets/css/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)