<?php
    include('header.php');
    $reg_mob = $_SESSION['session_mobile_number'];
      // ini_set('display_errors', '1');
    // ini_set('display_startup_errors', '1');
    // error_reporting(E_ALL);
?>
<div class="auto-container">
    <div class="row">
        <div class="details-pickup-section auto-container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">                        
                        <div class="panel-body">
                            <div class="row">
								<div class="col-lg-3">
                                        <?php
                                            $query = "SELECT * FROM students WHERE reg_mobile=".$reg_mob; 
                                            $stddt= $mysqli->query($query);                                            
                                            if ($stddt->num_rows > 0) {
                                                while($row1 = $stddt->fetch_assoc()){                                    
                                        ?>
                                            <div class="stident-area">
                                                <ul class="dashboard-data">
                                                    <li>
                                                        <a href="">
                                                            <span>Student Name</span>
                                                            <?= $row1["first_name"].' '.$row1["middle_name"].' '.$row1["last_name"] ?>
                                                        </a>
                                                        <a href="">
                                                            <span>SID</span>
                                                            <?= $row1["sid"] ?>
                                                        </a>
                                                        <a href="">
                                                            <span>Aadhar Id</span>
                                                            <?= ($row1["aadhar_id"]!='' ? $row1["aadhar_id"]  : '-') ?>
                                                        </a>
                                                        <a href="">
                                                            <span>Age</span>
                                                            <?= ($row1["age"]!='' ? $row1["age"] : '-') ?>
                                                        </a>
                                                    </li>
                                                </ul>		
                                            </div>
                                        <?php 
                                            }
                                        } ?>    
                                 </div>
                                <div class="col-lg-7">
                                    <div class="col-lg-12 col-md-12 col-12 col-user-profile user-sid dashboard-area">						    			
                                        <ul class="dashboard-data">                                            
                                            <li class="one">
                                                <a href="">
                                                    <span>Name</span>
                                                    <?= $_SESSION['login_name'] ?>
                                                </a>
                                            </li>
                                            <li class="two">
                                                <a href="">
                                                    <span>Email</span>
                                                    <?= $_SESSION['reg_email'][0] ?>
                                                </a>
                                            </li>
                                            <li class="three">
                                                <a href="">
                                                    <span>Mobile No</span>
                                                    <?= $_SESSION['session_mobile_number'] ?>
                                                </a>
                                            </li>
                                        </ul>							
                                        <ul class="dashboard-data">
                                            <?php                                                
                                                $seat_query = "SELECT * FROM std_ticket WHERE reg_mobile=".$reg_mob; 
                                                $seat_dt= $mysqli->query($seat_query);	
                                                $totalbooked = $seat_dt->num_rows;
                                            ?>
                                            <li class="sid-no">
                                                <?php
                                                    if ($seat_dt->num_rows > 0) {
                                                    while($row_seat = $seat_dt->fetch_assoc()){                                                            
                                                ?>
                                                <span href="">
                                                    <?= strtoupper($row_seat["seat_type"].'-'.$row_seat["seat_no"]); ?>
                                                </span>
                                                <?php } } ?>
                                                
                                            </li>
                                        </ul>
                                        <?php  if ($seat_dt->num_rows > 0) { ?> 
                                            <div class="qr-code">
                                                <img src="QRCode/codeimage/<?= $reg_mob.'.png' ?>" alt="">
                                            </div>
                        					
                        					<div class="col-lg-12">
                                                <a target="_blank" href="https://dev.srimaone.in/srimaticket/ticketpdf/<?= $reg_mob.'.pdf' ?>" class="download-tickt">Download PDF</a>
                                            </div>
                                        <?php } ?>
                                    </div>
                                </div>
                                <?php if($totalbooked < 4){ ?>
                                    <div class="col-lg-2">
                                        <a href="selectseat.php" class="book-tickt">Book Ticket</a>
                                    </div>
                                <?php } ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>        
<?php
    include('footer.php');
?>