Skip to content

Commit b54e5a0

Browse files
add .htaccess
1 parent 1a7bb07 commit b54e5a0

38 files changed

+21
-8
lines changed

.gitignore

100644100755
File mode changed.

Readme.MD

100644100755
File mode changed.

app/controllers/admin.php

100644100755
File mode changed.

app/controllers/book.php

100644100755
File mode changed.

app/controllers/login.php

100644100755
File mode changed.

app/models/admindashboard.php

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function addbook($bookname, $number)
5858
public static function bookapprovalrender()
5959
{
6060
$db = \DB::get_instance();
61-
$stmt = $db->prepare("SELECT * FROM requests WHERE status=2");
61+
$stmt = $db->prepare("SELECT requests.bookid,requests.username,requests.status,requests.returned,books.bookname FROM requests INNER JOIN books ON requests.bookid=books.id WHERE status=2");
6262
$stmt->execute();
6363
$rows = $stmt->fetchAll();
6464
return $rows;
@@ -81,7 +81,7 @@ public static function requestResolve($id, $status, $username)
8181
public static function pastresolve($username)
8282
{
8383
$db = \DB::get_instance();
84-
$stmt = $db->prepare("SELECT * FROM requests WHERE username=? ORDER BY id DESC");
84+
$stmt = $db->prepare("SELECT requests.bookid,requests.username,requests.status,requests.returned,books.bookname FROM requests INNER JOIN books ON requests.bookid=books.id WHERE username=? ORDER BY id DESC");
8585
$stmt->execute([$username]);
8686
$rows = $stmt->fetchAll();
8787
return $rows;

app/models/dashboard.php

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function checkAvailiabilityforuser($username, $bookid)
5757
public static function userresolved($username)
5858
{
5959
$db = \DB::get_instance();
60-
$stmt = $db->prepare("SELECT * FROM requests WHERE username=? ORDER BY id DESC");
60+
$stmt = $db->prepare("SELECT requests.bookid,requests.username,requests.status,requests.returned,books.bookname FROM requests INNER JOIN books ON requests.bookid=books.id WHERE username=? ORDER BY requests.id DESC");
6161
$stmt->execute([$username]);
6262
$rows = $stmt->fetchAll();
6363
return $rows;

app/models/db.php

100644100755
File mode changed.

app/models/postlogin.php

100644100755
File mode changed.

app/utils/utils.php

100644100755
File mode changed.

app/views/loader.php

100644100755
File mode changed.

app/views/templates/head.twig

100644100755
File mode changed.

app/views/templates/history.twig

100644100755
+8-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{% extends "templates/homelayout.twig" %}
22
{% block body %}
3+
<button
4+
type="button"
5+
class="btn btn-info filter"
6+
id="history"
7+
onclick="userHistory()"
8+
>Filter</button>
39

410
<div class="header">History
511
</div>
612
<table cellspacing="0">
713
<tr>
814
<th>Username</th>
9-
<th>BookId</th>
15+
<th>Book</th>
1016
<th>Status</th>
1117
</tr>
1218
{% for row in history %}
1319
<tr id={{row.id}}>
1420
<td>{{row.username}}</td>
15-
<td>{{row.bookid}}</td>
21+
<td>{{row.bookname}}</td>
1622
<td style="text-align:center">
1723
{% if row.status == 2 %}
1824
Pending

app/views/templates/home.twig

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
id="btn"
4242
onclick="checkId({{book.id}},{{book.avail}})"
4343
>Change State</button>
44-
{% else %}
44+
{% elseif book.avail %}
4545
<button
4646
type="button"
4747
class="btn btn-success"

app/views/templates/homelayout.twig

100644100755
File mode changed.

app/views/templates/login.twig

100644100755
File mode changed.

app/views/templates/loginlayout.twig

100644100755
File mode changed.

app/views/templates/navbar.twig

100644100755
File mode changed.

app/views/templates/reqlayout.twig

100644100755
File mode changed.

app/views/templates/requests.twig

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<table cellspacing="0">
77
<tr>
88
<th>Username</th>
9-
<th>BookId</th>
9+
<th>Book</th>
1010
<th></th>
1111
</tr>
1212
{% for req in requests %}
1313
<tr id={{req.id}}>
1414
<td>{{req.username}}</td>
15-
<td>{{req.bookid}}</td>
15+
<td>{{req.bookname}}</td>
1616
{% if req.status == 2 %}
1717
<td id="action"><button
1818
type="button"

app/views/templates/signup.twig

100644100755
File mode changed.

app/views/templates/signuplayout.twig

100644100755
File mode changed.

composer.json

100644100755
File mode changed.

composer.lock

100644100755
File mode changed.

config/sample.config.php

100644100755
File mode changed.

public/.htaccess

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine On
3+
RewriteBase /
4+
RewriteCond %{REQUEST_FILENAME} !-f
5+
RewriteCond %{REQUEST_FILENAME} !-d
6+
RewriteRule . /index.php [L]
7+
</IfModule>

public/assets/Js/adminBook.js

100644100755
File mode changed.

public/assets/Js/adminRequests.js

100644100755
File mode changed.

public/assets/Js/dashboard.js

100644100755
File mode changed.

public/assets/Js/signup.js

100644100755
File mode changed.

public/assets/css/Login-Form-Clean.css

100644100755
File mode changed.

public/assets/css/Ludens-Users---2-Register.css

100644100755
File mode changed.

public/assets/css/info.css

100644100755
File mode changed.

public/assets/css/signup.css

100644100755
File mode changed.

public/assets/css/styles.css

100644100755
File mode changed.

public/index.php

100644100755
File mode changed.

schema/schema.sql

100644100755
File mode changed.

script.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)