<?php
include('views/_header.tpl.php');

if (isset($_GET['jets'])) {
    require('views/admin/jets-tab.tpl.php');
    exit;
}

if (isset($_GET['app'])) {
    require('views/admin/app-tab.tpl.php');
    exit;
}

?>

<style type="text/css">
#fb-editor p {
    margin-right: 5px;
    display: inline-block;
}

#customAjaxLoader td, #customAjaxLoader th {
    padding: 4px;
}
.admintable td, .admintable th {
    padding: 3px;
    border: solid #eee 1px;
}
.regl a, .regl a:active, .regl. a:visited, .regl:link { color:#0077cc !important; }
.regl a:hover { color:#0000ff; }
.btn { background:#325fac; }
a.lgbtn, a.lgbtn:active, a.lgbtn:visited {
	padding:3px; width:50px;	display:inline-block; background:#ddd; text-shadow:0px 1px 0px #fff;
	border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;
}
a.lgbtn.confirm { color:#ff0000; }

a.lgbtn:hover {
	background:#0077cc; color:#fff; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;
	text-shadow:0px -1px 0px rgba(0,0,0,.5);
}
a:focus {
	outline: none;
	text-decoration:none !important;
	border:0;
	color: none !important;
}
.btn-blue { margin:5px 5px 5px 0; }

/* ############################## */
/* #########   NAV TABS   ####### */
/* ############################## */

.nav-tabs > li.active > a {
    /*color: #377ae8;*/
	color:#ff0000;
	font-weight:bold;
    background-color: none !important;
	background:none !important;
    border: 0px solid #d4d4d4;
    border-bottom-color: #ff0000;
}

.nav-tabs > li > a {
    color: #5c666b;
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    padding: 9px 18px;
    border-radius: 4px 4px 0 0;
    -webkit-border-radius: 4px 4px 0 0;
    -moz-border-radius: 4px 4px 0 0;
    background-color: none !important;	
	background:none !important;
}

/* ############################## */
/* #########   SUB TABS   ####### */
/* ############################## */

ul.subtabs-list {
    margin: 0;
    padding: 0;
    list-style: none;
	margin-right:10px;
	width:98%;
	background:#444;
	-webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
	border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;
	overflow:hidden;
}
ul.subtabs-list li {
    float: left;
	width:14.5%;
	padding-left:1%;
	padding-right:1%;
	margin-left: 0px;
	border-right: 1px solid #777;
    padding-top: 5px;
	padding-bottom:7px;
	font-family: 'Open Sans',sans-serif;
	font-weight:300;
    font-size: 15px;
    background: #444;
	text-shadow:0px -1px 0px rgba(0,0,0,.4);
	text-align:center;
}
ul.subtabs-list li a {
    color: #ccc;
	font-family: 'Open Sans',sans-serif;
	font-weight:300;
	display:block;
}
ul.subtabs-list li.active {
    background: #00C617;
	color:#fff;
	text-shadow:0px -1px 0px rgba(0,0,0,.4);
}
ul.subtabs-list li.active a {
    color: #fff;
	font-family: 'Open Sans',sans-serif;
	font-weight:300;
	text-shadow:0px -1px 0px rgba(0,0,0,.4);
}
div.subtab {
    display: none;
}
div.subtab.active {
    display: block;
}

div.form.form-profile { padding-top:20px; }
td img { width:100px; }

.dashtotals {
	float:right; text-align:right; font-family:'Open Sans';
}

#footer { padding-top:0px; }
.main-footer { display:none; }

/* APP INTRO PADDING TOP */
.aif { padding-top:20px; }

/* ######################### */
/*       1024px Screens      */
/* ######################### */
@media (max-width: 1024px) {
	div.form.form-profile { }
	ul.subtabs-list {
		width:95%;
	}
}

/* ######################### */
/* Layout 2-cols */
/* ######################### */

@media (max-width: 1160px) {
	.layout-2cols { width:100%; }
}	

/* ######################### */
/* Landscape phones and down */
/* ######################### */

@media screen and (max-device-width:  600px), screen and (max-width: 600px) {
	#wrapper { overflow:hidden; }
}

/* ######################### */
/* Landscape phones and down */
/* ######################### */

@media screen and (max-device-width:  480px), screen and (max-width:  480px) {
	.layout-2cols { padding-top:3px; }
	.header-content .header-right {
		border-bottom: 0px solid #d4d4d4;
		padding-bottom: 0px;
	}
	ul.subtabs-list {
		-webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
		width:99%;
	}
	ul.subtabs-list li {
		float: left;
		width:14%;
		padding-left:1%;
		padding-right:1%;
		margin-left: 0px;
		border-right: 1px solid #777;
		font-size: 14px;
	}
	.dashtotals {
		font-size:11px; padding-right:3px;
		text-shadow:0px 1px 0px rgba(255,255,255,.5); font-family:'Open Sans';
	}
	.tophdrw{ display:none; }
	div.form.form-profile { padding:5px; }
	/* APP INTRO PADDING TOP */
	.aif { padding-top:5px; }
}

</style>

<script type="text/javascript">
$(document).ready(function()
{
    $(".subtabs-list li a").click(function(e)
    {
        e.preventDefault();
        group_id = $(this).attr("href");
        li_elm   = $(this).parent();

        $(".subtab.active").fadeOut("fast");
        $(".subtab.active").removeClass("active");
        $(".subtabs-list li.active").removeClass("active");

        $(group_id).fadeIn("slow");
        $(group_id).addClass("active");

        li_elm.addClass("active");

        return false;
    });
});
</script>

    <div class="layout-2cols">
        <div class="content grid_12" style="overflow:hidden;">
            <div class="project-detail" style="width:auto; overflow:hidden;">
                <div class="project-tab-detail tabbable accordion" style="width:auto; overflow:hidden;">

                    <?php
                    $invalid_tab = !in_array($_GET['tab'], ['welcome','settings', 'orders', 'testimonials', 'logos', 'projects', 
															'storecat', 'projectcat', 'content',  'app', 'jets', 'manageusers',
                                                            'appintro', 'portfolio', 'forms']);
                    $_GET['tab'] 	   = $invalid_tab ? "welcome" : $_GET['tab'];
					$active_welcome    = $_GET['tab'] && $_GET['tab'] == 'welcome' ? " active" : "";
                    $active_settings   = $_GET['tab'] && $_GET['tab'] == 'settings' ? " active" : "";
					$active_orders     = $_GET['tab'] && $_GET['tab'] == 'orders' ? " active" : "";
					$active_testimonials   = $_GET['tab'] && $_GET['tab'] == 'testimonials' ? " active" : "";
					$active_logos	   = $_GET['tab'] && $_GET['tab'] == 'logos' ? " active" : "";
                    $active_projects   = $_GET['tab'] && $_GET['tab'] == 'projects' ? " active" : "";
                    $active_storecat   = $_GET['tab'] && $_GET['tab'] == 'storecat' ? " active" : "";
                    $active_projectcat = $_GET['tab'] && $_GET['tab'] == 'projectcat' ? " active" : "";
                    $active_content    = $_GET['tab'] && $_GET['tab'] == 'content' ? " active" : "";
					$active_app   	   = $_GET['tab'] && $_GET['tab'] == 'app' ? " active" : "";
					$active_jets   	   = $_GET['tab'] && $_GET['tab'] == 'jets' ? " active" : "";
					$active_manageusers   = $_GET['tab'] && $_GET['tab'] == 'manageusers' ? " active" : "";
                    $active_appintro   = !$_GET['tab'] || $_GET['tab'] == 'appintro' ? " active" : "";
                    $active_portfolio  = $_GET['tab'] && $_GET['tab'] == 'portfolio' ? " active" : "";
                    $active_forms  = $_GET['tab'] && $_GET['tab'] == 'forms' ? " active" : "";
                    ?>

					<ul class="nav nav-tabs clearfix">
					  <li class="<?= $active_welcome ?>"><a href="#">Welcome</a></li>
					  <?php if ($_SESSION['loggedin'] && $_SESSION['user']['is_admin'] < 3) : ?>
						  <li class="<?= $active_settings ?>"><a href="#">Settings</a></li>
						  <li class="<?= $active_orders ?>"><a href="#">Orders</a></li>
						  <li class="<?= $active_testimonials ?>"><a href="#">Testimonials</a></li>
						  <li class="<?= $active_logos ?>"><a href="#">Logos</a></li>
						  <li class="<?= $active_projects ?>"><a href="#">Featured</a></li>
						  <li class="<?= $active_storecat ?>"><a href="#">Shop</a></li>
					  <?php endif; ?>
					  
                      <li class="<?= $active_projectcat ?>"><a href="#">Cats</a></li>
                      <li class="<?= $active_content ?>"><a href="#">CMS</a></li>

					  <?php if ($_SESSION['loggedin'] && $_SESSION['user']['is_admin'] < 3) : ?>
					      <li class="<?= $active_app ?>"><a href="#">App</a></li>		
						  <li class="<?= $active_jets ?>"><a href="#">Jets</a></li>
						  <li class="<?= $active_manageusers ?>"><a href="#">Users</a></li>
						  <li class="<?= $active_appintro ?>"><a href="#">Intro</a></li>
						  <li class="<?= $active_portfolio ?>"><a href="#">Portfolio</a></li>
						  <li class="<?= $active_forms ?>"><a href="#">Forms</a></li>
					  <?php endif; ?>
                    </ul>

                    <div class="tab-content" style="padding-top:0px; margin-top:0px !important;">
                        <div style="padding-top:0px; margin-top:0px !important;">
						
                            <h3 class="rs alternate-tab accordion-label">Welcome <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_welcome ?>">                             
								<div class="form form-profile aif" style='width:96.5%'>           
								
									<h2>Welcome to the Website &#923;dmin</h2>	
								
									<a href="/project/add" class="btn btn-blue">+ Add an Event or Blog Post</a>
									<a href="/product/add" class="btn btn-blue">+ Add a New Product/Item</a>
									<a href="/admin/exportFormSubmissions" class="btn btn-blue">Export Form Submissions</a>
									<br /><br />
									<div style="border-left:2px solid #ff0000; padding:10px;">
										<span style="color:#ff0000;">V2.01</span> (Last Updated 04/01/2017)
										<a href="/changelog.html" title="View Version Changelog" target="_blank">View Version Changelog <i 
										class="fa fa-angle-right" aria-hidden="true"></i></a>
									</div>
									
									<br />									
									
									Tip: There are &ldquo;Edit&rdquo; links (or buttons), which allow you to edit various pages
									on both the CMS Pages - and the Blog Post and Events pages - they are usually towards the 
									bottom or the right side and you won&rsquo;t see them unless you are logged in as an Admin.
									<br /><br />
								
<!-- ###################################### -->
<!-- ############  SETTINGS FORM  ######### -->
<!-- ###################################### -->

									
									<form action="/admin/saveSettings" method="post" enctype="multipart/form-data" 
									style="padding:20px 20px 10px; background:#eee;">
									
										<h2>Create an Alert</h2>								
										
										<div style="display:inline-block; width:20%; min-width:100px; height:35px; 
										font-weight:bold; text-align:left;">
											<label>Turn Alert On: </label>
										</div>
										<div style="display:inline-block; width:auto; min-width:150px;">
											<?php
											$checked_enable_alert = !empty($website_options['enable_alert']) ? " checked='checked'" : "";
											?>
											<input type="checkbox" name="settings[enable_alert]"<?= $checked_enable_alert ?> />
										</div>	
										<br />
										<div style="display:inline-block; width:20%; min-width:150px; height:35px; 
										font-weight:bold; text-align:left;">
											<label>Alert Text: </label>
										</div>
										<div style="display:inline-block; width:100%; min-width:220px; max-width:320px;">
											<input type="text" name="settings[alert_text]" class="txt" 
											style="min-width:250px; width:100%" 
											value="<?= $website_options['alert_text'] ?>" placeholder="Type Alert Text Here..." />
										</div>	
										
										<p>
											<input class="btn btn-blue" type="submit" name="save_settings" value="Save Settings" />
										</p>
									</form>
								</div>							
								<div class="clear"></div>                            
							</div>
                            <div class="clear"></div>

						</div><!-- END OF WELCOME DIV --><!--end: .tab-pane (Website Welcome) -->

						<!-- ###################################### -->
						<!-- ###########    SETTINGS    ########### -->
						<!-- ###################################### -->
						
                        <div>						
						
                            <h3 class="rs alternate-tab accordion-label">Settings <i class="fa fa-caret-down" 
							style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content">
                                <form action="/admin/saveSettings" method="post" enctype="multipart/form-data">
								<div class="form form-profile aif" 
								style='width:auto; background:none'>

                <ul class="subtabs-list" style="border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;">
                    <li class="active"><a href="#design-settings">Design</a></li>
                    <li><a href="#homepage-settings">Home</a></li>
                    <li><a href="#general-settings">Ver</a></li>
                    <li style=""><a href="#seo-settings">SEO</a></li>
                    <li style=""><a href="#text-settings">Text</a></li>
                    <li style="border-right:none"><a href="#menu-settings">Menu</a></li>
                    <div class="clear"></div>
                </ul>
                <div class="clear"></div>            

                <div id="design-settings" class="subtab active">
			    <h2>
					Design Settings - <span style="font-size:12px;"><a href="/project/add" class="btn btn-blue">+ Content</a> 
									  <a href="/product/add" class="btn btn-blue">+ Product</a></span>
				</h2>
				<!--Welcome to your Admin Dashboard. 
				<a href="/admin/?tab=orders">Orders</a> |
				<a href="/admin/?tab=testimonials">Testimonials</a> |
				<a href="/admin/?tab=logos">Featured</a> |
				<a href="/admin/?tab=projects">Featured</a> |
				<a href="/admin/?tab=storecat">Shop Cats</a> |
				<a href="/admin/?tab=projectcat">Blog Cats</a> |
				<a href="/admin/?tab=content">CMS</a> |
				<a href="/admin/?tab=usersact">Approvals</a> |
				<a href="/admin/?tab=manageusers">Manage Users</a> |
				<a href="/admin/?tab=appintro">Welcome</a> |
				<a href="/admin/?tab=portfolio">Portfolio</a>
				-->
				
				<span style="color:#ff0000;">V2.01</span> (Last Updated 04/01/2017)
				<a href="/changelog.html" title="View Version Changelog" target="_blank">View Version Changelog <i 
				class="fa fa-angle-right" aria-hidden="true"></i></a>
				<br /><br />
				
                    <div class="dashtotalsxx">
	                    Purchased: <strong><?= number_format($total_points_purchased); ?> items/points ($<?= number_format($total_points_cost,2); ?>)</strong><br />
	                    Spent: <strong><?= number_format($total_store_spent); ?></strong> spent
                    </div>				
				<br />
				<div style="background:#aaa; height:1px; width:auto;"></div>
				<br />
                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>Website Logo: </label><br />
                                    <small>Recommended Size: 339(W)x100(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="website_logo" />
                                    <?php if (!empty($website_options['website_logo'])) : ?>
                                    <img src="/<?= $website_options['website_logo'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>Footer Logo: </label><br />
                                    <small>Recommended Size: 339(W)x100(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="footer_logo" />
                                    <?php if (!empty($website_options['footer_logo'])) : ?>
                                    <img src="/<?= $website_options['footer_logo'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of your Footer logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>Side Menu Logo: </label><br />
                                    <small>Recommended Size: 100(W)x100(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo" />
                                    <?php if (!empty($website_options['mobile_logo'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of your Mobile logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Intro Logo: </label><br />
                                    <small>Recommended Size: 500(W)x120(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="appintro_logo" />
                                    <?php if (!empty($website_options['appintro_logo'])) : ?>
                                    <img src="/<?= $website_options['appintro_logo'] ?>"
                                    style="width: auto; max-width: 150px; height: auto; background:#222;" alt="Preview of your App Intro logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>Website Favicon: </label><br />
                                    <small>Recommended Size: 16(W)x16(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="website_favicon" />
                                    <?php if (!empty($website_options['website_favicon'])) : ?>
                                    <img src="/<?= $website_options['website_favicon'] ?>"
                                    style="width: 16px; max-width: 16px; height: 16px;" alt="Preview of your Favicon" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>Mobile Background: </label><br />
                                    <small>Recommended Size: 2500(W)x1600(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_background" />
                                    <?php if (!empty($website_options['mobile_background'])) : ?>
                                    <img src="/<?= $website_options['mobile_background'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of your Mobile Background" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>Facebook Share Image: </label><br />
                                    <small>Recommended Size: 940(W)x500(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="fb_shareimage" />
                                    <?php if (!empty($website_options['fb_shareimage'])) : ?>
                                    <img src="/<?= $website_options['fb_shareimage'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of your Facebook Share Image" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 57x57: </label><br />
                                    <small>Recommended Size: 57(W)x57(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_57x57" />
                                    <?php if (!empty($website_options['mobile_logo_57x57'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_57x57'] ?>"
                                    style="width: auto; max-width: 57px; height: 57px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 72x72: </label><br />
                                    <small>Recommended Size: 72(W)x72(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_72x72" />
                                    <?php if (!empty($website_options['mobile_logo_72x72'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_72x72'] ?>"
                                    style="width: auto; max-width: 72px; height: 50px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 76x76: </label><br />
                                    <small>Recommended Size: 76(W)x76(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_76x76" />
                                    <?php if (!empty($website_options['mobile_logo_76x76'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_76x76'] ?>"
                                    style="width: auto; max-width: 76px; height: 57px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 114x114: </label><br />
                                    <small>Recommended Size: 114(W)x114(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_114x114" />
                                    <?php if (!empty($website_options['mobile_logo_114x114'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_114x114'] ?>"
                                    style="width: auto; max-width: 114px; height: 57px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 120x120: </label><br />
                                    <small>Recommended Size: 120(W)x120(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_120x120" />
                                    <?php if (!empty($website_options['mobile_logo_120x120'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_120x120'] ?>"
                                    style="width: auto; max-width: 120px; height: 57px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 144x144: </label><br />
                                    <small>Recommended Size: 144(W)x144(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_144x144" />
                                    <?php if (!empty($website_options['mobile_logo_144x144'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_144x144'] ?>"
                                    style="width: auto; max-width: 144px; height: 57px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:auto; font-weight:bold; text-align:left; padding-bottom:10px;">
                                    <label>App Icon 152x152: </label><br />
                                    <small>Recommended Size: 152(W)x152(L)</small>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="mobile_logo_152x152" />
                                    <?php if (!empty($website_options['mobile_logo_152x152'])) : ?>
                                    <img src="/<?= $website_options['mobile_logo_152x152'] ?>"
                                    style="width: auto; max-width: 152px; height: 57px;" alt="Preview of your logo" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Sidebar on CMS Pages: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_enable_sidebar = !empty($website_options['enable_cms_sidebar']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_cms_sidebar]"<?= $checked_enable_sidebar ?> />
                                </div>
                <div class="clear;"></div>
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>CMS Pages Sidebar HTML: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[cms_sidebar_content]" class="txt" style="min-width:350px; min-height:150px;"><?= $website_options['cms_sidebar_content'] ?></textarea>
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Website Title: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[website_title]" class="txt" style="min-width:250px;" value="<?= $website_options['website_title'] ?>" placeholder="ThinApp Demo" />
                                </div>

				<div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Short Title: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[short_title]" class="txt" style="min-width:250px;" value="<?= $website_options['short_title'] ?>" placeholder="My Website" />
                                </div>

				<div class="clear;"></div>
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Custom Homepage: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[custom_homepage]" class="txt" style="min-width:250px;" value="<?= $website_options['custom_homepage'] ?>" placeholder="http://somepage.com" />
                                </div>

				<div class="clear;"></div>		

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Custom Mobile Home: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[custom_mobile]" class="txt" style="min-width:250px;" value="<?= $website_options['custom_mobile'] ?>" placeholder="http://somepage.com" />
                                </div>

				<div class="clear;"></div>					
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Contact Form E-Mail: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[contact_email]" class="txt fill-width" style="min-width:250px;" value="<?= $website_options['contact_email'] ?>" placeholder="contact@thinapp.co" />
                                </div>

				<div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:70px; font-weight:bold; text-align:left;">
                                    <label>Footer Copyright: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <textarea name="settings[footer_copyright]" class="txt" style="width: 350px; height: 150px;"><?= $website_options['footer_copyright'] ?></textarea>
                                </div>
                                
 				<div class="clear;"></div>
 				
                                 <div style="display:inline-block; width:20%; min-width:120px; height:70px; font-weight:bold; text-align:left;">
                                    <label>Default Copyright: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <textarea name="" 
                                    class="txt" style="width: 350px; height: 150px; overflow:hidden;">
&copy; 2017 <a href="//master.thndev.com" title="ThinApp">Thin&#923;pp</a>, Inc. &bull; All rights reserved &bull; Designed by <a href="//master.thndev.com/" title="ThinApp" target="_blank">Thin&#923;pp</a>                                        
                                        
                                    </textarea>
                                </div>

                <div class="clear;"></div>
				<br />
                                <div style="display:inline-block; width:20%; min-width:120px; height:70px; font-weight:bold; 
								text-align:left;">
                                    <label>Disable Footer Links:<br />
									<span style="font-weight:normal;">Tip: Use Cntrl+</span></label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $sel_about = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "about") ? " selected='selected'" : "";
                                    $sel_addproject = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "addproject") ? " selected='selected'" : "";
                                    $sel_faq = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "faq") ? " selected='selected'" : "";
                                    $sel_contact = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "contact") ? " selected='selected'" : "";
                                    $sel_projects = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "projects") ? " selected='selected'" : "";
                                    $sel_profile = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "profile") ? " selected='selected'" : "";
                                    $sel_store = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "store") ? " selected='selected'" : "";
                                    $sel_leaderboard = $website_options['disabled_footer_links'] && false!==strpos($website_options['disabled_footer_links'], "leaderboard") ? " selected='selected'" : "";
                                    ?>
                                    <select style="height:200px;" name="settings[disabled_footer_links][]" class="txt" multiple>
                                        <option<?= $sel_about ?> value="about">About</option>
                                        <option<?= $sel_addproject ?> value="addproject">Start a project</option>
                                        <option<?= $sel_faq ?> value="faq">How it Works</option>
                                        <option<?= $sel_contact ?> value="contact">Contact</option>
                                        <option<?= $sel_projects ?> value="projects">Browse Projects</option>
                                        <option<?= $sel_profile ?> value="profile">Edit Profile</option>
                                        <option<?= $sel_store ?> value="store">Store/Redeem</option>
                                        <option<?= $sel_leaderboard ?> value="leaderboard">Leaderboard</option>
                                    </select>
                                </div>

                <div class="clear;"></div>
                </div>

                <div id="homepage-settings" class="subtab">
                <h2>Homepage Settings</h2>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Homepage Search: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_enable_search = !empty($website_options['enable_homepage_search']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_homepage_search]"<?= $checked_enable_search ?> />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Disable Desktop Version: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_disable_desktop = !empty($website_options['disable_desktop_version']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[disable_desktop_version]"<?= $checked_disable_desktop ?> />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Homepage Slider: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_enable_slider = !empty($website_options['enable_homepage_slider']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_homepage_slider]"<?= $checked_enable_slider ?> />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Show Projects NearBy on Homepage: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_enable_nearby = !empty($website_options['enable_homepage_nearby']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_homepage_nearby]"<?= $checked_enable_nearby ?> />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:100px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 1 Image: </label><br />
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="homepage_slider_img_1" />
                                    <?php if (!empty($website_options['homepage_slider_img_1'])) : ?>
                                    <img src="/<?= $website_options['homepage_slider_img_1'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of the Slider image 1" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 1 Title: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" class="txt" type="text" name="settings[homepage_slider_title_1]" value="<?= $website_options['homepage_slider_title_1'] ?>" placeholder="Slide Title" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 1 Link: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" class="txt" type="text" name="settings[homepage_slider_url_1]" value="<?= $website_options['homepage_slider_url_1'] ?>" placeholder="http://www.luxbranded.com" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 1 Text: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[homepage_slider_text_1]" class="txt" style="min-width:350px; min-height:150px;"><?= $website_options['homepage_slider_text_1'] ?></textarea>
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:100px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 2 Image: </label><br />
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="homepage_slider_img_2" />
                                    <?php if (!empty($website_options['homepage_slider_img_2'])) : ?>
                                    <img src="/<?= $website_options['homepage_slider_img_2'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of the Slider image 2" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 2 Title: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" class="txt" type="text" name="settings[homepage_slider_title_2]" value="<?= $website_options['homepage_slider_title_2'] ?>" placeholder="Slide Title" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 2 Link: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                     <input style="width: 250px;" class="txt" type="text" name="settings[homepage_slider_url_2]" value="<?= $website_options['homepage_slider_url_2'] ?>" placeholder="http://www.luxbranded.com" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 2 Text: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[homepage_slider_text_2]" class="txt" style="min-width:350px; min-height:150px;"><?= $website_options['homepage_slider_text_2'] ?></textarea>
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:100px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 3 Image: </label><br />
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; height:100px;">
                                    <input type="file" name="homepage_slider_img_3" />
                                    <?php if (!empty($website_options['homepage_slider_img_3'])) : ?>
                                    <img src="/<?= $website_options['homepage_slider_img_3'] ?>"
                                    style="width: auto; max-width: 170px; height: 50px;" alt="Preview of the Slider image 3" />
                                    <?php endif; ?>
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 3 Title: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" class="txt" type="text" name="settings[homepage_slider_title_3]" value="<?= $website_options['homepage_slider_title_3'] ?>" placeholder="Slide Title" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 3 Link: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" class="txt" type="text" name="settings[homepage_slider_url_3]" value="<?= $website_options['homepage_slider_url_3'] ?>" placeholder="http://www.luxbranded.com" />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Homepage Slider 3 Text: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[homepage_slider_text_3]" class="txt" style="min-width:350px; min-height:150px;"><?= $website_options['homepage_slider_text_3'] ?></textarea>
                                </div>
                <div class="clear;"></div>
                </div>

                <div id="general-settings" class="subtab">
                <h2>Activate/Enable Different Versions</h2>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Blog Version (T5): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $check_blog = !empty($website_options['enable_blog']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_blog]"<?= $check_blog ?> />
                                </div>							
				<div class="clear;"></div>
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Opinions (T8): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_opinions = !empty($website_options['enable_opinions']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_opinions]"<?= $checked_opinions ?> />
                                </div>								
								
				<div class="clear;"></div>	

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable E-Commerce Version (T7): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_ecommerce = !empty($website_options['enable_ecommerce']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_ecommerce]"<?= $checked_ecommerce ?> />
                                </div>

				<div class="clear;"></div>				
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Activate Physical Goods: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_physical = !empty($website_options['enable_physical']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_physical]"<?= $checked_physical ?> />
                                </div>
								
				<div class="clear;"></div>
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Activate Services: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_services = !empty($website_options['enable_services']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_services]"<?= $checked_services ?> />
                                </div>								

				<div class="clear;"></div>					

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Events Version (T7): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_events = !empty($website_options['enable_events']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_events]"<?= $checked_events ?> />
                                </div>

                <div class="clear;"></div>					
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Questions Version (T4): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_questions = !empty($website_options['enable_questions']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_questions]"<?= $checked_questions ?> />
                                </div>

                <div class="clear;"></div>		

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Menu (T9): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_menu = !empty($website_options['enable_menu']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_menu]"<?= $checked_menu ?> />
                                </div>

				<div class="clear;"></div>				

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Fundraising Version (T1): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $check_fundraising = !empty($website_options['enable_fundraising']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_fundraising]"<?= $check_fundraising ?> />
                                </div>
				<div class="clear;"></div>
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Activate Fundraising Rewards: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_enable_fundrewards = !empty($website_options['enable_fundrewards']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_fundrewards]"<?= $checked_enable_fundrewards ?> />
                                </div>
                <div class="clear;"></div>
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Backing Amts => Credits: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_backing_payback = !empty($website_options['enable_backing_payback']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_backing_payback]"<?= $checked_backing_payback ?> />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Activate Paypal => Site Owner: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $check_payment = !empty($website_options['enable_payment_to_siteowner']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_payment_to_siteowner]"<?= $check_payment ?> />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Deals Version (T3): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_deals = !empty($website_options['enable_deals']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_deals]"<?= $checked_deals ?> />
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Max Deals Allowed per Biz: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[max_active_deals]" class="txt" value="<?= $website_options['max_active_deals'] ?>" placeholder="3" />
                                </div>

                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Website PayPal E-Mail: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[paypal_email]" class="txt" value="<?= $website_options['paypal_email'] ?>" placeholder="contact@thinapp.co" />
                                </div>

				<div class="clear;"></div>
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Proposals Version (T2): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_proposals = !empty($website_options['enable_proposals']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_proposals]"<?= $checked_proposals ?> />
                                </div>

				<div class="clear;"></div>					

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Default Project Fees (%): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="number" class="txt" style="width: 70px; text-align:center;" name="settings[project_amount_fee]" value="<?= $website_options['project_amount_fee'] ?>" placeholder="10" />
                                </div>

				<div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>- Default Proposal Fees (%): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="number" class="txt" style="width: 70px; text-align:center;" name="settings[proposal_amount_fee]" value="<?= $website_options['proposal_amount_fee'] ?>" placeholder="10" />
                                    <button class="btn btn-blue btn-buck-project user-fees" href="/admin/usersFees"><span class="lbl">Per User Fees &raquo;</span></button>
                                </div>

                <div class="clear;"></div>			
				
                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:normal; text-align:left;">
                                    <label>Activate Realtime GPS: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <?php
                                    $checked_enable_gps = !empty($website_options['enable_gps']) ? " checked='checked'" : "";
                                    ?>
                                    <input type="checkbox" name="settings[enable_gps]"<?= $checked_enable_gps ?> />
                                </div>
								
                <div class="clear;"></div>				

                                <a href="/admin/exportTable"><u>Export Authorize Backing History to csv</u></a>

                <div class="clear;"></div>
                </div>


                <div id="seo-settings" class="subtab">
                <h2>Search Engine / Scripts Settings</h2>

                                <div style="display:inline-block; width:20%; min-width:120px; height:70px; font-weight:bold; text-align:left;">
                                    <label>Website Keywords: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <textarea name="settings[website_keywords]" class="txt" style="width: 350px; height: 150px;"><?= $website_options['website_keywords'] ?></textarea>
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:70px; font-weight:bold; text-align:left;">
                                    <label>Website Description: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <textarea name="settings[website_description]" class="txt" style="width: 350px; height: 150px;"><?= $website_options['website_description'] ?></textarea>
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Facebook URL: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" class="txt" name="settings[facebook_url]" value="<?= $website_options['facebook_url'] ?>" placeholder="http://facebook.com/LuxBrande" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Twitter URL: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" class="txt" name="settings[twitter_url]" value="<?= $website_options['twitter_url'] ?>" placeholder="http://twitter.com/thinapp" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>LinkedIn URL: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" class="txt" name="settings[linkedin_url]" value="<?= $website_options['linkedin_url'] ?>" placeholder="http://linkedin.com/thinapp" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Google+ URL: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" class="txt" name="settings[googleplus_url]" value="<?= $website_options['googleplus_url'] ?>" placeholder="http://plus.google.com/thinapp" /><br />
                                </div>
                <div class="clear;"></div>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Google Analytics Tracking ID: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" class="txt" name="settings[googleanalytics_tracker]" value="<?= $website_options['googleanalytics_tracker'] ?>" placeholder="UA-12345678" /><br />
                                </div><div class="clear;"></div>						
								 <p class="rs description-input"><a href="https://support.google.com/analytics/answer/1032385?hl=en">https://support.google.com/analytics/answer/1032385?hl=en</a></p>								
				<div class="clear;"></div>
								<br />
                                <div style="display:inline-block; width:20%; min-width:120px; font-weight:bold; text-align:left;">
                                    <label style="margin-top:-20px;">Facebook (Connect) App ID: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;"> 
                                    <input style="width: 250px;" type="text" class="txt"  name="settings[facebook_app_id]" value="<?= $website_options['facebook_app_id'] ?>" placeholder="Facebook App ID" /><br />                                    
								</div>
				<div class="clear;"></div>
								<div style="display:inline-block; width:20%; min-width:120px; font-weight:bold; text-align:left;">
                                    <label style="margin-top:-20px;">Facebook Auth Token: </label>
                                </div>
								 <div style="display:inline-block; width:auto; min-width:150px;"> 
									<input style="width: 250px;" type="text" class="txt" name="settings[facebook_app_token]" value="<?= $website_options['facebook_app_token'] ?>" placeholder="Facebook App AUTH TOKEN" /><br />									
								</div>
								<p class="rs description-input">
									Login to Facebook then go <a href="https://developers.facebook.com/docs/apps/register">here</a> for a pretty straight forward How To from Facebook themselves. Step 11 should be the final step.<br />
									<span style="color:#777;">Example App ID:</span> 1670684326485337<br />
									<span style="color:#777;">Example Auth Token:</span> c47b9ca0dde149b8e8a224a030dc433a<br />
									Note: You typically do <u>not</u> need to submit your &ldquo;App&rdquo; for review after finishing. 
								</p>
                <div class="clear;"></div>
                </div>

<div id="text-settings" class="subtab">
    <h2>Text / Content Settings - <span style="font-size:12px;">
		<a href="/filemanager/dialog.php?type=2" class="btn btn-blue" target="_blank">Media Manager</a> 
		<!--<a href="/filemanager/dialog.php?type=0&amp;editor=mce_0">Media Popup</a>-->
		</span>	
	</h2>
	These are updateable sections we&rsquo;ve pre-made so they can quickly be assigned (or moved) to various 
	areas of your site, allowing you to edit those areas very easily.

	<br /><br />
    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Enable Feature 1: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px;">
        <?php $checked_feat1=! empty($website_options[ 'enable_feature_1']) ? " checked='checked'" : ""; ?>
        <input type="checkbox" name="settings[enable_feature_1]" <?= $checked_feat1 ?> />
    </div>

    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Enable Feature 2: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px;">
        <?php $checked_feat2=! empty($website_options[ 'enable_feature_2']) ? " checked='checked'" : ""; ?>
        <input type="checkbox" name="settings[enable_feature_2]" <?= $checked_feat2 ?> />
    </div>

    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Enable Feature 3: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px;">
        <?php $checked_feat3=! empty($website_options[ 'enable_feature_3']) ? " checked='checked'" : ""; ?>
        <input type="checkbox" name="settings[enable_feature_3]" <?= $checked_feat3 ?> />
    </div>

    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Enable Feature 4: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px;">
        <?php $checked_feat4=! empty($website_options[ 'enable_feature_4']) ? " checked='checked'" : ""; ?>
        <input type="checkbox" name="settings[enable_feature_4]" <?= $checked_feat4 ?> />
    </div>

    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Enable Feature 5: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px;">
        <?php $checked_feat5=! empty($website_options[ 'enable_feature_5']) ? " checked='checked'" : ""; ?>
        <input type="checkbox" name="settings[enable_feature_5]" <?= $checked_feat5 ?> />
    </div>

    <div class="clear;"></div>
	
    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Enable Feature 6: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px;">
        <?php $checked_feat6=! empty($website_options[ 'enable_feature_6']) ? " checked='checked'" : ""; ?>
        <input type="checkbox" name="settings[enable_feature_6]" <?= $checked_feat6 ?> />
    </div>

    <div class="clear;"></div>	

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Mobile Embed (inactive): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[mobile_custom_embed]" class="txt" style="min-width:350px; min-height:150px;">
            <?=$website_options['mobile_custom_embed'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 0 (Home page L): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_0]" id="ckeditor1" class="ckeditor" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_0'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>	
	
    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 1 (Home page R): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_1]" id="ckeditor2" class="ckeditor" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_1'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 2 (About): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_2]" id="ckeditor3" class="ckeditor" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_2'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 3 (Contact): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_3]" id="ckeditor4" class="ckeditor" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_3'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>
	
    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 6: </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_6]" id="ckeditor5" class="ckeditor" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_6'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>	

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 4 (About): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_4]" class="txt" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_4'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>

    <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
        <label>Text Area 5 (inactive): </label>
    </div>
    <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
        <textarea name="settings[custom_text_5]" class="txt" style="min-width:350px; min-height:150px;">
            <?=$website_options[ 'custom_text_5'] ?>
        </textarea>
    </div>
    <div class="clear;"></div>
	<br />
	<a href="?editchk" title="Click here to edit Checkout Text">Edit Checkout Text &raquo;</a>
	
</div><!-- END OF TEXT AREA SECTIONS -->

<div id="menu-settings" class="subtab">
    <h2>Custom Menu Items</h2>
	These appear toward the bottom of the mobile slide-out left menu <i>and</i> in the text menu links that appear
	at the top left of all interior pages. <span style="color:red;">Tip: May have to click the red X button twice 
	to delete a menu item.</span>
	<br /><br />
	<link rel="stylesheet" type="text/css" href="/static/css/jquery.domenu-0.95.77.css"/>
	<script src="/static/js/jquery.domenu-0.95.77.js"></script>
	
	<div class="dd" id="domenu-0">
	  <input type="button" class="dd-new-item" value="+" />
	  <li class="dd-item-blueprint">
	    <button type='button' class="collapse" data-action="collapse" type="button" style="display: none;">–</button>
	    <button type='button' class="expand" data-action="expand" type="button" style="display: none;">+</button>
	    <div class="dd-handle dd3-handle">Drag</div>
	    <div class="dd3-content">
	      <span class="item-name">[item_name]</span>
	      <div class="dd-button-container">
	        <button type='button' class="item-add">+</button>
	        <button type='button' class="item-remove" data-confirm-class="item-remove-confirm">&times;</button>
	      </div>
	      <div class="dd-edit-box" style="display: none;">
	        <input type="text" name="title" autocomplete="off" placeholder="Item"
	               data-placeholder=""
	               data-default-value="">
	        
	        <input type="text" name="url" autocomplete="off" placeholder="Item"
	               data-placeholder="URL"
	               data-default-value="">

	        <i class="end-edit">save</i>
	      </div>
	    </div>
	  </li>
	  <ol class="dd-list"></ol>
	</div>
		
	<input id="menujson" name="settings[menu_custom_items]" type="hidden" value="<?= htmlspecialchars($website_options['menu_custom_items']) ?>" />
	
	<script>
// 	$(document).ready(function() {
	  var doMenu = $('#domenu-0').domenu({
	    data: $('#menujson').val() // '[{"title":"Google","url":"http://google.com/"},{"title":"Bing","url":"http://bing.com"}]'
	  }).parseJson().on(['onItemCollapsed', 'onItemExpanded', 'onItemAdded', 'onSaveEditBoxInput', 'onItemDrop', 'onItemDrag', 'onItemRemoved', 'onItemEndEdit'], updateMenu);
	  
	  function updateMenu(a, b, c) {
		  console.log(doMenu);
       	$('#menujson').val(doMenu.toJson());
      }
      
      updateMenu();
// 	});
	</script>
        
    <div class="clear"></div>
</div>


                                <p>
                                    <br />
                                    <input class="btn btn-blue" type="submit" name="save_settings" value="Save Settings" />
                                </p>
                                
                                </form>

                                <div class="clear;"></div>

                                </div><!-- END OF SETTINGS DIV -->
                            </div><!--end: .tab-pane (Website Settings) -->
                        </div>
						
						<!-- ########################## -->
						<!--  NEW ORDERS SECTION  -->
						<!-- ########################## -->								
						
                        <div>
                            <h3 class="rs alternate-tab accordion-label">New Orders <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_orders ?>">
                                <div class="form form-profile" style='width:100%'>

                               <form action="" method="post">

                               <table class="admintable" id="projects_table" style="width: 95%">
                                    <tr><th>ID</th>
									<th>OrderID</th>
									<th>TXID</th>
									<th>Pmt Amt</th>
									<th>Status</th>
									<th>Fulfilled?</th>
                                    <th>Date
                                    <!--<FORM>
                                        <INPUT TYPE="button" onClick="history.go(0)" VALUE="Ref">
                                    </FORM>-->
                                    </th>
                                    <th>Email</th>
									<th>Items</th>
									<th style="display:none;">OrderID</th></tr>

                                    <?php
                                    foreach ($orders as $order) {
                                        if ($order['payment_status'] & FLAG_FULFILLED) {
											$fulfilled = 'checked="checked"';
											$oscolor = '#38BC00';
										} else {
											$fulfilled = '';
											$oscolor = '#ff0000';
										}	
										if($order['payment_status'] == 4){
												$status = 'Fulfilled';
										} else {
												$status = 'Unfulfilled';
										}
										$total 		= "$".$order['payment_amount'];											
										$orderdate	= date( 'm-d-Y', strtotime($order['createdtime']));
										if($order['email'] !=''){
											$custemail = $order['email'];
										} else {
											$custemail = $order['guestemail'];	
										}
                                        echo
                                        "<tr>
                                            <td style='text-align:center; max-width:150px; overflow:hidden; line-height:22px; text-wrap:none'>{$order['id']}</td>
                                            <td style='text-align:center'>{$order['orderid']}</td>
											<td style='text-align:center'>{$order['txnid']}</td>
                                            <td style='text-align:center; font-weight:600'>{$total}</td>
                                            <td style='text-align:center; width:90px; color:{$oscolor}' id='ostatus'>{$status}</td>
											<td style='text-align:center'><input flag='" . FLAG_FULFILLED . "' type='checkbox' name='fulfilled' class='fulfilled' $fulfilled id='{$order['id']}' /></td>                
                                            <td style='text-align:center'>{$orderdate}</td>
                                            <td style='text-align:center'>
											{$custemail}
                                            </td>
                                            <td style='text-align:center;'>
											{$order['creditAmount']}
                                            </td>
                                            </td>
                                            <td style='text-align:center; display:none;'><a href='/orders/{$order['id']}/edit' class='confirm'>edit</a> | <a href='?delete={$order['id']}' class='confirm'>delete</a></td>
                                        </tr>
										<tr>
											<td>&nbsp;</td>
											<td colspan='8' style='background:#f3f3f3; text-shadow:0px 1px 0px #fff;'>
												<strong>CUSTOMER:</strong> {$order['fullname']} <strong>&nbsp;&bull;&nbsp;</strong>
												&nbsp;<strong>ADDRESS:</strong> {$order['address1']} <strong>&nbsp;&bull;&nbsp;</strong> <span style='color:#38BC00'>{$order['address2']}</span> <strong>&nbsp;&bull;&nbsp;</strong> {$order['city']}, {$order['state']} {$order['zip']} <strong>&nbsp;&bull;&nbsp;</strong> <strong>DELIVERY TYPE:</strong> {$order['delivtype']} 
											</td>
										</tr>";
										
										echo "<tr><td>&nbsp;</td><td colspan='8' style='color:#aaa;'><strong>PRODUCTS ORDERED:</strong></td></tr>";
										// Start of Order Items
										foreach ($order['items'] as $item) {
											$itemamt = '$' . $item['payment_amount'];
											// Statements
											echo "<tr>
												<td>&nbsp;</td>
												<td>{$item['itemid']}</td>
												<td style='text-align:center'>{$item['orderid']}</td>
												<td style='text-align:center'>{$itemamt} x {$item['creditAmount']}</td>
											</tr>";
										}
                                    }
                                    ?>


                                </table>
								<br /><br /><br />
                                <input type="submit" value="Submit?" /> &nbsp;
                                </form>

                                </div><div class="clear;"></div>
                            </div><!--end: .tab-pane (Featured) -->
                        </div>		

						<!-- ############################### -->
						<!--   MANAGE TESTIMONIALS SECTION   -->
						<!-- ############################### -->								
						
                        <div>
							<h3 class="rs alternate-tab accordion-label">Testimonials <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_testimonials ?>" style="padding:30px">
							 <h2>Testimonials</h2>
                                <table class="admintable" style="margin:10px;">
                                	<tr><th width="150">Image</th>
									<th width="150">Title</th>
									<th width="300">Testimonial</th>
									<th width="300">Filename</th>
									<th>Actions</th></tr>
                                	<?php
                                	foreach ($testimonials as $tes) {
										echo "<tr>
										<td style='padding:10px;'><img src='/{$tes['image']}' alt='{$tes['title']}' /></td>
										<td style='padding:10px;'>{$tes['title']}</td>
										<td style='padding:10px;'>{$tes['content']}
											<br /><br />
											{$tes['author']}
										</td>
										<td style='padding:10px; overflow:hidden;'>{$tes['image']}</td>
										<td style='padding:10px;'><a href='?tes&edit={$tes['id']}'>edit</a> | <a href='?tes&delete={$tes['id']}' class='confirm'>delete</a></td></tr>";
									}
                                	?>
                                </table>
                                <div style="margin:10px;">
									<a href='?tes&add' class='btn btn-blue'>Add New</a>
								</div>
                            </div><!--end: .tab-pane (Blog Categories) -->
                        </div>						
						
						<!-- ########################## -->
						<!--    MANAGE LOGOS SECTION    -->
						<!-- ########################## -->								
						
                        <div>
							<h3 class="rs alternate-tab accordion-label">Logos <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_logos ?>" style="padding:30px">
							 <h2>Logos</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: .tab-pane (Blog Categories) -->
                        </div>							
												
						<!-- ########################## -->
						<!--  FEATURED CONTENT SECTION  -->
						<!-- ########################## -->								
						
                        <div>
                            <h3 class="rs alternate-tab accordion-label">Featured <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_projects ?>">
                                <div class="form form-profile" style='width:100%'>

                               <form action="exportCsvToPayViaAuthorize" method="post">

                               <table class="admintable" id="projects_table" style="width: 95%">
                                    <tr><th>Title</th><th>Author</th><th>Date Posted</th><th>Feat</th><th>Feat2</th>
                                    <th>Backed | Goal | Paid
                                    <FORM>
                                        <INPUT TYPE="button" onClick="history.go(0)" VALUE="Ref">
                                        </FORM>
                                    </th>

                                    <th>Export</th><th>$ Payout.</th><th>Actions</th></tr>


                                    <?php

                                    foreach ($projects as $project) {
                                        if ($project['is_featured'] & FLAG_FEATURED) {
											$featured = 'checked="checked"';
										} else {
											$featured = '';
										}
										if ($project['is_featured'] & FLAG_STAFFPICK) {
											$staffpick = 'checked="checked"';
										} else {
											$staffpick = '';
										}

										if ($project['backed_amount']>=$project['budget']&FLAG_GOAL) {
											$goal = 'checked="checked"';
										} else {
											$goal = '';
										}
										$todayPay='';

										$backed_amount=$project['backed_amount'];
										
										$ptite = substr($project['title'],0,20).'...';							
										
										if(is_null($backed_amount)){$backed_amount=0.00;}

                                        echo
                                        "<tr>
                                            <td style='max-width:150px; overflow:hidden; line-height:22px; text-wrap:none'>{$ptite}</td>
                                            <td>{$project['user']['name']}</td>
                                            <td>{$project['timestamp_posted']}</td>
                                            <td style='text-align:center'><input flag='" . FLAG_FEATURED . "' type='checkbox' class='featured' $featured id='{$project['id']}' /></td>
                                            <td style='text-align:center'><input flag='" . FLAG_STAFFPICK . "' type='checkbox' class='featured' $staffpick id='{$project['id']}' /></td>
                                            <td>";

                                        echo sprintf("%.2f" . " | ", $backed_amount);
                                       echo  "{$project['budget']} | {$project['already_paid']}</td>
                                            <td style='text-align:center'>

                                             <input id='{$project['id']}' value='{$project['id']}' type='checkbox' name='export_list[]' $goal  />

                                             <input type='hidden' name='backed_amount[]' value='{$project['backed_amount']}'/>
                                             <input type='hidden' name='already_paid[]' value='{$project['already_paid']}'/>
                                            <input type='hidden' name='id[]' value='{$project['id']}'/>
                                            </td>
                                            <td style='text-align:center'>
                                            <input style='width: 100px;' name='todaypay' class='todayPay' value='$todayPay' id='{$project['id']}' /></td>
                                            </td>
                                            <td><a href='/project/{$project['id']}/edit' class='confirm'>edit</a> | <a href='?delete={$project['id']}' class='confirm'>delete</a></td>
                                        </tr>";
                                    }

                                    ?>


                                </table>
								<br />
                                <em>$ Payout = fill this in to pay a different amount than the goal or balance</em><br />
                                <em>Check Export column if you want to add this amount to the csv to be exported to Authorize.net and paid out</em>

                                 <br /><br />
                                 <input type="submit" value="Export to csv" /> &nbsp;
                                 <input id='markpaid' value='' type='checkbox' name='payChecked' />
                                 <label for='markpaid'>Mark as Paid</label>
                                    </form>



                                </div><div class="clear;"></div>
                            </div><!--end: .tab-pane (Featured) -->
                        </div>
                        <!-- <div>
                            <div class="tab-pane accordion-content">
                                Categories
                            </div>
                        </div>
                        -->

						<!-- ########################## -->
						<!--    MANAGE SHOP SECTION     -->
						<!-- ########################## -->								
						
                        <div>
						<h3 class="rs alternate-tab accordion-label">Shop Categories<i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
							<div class="tab-pane accordion-content<?= $active_storecat ?>" style="padding:30px;">
							  <h2>Shop Categories - <a href="/store" title="View Shop page" target="_blank">View Shop page <i class="fa fa-angle-right" aria-hidden="true"></i></a></h2>
                                <table class="admintable" style="margin:10px;">
                                	<tr><th width="150">Image</th><th width="150">Name</th><th width="300">Filename</th><th>Actions</th></tr>
                                	<?php
                                	foreach ($store_categories as $cat) {
										echo "<tr>
												<td style='padding:10px;'><img src='/{$cat['image']}' alt='{$cat['name']}' /></td>
												<td style='padding:10px;'>{$cat['name']}</td>
												<td style='padding:10px;'>{$cat['image']}</td>
												<td style='padding:10px;'><a href='?store_cat&edit={$cat['id']}'>edit</a> | <a href='?store_cat&delete={$cat['id']}' class='confirm'>delete</a></td>
												</tr>";
									}
                                	?>
                                </table>
                                <div style="margin:10px;">
                                    <a href='?store_cat&add' class='btn btn-blue'>Add New</a>
									<a href='/store/add' class='btn btn-blue'>Create New Product</a>
								</div>
                            </div><!--end: .tab-pane (Store Categories) -->
                        </div>
						
						<!-- ########################## -->
						<!-- MANAGE CATEGORIES SECTION  -->
						<!-- ########################## -->								
						
                        <div>
							<h3 class="rs alternate-tab accordion-label">Categories <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_projectcat ?>" style="padding:30px">
							 <h2>Categories - <a href="/categories/all" title="View Categories page" target="_blank">View Categories <i class="fa fa-angle-right" aria-hidden="true"></i></a></h2>
                                <table class="admintable" style="margin:10px;">
                                	<tr><th width="150">Image</th><th width="150">Name</th><th width="300">Filename</th><th>Actions</th></tr>
                                	<?php
                                	foreach ($categories as $cat) {
										echo "<tr>
										<td style='padding:10px;'><img src='/{$cat['image']}' alt='{$cat['title']}' /></td>
										<td style='padding:10px;'>{$cat['title']}</td>
										<td style='padding:10px;'>{$cat['image']}</td>
										<td style='padding:10px;'><a href='?project_cat&edit={$cat['id']}'>edit</a> | <a href='?project_cat&delete={$cat['id']}' class='confirm'>delete</a></td></tr>";
									}
                                	?>
                                </table>
                                <div style="margin:10px;">
									<a href='?project_cat&add' class='btn btn-blue'>Add New</a>
								</div>
                            </div><!--end: .tab-pane (Blog Categories) -->
                        </div>

						<!-- ########################## -->
						<!--   MANAGE PAGES SECTION  	-->
						<!-- ########################## -->		
						
                        <div>
						    <h3 class="rs alternate-tab accordion-label">Manage Pages <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_content ?>" style="padding:10px;">
                            	<table id="pagetable" style="width:100%">
                            		<tr style="border-bottom:1px solid #ddd; height:25px; padding-bottom:5px;">
										<th>PAGE</th>
										<th>CREATED</th>
										<th style="width:70px;">EDIT</th>
									</tr>
	                                <?php

	                                foreach ($pages as $page) {
										echo "<tr style='border-bottom:1px solid #ddd; padding:0px 0;'>
											<td style='padding-right:10px;'><i class='fa fa-pencil-square-o'></i> <a href='?editPage={$page['id']}' target='_blank'>{$page['name']}</a>
											<br />
											by: <a href='/profile/{$page['author']['user_slug']}'>{$page['author']['name']}</a></td>
											<td>{$page['date_created']}
											<br />
											{$page['date_edited']}</td>
											<td>
											<br /><br />
											<i class='fa fa-external-link-square'></i> <a href='/{$page['slug']}' target='_blank'>view</a>
											<br /><br />
											<i class='fa fa-pencil-square-o'></i> <a href='/admin/page/{$page['id']}?edit'>edit</a>
											<br /><br />
											<i class='fa fa-times'></i> <a href='/admin/page/{$page['id']}?delete' class='confirm'>delete</a>
											<br /><br />
                                            <i class='fa fa-envelope'></i> <a href='/admin/page/{$page['id']}?duplicate'>dupe</a>
                                            <br /><br />											
											</td>
										</tr>";
									}

	                                ?>
                                </table>

                                <div style="margin:10px;">
									<input class="btn btn-blue" type="button" value="Add New Page"
									onclick="window.location = '/admin/page/new'" />
								</div>
                                <style>
                                #pagetable th {
                                	text-align: left;
                                }
                                </style>
                            </div><!--end: .tab-pane (Manage Pages) -->
                        </div>

                        <!-- ##################### -->
						<!--  MOBILE APP SECTION -->
						<!-- ########################## -->
						<?php
                        require('views/admin/app-tab.tpl.php');
                        ?>    						
  
                        <!-- ##################### -->
						<!-- NEW JETS SECTION -->
						<!-- ########################## -->
						<?php
                        require('views/admin/jets-tab.tpl.php');
                        ?>                   

						<!-- ########################## -->
						<!-- MANAGE USERS SECTION -->
						<!-- ########################## -->		

                        <div>
                            <h3 class="rs alternate-tab accordion-label">Manage Users <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_manageusers ?>">
                                <div class="form form-profile aif" style='width:auto'>

                                <?php
                                if (empty($inactive_users)) : ?>

                                <p>There are currently no Inactive Users on the platform.</p>

                                <?php
                                else : ?>

                                <table class="admintable" id="projects_table" style="width:100%; overflow:hidden;">
                                    <tr><th>Img</th><th>Name</th><th>Email</th><th>Reg Date</th><th>Actions</th></tr>

                                    <?php
                                    foreach ($inactive_users as $user) : ?>
                                        <tr data-uid="<?= $user['id'] ?>">
                                            <td style="text-align:center;"><img src="<?= $user['image'] ?>" alt="<?= $user['name'] ?> profile picture" style="width: 64px; height: 64px" /></td>
                                            <td><?= $user['name'] ?></td>
                                            <td><?= $user['email'] ?></td>
                                            <td style="text-align:center;"><?= date("Y-m-d h:i:s A", strtotime($user['reg_date'])) ?></td>
                                            <td style="text-align:center;"><a href='/admin/activateUser' class='btn btn-green activate-user'>Approve &raquo;</a></td>
                                        </tr>
                                    <?php
                                    endforeach; ?>

                                </table>

                                <?php
                                endif; ?>

                                </div>
                            </div><!--end: .tab-pane (Approvals) -->
                        </div>

						<!-- ########################## -->
						<!--  APP INTRO/WELCOME SLIDES  -->
						<!-- ########################## -->								

                        <div>
                            <h3 class="rs alternate-tab accordion-label">App Intro Slides <i class="fa fa-caret-down" 
							style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_appintro ?>" style="overflow:hidden;">
                                <div class="form form-profile aif" style="width:auto;">

                                <?php
                                if (empty($featured_accounts)) : ?>

                                <p>There are currently no Featured Sliders that have been uploaded.</p>

                                <?php
                                else : ?>

                                <table class="admintable regl" id="projects_table" style="width:100%;">

                                    <tr><th>Group</th><th>Image</th><th>Content</th></tr>
					
                                    <?php
                                    foreach ($featured_accounts as $featured) : ?>
                                        <tr data-uid="<?= $featured['id'] ?>">
                                            <td style="text-align:center;">
												<?= $featured['ord'] ?><br />
												<?= $featured['slider_group'] ?>
												<br /><br />
												<a href='?featured_accounts&edit=<?= $featured['id'] ?>' class="lgbtn">Edit</a>
												<br /><br />
												<a href='?featured_accounts&delete=<?= $featured['id'] ?>' class='confirm lgbtn'>Delete</a>
											</td>
                                            <td style="width:100px; padding:0px;">
												<img src="/<?= $featured['image'] ?>" alt="Feature Account #<?= $featured['id'] ?>"
												style="max-width: 255px; height: auto; margin:0 0 5px 0; padding:0px;" />
												<br />
												<center>
													<span style="color:#ccc;">Created:<br />
													<?= date("l<\b\\r>m/d/y<\b\\r>h:i A", strtotime($featured['date_created'])) ?>
													</span>
												</center>
											</td>
                                            <td>
												<span style="font-weight:600;"><?= $featured['title'] ?></span><br />
												
												<?= substr($featured['content'],0,50) ?>...
											</td>
                                        </tr>
                                    <?php
                                    endforeach; ?>							
									
                                </table>

                                <?php
                                endif; ?>
									<div style="margin:10px;">
										<a href='?featured_accounts&add' class="btn btn-blue">+ Add New Slide &raquo;</a>
									</div>
                                </div>
                            </div><!--end: .tab-pane (App Intro/Sliders)-->
                        </div>

						<!-- ########################## -->
						<!-- PORTFOLIO GALLERY SECTION  -->
						<!-- ########################## -->							
					
                        <div>
                            <h3 class="rs alternate-tab accordion-label">Portfolio Gallery <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_portfolio ?>" style="overflow:hidden;">
                                <div class="form form-profile aif" style='width:auto;'>
                                <form action="?portfolio" method="post">
                                    <div class="row-item clearfix" style="text-align:left; padding-bottom:10px;">
                                        <label class="lbl" for="txt_name1"
										style="text-align:left; padding-bottom:7px; width:100%; display:block;">Upload Images</label>
										<div class="val" style="margin-left:0px;">
                                            <div>
                                                <div class="fileUpload" rel="/portfolio/upload">
                                                    <span>Upload</span>
                                                    <input type="file" class="upload" data-type="image" />
                                                </div>
                                                <span class="maxsize">(max size: 10MB*)</span>
                                                <div style="clear:both"></div>
                                            </div>
                                            <p class="rs description-input"></p>
                                        </div>
                                    </div>

                                    <p class="wrap-btn-submit rs ta-l" style="padding-top:0px;">
										<button class="btn btn-blue btn-submit-all">Save Pictures</button>
									</p>

                                    <h3>Preview of your Portfolio Gallery</h3>
                                    <?php
                                    foreach ($portfolio_entries as $entry) {
                                        echo "<div style='width:160px; height:130px; margin:0 22px 10px 0; text-align:center; display:inline-block; float:left;'><a href='/{$entry['image']}' class='loginpop' rel='group'><img src='/{$entry['image']}' style='margin:5px 0; margin-right:8px; width:160px' /></a><a href='?portfolioDeleteFile={$entry['upload_id']}'>delete</a></div>";
                                    }
                                    ?>
									<div class="clear"></div>
                                </form>
								
								<style type="text/css">
								.fancybox-overlay {
									/*z-index: 8010;*/
									z-index: 999999999999999;
								}
								.fancybox-wrap, .fancybox-opened { overflow-y: hidden !important; }
								.fancybox-close {
									position: absolute;
									top: -18px;
									right: 0px;
									width: 36px;
									height: 36px;
									cursor: pointer;
									z-index: 8040;
								}
								 .fancybox-next span {
								  left: auto;
								  right: 20px;
								 }
								 .fancybox-prev span {
								  left: 20px;
								 }
								</style>
								
								<br /><br /><br />
                                </div>
                            </div><!--end: .tab-pane (Portfolio) -->
                        </div>
                        
                        <!-- ####### -->
						<!--  FORMS  -->
						<!-- ####### -->								

                        <div>
                            <h3 class="rs alternate-tab accordion-label">Forms <i class="fa fa-caret-down" 
							style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content<?= $active_appintro ?>" style="overflow:hidden;">
                                <div class="form form-forms aif" style="width:auto;">
                                    <!--<link rel="stylesheet" type="text/css" media="screen" 
									href="//formbuilder.online/assets/css/form-builder.min.css">-->

                                    <script src="//formbuilder.online/assets/js/form-builder.min.js"></script>

                                    &nbsp;&nbsp; <a class='editFormLink' href='#editForm'>Edit Form</a> | <a class="viewRecordsLink" href="#customAjaxLoader">View Records</a> | <a href="#" class='deleteRecords'>Delete Records</a>
                                    
                                    <br /><br />
                                    
                                    <div id="fb-editor" style="display:none; height:600px;">
                                    </div>
                                    
                                    <div style="display: none">
                                        <div id="customAjaxLoader" style="max-width: 90%; max-height:90%"></div>
                                    </div>
                                                                                                            
                                    <script>
                                    jQuery(function($) {
                                        $('.deleteRecords').click(function (e) {
                                            e.preventDefault();
                                            
                                            if (confirm("Are you sure you want to erase form records?")) {
                                                $.ajax({
                                                    url: '?deleteFormRecords',
                                                    success: function () {
                                                       alert("Done");
                                                    }
                                                })
                                            }
                                        });
                                        
                                        $('.editFormLink').click(function () {
                                            $('#fb-editor').show();
                                        });
                                        $('.viewRecordsLink').fancybox();
                                        
                                        $('.viewRecordsLink').click(function () {
                                            $.ajax({
                                               url: '?loadFormRecords',
                                               success: function (d) {
                                                   $('#customAjaxLoader').html(d);
                                               }
                                            }); 
                                        });
                                        
                                        var $fbEditor = $(document.getElementById('fb-editor'));
                                        var formData = <?= $form['fields'] ?>;
                                        
                                        if (formData) {
                                            formData = JSON.stringify(formData);
                                        }
                                        
                                        var fbOptions = {};
                                        if (formData && formData != 'undefined') {
                                          fbOptions.formData = formData;
                                        }
                                        var formBuilder = $fbEditor.formBuilder(fbOptions);
                                        $('#fb-editor').on('click', '.save-template', function () {
                                          $.ajax({
                                              url: '?saveForm',
                                              type: 'POST',
                                              data: { formData: formBuilder.formData },
                                              success: function (d) {
                                                  if (d == 'ok') {
                                                      alert("Saved Successfully");
                                                      $.fancybox.close();
                                                  }
//                                                  
                                              }
                                          })
                                          
                                          window.sessionStorage.setItem('formData', formBuilder.formData);
                                          // console.log(window.sessionStorage.getItem('formData'));
                                        });
                                    });
                                    </script>
                                </div>
                            </div><!--end: .tab-pane (App Intro/Sliders)-->
                        </div>

                    </div>

                </div><!--end: .project-tab-detail -->
            </div>
        </div><!--end: .content -->
        <div class="clear"></div>
    </div>

<script>
$('.featured').change(function () {
    $.ajax({
        url: '?setFeatured',
        type: 'post',
        data: {
            id: $(this).attr('id'),
            flag: ($(this).attr('flag')),
            featured: ($(this).attr('checked') == 'checked')
        },
        success: function (d) {
            if (d != 'ok') {
                alert("Unable to update featured status");
            }
        }
    })
});

$('.fulfilled').change(function () {	
	var ischecked = $(this).is(':checked');
    if(!ischecked){
		$.ajax({
			url: '?setFulfilled',
			type: 'post',
			data: {
				id: $(this).attr('id'),
				flag: ($(this).attr('flag')),
				fulfilled: ($(this).attr('checked') == '')
			},
			success: function (d) {
				$('#ostatus').html('<span style="color:#ff0000;">Unfulfilled</span>');
				if (d != 'ok') {
					alert("Unable to update fulfillment status");
				}
			}
		})			
	} else {
		$.ajax({
			url: '?setFulfilled',
			type: 'post',
			data: {
				id: $(this).attr('id'),
				flag: ($(this).attr('flag')),
				fulfilled: ($(this).attr('checked') == 'checked')
			},
			success: function (d) {
				$('#ostatus').html('<span style="color:#38BC00;">Fulfilled</span>');
				if (d != 'ok') {
					alert("Unable to update fulfillment status");
				}
			}
		})		
	}
});

$('.todayPay').change(function () {
    $.ajax({
        url: '?todayPay',
        type: 'post',
        data: {
            id: $(this).attr('id'),
            value: ($(this).attr('value')),
        },
        success: function (d) {
            if (d != 'ok') {
                alert("Unable to update amount_paid ");
            }
        }
    })
});

$(".activate-user").click(function(e)
{
    e.preventDefault();

    var button = $(this);
    var row    = $(this).parents("tr").first();
    var uid    = row.attr("data-uid");
    var url    = $(this).attr("href");
    $.ajax({
        url: url,
        type: "post",
        data: {uid: uid},
        success:function(d) {
            var d = eval(d);

            if (d)
                // activate done.
                row.fadeOut();

        }
    });
    return false;
});

$(".user-fees").each(function()
{
    var href = $(this).attr("href");
    $(this).fancybox({
        'hideOnContentClick': true,
        'width': 1200,
        'height': 550,
        'autoDimensions': false,
        'autoSize': false,
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'speedIn': 500,
        'speedOut': 300,
        'centerOnScroll': true,
        'type': 'ajax',
        'href': href
    });
});

$(function() {	
    //CKEDITOR.config.extraPlugins = 'justify'; 	
	//CKEDITOR.add
    //CKEDITOR.config.contentsCss = '/static/css/my_styles.css?v2';  
	//CKEDITOR.config.extraPlugins = 'ckeditor-gwf-plugin';
	//CKEDITOR.config.font_names = 'GoogleWebFonts';	
});
</script>

<style>
.admintable td, .admintable th {
    padding: 3px;
    border:solid #eee 1px;
}
</style>
<?php
include 'views/_footer.tpl.php';
?>
<!--
6/29/2017 - I commented this out because for some reason it was 
hanging the whole admin update, but I need these so hopefully we can 
just split the Admin up more so only the things needed for the area 
that's needed to be updated can simply be loaded - instead of having 
to load everything.

<script src="/3rdparty/ckeditoradv/ckeditor.js"></script>

<script>
CKEDITOR.replace( 'ckeditor1' ,{
	filebrowserBrowseUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserUploadUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserImageBrowseUrl : '/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>

<script>
CKEDITOR.replace( 'ckeditor2' ,{
	filebrowserBrowseUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserUploadUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserImageBrowseUrl : '/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>

<script>
CKEDITOR.replace( 'ckeditor3' ,{
	filebrowserBrowseUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserUploadUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserImageBrowseUrl : '/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>

<script>
CKEDITOR.replace( 'ckeditor4' ,{
	filebrowserBrowseUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserUploadUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserImageBrowseUrl : '/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>

<script>
CKEDITOR.replace( 'ckeditor5' ,{
	filebrowserBrowseUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserUploadUrl : '/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
	filebrowserImageBrowseUrl : '/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>

-->