<?php
###################################################################
##                           WARNING!                            ##
##                                                               ##
##         THIS SCRIPT IS COPYRIGHTED TO EASYBUILDR.COM          ##
##      DUPLICATING, SELLING OR TRANSFERRING OF THIS SCRIPT      ##
##    IS A VIOLATION OF THE COPYRIGHT AND PURCHASE AGREEMENT     ##
##          PLEASE READ THE TERMS AND CONDITIONS HERE:           ##
##            https://easybuildr.com/members/terms/              ##
## ANY VIOLATION OF THESE TERMS WILL BE DEALT WITH LEGAL ACTION! ##
###################################################################
error_reporting(E_ERROR);
ini_set('display_errors',1);
session_save_path('./sessions');
session_start();

require_once "./includes/init.php";

if( $_SESSION['logged_in'] != true ){
    header("location:index.php?flag=2");
    exit;
}
		 
if ( isset( $_GET[ 'download_backup' ] ) ){
    require_once './upgrade/config.php';
	require_once './upgrade/upgrade.php';
	$upgrader = new Upgrader( $config );
	$upgrader->getBackupInfo();

	$file_name = dirname( __FILE__  ) . '/upgrade/backup/website-backup.zip';
	header( 'Content-type: application/zip' ); 
	header( 'Content-Disposition: attachment; filename=website-backup.zip' );
	header( 'Content-length: ' . filesize( $file_name ) );
	header( 'Pragma: no-cache' ); 
	header( 'Expires: 0' ); 
	readfile( $file_name );
	exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Easy Page Buildr Admin Area</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="table_border">
  <tr>
    <td colspan="2" align="left" valign="top"><div align="center" class="header_bg"><img src="images/logo.png" width="597" height="77" /></div></td>
  </tr>
  <tr>
    <td width="250" align="center" valign="top" style="padding-left:10px; padding-right:10px; padding-top:20px; padding-bottom:20px">
<!--Side Nav -->
        <table width="250" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="center" valign="middle"></td>
          </tr>
          <tr>
            <td align="center" valign="middle"><div class="members_title"><strong>Navigation</strong></div></td>
          </tr>
          <tr>
            <td height="10" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a href="../" target="_blank" id="link"><b>View Your Website</b></a></div></td>
          </tr>
          <tr>
            <td height="20" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="welcome.php"><b>Home</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="admin_settings.php"><b>Admin Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="design_settings.php"><b>Design/Basic Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="sales_page_settings.php"><b>Sales Page Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="optin_settings.php"><b>Optin Page Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="download_page_settings.php"><b>Download Page Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="10" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="jv_page_settings.php"><b>Affiliate Page Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="20" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="add_content_pages.php"><b>Add/Remove Pages</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="edit_content_pages.php"><b>Edit Pages</b></a></div></td>
          </tr>
          <tr>
            <td height="20" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="privacy_terms_settings.php"><b>Privacy/Terms Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="20" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="seo_settings.php"><b>S.E.O/CSS/Script Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="10" align="center" valign="middle"></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="logout.php"><b>Log Out</b></a></div></td>
          </tr>
          <tr>
            <td align="center" valign="middle"></td>
          </tr>
        </table>
<!--Side Nav -->
    </td>

    <td width="706" align="left" valign="top" style="padding-left:10px; padding-right:10px; padding-top:20px; padding-bottom:20px"><div class="members_title"><strong>Welcome to Your Website Admin Area!</strong></div>

<?php require "./upgrader.php"; ?>	
      <p align="center">
<!--Main -->
<!--Admin-Welcome -->
<div id="target"></div>
 <div align="center">
  <?php
function get_data($url) {
	$ch = curl_init();
	$timeout = 5;
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	$data = curl_exec($ch);
	curl_close($ch);
	return $data;
}
 $returned_content = get_data('https://easybuildr.com/feeds/admin-welcome.php');
  echo $returned_content;
?>
 </div>
   <!--Admin-Welcome -->
 <p>We've made this as simple as possible for you to edit every aspect of your website, with the use of our very special admin area. Simply use the navigation to edit your individual settings.</p>
 <p>If you ever need to backup your entire website, you can do that any time from <a href="welcome.php?download_backup=1">here</a>.</p>
 <p>You'll find  tool tips included in the admin area, just click on the <span style="color: #FFFFFF"><b style="background-color:#000000">&nbsp;?&nbsp;</b></span> for help in each section. </p>
 <p align="left">If you'd like to be kept upto date with the latest updates, please enter your details below:</p>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="332" align="center" valign="top"><p class="optin-text">Enter your name and email below and we'll keep you updated when new versions are available and updates added!</p>
<!--Easy Page Buildr Updates -->
<form method="post" class="af-form-wrapper" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
<div style="display: none;">
<input type="hidden" name="meta_web_form_id" value="" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="awlist5639552" />
<input type="hidden" name="redirect" value="https://easybuildr.com/confirmed" />
<input type="hidden" name="meta_redirect_onlist" value="https://easybuildr.com/confirmed">
<input type="hidden" name="meta_adtracking" value="" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="name,email" />
<input type="hidden" name="meta_tooltip" value="" />
</div>      
        <input name="name" type="text" class="optin-input" value="Enter your first name here..." onFocus=" if (this.value == 'Enter your first name here...') { this.value = ''; }" onBlur="if (this.value == '') { this.value='Enter your first name here...';} " />
        
        <input name="email" type="text" class="optin-input" value="Enter your best email here..." onFocus=" if (this.value == 'Enter your best email here...') { this.value = ''; }" onBlur="if (this.value == '') { this.value='Enter your best email here...';} " />
        <input name="Submit" type="submit" value="Keep me in The Loop!" id="optin-button" />
    </form>
<!--Easy Page Buildr Updates -->
    </td>
            </tr>
      </table>


	  
<!--Main --></td>
  </tr>
</table>
<div align="center"><span class="footer_policy">No part of this website may be reproduced or transmitted in any form or by any means without written permission from EasyBuildr.com<br />
        <strong>Copyright
<script type="text/javascript" language="JavaScript">function getCorrectedYear(year) {
year = year - 0;
if (year < 70) return (2000 + year);
if (year < 1900) return (1900 + year);
return year;
}
var lmod = new Date();
var yearstr = getCorrectedYear(lmod.getYear());
document.write(yearstr);
// -->
</script>, EasyBuildr.com. All Rights Reserved.</strong></span></div>
</body>
</html>
