<?php
if ( !$_SESSION[ 'logged' ] )
{
$_SESSION[ 'logged' ] = false;
}
?>
<div class="page-title-area"> <img src="assets/img/home-one/footer-car.png" alt="Title">
<div class="container">
<div class="page-title-content">
<h2>My Account</h2>
<ul>
<li> <a href="index.php?p=home">Home</a> </li>
<li> <i class='bx bx-chevron-right'></i> </li>
<li>My Account</li>
</ul>
</div>
</div>
</div>
<section class="parts-area pt-100 pb-70">
<div class="container">
<div class="section-title">
<h2>Client Account Page</h2>
</div>
<div id="Container" class="row">
<?php
if ( !$_SESSION[ 'logged' ] )
{
echo 'You are not register kindly register then visit this page.';
}
else
{
echo 'Welcome user your email address is: '.$_SESSION[ 'email' ];
}
?>
<a href="sign_out.php">Sign Out</a>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Dated</th>
<th>Vehicle</th>
<th>Services</th>
<th>Additional Services</th>
</tr>
</thead>
<tbody>
<?php
$selectQuery = "SELECT * FROM ".Config::tbI." WHERE ".Config::tbIUUID."=:".Config::tbIUUID;
$selectResult = $db->Select($selectQuery, [ Config::tbIUUID => $_SESSION[ 'uid' ] ]);
foreach( $selectResult as $idx=>$val )
{
echo '
<tr>
<td>'.$val[Config::tbCreated].'</td>
<td>'.$val[Config::tbIVehicle].'</td>
<td>
<ol>
';
$selectQuery = "SELECT * FROM ".Config::tbIs." WHERE ".Config::tbIsIUID."=:".Config::tbIsIUID;
$selectResult = $db->Select($selectQuery, [ Config::tbIsIUID => $val[Config::tbIUID] ]);
foreach( $selectResult as $idx2=>$val2 )
{
$selectQuery = "SELECT * FROM ".Config::tbS." WHERE ".Config::tbSUID."=:".Config::tbSUID;
$selectResult = $db->Select($selectQuery, [ Config::tbSUID => $val2[Config::tbIsSUID] ]);
echo '
<li>
<ul>
<li>'.$selectResult[0][Config::tbSName].'</li>
<li>'.$selectResult[0][Config::tbSPrice].' RS</li>
</ul>
</li>
';
}
echo '
</ol>
</td>
<td>
<ol> ';
$selectQuery = "SELECT * FROM ".Config::tbIas." WHERE ".Config::tbIasIUID."=:".Config::tbIasIUID;
$selectResult = $db->Select($selectQuery, [ Config::tbIasIUID => $val[Config::tbIUID] ]);
foreach( $selectResult as $idx2=>$val2 )
{
echo '
<li>
<ul>
<li>'.$val2[Config::tbIasName].'</li>
<li>'.$val2[Config::tbIasPrice].' RS</li>
</ul>
</li>
';
}
echo '
</ol>
</td>
</tr>
';
}
?>
</tbody>
</table>
<div style="padding:70px;"></div>
</div>
</div>
</section>