1212Template::render_header (_ ("Settings " ), true );
1313?>
1414<div class="text-center">
15- <h2>Settings</h2>
15+ <h2>Settings</h2>
1616</div>
1717<?php
1818if (isset ($ message )){
19- ?>
19+ ?>
2020<p class="alert alert-danger"><?php echo $ message ; ?> </p>
2121<?php }?>
2222<section>
23- <h3 class="pull-left"><?php echo _ ("Services " );?> </h3>
24- <?php if ($ user ->get_rank () <= 1 ){?>
25- <form action="?do=settings&new=service" method="post">
26- <div class="input-group pull-right new-service">
27- <input class="form-control" name="service" placeholder="Name" type="text" value="<?php echo ((isset ($ _POST ['service ' ]))?htmlspecialchars ($ _POST ['service ' ]):'' ); ?> " maxlength="50" required>
28- <span class="input-group-btn">
29- <button type="submit" class="btn btn-success pull-right"><?php echo _ ("Add service " );?> </button>
30- </span>
23+ <h3 class="pull-left"><?php echo _ ("Services " );?> </h3>
24+ <?php if ($ user ->get_rank () <= 1 ){?>
25+ <form action="?do=settings&new=service" method="post">
26+ <div class="input-group pull-right new-service">
27+ <input class="form-control" name="service" placeholder="Name" type="text" value="<?php echo ((isset ($ _POST ['service ' ]))?htmlspecialchars ($ _POST ['service ' ]):'' ); ?> " maxlength="50" required>
28+ <span class="input-group-btn">
29+ <button type="submit" class="btn btn-success pull-right"><?php echo _ ("Add service " );?> </button>
30+ </span>
31+ </div>
32+ </form>
33+ <?php }?>
34+ <div class="table-responsive">
35+ <table class="table">
36+
37+ <thead><tr>
38+ <th scope="col"><?php echo _ ("ID " );?> </th>
39+ <th scope="col"><?php echo _ ("Name " );?> </th>
40+ <?php if ($ user ->get_rank ()<=1 )
41+ {?>
42+ <th scope="col"><?php echo _ ("Delete " );?> </th>
43+ <?php } ?>
44+ </tr>
45+ </thead>
46+ <tbody>
47+ <?php
48+ $ query = $ mysqli ->query ("SELECT * FROM services " );
49+ while ($ result = $ query ->fetch_assoc ())
50+ {
51+ echo "<tr> " ;
52+ echo "<td> " .$ result ['id ' ]."</td> " ;
53+ echo "<td> " .$ result ['name ' ]."</td> " ;
54+ if ($ user ->get_rank ()<=1 )
55+ {
56+ echo '<td><a href=" ' .WEB_URL .'/admin/?do=settings&delete= ' .$ result ['id ' ].'" class="pull-right delete-service"><i class="fa fa-trash"></i></a></td> ' ;
57+ }
58+ echo "</tr> " ;
59+ }?>
60+ </tbody>
61+ </table>
3162 </div>
32- </form>
33- <?php }?>
34- <table class="table">
35-
36- <thead><tr>
37- <th scope="col"><?php echo _ ("ID " );?> </th>
38- <th scope="col"><?php echo _ ("Name " );?> </th>
39- <?php if ($ user ->get_rank ()<=1 )
40- {?>
41- <th scope="col"><?php echo _ ("Delete " );?> </th>
42- <?php } ?>
43- </tr>
44- </thead>
45- <tbody>
46- <?php
47- $ query = $ mysqli ->query ("SELECT * FROM services " );
48- while ($ result = $ query ->fetch_assoc ())
49- {
50- echo "<tr> " ;
51- echo "<td> " .$ result ['id ' ]."</td> " ;
52- echo "<td> " .$ result ['name ' ]."</td> " ;
53- if ($ user ->get_rank ()<=1 )
54- {
55- echo '<td><a href=" ' .WEB_URL .'/admin/?do=settings&delete= ' .$ result ['id ' ].'" class="pull-right delete-service"><i class="fa fa-trash"></i></a></td> ' ;
56- }
57- echo "</tr> " ;
58- }?>
59- </tbody>
60- </table>
6163</section>
6264
6365
6466<section>
65- <h3 class="pull-left"><?php echo _ ("Users " );?> </h3>
66- <?php if ($ user ->get_rank () == 0 ){?> <a href="<?php echo WEB_URL ;?> /admin/?do=new-user" class="btn btn-success pull-right"><?php echo _ ("Add new user " );?> </a><?php }?>
67- <table class="table">
68-
69- <thead><tr><th scope="col"><?php echo _ ("ID " );?> </th><th scope="col"><?php echo _ ("Username " );?> </th><th scope="col"><?php echo _ ("Name " );?> </th><th scope="col"><?php echo _ ("Surname " );?> </th><th scope="col"><?php echo _ ("Email " );?> </th><th scope="col"><?php echo _ ("Role " );?> </th><th scope="col">Active</th></tr></thead>
70- <tbody>
71- <?php
72- $ query = $ mysqli ->query ("SELECT * FROM users " );
73- while ($ result = $ query ->fetch_assoc ())
74- {
75- echo "<tr> " ;
76- echo "<td> " .$ result ['id ' ]."</td> " ;
77- echo "<td><a href=' " .WEB_URL ."/admin/?do=user&id= " .$ result ['id ' ]."'> " .$ result ['username ' ]."</a></td> " ;
78- echo "<td> " .$ result ['name ' ]."</td> " ;
79- echo "<td> " .$ result ['surname ' ]."</td> " ;
80- echo "<td><a href= \"mailto: " .$ result ['email ' ]."\"> " .$ result ['email ' ]."</a></td> " ;
81- echo "<td> " .$ permissions [$ result ['permission ' ]]."</td><td> " ;
82- echo "<i class='fa fa- " .($ result ['active ' ]?"check success " :"times danger " )."'></i> " ;
83- echo "</td> " ;
84- echo "</tr> " ;
85- }?>
86- </tbody>
87- </table>
67+ <h3 class="pull-left"><?php echo _ ("Users " );?> </h3>
68+ <?php if ($ user ->get_rank () == 0 ){?> <a href="<?php echo WEB_URL ;?> /admin/?do=new-user" class="btn btn-success pull-right"><?php echo _ ("Add new user " );?> </a><?php }?>
69+ <div class="table-responsive">
70+ <table class="table">
71+
72+ <thead><tr><th scope="col"><?php echo _ ("ID " );?> </th><th scope="col"><?php echo _ ("Username " );?> </th><th scope="col"><?php echo _ ("Name " );?> </th><th scope="col"><?php echo _ ("Surname " );?> </th><th scope="col"><?php echo _ ("Email " );?> </th><th scope="col"><?php echo _ ("Role " );?> </th><th scope="col">Active</th></tr></thead>
73+ <tbody>
74+ <?php
75+ $ query = $ mysqli ->query ("SELECT * FROM users " );
76+ while ($ result = $ query ->fetch_assoc ())
77+ {
78+ echo "<tr> " ;
79+ echo "<td> " .$ result ['id ' ]."</td> " ;
80+ echo "<td><a href=' " .WEB_URL ."/admin/?do=user&id= " .$ result ['id ' ]."'> " .$ result ['username ' ]."</a></td> " ;
81+ echo "<td> " .$ result ['name ' ]."</td> " ;
82+ echo "<td> " .$ result ['surname ' ]."</td> " ;
83+ echo "<td><a href= \"mailto: " .$ result ['email ' ]."\"> " .$ result ['email ' ]."</a></td> " ;
84+ echo "<td> " .$ permissions [$ result ['permission ' ]]."</td><td> " ;
85+ echo "<i class='fa fa- " .($ result ['active ' ]?"check success " :"times danger " )."'></i> " ;
86+ echo "</td> " ;
87+ echo "</tr> " ;
88+ }?>
89+ </tbody>
90+ </table>
91+ </div>
8892</section>
0 commit comments