Skip to content

Commit

Permalink
Fixed views
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbird7112 committed Jun 23, 2021
1 parent 165415b commit 1acc49c
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 30 deletions.
4 changes: 3 additions & 1 deletion app/controller/adminbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ public function get(){
header("Location: /illegal");
}else{
$books = \Models\Admin::get_books();
$books["users"] = str_replace(";",",",$books["users"]);
foreach($books as $b){
$b["users"] = str_replace(";",",",$b["users"]);
}
echo \View\Loader::make()->render("templates/adminbook.twig", array(
books => $books
));
Expand Down
2 changes: 1 addition & 1 deletion app/views/templates/adminbook.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<input type="submit" value="Book Deletion">
</form>
<form action="/adminhome" method="GET">
<input type="submit" value="Return">
<input class="invert" type="submit" value="Return">
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion app/views/templates/adminhome.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<input type="submit" value="Manage Requests">
</form>
<form action="/" method="GET">
<input type="submit" value="Logout">
<input class="invert" type="submit" value="Logout">
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion app/views/templates/adminreq.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endfor %}
</table>
<form action="/adminhome" method="GET">
<input type="submit" value="Return">
<input class="invert" type="submit" value="Return">
</form>
{% endblock %}

Expand Down
3 changes: 3 additions & 0 deletions app/views/templates/adminsignin.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<br>
<input type="submit" value="Login">
</form>
<form action="/" method="GET">
<input class="invert" type="submit" value="Home">
</form>
{% if error %}
Invalid Username or password
{% endif %}
Expand Down
35 changes: 30 additions & 5 deletions app/views/templates/base.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
}
input {
font-size: 1vw;
padding: 0px 100px;
text-align: center;
width: 12vw;
color: white;
background-color: #8750A9;
}
Expand All @@ -38,16 +39,40 @@
color: white;
background-color: #8750A9;
}
.text{
font-size: 1vw;
padding: 2px;
display: grid;
grid-template-columns: 1fr 2fr;
}
.label{
text-align: right;
}
.myinput{
font-size: 1vw;
padding: 0px;
color: black;
background-color: white;
width: 20vw;
}
.text input{
margin-left: 0px;
font-size: 1vw;
padding: 10px 50px;
padding-bottom: 5px;
color: black;
background-color: white;
width: 20vw;
text-align: left;
}
.text{
.invert {
color: #8750A9;
font-size: 1vw;
padding: 2px;
text-align: center;
width: 12vw;
background-color: white;
border: 2px solid #8750A9;
}
</style>
<title>{% block title %}{% endblock %}</title>
Expand Down
4 changes: 2 additions & 2 deletions app/views/templates/bookdel.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
{% block body %}
<h2>Welcome to Book Deletion</h2>
<form action="/bookdel" method="POST">
<div class="text">Book ID: <input type="text" name="bid"><br></div>
<div class="text"><div class="label">Book ID:</div><input class="myinput" type="text" name="bid"><br></div>
<input type="submit" value="Delete Book">
</form>
<form action="/adminhome" method="GET">
<input type="submit" value="Home">
<input class="invert" type="submit" value="Home">
</form>
{% if stat == 1 %}
Deletion Successful
Expand Down
10 changes: 5 additions & 5 deletions app/views/templates/bookreg.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
{% block body %}
<h2>Book Registraion</h2>
<form action="/bookreg" method="POST">
<div class="text">Book Name: <input type="text" name="name"><br></div>
<div class="text">Author: <input type="text" name="author"><br></div>
<div class="text">Publisher: <input type="text" name="pub"><br></div>
<div class="text">Quantity: <input type="text" name="qty"><br></div>
<div class="text"><div class="label">Book Name:</div><input class="myinput" type="text" name="name"><br></div>
<div class="text"><div class="label">Author:</div><input class="myinput" type="text" name="author"><br></div>
<div class="text"><div class="label">Publisher:</div><input class="myinput" type="text" name="pub"><br></div>
<div class="text"><div class="label">Quantity:</div><input class="myinput" type="text" name="qty"><br></div>
<input type="submit" value="Register">
</form>
<form action="/adminhome" method="GET">
<input type="submit" value="Return">
<input class="invert" type="submit" value="Return">
</form>
{% if stat == 1 %}
Registraion Successful
Expand Down
2 changes: 1 addition & 1 deletion app/views/templates/userbook.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% endfor %}
</table>
<form action="/userhome" method="GET">
<input type="submit" value="Return">
<input class="invert" type="submit" value="Return">
</form>
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions app/views/templates/userdets.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block body %}
<h2>User Details Search</h2>
<form action="/userdets" method="POST">
<div class="text">Username: <label id="usr"><input type="text" name="usr"></label>
<div class="text"><div class="label">Username:</div><input class="myinput" type="text" name="usr">
<br></div>
<input type="submit" value="Submit" name="submit">
</form>
Expand All @@ -20,6 +20,6 @@ Search Results
No details found
{% endif %}
<form action="/adminhome" method="GET">
<input type="submit" value="Return">
<input class="invert" type="submit" value="Return">
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion app/views/templates/userhome.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<input type="submit" value="Book Catalog">
</form>
<form action="/" method="GET">
<input type="submit" value="Logout">
<input class="invert" type="submit" value="Logout">
</form>
Books Checked Out By You
<table><tr><th>Book Id</th><th>Name</th><th>Author</th><th>Publisher</th><th>Action</th></tr>
Expand Down
6 changes: 3 additions & 3 deletions app/views/templates/usersignin.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

