        <div class="form form-profile aif app" style='width:auto'>
                <ul class="subtabs-list" style="border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;">
                    <li class="active"><a href="#tab1">News</a></li>
                    <li><a href="#tab2">Rewards</a></li>
                    <li><a href="#tab3">Logos</a></li>
                    <li><a href="#tab4">Links</a></li>
                    <!--<li><a href="#tab4">Specials</a></li>-->
                    <li><a href="#tab5">Events</a></li>
                    <li style="border-right:none"><a href="#tab6">Deals</a></li>
                    <div class="clear"></div>
                </ul>
                <div class="clear"></div>   

				<!-- ################################# -->
				<!-- #########  SUB-TAB #1   ######### -->
				<!-- ################################# -->
				
                <div id="tab1" class="subtab active">
                    <h2>
						Events API - Webservice: <a href="<?= get('siteroot') ?>api/webservices?command=getNews" 
						target="_blank"><?= get('siteroot') ?>api/webservices?command=getNews</a> (700 x 394 px) 
						<span style="float:right;"><a href="<?= get('siteroot') ?>events/" target="_blank">View 
						<i class="fa fa-link"></i></a></span>						
					</h2>
						<table class="admintable" style="margin:10px;">
							<tr>
								<th width="270">Image</th>
								<th width="150">Title</th>
								<th width="400">Author</th>
								<th width="150">Location</th>
								<th width="130">Actions</th>
							</tr>
							<?php
							foreach ($events as $event) {
								echo "<tr>
								<td style='padding:10px;'>
									<img src='{$event['image']}' alt='{$event['title']}' style='width:250px; height:auto;' />
								</td>
								<td style='padding:10px;'>{$event['title']}</td>
								<td style='padding:10px;'>{$event['author']}
									<br />
									{$event['custom']}
								</td>
								<td style='padding:10px; background:none; overflow:hidden; word-wrap: break-word;'>{$event['image']}</td>
								<td style='padding:10px;'><a href='?event&edit={$event['id']}'>edit</a> | <a href='?event&delete={$event['id']}' class='confirm'>delete</a></td></tr>";
							}
							?>
						</table>
						<div style="margin:10px;">
							<a href='?event&add' class='btn btn-blue'>Add New</a>
						</div>								
				</div>	
					
                <!-- END OF SUB-TAB #1 -->				
 
                <!-- ################################# -->
                <!-- #########  SUB-TAB #2   ######### -->
                <!-- ################################# -->
 
                <div id="tab2" class="subtab">
                    <h2>
                        Rewards API - Webservice: <a href="<?= get('siteroot') ?>api/eventsother/" 
                        target="_blank"><?= get('siteroot') ?>api/eventsother/</a> (645 x 363 px)
                        <span style="float:right;"><a href="<?= get('siteroot') ?>eventsother/" target="_blank">View 
                        <i class="fa fa-link"></i></a></span>                               
                    </h2>
                        <table class="admintable" style="margin:10px;">
                            <tr>
                                <th width="270">Image</th>
                                <th width="150">Name</th>
                                <th width="150">Stars</th>
                                <th width="300">Definition</th>
                                <th width="130">Actions</th>
                            </tr>
                            <?php
                            foreach ($rewards as $reward) {
                                echo "<tr>
                                <td style='padding:10px;'>
                                    <img src='/static/client/square-reward-img.png' alt='{$reward['name']}' style='width:250px; height:auto;' />
                                </td>
                                <td style='padding:10px;'>{$reward['name']}</td>
                                <td style='padding:10px;'>{$reward['stars']}</td>
                                <td style='padding:10px; background:none; overflow:hidden; word-wrap: break-word;'>{$reward['definition']}</td>
                                <td style='padding:10px;'><a href='?reward&edit={$reward['id']}'>edit</a> | <a href='?reward&delete={$reward['id']}' class='confirm'>delete</a></td></tr>";
                            }
                            ?>
                        </table>
                        <div style="margin:10px;">
                            <a href='?reward&add' class='btn btn-blue'>Add New</a>
                        </div>                          
                </div>
                <!-- END OF SUB-TAB #2 -->
 
				<!-- ################################# -->
				<!-- #########  SUB-TAB #2 OLD  ######### -->
				<!-- ################################# -->
 
                <div id="tab2XX" class="subtab" style="display:none;">
                    <h2>
						Events 2 API - Webservice: <a href="<?= get('siteroot') ?>api/eventsother/" 
						target="_blank"><?= get('siteroot') ?>api/eventsother/</a> (645 x 363 px)
						<span style="float:right;"><a href="<?= get('siteroot') ?>eventsother/" target="_blank">View 
						<i class="fa fa-link"></i></a></span>								
					</h2>
						<table class="admintable" style="margin:10px;">
							<tr>
								<th width="270">Image</th>
								<th width="150">Title</th>
								<th width="400">Author</th>
								<th width="150">Location</th>
								<th width="130">Actions</th>
							</tr>
							<?php
							foreach ($eventsother as $event) {
								echo "<tr>
								<td style='padding:10px;'>
									<img src='{$event['image']}' alt='{$event['title']}' style='width:250px; height:auto;' />
								</td>
								<td style='padding:10px;'>{$event['title']}</td>
								<td style='padding:10px;'>{$event['author']}
									<br />
									{$event['custom']}
								</td>
								<td style='padding:10px; background:none; overflow:hidden; word-wrap: break-word;'>{$event['image']}</td>
								<td style='padding:10px;'><a href='?eventother&edit={$event['id']}'>edit</a> | <a href='?eventother&delete={$event['id']}' class='confirm'>delete</a></td></tr>";
							}
							?>
						</table>
						<div style="margin:10px;">
							<a href='?eventother&add' class='btn btn-blue'>Add New</a>
						</div>							
                </div>
                <!-- END OF SUB-TAB #2 -->
				
				<!-- ################################# -->
				<!-- #########  SUB-TAB #3   ######### -->
				<!-- ################################# -->				
                
                <div id="tab3" class="subtab">
                    <h2>
						Logos API - Webservice: <a href="<?= get('siteroot') ?>api/logos/" 
						target="_blank"><?= get('siteroot') ?>api/logos/</a> (645 x 363 px)
						<span style="float:right;"><a href="<?= get('siteroot') ?>logos/" target="_blank">View 
						<i class="fa fa-link"></i></a></span>								
					</h2>              
						<table class="admintable" style="margin:10px;">
							<tr><th width="150">Image</th>
							<th width="150">Title</th>
							<th width="300">Text</th>
							<th width="300">Filename</th>
							<th>Actions</th></tr>
							<?php
							foreach ($logos as $logo) {
								echo "<tr>
								<td style='padding:10px;'><img src='{$logo['image']}' alt='{$logo['title']}' /></td>
								<td style='padding:10px;'>{$logo['title']}</td>
								<td style='padding:10px;'>{$logo['content']}
									<br /><br />
									{$logo['author']}
								</td>
								<td style='padding:10px; overflow:hidden;'>{$logo['image']}</td>
								<td style='padding:10px;'><a href='?logo&edit={$logo['id']}'>edit</a> | <a href='?logo&delete={$logo['id']}' class='confirm'>delete</a></td></tr>";
							}
							?>
						</table>
						<div style="margin:10px;">
							<a href='?logo&add' class='btn btn-blue'>Add New</a>
						</div>					            
                </div>
                <!-- END OF SUB-TAB #3 -->                             
 
                <!-- ################################# -->
                <!-- #########  SUB-TAB #4   ######### -->
                <!-- ################################# -->  
 
                <div id="tab4" class="subtab">               
                    <h2>
                        Links API - Webservice: <a href="<?= get('siteroot') ?>api/links/" 
                        target="_blank"><?= get('siteroot') ?>api/links/</a> (645 x 363 px)
                        <span style="float:right;"><a href="<?= get('siteroot') ?>links/" target="_blank">View 
                        <i class="fa fa-link"></i></a></span>                       
                    </h2>
                        <table class="admintable" style="margin:10px;">
                            <tr>
                                <th width="270">Image</th>
                                <th width="150">Title</th>
                                <th width="400">Filename</th>
								<th width="300">Link</th>
                                <th width="130">Actions</th>
                            </tr>
                            <?php
							foreach ($specials as $special) {
                                echo "<tr>
								<td style='padding:10px;'><img src='/static/images/users/loyaltycard/{$special['image']}' 
								onerror=\"this.src='/static/images/placeholder_sqcat.jpg'\"
								alt='{$special['title']}' style='width:100%; height:auto;' /></td>
								<td style='padding:10px;'>{$special['title']}</td>
								<td style='padding:10px;'>{$special['image']}</td>
								<td style='padding:10px;'>{$special['link']}</td>
								<td style='padding:10px;'><a href='?special&edit={$special['id']}'>edit</a> | 
								<a href='?special&delete={$special['id']}' class='confirm'>delete</a></td></tr>";
                            }
                            ?>
                        </table>
                        <div style="margin:10px;">
                            <a href='?special&add' class='btn btn-blue'>Add New</a>
                        </div>                                      
                </div>
                <!-- END OF SUB-TAB #4 -->      
 
				<!-- ################################# -->
				<!-- #########  SUB-TAB #4   OLD ######### -->
				<!-- ################################# -->	
 
                <div id="tab4x" class="subtab" style="display:none;">               
                    <h2>
						Specials API - Webservice: <a href="<?= get('siteroot') ?>api/specials/" 
						target="_blank"><?= get('siteroot') ?>api/specials/</a> (645 x 363 px)
						<span style="float:right;"><a href="<?= get('siteroot') ?>specials/" target="_blank">View 
						<i class="fa fa-link"></i></a></span>						
					</h2>
						<table class="admintable" style="margin:10px;">
							<tr>
								<th width="270">Image</th>
								<th width="150">Title</th>
								<th width="400">Author</th>
								<th width="150">Location</th>
								<th width="130">Actions</th>
							</tr>
							<?php
							foreach ($specials as $special) {
								echo "<tr>
								<td style='padding:10px;'>
									<img src='{$special['image']}' alt='{$special['title']}' style='width:250px; height:auto;' />
								</td>
								<td style='padding:10px;'>{$special['title']}</td>
								<td style='padding:10px;'>{$special['author']}
									<br />
									{$special['custom']}
								</td>
								<td style='padding:10px; background:none; overflow:hidden; word-wrap: break-word;'>{$special['image']}</td>
								<td style='padding:10px;'><a href='?special&edit={$special['id']}'>edit</a> | <a href='?special&delete={$special['id']}' class='confirm'>delete</a></td></tr>";
							}
							?>
						</table>
						<div style="margin:10px;">
							<a href='?special&add' class='btn btn-blue'>Add New</a>
						</div>					                    
                </div>
                <!-- END OF SUB-TAB #4 -->			
                
                <!-- ################################# -->
                <!-- #########  SUB-TAB #5   ######### -->
                <!-- ################################# -->
                
                <div id="tab5" class="subtab">
                    <h2>
                        EVENTS API - Webservice: <a href="<?= get('siteroot') ?>api/webservices?command=getEvents" 
                        target="_blank"><?= get('siteroot') ?>api/webservices?command=getEvents</a> (700 x 394 px) 
                        <span style="float:right;"><a href="<?= get('siteroot') ?>api/webservices?command=getNews" target="_blank">View 
                        <i class="fa fa-link"></i></a></span>                      
                    </h2>
                        <table class="admintable" style="margin:10px;">
                            <tr>
                                <th width="270">Image</th>
                                <th width="150">Title</th>
                                <th width="400">Author</th>
                                <th width="150">Location</th>
                                <th width="130">Actions</th>
                            </tr>
                            <?php
                            foreach ($eventsmain as $eventmain) {
                                echo "<tr>
                                <td style='padding:10px;'>
                                    <img src='{$eventmain['image']}' alt='{$eventmain['title']}' style='width:250px; height:auto;' />
                                </td>
                                <td style='padding:10px;'>{$eventmain['title']}</td>
                                <td style='padding:10px;'>{$eventmain['author']}
                                    <br />
                                    {$eventmain['custom']}
                                </td>
                                <td style='padding:10px; background:none; overflow:hidden; word-wrap: break-word; max-width:400px;'>{$eventmain['image']}</td>
                                <td style='padding:10px;'><a href='?eventmain&edit={$eventmain['id']}'>edit</a> | <a href='?eventmain&delete={$eventmain['id']}' class='confirm'>delete</a></td></tr>";
                            }
                            ?>
                        </table>
                        <div style="margin:10px;">
                            <a href='?eventmain&add' class='btn btn-blue'>Add New</a>
                        </div>                              
                </div>  
                    
                <!-- END OF SUB-TAB #6 -->                      	                

				<!-- ################################# -->
				<!-- #########  SUB-TAB #5 JETS  ######### -->
				<!-- ################################# -->	
				
                <div id="tab55" class="subtab" style="display:none;">
                  <h2>Cat #5</h2>    
                    <table>
                        <tr>
                            <th>Make</th><th>Model</th><th>Seats</th><th>Carrier</th><th>Actions</th>
                        </tr>
                        <?php
                          
                        foreach ($jet_planes as $row) {
                            echo "<tr><td>{$row['make']}</td><td>{$row['model']}</td><td>{$row['seats']}</td><td></td>
                                <td>
                                    <a href='?jet&deletePlane={$row['id']}'>Delete</a>
                                </td>
                            </tr>";
                        }
                        
                        ?>
                    </table>
                    
                    <div id="add_plane" style="display:none">
                        <!-- Add Plane Form -->
                        <form method="post" class="form form-profile">
                            <input type="hidden" name="jet" value="add_plane" />
                			<div class="row-item">
                				<label class="lbl">Make:</label>
                                <div class="val"><input class="txt" type="text" name="make"></div>			
                			</div>
                			<div class="row-item">                
                                <label class="lbl">Model:</label>
                                <div class="val"><input class="txt" type="text" name="model"></div>			
                            </div>
                			<div class="row-item">                
                                <label class="lbl">Seats:</label>
                                <div class="val"><input class="txt" type="text" name="seats"></div>			
                            </div>
                			<div class="row-item">                
                                <label class="lbl">Tail Number:</label>
                                <div class="val"><input class="txt" type="text" name="tailno"></div>			
                            </div>
                			<div class="row-item">                
                                <label class="lbl">Carrier:</label>
                                <div class="val">
                                    <select name="carrier_id" class="txt">
                                        <option value=""> - Please Select - </option>
                                        <?php
                                        foreach ($jet_carriers as $carrier) {
                                            echo "<option value='{$carrier['id']}'>{$carrier['name']}</option>";
                                        }
                                        ?>
                                    </select>
                                </div>			
                            </div>
                            <br>
                            <input type="submit" style="font-weight:300" class="btn btn-blue"> 
