Skip to content

Commit 5300773

Browse files
authored
Merge pull request #33 from rathinimal/feature/admin-new
creating admin ui
2 parents 758c319 + 49ff8ea commit 5300773

19 files changed

+876
-21
lines changed

.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
DB_DSN = mysql:host=localhost;port=3306;dbname=fixmedb
1+
DB_DSN = "mysql:host=localhost;dbname=fixmedb"
22
DB_USER = root
3-
DB_PASSWORD =
3+
DB_PASSWORD = Nimal@123

controllers/AdminController.php

+35-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,47 @@
22

33
namespace app\controllers;
44

5+
use app\core\Application;
56
use app\core\Controller;
7+
use app\core\Request;
8+
use app\models\Customer;
9+
use app\models\Technician;
610

711
class AdminController extends Controller
812
{
913
public function dashboard()
1014
{
11-
// Render the admin dashboard view
1215
$this->setLayout('auth');
13-
return $this->render('admin/admin-dashboard');
16+
return $this->render('/admin/dashboard');
1417
}
18+
public function manageUsers()
19+
{
20+
$this->setLayout('auth');
21+
return $this->render('/admin/users');
22+
}
23+
public function settings()
24+
{
25+
$this->setLayout('auth');
26+
return $this->render('/admin/settings');
27+
}
28+
public function viewReports()
29+
{
30+
$this->setLayout('auth');
31+
return $this->render('/admin/reports');
32+
}
33+
public function manageServices()
34+
{
35+
$this->setLayout('auth');
36+
return $this->render('/admin/services');
37+
}
38+
public function adminLogin()
39+
{
40+
$this->setLayout('auth');
41+
return $this->render('/admin/admin-login.php');
42+
}
43+
44+
45+
46+
1547
}
48+

public/css/admin/admin-dashboard.css

+175-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ body {
214214

215215
/* ======================= Cards ====================== */
216216
.cardBox {
217-
top: 150px;
217+
218+
top: 20px;
218219
position: relative;
219220
width: 100%;
220221
padding: 20px;
@@ -226,7 +227,7 @@ body {
226227
.cardBox .card {
227228
position: relative;
228229
background: var(--white);
229-
padding: 30px;
230+
padding: 50px;
230231
border-radius: 20px;
231232
display: flex;
232233
justify-content: space-between;
@@ -297,3 +298,175 @@ body {
297298
left: initial;
298299
}
299300
}
301+
302+
/* line Chart */
303+
.MainChart {
304+
display: flex;
305+
grid-template-columns: 2fr 1fr;
306+
grid-gap: 20px;
307+
width: 100%;
308+
padding: 20px;
309+
padding-top: 0;
310+
}
311+
.MainChart .Chart {
312+
background: #fff;
313+
box-shadow: var(--box_shadow);
314+
padding: 20px;
315+
border-radius: 10px;
316+
width: 100%;
317+
}
318+
.MainChart .Chart h1 {
319+
color: #222;
320+
text-align: center;
321+
margin-bottom: 5px;
322+
font-size: 20px;
323+
}
324+
325+
326+
327+
/* users */
328+
.details {
329+
position: relative;
330+
width: 100%;
331+
padding: 20px;
332+
display: grid;
333+
grid-template-columns: 2fr 1fr;
334+
grid-gap: 30px;
335+
/* margin-top: 10px; */
336+
}
337+
338+
.details .recentOrders {
339+
position: relative;
340+
display: grid;
341+
min-height: 500px;
342+
background: var(--white);
343+
padding: 20px;
344+
box-shadow: 0 7px 25px rgba(0, 0, 0, 0.08);
345+
border-radius: 20px;
346+
}
347+
348+
.details .cardHeader {
349+
display: flex;
350+
justify-content: space-between;
351+
align-items: flex-start;
352+
}
353+
.cardHeader h2 {
354+
font-weight: 600;
355+
color: var(--blue);
356+
}
357+
.cardHeader .btn {
358+
position: relative;
359+
padding: 5px 10px;
360+
background: var(--blue);
361+
text-decoration: none;
362+
color: var(--white);
363+
border-radius: 6px;
364+
}
365+
366+
.details table {
367+
width: 100%;
368+
border-collapse: collapse;
369+
margin-top: 10px;
370+
}
371+
.details table thead td {
372+
font-weight: 600;
373+
}
374+
.details .recentOrders table tr {
375+
color: var(--black1);
376+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
377+
}
378+
.details .recentOrders table tr:last-child {
379+
border-bottom: none;
380+
}
381+
.details .recentOrders table tbody tr:hover {
382+
background: var(--blue);
383+
color: var(--white);
384+
}
385+
.details .recentOrders table tr td {
386+
padding: 10px;
387+
}
388+
.details .recentOrders table tr td:last-child {
389+
text-align: end;
390+
}
391+
.details .recentOrders table tr td:nth-child(2) {
392+
text-align: end;
393+
}
394+
.details .recentOrders table tr td:nth-child(3) {
395+
text-align: center;
396+
}
397+
.status.delivered {
398+
padding: 2px 4px;
399+
background: #8de02c;
400+
color: var(--white);
401+
border-radius: 4px;
402+
font-size: 14px;
403+
font-weight: 500;
404+
}
405+
.status.pending {
406+
padding: 2px 4px;
407+
background: #e9b10a;
408+
color: var(--white);
409+
border-radius: 4px;
410+
font-size: 14px;
411+
font-weight: 500;
412+
}
413+
.status.return {
414+
padding: 2px 4px;
415+
background: #f00;
416+
color: var(--white);
417+
border-radius: 4px;
418+
font-size: 14px;
419+
font-weight: 500;
420+
}
421+
.status.inProgress {
422+
padding: 2px 4px;
423+
background: #1795ce;
424+
color: var(--white);
425+
border-radius: 4px;
426+
font-size: 14px;
427+
font-weight: 500;
428+
}
429+
430+
.recentCustomers {
431+
position: relative;
432+
display: grid;
433+
min-height: 500px;
434+
padding: 20px;
435+
background: var(--white);
436+
box-shadow: 0 7px 25px rgba(0, 0, 0, 0.08);
437+
border-radius: 20px;
438+
}
439+
.recentCustomers .imgBx {
440+
position: relative;
441+
width: 40px;
442+
height: 40px;
443+
border-radius: 50px;
444+
overflow: hidden;
445+
}
446+
.recentCustomers .imgBx img {
447+
position: absolute;
448+
top: 0;
449+
left: 0;
450+
width: 100%;
451+
height: 100%;
452+
object-fit: cover;
453+
}
454+
.recentCustomers table tr td {
455+
padding: 12px 10px;
456+
}
457+
.recentCustomers table tr td h4 {
458+
font-size: 16px;
459+
font-weight: 500;
460+
line-height: 1.2rem;
461+
}
462+
.recentCustomers table tr td h4 span {
463+
font-size: 14px;
464+
color: var(--black2);
465+
}
466+
.recentCustomers table tr:hover {
467+
background: var(--blue);
468+
color: var(--white);
469+
}
470+
.recentCustomers table tr:hover td h4 span {
471+
color: var(--white);
472+
}

0 commit comments

Comments
 (0)