<?php
session_start(); 
require('config/Database.php');
$db = Database::getInstance();
$mysqli = $db->getConnection();
$reg_mob = $_POST['mob'];
$seat_query = "SELECT * FROM std_ticket WHERE reg_mobile=".$reg_mob; 
$seat_dt= $mysqli->query($seat_query);
$html = '';
$font = 'font-family:sans-serif;';
$html .= '<!DOCTYPE html>
<html lang="en">
   <head>
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
      <meta charset="utf-8">
      <title>Sri Ma</title>
      <style type="text/css">
         #outlook a {
         padding: 0;
         }
         body {
         width: 100% !important;
         size-adjust: 100%;
         margin: 0;
         padding: 0;
         background: #ddd;
         }
         .ReadMsgBody {
         width: 100%;
         }
         .ExternalClass {
         width: 100%;
         }
         .backgroundTable {
         margin: 0 auto;
         padding: 0;
         width: 100%!important;
         }
         table td {
         border-collapse: collapse;
         }
         .ExternalClass * {
         line-height: 115%;
         }
         /* End reset */
         @media (max-width:600px) {
         .sidearea {padding-left:0 !important;padding-right:0 !important;}
         .sidearea2 {margin:0 !important}
         img{width:100%; height:auto}
         table {
         width: 100%!important;
         max-width: 95%!important;
         min-width: 98%!important;
         clear: both!important;
         display: table !important;
         margin: 0 auto;background-size: 100% !important;
         }
         table.inside-table {
         width: 96%!important;
         max-width: 96%!important;
         min-width: 96%!important;
         clear:both!important;
         display: table !important;
         }
         table .top-t{padding-bottom:0 !important}
         table .bot-t{padding-top:0 !important}
         #none {
         display: none !important;
         }
         #hide {
         display: none !important;
         }
         .responsive-image img {
         height: auto !important;
         max-width: 100% !important;
         width: 100% !important;
         }
         .responsive-image2 img {
         height: auto !important;
         max-width: 100% !important;
         width:auto !important;max-height:70px !important;
         }
         img{width:auto!important; max-width:100%!important; height:auto!important;}
         .imgarea {width:auto !important}
         .logo-area {padding-left: 10px !important;font-size: 15px;}
         .menu-area {padding-right: 9px !important}
         .padding-bottom-20 { padding-bottom: 20px !important; }          
         .sidearea.sidearea3 {margin-left:35px;float: left;}
         .sidearea4 {margin-left:0 !important}
         .menu-area a { margin-left: 0 !important; }
         .bottom-space {margin-bottom:20px !important}
         .readmore {padding-right: 10px !important;}
         .width-auto-m {
         width: auto !important;
         margin: 0 auto;
         float: none;
         text-align: center;
         display: block;
         }
         table.devider {
         width: 80px !important;
         min-width: inherit !important;
         }
         }
      </style>
   </head>
   <body style="background-color:#f5f7fa;'.$font.'">
      <table style="border: 0;margin: 30px auto 0 auto;width:100%" width="100%" cellspacing="0" cellpadding="0">
         <tbody>
            <tr>
               <td style="padding: 0;" align="center">
                  <!-- Content table with backgdound color #fff, width 500px -->
                  <table style="width:700px;margin:0 auto;" cellspacing="0" cellpadding="0">
                     <tbody>
                        <tr>
                           <td style="padding: 0; color: #333; font-size: 15px; '.$font.' text-align: left;">
                              <table style=" border:0;width: 100%;background:url(https://dev.srimaone.in/srimaticket/images/emailer-top-img.png) no-repeat center top;">
                                 <tbody>
                                    <tr>
                                       <td style="padding: 15px 0 0 ; color: #333; font-size: 15px; '.$font.' text-align: left;">
                                       </td>
                                    </tr>
                                 </tbody>
                              </table>
                           </td>
                        </tr>
                        <tr>
                           <td style="padding: 0; color: #333; font-size: 15px; '.$font.' text-align: left;border:0;">
                               <table style="width:100%;padding:0;margin:0 auto;width: 100%;background:url(https://dev.srimaone.in/srimaticket/images/emailer-middle-img.png) repeat-y center top;" cellspacing="0" cellpadding="0">
                                 <tbody>
                                     <tr>
                                       <td>
                                       <table style="width:100%;padding:0;margin:0 auto" cellspacing="0" cellpadding="0">
											  <tbody>
												 <tr><td width="10%"></td>
													<td> <p style="margin: 0;padding:0px 0 10px 0"><a style="padding:0; margin: 0; border: 0; outline: none; text-decoration: none; text-align: center;" href="#"><img style="display: inline-block; padding: 0; margin: 0; border: 0; outline: none;" src="https://dev.srimaone.in/srimaticket/images/email-logo.png" alt="" /></a></p></td><td width="10%"></td>
												 </tr>
											  </tbody>
										   </table>
										</td>
                                    </tr>
									<tr>
                                       <td>
                                       <table style="width:100%;padding:0;margin:0 auto" cellspacing="0" cellpadding="0">
											  <tbody>
												 <tr><td width="100%"><p style="border-top: 1px solid #cccccc;margin: 0 auto;padding:0;width: 98%;"></p></td></tr>
											  </tbody>
										   </table>
										</td>
                                    </tr>
									 <tr>
                                       <td style="height:20px;"></td>
                                    </tr>
									<tr>
                                       <td>
                                       <table style="width:100%;padding:0;margin:0 auto" cellspacing="0" cellpadding="0">
											  <tbody>
												 <tr><td width="100%" style="text-align: center;width: 100%;float: left;color: #FB5221;margin: 30px 0;font-weight: 600;    font-size: 26px;">Thank you! your seats has been confirmed</td></tr>
											  </tbody>
										   </table>
										</td>
                                    </tr>
                                    <tr>
                                       <table style="width:100%;padding:0;margin:0 auto;width: 100%;background:url(https://dev.srimaone.in/srimaticket/images/emailer-middle-img.png) repeat-y center top;" cellspacing="0" cellpadding="0">
                                          <tbody>
                                             <tr>
                                                <td width="10%"></td>
                                                <td width="20%" style="background:#fff5f5;padding: 14px;border-right: 10px solid #fff;">
                                                   <span style="font-size: 14px;line-height: 14.52px;color: #FB5221;font-weight: 700;display: block;margin-bottom: 5px;">Name</span>
                                                   <span style="font-size: 14px;line-height: 14.52px;color: #000;font-weight: normal;display: block;margin-bottom: 5px;">'.$_POST['login_name'].'</span>
                                                </td>
												<td width="40%" style="background:#fff5f5;padding: 14px;border-right: 10px solid #fff;"><span style="font-size: 14px;line-height: 14.52px;color: #FB5221;font-weight: 700;display: block;margin-bottom: 5px;">Email</span>
                                                   <span style="font-size: 14px;line-height: 14.52px;color: #000;font-weight: normal;display: block;margin-bottom: 5px;">'.$_POST['email'].'</span></td>
												<td width="20%" style="background:#fff5f5;padding: 14px;border-right: 10px solid #fff;"><span style="font-size: 14px;line-height: 14.52px;color: #FB5221;font-weight: 700;display: block;margin-bottom: 5px;">Mobile No</span>
                                                   <span style="font-size: 14px;line-height: 14.52px;color: #000;font-weight: normal;display: block;margin-bottom: 5px;">'.$reg_mob.'</span></td>
                                                <td width="10%"></td>
                                             </tr>
											 <tr>
                                                <td width="10%"></td>
                                                <td width="20%"></td>
												<td width="40%" style="padding-top: 15px;text-align: center;">';
												    if ($seat_dt->num_rows > 0) {
                                                        while($row_seat = $seat_dt->fetch_assoc()){                                                            
                                                            $pdfhtml .='<span style="font-size: 14px;margin-left:35px;color: #000000;font-weight: 400;background-color: #fff;border-radius: 60px;float: left;width: 40px;height: 40px;line-height: 42px;text-align: center;border: 2px solid #30b946;text-decoration: none;">'.
                                                                strtoupper($row_seat["seat_type"].'-'.$row_seat["seat_no"])
                                                            .'</span>';
                                                        } 
                                                     }
														
												$pdfhtml .='</td>
												<td width="20%"></td>
                                                <td width="10%"></td>
                                             </tr>
											 <tr>
                                                <td width="10%"></td>
                                                <td width="20%"></td>
												<td width="40%" style="padding-top: 25px;text-align: center;">
													<img src="https://dev.srimaone.in/srimaticket/images/qr-code.png" alt="">
												</td>
												<td width="20%"></td>
                                                <td width="10%"></td>
                                             </tr>
                                          </tbody>
										  
                                       </table>
                                       </td>
                                    </tr>
									
									
								
								<tr>
								   <td style="padding:0px 20px 20px 20px; text-align: center; '.$font.' color: #000000; font-size: 15px;background:url(https://dev.srimaone.in/srimaticket/images/emailer-middle-img.png) repeat-y center top;width:100%;">
									  <p style="'.$font.'font-size: 15px;line-height: 22px;font-weight: normal;padding: 0;margin-top:0;border-top: 1px solid #ccc;padding-top: 20px;"></p>
									  <p style="text-align: center; '.$font.' color: #000; font-size: 15px; margin: 0;">© Copyright 2023, Sri Ma Vidyalaya</p>
								   </td>
								</tr>
									<tr>
									   <td style="padding: 0 0 20px 0; color: #333; font-size: 13px; '.$font.' text-align: left;">
										  <table style=" width: 100%;background:url(https://dev.srimaone.in/srimaticket/images/emailer-bottom-img.png) no-repeat center bottom;border:0">
											 <tbody>
												<tr>
												   <td style="padding:0 0 15px 0; color: #333; font-size: 15px; '.$font.' text-align: left;">
												   </td>
												</tr>
											 </tbody>
										  </table>
									   </td>
									</tr>
								 </tbody>
							  </table>
						   </td>
						</tr>
						
         </tbody>
      </table>
   </body>
</html>';


echo $html;