<?php

    include('config.php');
 
  
  ?>
	<?php
    
 If(isset($_POST[subt])){
   $searchNumberr=$_POST['tknumb']; 
			    
			        $queryy="SELECT * FROM shippingDetails where shippingID = '$searchNumberr'";
    			    
    			    $row=mysqli_query($conn, $queryy);
    			    
    			    $rb=mysqli_fetch_array($row);
    			         
    			         $sender=$rb['sender'];
    			         $weight=$rb['weight'];
    			          $receiver=$rb['receiver'];
    			        $shipDate=$rb['date'];
    			        $shipnumbr=$rb['shippingID'];
    			        $shipdelivery=$rb['deliveryDate'];
    			        $quantity =$rb['quantity'];
    			        $email = $rb['email'];
    			        $s_address = $rb['s_address'];
    			        $r_address = $rb['r_address'];
    			        $type = $rb['type'];
    			        $desc = $rb['descr'];

        $query="SELECT * FROM shippingHistory where shippingID = '$searchNumberr'";
    			    $row=mysqli_query($conn,$query);
    			    
    			    $rw=mysqli_fetch_array($row);
    			        $shippDate=$rw['date'];
    			        $curCountry=$rw['currentCountry'];
    			        $curCity=$rw['currentCity'];
    			        $curDescription=$rw['description'];
    			         
    			         
    	 $queryyy="SELECT * FROM shippingStatus where shippingID = '$searchNumberr'";
    			    $row=mysqli_query($conn,$queryyy);
    			    
    			    $rw=mysqli_fetch_array($row);
    			        $shipstat=$rw['status'];		         
    			        
    		$queryyt="SELECT * FROM timeCategory where shippingID = '$searchNumberr'";
    			    $row=mysqli_query($conn,$queryyt);
    			    
    			    $rw=mysqli_fetch_array($row);
    			        $curTime=$rw['timeID'];	         
    			         
    			         
 }
  
  ?>
		<?php include("inc/header.php");?>
			<section id="recent-services-2" class="widget widget_recent_services">
				<h2 class="widget-title">Services</h2>
				<ul>
					<li>
						<div class="sigma-service-image"> <img width="150" height="150" src="wp-content/uploads/2020/06/service-5-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" /> </div>
						<div class="sigma-service-content"> <a href="#">SEA FREIGHT</a> <span class="post-date"></span> </div>
					</li>
					<li>
						<div class="sigma-service-image"> <img width="150" height="150" src="wp-content/uploads/2020/06/service-3-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" /> </div>
						<div class="sigma-service-content"> <a href="#">AIR FREIGHT</a> <span class="post-date"></span> </div>
					</li>
					<li>
						<div class="sigma-service-image"> <img width="150" height="150" src="wp-content/uploads/2020/06/service-6-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" /> </div>
						<div class="sigma-service-content"> <a href="#">ROAD FREIGHT</a> <span class="post-date"></span> </div>
					</li>
					<li>
						<div class="sigma-service-image"> <img width="150" height="150" src="wp-content/uploads/2020/06/service-4-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" /> </div>
						<div class="sigma-service-content"> <a href="#">LOCAL DELIVERY</a> <span class="post-date"></span> </div>
					</li>
					<li>
						<div class="sigma-service-image"> <img width="150" height="150" src="wp-content/uploads/2020/06/service-3-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" /> </div>
						<div class="sigma-service-content"> <a href="#">AIR DELIVERY</a> <span class="post-date"></span> </div>
					</li>
				</ul>
			</section>
			</div>
			</div>
			</div>
			</div>
			</header>
			<div id="content" class="site-content">
				<div class="sigma-page-title d-flex align-items-center">
					<div class="sigma-page-title-layer container">
						<h1 class="page-title">
		 <br>TRIP DE EXPRESS TICKET INFO	</h1>
						<div class="breadcrumb"><span class="current"></span></div>
					</div> <span class="btg-text"></span>
					<div class="breadcrumb-shape">
						<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">
							<path d="M500,97C126.7,96.3,0.8,19.8,0,0v100l1000,0V1C1000,19.4,873.3,97.8,500,97z"> </path>
						</svg>
					</div>
				</div>
				
				<div class="container">
					<div class="row">
						<div class="col-sm-12">
							<div class="results-container mt-5">
								<div id="tracking-detail" class="results-contents container-fluid">
									<div class="detailed-view Delivered">
										<div class="row">
											<div class="col-5 col-sm-8 col-md-9 col-lg-9">
												<h2 class="ml-0" tabindex="-1">
						    <span class="d-none d-sm-inline">Shipment ID Number: </span><span class="pin"><?php echo $shipnumbr; ?></span> </h2>
												<br> </div>
											<div class="col-7 col-sm-4 col-md-3 col-lg-3 text-right"></div>
										</div>
										<div class="progress-labels">
											<h5>Current Delivery Status : 
    																							<span style="color: green !important;"><?php echo $shipstat; ?></span></h5> </div>
										<br>
										<div role="progressbar" aria-label="Shipment Delivered" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
										<div class="row">
											<div class="col-12 col-sm-7">
												<h3 class="pb-3" style="color:#4E7092 !important;">Delivery Date</h3>
												<p class="receivedby font-weight-bold">
													<?php echo $shipdelivery; ?>
												</p>
											</div>
											<div class="col-12 col-sm-5 update">
												<p>Last updated</p>
												<p class="font-weight-bold">
													<?php echo $curTime; ?>
												</p>
											</div>
										</div>
										
										<div class="card white-box p-0">
                            <div class="card-body" style="background-color:#000;">
                                <h4 class="box-title mb-0" style="color:white;">Ticket Details</h4>
                            </div>
                             <div class="container" style="background-color:white;">
                                 <br>
                                  <div class="mb-3">
                                    <label for="" class="form-label">Seat Number :</label>
                                    <span><?php echo $quantity; ?></span>
                                    </div>
                                    <div class="mb-3">
                                     <label for="" class="form-label">Terminal :</label>
                                    <span><?php echo $weight; ?></span>
                                    </div>
                                    <div class="mb-3">
                                     <label for="" class="form-label">From:</label>
                                    <span><?php echo $type; ?></span>
                                    </div>
                                    <div class="mb-3">
                                    <label for="" class="form-label">Airline Ticket Type:</label>
                                    <span><?php echo $desc; ?></span>
                                    </div>
                                    
                                  </div>
                                  
                                  
                                
                                
                                
                                
                                
                             </div>
                             <br>
										
										<div class="card white-box p-0">
                            <div class="card-body" style="background-color:#000;">
                                <h4 class="box-title mb-0" style="color:white;">Destination</h4>
                            </div>
                             <div class="container" style="background-color:white;">
                                 <br>
                                  <div class="mb-3">
                                    <label for="" class="form-label">Gate: :</label>
                                    <span><?php echo $receiver; ?></span>
                                    </div>
                                    <div class="mb-3">
                                     <label for="" class="form-label">Enter Passenger Email:</label>
                                    <span><?php echo $email; ?></span>
                                    </div>
                                    <div class="mb-3">
                                     <label for="" class="form-label">Arrival destination::</label>
                                    <span><?php echo $r_address; ?></span>
                                    </div>
                                    <div class="mb-3">
                                    <label for="" class="form-label">Expected date of delivery :</label>
                                    <span><?php echo $shipdelivery; ?></span>
                                    </div>
                                    
                                  </div>
                                  
                                  
                                
                                
                                
                                
                                
                             </div>
                             <br>
                             <div class="card white-box p-0">
                            <div class="card-body" style="background-color:#000;">
                                <h4 class="box-title mb-0" style="color:white;">Origin</h4>
                            </div>
                             <div class="container" style="background-color:white;">
                                 <br>
                                  <div class="mb-3">
                                    <label for="" class="form-label">Enter Passenger Name:</label>
                                    <span><?php echo $sender; ?></span>
                                    </div>
                                    <div class="mb-3">
                                     <label for="" class="form-label">Boarding Id:</label>
                                    <span><?php echo $s_address; ?></span>
                                    </div>
                                    <div class="mb-3">
                                    <label for="" class="form-label">Seat Number:</label>
                                    <span><?php echo $shipDate; ?></span>
                                    </div>
                                    
                                  </div>
                                  
                                  
                                
                                
                                
                                
                                
                             </div>
                             
                             <br>
                             <div class="card white-box p-0">
                            <div class="card-body" style="background-color:gray;">
                                <h4 class="box-title mb-0">FLIGHT BOARDED HISTORY STATUS</h4>
                            </div>
                            <br>
                             <div class="container" style="background-color:white;">
                                  <div class="mb-3">
											    
											        <style>
                                                        table {
                                                        
                                                        width: 100%;
                                                        color: #000;
                                                        font-family: monospace;
                                                        font-size: 15px;
                                                        text-align: left;
                                                        }
                                                        th {
                                                        background-color: #588c7e;
                                                        color: white;
                                                        }
                                                        tr:nth-child(even) {background-color: #f2f2f2}
                                                        </style>
                                                        </head>
                                                        <body>
                                                        <table>
                                                        <tr>
                                                        <th>Date</th>
                                                        <th>City</th>
                                                        <th>Description</th>
                                                        </tr>
                                                        <?php
                                                      
                                                        $sql = "SELECT date, currentCity, description FROM shippingHistory where shippingID='$searchNumberr'";
                                                        $result = $conn->query($sql);
                                                        if ($result->num_rows > 0) {
                                                        // output data of each row
                                                        while($row = $result->fetch_assoc()) {
                                                        echo "<tr>
                                                                    <td>" . $row["date"]. "</td>
                                                                    <td>" . $row["currentCity"] . "</td>
                                                                    <td>" . $row["description"]. "</td>
                                                              </tr>";
                                                        }
                                                        echo "</table>";
                                                        } else { echo "0 results"; }
                                                         
                                                        ?>
                                                        </table>
											    
											    
											    
											    <hr>
											    
											</div>
                                  
                                  
                                
                                
                                
                                
                                
                             </div>
                             
                        </div>
										<br>
										
											<div class="container" align="center">
									        <button type="button" class="" data-toggle="modal" data-target="#exampleModal">
  VIEW TICKET SLIP
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Ticket Image</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
          <?php
            $select_image = "select * from picture where shippingID='$searchNumberr'";
            $query_image = mysqli_query($conn, $select_image);
            $fetch_image = mysqli_fetch_array($query_image);
            
            $picture = $fetch_image['pic'];
          ?>
        <img src = "Admindashboard/upload/<?php echo $picture; ?>">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
									    </div>
										</div>
									</div>
									<br>
									<div class="forms-container">
										<div class="forms-contents container-fluid">
											<ul class="list-group list-group-horizontal">
												<li class="list-group-item"><a href="javascript: window.print();"><i class="fa fa-print" aria-hidden="true"></i> Print</a></li>
											</ul>
										</div>
									</div>
									
									    
								</div>
							</div>
							<div id="primary" class="content-area">
								<main id="main" class="site-main">
									<article id="post-16" class="post-16 page type-page status-publish hentry without-image">
										<div class="entry-content">
											<div class="vc_row wpb_row vc_row-fluid sigma-z-index-down sigma-contact-map vc_custom_1592301874284 sigma-bg-color-transparent sigma-background-position-left-top sigma-title-color-default">
												<div class="wpb_column vc_column_container vc_col-sm-12 sigma-bg-color-transparent sigma-background-position-left-top sigma-title-color-default">
													<div class="vc_column-inner">
														<div class="wpb_wrapper">
															<div class="wpb_raw_code wpb_content_element wpb_raw_html">
																<div class="wpb_wrapper">
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
										<!-- .entry-content -->
									</article>
									<!-- #post-16 -->
								</main>
								<!-- #main -->
							</div>
							<!-- #primary -->
						</div>
					</div>
				</div>
			</div>
			<!-- #content -->
			<?php include("inc/footer.php")?>
				</div>
				<!-- #page -->
				<!-- Instagram Feed JS -->
				<script type="text/javascript">
				var sbiajaxurl = "wp-admin/admin-ajax.html";
				</script>
				<script type="text/html" id="wpb-modifications"></script>
				<script type='text/javascript'>
				/* <![CDATA[ */
				var wpcf7 = {
					"apiSettings": {
						"root": "http:\/\/slidesigma.com\/themes\/wp\/delco\/wp-json\/contact-form-7\/v1",
						"namespace": "contact-form-7\/v1"
					}
				};
				/* ]]> */
				</script>
				<script type='text/javascript' src='wp-content/plugins/contact-form-7/includes/js/scripts9dff.js?ver=5.3.2'></script>
				<script type='text/javascript' src='wp-content/themes/delco/assets/js/bootstrap.mincce7.js?ver=4.0.0'></script>
				<script type='text/javascript' src='wp-content/themes/delco/assets/js/popper.min1159.js?ver=1.4.2'></script>
				<script type='text/javascript' src='wp-content/themes/delco/assets/js/magnific-popupf488.js?ver=1.1.0'></script>
				<script type='text/javascript' src='wp-content/themes/delco/assets/js/slick.min8a54.js?ver=1.0.0'></script>
				<script type='text/javascript' src='wp-content/themes/delco/assets/js/skip-link-focus-fix1159.js?ver=1.4.2'></script>
				<script type='text/javascript' src='wp-content/themes/delco/assets/js/custom1159.js?ver=1.4.2'></script>
				<script type='text/javascript' src='wp-content/plugins/sigma-core/assets/js/isotope.pkgd.min7c45.js?ver=3.0.6'></script>
				<script type='text/javascript' src='wp-content/plugins/sigma-core/assets/js/shortcodes03e2.js?ver=5.4.6'></script>
				<script type='text/javascript' src='wp-content/plugins/sigma-core/assets/js/jquery.easypiechart784e.js?ver=2.1.6'></script>
				<script type='text/javascript' src='wp-includes/js/wp-embed.min03e2.js?ver=5.4.6'></script>
				<script type='text/javascript' src='wp-content/plugins/js_composer/assets/js/dist/js_composer_front.min1e39.js?ver=6.4.2'></script>
				<!--====== GO TO TOP PART START ======-->
				<div class="go-top-area">
					<div class="go-top-wrap">
						<div class="go-top-btn-wrap">
							<div class="go-top go-top-btn"> <i class="fal fa-angle-double-up"></i> <i class="fal fa-angle-double-up"></i> </div>
						</div>
					</div>
				</div>
				<!--====== GO TO TOP PART ENDS ======-->
				</body>
				
			

				</html>