<!--                 			<input type="button" value="Cancel" class="btn btn-black" onclick="location = '/admin/'"> -->
                		</form>
                    </div>
                    
                    <a href="#add_plane" class="show">Add</a>				  
                </div>
                <!-- END OF SUB-TAB #4 -->				
                
                <!-- ################################# -->
                <!-- #########  SUB-TAB #6   ######### -->
                <!-- ################################# -->
                
                <div id="tab6" class="subtab">
                    <h2>
                        DEALS API - Webservice: <a href="<?= get('siteroot') ?>api/mdeals/" 
                        target="_blank"><?= get('siteroot') ?>api/mdeals/</a> (700 x 394 px) 
                        <span style="float:right;"><a href="<?= get('siteroot') ?>mdeals/" target="_blank">View 
                        <i class="fa fa-link"></i></a></span>                      
                    </h2>
                        <table class="admintable" style="margin:10px;">
                            <tr>
                                <th width="270">Image</th>
                                <th width="150">Title</th>
                                <th width="400">Author</th>
                                <th width="150">Location</th>
                                <th width="130">Actions</th>
                            </tr>
                            <?php
                            foreach ($mdeals as $mdeal) {
                                echo "<tr>
                                <td style='padding:10px;'>
                                    <img src='{$mdeal['image']}' alt='{$mdeal['title']}' style='width:250px; height:auto;' />
                                </td>
                                <td style='padding:10px;'>{$mdeal['title']}</td>
                                <td style='padding:10px;'>{$mdeal['artist']}
                                    <br />
                                    {$mdeal['venue']}
                                </td>
                                <td style='padding:10px; background:none; overflow:hidden; word-wrap: break-word; max-width:400px;'>{$mdeal['image']}</td>
                                <td style='padding:10px;'><a href='?mdeal&edit={$mdeal['id']}'>edit</a> | <a href='?mdeal&delete={$mdeal['id']}' class='confirm'>delete</a></td></tr>";
                            }
                            ?>
                        </table>
                        <div style="margin:10px;">
                            <a href='?mdeal&add' class='btn btn-blue'>Add New</a>
                        </div>                              
                </div>  
                    
                <!-- END OF SUB-TAB #6 -->                          	
               
        </div><!-- END OF OVERALL TAB-->

<script>
$('.show').click(function (e) {
   e.preventDefault();
   var sel = $(this).attr('href');
   $(sel).show();
   $(this).hide();
});

$( ".datepicker" ).datepicker();
</script>

<style>
.jet .row-item {
    padding-bottom: 8px;
}
.jet td, .jet th {
    padding: 5px;
}
</style>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">