CIM69 - car database
This commit is contained in:
22
cartests.php
22
cartests.php
@@ -54,6 +54,10 @@ if (isset($_GET['success_msg'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['download'])){
|
||||
downloadToExcel('cartests',$responses);
|
||||
}
|
||||
|
||||
template_header('Cartests', 'cartests' ,'view');
|
||||
$view = '
|
||||
<div class="content-title">
|
||||
@@ -91,8 +95,14 @@ $view .= '
|
||||
</select>
|
||||
<button type="submit">'.$button_apply.'</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search">
|
||||
</div>';
|
||||
//SHOW DOWNLOAD TO EXCELL OPTION ONLY TO ADMIN USERS
|
||||
if ($_SESSION['permission'] == 3 || $_SESSION['permission'] == 4){
|
||||
$view .='<div class="filters">
|
||||
<a href="index.php?page=cartests&download="><i class="fa-solid fa-download"></i></a>
|
||||
</div>';
|
||||
}
|
||||
$view .= '<div class="search">
|
||||
<label for="search">
|
||||
<input id="search" type="text" name="search" placeholder="'.$cartest_search.'" value="" class="responsive-width-100">
|
||||
<i class="fas fa-search"></i>
|
||||
@@ -111,6 +121,7 @@ $view .= '
|
||||
<th class="responsive-hidden">'.$cartest_rowID.'</th>
|
||||
<th>'.$cartest_carbrand.'</th>
|
||||
<th>'.$cartest_cartype.'</th>
|
||||
<th>'.$general_createdby.'</th>
|
||||
<th>'.$general_actions.'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -126,13 +137,12 @@ $view .= '
|
||||
}
|
||||
else {
|
||||
foreach ($responses as $response){
|
||||
//get cartest details
|
||||
$cartest = json_decode($response->description,true);
|
||||
$view .= '
|
||||
<tr>
|
||||
<td class="responsive-hidden">'.$response->rowID.'</td>
|
||||
<td>'.$cartest['CarBrand'].'</td>
|
||||
<td>'.$cartest['CarType'].'</td>
|
||||
<td>'.$response->carbrand.'</td>
|
||||
<td>'.$response->cartype.'</td>
|
||||
<td>'.$response->createdby.'</td>
|
||||
<td><a href="index.php?page=cartest&rowID='.$response->rowID.'" class="btn_link">'.$general_view.'</a></td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
Reference in New Issue
Block a user