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

<style type="text/css">
.regl a, .regl a:active, .regl. a:visited, .regl:link { color:#0077cc !important; }
.regl a:hover { color:#0000ff; }

a.lgbtn, a.lgbtn:active, a.lgbtn:visited {
	padding:3px; width:50px;	display:inline-block; background:#eee; text-shadow:0px 1px 0px #fff;
	border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;
}
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);
}

ul.subtabs-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
ul.subtabs-list li {
    float: left;
    margin-left: 20px;
    border: 1px solid #eee;
    padding: 5px;
    font-size: 16px;
    background: #fff;
}
ul.subtabs-list li.active {
    background: #eee;
}
div.subtab {
    display: none;
}
div.subtab.active {
    display: block;
}

div.form.form-profile { }

td img { width:100px; }

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

/* ######################### */	
/*       1024px Screens      */
/* ######################### */	
@media (max-width: 1024px) {
	div.form.form-profile { padding:0px; }
}
	
/* ######################### */	
/* Landscape phones and down */
/* ######################### */	

@media (max-width: 480px) {
	.layout-2cols { padding-top:3px; }
	.header-content .header-right {
		border-bottom: 0px solid #d4d4d4;
		padding-bottom: 0px;
	}	
	.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:0px; }
}

</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;">

                    <div class="dashtotals">
	                    Total Purchased: <strong><?= $total_points_purchased ?> ($<?= $total_points_cost ?>)</strong><br />
	                    Total Spent: <strong><?= $total_store_spent ?></strong>
                    </div>

                    <ul class="nav nav-tabs clearfix">
                      <li><a href="#">Settings</a></li>
                      <li class="active"><a href="#">Featured</a></li>
                      <li><a href="#">Store</a></li>
                      <li><a href="#">Categories</a></li>
                      <li><a href="#">CMS</a></li>
                      <li><a href="#">Verified</a></li>
                      <li><a href="#">App Intro/Sliders</a></li>
                    </ul>

                    <div class="tab-content">
                        <div>
                            <h3 class="rs alternate-tab accordion-label">Settings <i class="fa fa-caret-down" style="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" style='width:100%;'>

                <ul class="subtabs-list">
                    <li class="active"><a href="#design-settings">Design</a></li>
                    <li><a href="#homepage-settings">Homepage</a></li>
                    <li><a href="#general-settings">General</a></li>
                    <li><a href="#seo-settings">SEO/Scripts Settings</a></li>
                    <li><a href="#text-settings">Text/Content</a></li>
                    <div class="clear;"></div>
                </ul>
                <div class="clear;"></div><br /><br />

                <div id="design-settings" class="subtab active">
                <h2>Design Settings</h2>

                                <div style="display:inline-block; width:20%; min-width:120px; height:100px; font-weight:bold; text-align:left;">
                                    <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:100px; font-weight:bold; text-align:left;">
                                    <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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo: </label><br />
                                    <small>Recommended Size: 100(W)x110(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:100px; font-weight:bold; text-align:left;">
                                    <label>App Intro Logo: </label><br />
                                    <small>Recommended Size: 500(W)x200(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: 170px; height: 50px;" 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:100px; font-weight:bold; text-align:left;">
                                    <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: 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:100px; font-weight:bold; text-align:left;">
                                    <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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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:100px; font-weight:bold; text-align:left;">
                                    <label>Mobile Logo 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]" 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]" style="min-width:250px;" value="<?= $website_options['website_title'] ?>" placeholder="LuxBrande 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>Contact Form E-Mail: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[contact_email]" value="<?= $website_options['contact_email'] ?>" placeholder="contact@luxbrande.com" />
                                </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]" style="width: 350px; height: 150px;"><?= $website_options['footer_copyright'] ?></textarea>
                                </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;" 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;" 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]" 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;" 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;" 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]" 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;" 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;" 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]" 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>General Settings</h2>

                                <div style="display:inline-block; width:20%; min-width:120px; height:50px; font-weight:bold; text-align:left;">
                                    <label>Enable Proposals: </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:bold; text-align:left;">
                                    <label>Enable Fundraising: </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:bold; text-align:left;">
                                    <label>Enable Paypal Payments to 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: </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:bold; text-align:left;">
                                    <label>Maximum Active Deals Count / Business: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="text" name="settings[max_active_deals]" 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:bold; 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]" value="<?= $website_options['paypal_email'] ?>" placeholder="contact@luxbrande.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>Default Project Fees (%): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="number" style="width: 50px;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:bold; text-align:left;">
                                    <label>Default Proposal Fees (%): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input type="number" style="width: 50px;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>

                                <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 / Integrations 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]" 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]" 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" 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" name="settings[twitter_url]" value="<?= $website_options['twitter_url'] ?>" placeholder="http://twitter.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>LinkedIn URL: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" name="settings[linkedin_url]" value="<?= $website_options['linkedin_url'] ?>" placeholder="http://linkedin.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>Google+ URL: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" name="settings[googleplus_url]" value="<?= $website_options['googleplus_url'] ?>" placeholder="http://plus.google.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>Google Analytics Tracker: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <input style="width: 250px;" type="text" name="settings[googleanalytics_tracker]" value="<?= $website_options['googleanalytics_tracker'] ?>" placeholder="UA-12345678" /><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>Facebook App (Connect): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px;">
                                    <p class="rs description-input">Example App ID: 1670684326485337<br />Example Auth Token: c47b9ca0dde149b8e8a224a030dc433a</p>
                                    <input style="width: 250px;" type="text" name="settings[facebook_app_id]" value="<?= $website_options['facebook_app_id'] ?>" placeholder="Facebook App ID" /><br />
                                    <input style="width: 250px;" type="text" name="settings[facebook_app_token]" value="<?= $website_options['facebook_app_token'] ?>" placeholder="Facebook App AUTH TOKEN" /><br />
                                </div>
                <div class="clear;"></div>
                </div>

                <div id="text-settings" class="subtab">
                <h2>Text / Content</h2>

                                <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>Mobile Embed: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[mobile_custom_embed]" 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>Mobile Customizable Text: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[mobile_custom_text]" class="ckeditor" style="min-width:350px; min-height:150px;"><?= $website_options['mobile_custom_text'] ?></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>Customizable Text 1 (Home page): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[custom_text_1]" 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>Customizable Text 2 (About): </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[custom_text_2]" 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>Customizable Text 3: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[custom_text_3]" 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>Customizable Text 4: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[custom_text_4]" 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>Customizable Text 5: </label>
                                </div>
                                <div style="display:inline-block; width:auto; min-width:150px; margin-bottom:25px;">
                                    <textarea name="settings[custom_text_5]" style="min-width:350px; min-height:150px;"><?= $website_options['custom_text_5'] ?></textarea>
                                </div>
                <div class="clear;"></div>
                </div>

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

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

                                </div><!-- END OF SETTINGS DIV -->
                                </form>
                            </div><!--end: .tab-pane -->
                        </div>
                        <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">
                                <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>
                                    </th><th>Staff Pick</th>
                                    <th>Backed | Goal | Paid
                                    <FORM>
<INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">
</FORM>
                                    </th>

                                    <th>Goal achieved (Export)</th><th>Freshly paid $.</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'];
										if(is_null($backed_amount)){$backed_amount=0.00;}

                                        echo
                                        "<tr>
                                            <td>{$project['title']}</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 />
                                 <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 -->
                        </div>
                        <!-- <div>
                            <div class="tab-pane accordion-content">
                                Categories
                            </div>
                        </div>
                        -->
                        <div>
						<h3 class="rs alternate-tab accordion-label">Store <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content" style="padding:30px;">
                                <table class="admintable" style="margin:10px;">
                                	<tr><th width="150">Name</th><th>Actions</th></tr>
                                	<?php
                                	foreach ($store_categories as $cat) {
										echo "<tr><td>{$cat['name']}</td><td><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>
								</div>
                            </div><!--end: .tab-pane -->
                        </div>
                        <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" style="padding:30px">
                                <table class="admintable" style="margin:10px;">
                                	<tr><th width="150">Name</th><th>Actions</th></tr>
                                	<?php
                                	foreach ($categories as $cat) {
										echo "<tr><td>{$cat['title']}</td><td><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 -->
                        </div>
                        <div>
						    <h3 class="rs alternate-tab accordion-label">CMS <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content" style="padding:30px">
                            	<table id="pagetable" style="width:100%">
                            		<tr><th>Page</th><th>Creator</th><th>Created</th><th>Last</th><th>Edit</th></tr>
	                                <?php

	                                foreach ($pages as $page) {
										echo "<tr style='border-bottom:1px solid #eee; padding:10px 0;'>
											<td><a href='?editPage={$page['id']}'>{$page['name']}</a></td>
											<td><a href='/profile/{$page['author']['user_slug']}'>{$page['author']['name']}</a></td>
											<td>{$page['date_created']}</td>
											<td>{$page['date_edited']}</td>
											<td>
											<br /><br />
											<a href='/{$page['slug']}' target='_blank'>view</a>
											<br /><br />
											<a href='/admin/page/{$page['id']}?edit'>edit</a>
											<br /><br />
											<a href='/admin/page/{$page['id']}?delete' class='confirm'>delete</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 -->
                        </div>

                        <div>
                            <h3 class="rs alternate-tab accordion-label">Users Activations <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content">
                                <div class="form form-profile" style='width:100%'>

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

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

                                <?php
                                else : ?>

                                <table class="admintable" id="projects_table">
                                    <tr><th>Image</th><th>Name</th><th>Email</th><th>Registration</th><th>Actions</th></tr>

                                    <?php
                                    foreach ($inactive_users as $user) : ?>
                                        <tr data-uid="<?= $user['id'] ?>">
                                            <td><img src="<?= $user['image'] ?>" alt="<?= $user['name'] ?> profile picture" style="width: 64px; height: 64px" /></td>
                                            <td><?= $user['name'] ?></td>
                                            <td><?= $user['email'] ?></td>
                                            <td><?= date("Y-m-d h:i:s A", strtotime($user['reg_date'])) ?></td>
                                            <td><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 -->
                        </div>


                        <div>
                            <h3 class="rs alternate-tab accordion-label">App Intro BGs & Featured Sliders <i class="fa fa-caret-down" style="float:right; margin:3px 5px 0 5px;"></i></h3>
                            <div class="tab-pane accordion-content active" style="overflow:hidden;">
                                <div class="form form-profile" 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">
                                    
                                    <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['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 class="tdimg">
												<img src="/<?= $featured['image'] ?>" alt="Feature Account #<?= $featured['id'] ?>" 
												style="max-width: 255px; height: auto; margin-bottom:5px;" />
												<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 />
											<?= $featured['content'] ?></td>                                      
                                        </tr>
                                    <?php
                                    endforeach; ?>

                                </table>

                                <?php
                                endif; ?>
									<div style="margin:10px;">
										<a href='?featured_accounts&add' class="btn btn-blue">+ Add New Slider &raquo;</a>
									</div>
                                </div>
                            </div><!--end: .tab-pane -->
                        </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");
            }
        }
    })
});

$('.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
    });
});
</script>

<style>
.admintable td, .admintable th {
    padding: 3px;
    border:solid #eee 1px;
}
</style>
<?php
include 'views/_footer.tpl.php';
?>

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