<?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);		
    $font = 'font-family:sans-serif;';
    $pdfhtml = '';
    
            $pdfhtml .='
            
                <table style="width:700px;margin:0 auto;'.$font.'" cellspacing="0" cellpadding="0">
                     <tbody>
                        <tr>
                           <td style="padding: 0; color: #333; font-size: 15px;  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;  text-align: left;">
                                       </td>
                                    </tr>
                                 </tbody>
                              </table>
                           </td>
                        </tr>
                        <tr>
                           <td style="padding: 0; color: #333; font-size: 15px;  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;'.$font.'">Thank you! Your seats has been confirmed</td></tr>
											  </tbody>
										   </table>
										</td>
                                    </tr>
                                    <tr>
                                       <td style="height:20px;"></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: 16px;line-height: 14.52px;color: #FB5221;font-weight: 700;display: block;margin-bottom: 5px;'.$font.'">Name</span>
                                                   <span style="font-size: 16px;line-height: 14.52px;color: #000;font-weight: normal;display: block;margin-bottom: 5px;'.$font.'">'.$_POST['login_name'].'</span>
                                                </td>
												<td width="40%" style="background:#fff5f5;padding: 14px;border-right: 10px solid #fff;"><span style="font-size: 16px;line-height: 14.52px;color: #FB5221;font-weight: 700;display: block;margin-bottom: 5px;'.$font.'">Email</span>
                                                   <span style="font-size: 16px;line-height: 14.52px;color: #000;font-weight: normal;display: block;margin-bottom: 5px;'.$font.'">'.$_POST['email'].'</span></td>
												<td width="20%" style="background:#fff5f5;padding: 14px;border-right: 10px solid #fff;"><span style="font-size: 16px;line-height: 14.52px;color: #FB5221;font-weight: 700;display: block;margin-bottom: 5px;'.$font.'">Mobile No</span>
                                                   <span style="font-size: 16px;line-height: 14.52px;color: #000;font-weight: normal;display: block;margin-bottom: 5px;'.$font.'">'.$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: 15px;margin-right:15px;color: #000000;font-weight: 400;background-color: #fff;border-radius: 60px;float: left;width:60px;height:60px;line-height:45px;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 style="height:20px;"></td>
                                             </tr>
                                             <tr>
                                                 <td style="height:20px;"></td>
                                             </tr>
                                             <tr>
                                                 <td style="height:20px;"></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;  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-size: 15px;line-height: 22px;font-weight: normal;padding: 0;margin-top:0;border-top: 1px solid #ccc;padding-top:10px;"></p>
									  <p style="text-align: center;  color: #000; font-size: 15px; margin: 0;padding:10px 0;">© Copyright 2023, Sri Ma Vidyalaya</p>
								   </td>
								</tr>
									<tr>
									   <td style="padding: 0 0 20px 0; color: #333; font-size: 13px;  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;  text-align: left;">
												   </td>
												</tr>
											 </tbody>
										  </table>
									   </td>
									</tr>
								 </tbody>
							  </table>
						   </td>
						</tr>
						
         </tbody>
      </table>';
            
    echo $pdfhtml;
?>