{% block body %}<h2>Welcome User</h2>
<form action="/userlog" method="POST">
<div class="text">Username: <label id="usr"><input type="text" name="usr"></label>
<div class="text"><div class="label">Username:</div><input class="myinput" type="text" name="usr">
<br></div>
<div class="text">Password: <label id="pass"><input type="password" name="pass"></label>
<div class="text"><div class="label">Password:</div><input class="myinput" type="password" name="pass">
<br></div>
<input type="submit" value="Login" name="submit">
</form>
<form action="/" method="GET">
<input type="submit" value="Home">
<input class="invert" type="submit" value="Home">
</form>

{% if error %}
Expand Down
14 changes: 7 additions & 7 deletions app/views/templates/usersignup.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
{% block body %}
<h2>Welcome to User Registration</h2>
<form action="/usersignup" method="POST">
<div class="text">Name: <input type="text" name="name"></div><br>
<div class="text">Email Id: <input type="text" name="email"></div><br>
<div class="text">Phone Number:<input type="text" name="phone"></div><br>
<div class="text">Username: <input type="text" name="usr"></div>
<div class="text"><div class="label">Name: </div><input class="myinput" type="text" name="name"></div><br>
<div class="text"><div class="label">Email Id:</div> <input class="myinput" type="text" name="email"></div><br>
<div class="text"><div class="label">Phone Number:</div><input class="myinput" type="text" name="phone"></div><br>
<div class="text"><div class="label">Username:</div><input class="myinput" type="text" name="usr"></div>
<br>
<div class="text">Password: <input type="password" name="pass"></div>
<div class="text"><div class="label">Password:</div><input class="myinput" type="password" name="pass"></div>
<br>
<div class="text">Reenter Password: <input type="password" name="repass"></div><br>
<div class="text"><div class="label">Reenter Password:</div><input class="myinput" type="password" name="repass"></div><br>
<input type="submit" value="Register">
</form>
{% if error == 1 %}
Expand All @@ -22,6 +22,6 @@ Registration Success
Registration Failed
{% endif %}
<form action="/" method="GET">
<input type="submit" value="Home">
<input class="invert" type="submit" value="Home">
</form>
{% endblock %}

0 comments on commit 1acc49c

Please sign in to comment.