<?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);

require_once "./includes/init.php";

session_save_path('./sessions');
      session_start();

       if($_SESSION['logged_in']!=true)
	     {
			header("location:index.php?flag=2");
			exit;
	     }
	   $filename="settings/admin_settings.txt";
		
		if($handle = @fopen($filename, 'r')) 
		  {
			 $contents = fread($handle, filesize($filename));
             fclose($handle);
		     $argument_arr=explode("#_1_#",$contents);
		  }
?>
<!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">
<style type="text/css">
<!--
#help_user { display:none; }
#help_pass { display:none; }
#help_name { display:none; }
#help_email { display:none; }
-->
</style>
<script type="text/javascript">
function mm_showHide(id)
{
    a=document.getElementById(id);
    if(a.style.display != 'none' && a.style.display != 'block') a.style.display='none';
    if(a.style.display == 'block') {
        a.style.display='none';
    }
    else {
        a.style.display='block';
    }
    return false;
}
</script>
</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>Admin Settings</strong></div>
      <!--Main -->
      <table width="705" border="0" align="center" cellpadding="0" cellspacing="0">
<script language="JavaScript">
	function chk()
	{
		if(document.frm.user_name.value=="")
		{
			alert("Please enter a unique username.");
			document.frm.user_name.focus();
			return false;
		}
		if(document.frm.password.value=="")
		{
			alert("Please enter a unique password.");
			document.frm.password.focus();
			return false;
		}
	}
          </script>

<form name="frm" action="admin_main_settings.php" method="post" onSubmit="return chk()">
            <input type="hidden" name="do_type" value="admin_settings_write">
            
            <?php
		if(!empty($_REQUEST['flag']) and $_REQUEST['flag']==1)
		  {
?>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="saved">Data saved successfully <img src="images/check-green2.png" width="20" height="20" align="absmiddle" /></td>
            </tr>
            <?php
		}
?>
            <tr>
              <td height="100" colspan="2" align="center" valign="middle"><p>Please enter a unique  Username and Password, this will secure your settings.<br />
                Please choose a memorable  password and never give out your password to anyone.</p>
              <p>Your Name and Email are needed to confirm your 'lost password', should you need to use it.</p></td>
            </tr>
            <tr>
              <td width="300" height="50" align="center" valign="middle">Your Admin Username: </td>
              <td width="405" height="50" align="left" valign="middle"><input name="user_name" type="text" style="width:300px">
                <a href="#" onClick="mm_showHide('help_user');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top"></a> </td>
          </tr>
            <tr>
              <td colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_user">
                Enter a username for login access to your admin control panel.<br />
                This will override any existing username so make sure you make a note of it before saving.
              </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle">Your Admin Password: </td>
              <td height="50" align="left" valign="middle"><input name="password" type="text" style="width:300px">
                <a href="#" onClick="mm_showHide('help_pass');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top"></a> </td>
            </tr>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_pass">
                Enter a password for login access to your admin control panel.<br />
                  This will override any existing password so make sure you make a note of it before saving.
              </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle">Your Full Name: </td>
              <td height="50" align="left" valign="middle"><input name="f_name" type="text" style="width:300px" value="<?php echo empty($argument_arr['2'])?'':$argument_arr['2']; ?>" />
                <a href="#" onClick="mm_showHide('help_name');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top" /></a> </td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_name"> Enter your full name here, this is used when emailing you your lost password. </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle">Your Contact Email Address: </td>
              <td height="50" align="left" valign="middle"><input name="email" type="text" style="width:300px" value="<?php echo empty($argument_arr['3'])?'':$argument_arr['3']; ?>" />
                <a href="#" onClick="mm_showHide('help_email');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top" /></a> </td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_email"> Enter your contact email address here, this is  needed to confirm your lost password, should you need to use it.
                Be sure to enter a valid email address here. </div></td>
            </tr>
            <tr>
              <td height="20" colspan="2" align="center" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle"><p>
                <input type="submit" name="Submit" value="Save Admin Settings" id="submit">
              </p></td>
            </tr>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle">&nbsp;</td>
            </tr>
          </form>
      </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>
