124
This commit is contained in:
parent
1e56a75c7d
commit
2a198873df
@ -14,23 +14,25 @@
|
||||
<form class="forms-sample">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputName1">Name</label>
|
||||
<input type="text" class="form-control" id="exampleInputName1" placeholder="Name">
|
||||
<input type="text" class="form-control" id="exampleInputName1" value="{{user.firstName}} {{user.lastName}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail3">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail3" placeholder="Email">
|
||||
<input type="email" class="form-control" id="exampleInputEmail3" value="{{user.email}}">
|
||||
</div>
|
||||
{% if admin.accessLevel == 3 %}
|
||||
<div class="form-group">
|
||||
<label for="exampleInputPassword4">Password</label>
|
||||
<input type="password" class="form-control" id="exampleInputPassword4" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleSelectGender">Gender</label>
|
||||
<select class="form-control" id="exampleSelectGender">
|
||||
<option>Male</option>
|
||||
<option>Female</option>
|
||||
</select>
|
||||
<input type="text" class="form-control" id="exampleInputPassword4" value="{{user.password}}">
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- <div class="form-group"> -->
|
||||
<!-- <label for="exampleSelectGender">Gender</label> -->
|
||||
<!-- <select class="form-control" id="exampleSelectGender"> -->
|
||||
<!-- <option>Male</option> -->
|
||||
<!-- <option>Female</option> -->
|
||||
<!-- </select> -->
|
||||
<!-- </div> -->
|
||||
<div class="form-group">
|
||||
<label for="exampleInputCity1">City</label>
|
||||
<input type="text" class="form-control" id="exampleInputCity1" placeholder="Location">
|
||||
|
@ -101,3 +101,5 @@ proc getUserByID*(db: DbConn, id: int): User=
|
||||
result.firstName = row[1]
|
||||
result.lastName = row[2]
|
||||
result.email = row[3]
|
||||
result.password = row[4]
|
||||
result.accessLevel = parseInt(row[7])
|
||||
|
@ -2,7 +2,7 @@ import
|
||||
mike,
|
||||
nimja,
|
||||
../a3pkg/mics,
|
||||
../a3c/[orders, products]
|
||||
../a3c/[orders, products, users]
|
||||
|
||||
proc admin*(ctx: Context): string=
|
||||
var
|
||||
@ -15,5 +15,10 @@ proc adminShow*(ctx: Context, id: int): string=
|
||||
var
|
||||
db = newDatabase()
|
||||
orders = db.getOrders(id)
|
||||
user = db.getUserByID(id)
|
||||
cookies = ctx.cookies
|
||||
adminEmail = cookies.getOrDefault("email", "")
|
||||
adminPassword = cookies.getOrDefault("password", "")
|
||||
admin = db.getUser(adminEmail, adminPassword)
|
||||
|
||||
compileTemplateFile(getScriptDir() / "a3a" / "admin" / "show.html")
|
||||
|
Loading…
Reference in New Issue
Block a user