<div class="col-xl-12 col-lg-12 col-md-12 col-12">
	<!--<div class="card shadow-sm ctm-border-radius">-->
		<!--<div class="card-body align-center">-->
			<!--<h3 class="card-title  mb-0 mt-2">CHOOSE YOUR FAVOURITE CAR</h3>-->
			<?php
			if($_SESSION['driverid']>0)
                $sql = 'SELECT * FROM rentedcars WHERE driver_id='.$data_1['DriverId'].' AND status!=\'Completed\' ORDER BY rentedcars.id DESC';
            else
                $sql = 'SELECT * FROM rentedcars WHERE AppUser='.$data_1['Id'].' AND status!=\'Completed\' ORDER BY rentedcars.id DESC';
            
                $sql = mysqli_query($connect,$sql);
                $row = mysqli_num_rows($sql);
                if($row>0)
                echo 
                '
                <div class="alert alert-warning d-flex align-items-center" role="alert" style="background-color:#f1ff07;">
                  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#ff0000" class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2" viewBox="0 0 16 16" role="img" aria-label="Warning:">
                    <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
                  </svg>
                  <div>
                    &nbsp; <FONT size="4" color="#000000">Alert! &nbsp; <FONT color="#FF0000">('.$row.')</FONT> Pending Bookings at your account.</FONT>
                    <a class="button" href="bookings-incomplete.php">VIEW</a>
                  </div>
                </div>'
                ;
            ?>
		
			<?php 
			if($brand=="")
			{
			    
			}
			else if (strlen($brand)>2)
			{
			    echo '<h4 class="card-title  mb-0 mt-2"></h4>';
			}
			else
			{
			    $sql = 'SELECT Title FROM brands';
			    $result1 = mysqli_query($connect,$sql);
			    $result1=mysqli_fetch_assoc($result1);
			    
			 //   $sql1 = 'SELECT count(*) FROM cars WHERE ';
			    
			 //   Selected Cars: (1)
			    
			    echo '<h4 class="card-title  mb-0 mt-2">Brand:'.$result1['Title'].'</h4>';
			    
			}
			?>
			<!--</div>-->
	<!--</div>-->
	<div class="row">
		<?php   
            $sql1 = "SELECT * FROM cars WHERE car_availability='yes' $brand";
            $result1 = mysqli_query($connect,$sql1);
            $url="../admin/";
            
            if(mysqli_num_rows($result1) > 0) {
                while($row1 = mysqli_fetch_assoc($result1)){
                    $car_id = $row1['car_id'];
                    $car_name = $row1['car_name'];
                    $car_nameplate = $row1["car_nameplate"];
                    $car_model = $row1["model"];
                    $ac_price = $row1['ac_price'];
                    $ac_price_per_day = $row1['ac_price_per_day'];
                    $non_ac_price = $row1['non_ac_price'];
                    $non_ac_price_per_day = $row1['non_ac_price_per_day'];
                    $car_img = $url.$row1['car_img'];
                            

                    ?>
			    <div class="col-xl-6 col-lg-6 col-sm-6 col-12">
			        <a href="booknow.php?id=<?php echo($car_id) ?>">
                    <div class="ctm-border-radius shadow-sm card">
                        
                    <!--<div class="card-header">
                        <h3 class="page-sub-title d-inline-block mb-0 mt-2"><?php echo $car_name; ?></h3>
                    </div>-->
                    
                    <div class="card-body"> <img class="card-img-top" style="width: 500px;" src="<?php echo $car_img; ?>" alt="Card image cap"></br></br>
                   
                      <center><h3> Model &nbsp; <?php echo($car_model);?></h3></center>

                     <!--  <center><h5><?php echo ("AED. " . $ac_price . "/Min"); ?> &nbsp; <?php echo ("AED. " .$ac_price_per_day . "/day"); ?></h5></center>-->

                        <div class="card-footer"><center><h2 class="page-sub-title d-inline-block mb-0 mt-2"><?php echo $car_name; ?>&nbsp;(<?php echo($car_nameplate);?>) </h2></center></div>
                        
                       </div>
<!--					    <div class="card-footer">	 
							<span class="avatar" data-toggle="tooltip" data-placement="top" title="" data-original-title="Minute" style="box-shadow: 0px 0px 0px 0px; width: 30px; height: 30px;">
		<img src="assets/img/timer.png" alt="" class="" > </span> <span class="ctm-text-sm ml-4"><?php echo ("AED. " . $ac_price . "/Min"); ?></span>
		&nbsp;
								<span class="avatar" data-toggle="tooltip" data-placement="top" title="" data-original-title="Day" style="box-shadow: 0px 0px 0px 0px; width: 30px; height: 30px;">
		<img src="assets/img/cleander.png" alt="" class="img-fluid"> </span> <span class="ctm-text-sm ml-4"><?php echo ("AED." . $ac_price_per_day . "/day"); ?></span>
							</div>
-->					</div>
					</a>
                </div>
			    
				<?php }}
            else {
                ?>
					<h1> No cars available :( </h1>
					<?php
            }
            ?>
	</div>
</div>	