<?php
###################################################################
##                           WARNING!                            ##
##                                                               ##
##        THIS SCRIPT IS COPYRIGHTED TO STOREBUILDR.COM          ##
##      DUPLICATING, SELLING OR TRANSFERRING OF THIS SCRIPT      ##
##    IS A VIOLATION OF THE COPYRIGHT AND PURCHASE AGREEMENT     ##
##          PLEASE READ THE TERMS AND CONDITIONS HERE:           ##
##      HTTP://STOREBUILDR.COM/ADMIN-TERMS-AND-CONDITIONS        ##
## ANY VIOLATION OF THESE TERMS WILL BE DEALT WITH LEGAL ACTION! ##
##                                                               ##
###################################################################
error_reporting(0);
ini_set('display_errors','off');
      session_start();

       if($_SESSION[logged_in]!=true)
	     {
			header("location:index.php?flag=2");
			exit;
	     }

	   $filename="settings/sidebar_settings.txt";
		
		if($handle = @fopen($filename, 'r')) 
		  {
			 $contents = fread($handle, filesize($filename));
             fclose($handle);
			 $sidebar_arr=explode("#_1_#",$contents);
		  }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Store Buildr Admin Area</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
#help_title { display:none; }
#help_display_title { display:none; }
#help_content { display:none; }
#none { display:none; }
#help_sidebar { display:none; }
#help_rightside_width { display:none; }
#help_rightside_bg_color { display:none; }
#help_rightside_border_color { display:none; }
#help_rightside_border_width { display:none; }
#help_leftside_width { display:none; }
#help_leftside_bg_color { display:none; }
#help_leftside_border_color { display:none; }
#help_leftside_border_width { display:none; }
#help_rightcontent { display:none; }

-->
</style>
<script src="ckeditor/ckeditor.js"></script>
<script src="js/jscolor.min.js"></script>
<script type="text/javascript">
var cp = new ColorPicker('window');
</script>
<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;
}
function mm_showHide1(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';
		what_hide = 'rightside';
		$(what_hide+"1").style.display='none';
		$(what_hide+"2").style.display='none';
		$(what_hide+"3").style.display='none';
		$(what_hide+"4").style.display='none';
		$(what_hide+"5").style.display='none';
		$(what_hide+"6").style.display='none';
		what_hide = 'leftside';
		$(what_hide+"1").style.display='none';
		$(what_hide+"2").style.display='none';
		$(what_hide+"3").style.display='none';
		$(what_hide+"4").style.display='none';
		$(what_hide+"5").style.display='none';
		$(what_hide+"6").style.display='none';

    }
    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" style="background-color:#5cadcb"><img src="images/logo450.png" width="450" height="96" /></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="10" 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 Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="home_page_settings.php"><b>Home/Main Page Settings</b></a></div></td>
          </tr>
          <tr>
            <td height="30" align="center" valign="middle"><div id="link"><a id="link" href="sidebar_settings.php"><b>Sidebar 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="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="10" 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 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>
<!--Side Nav -->
    <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>Sidebar Settings </strong></div>
      <!--Main -->
      <table width="705" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="frm" action="file_io.php" method="post" onSubmit="return chk()">
            <input type="hidden" name="do_type" value="sidebar_settings_write">
            
            <?php
		if($_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="20" colspan="2" align="center" valign="middle">&nbsp;</td>
          </tr>
            
            <tr>
              <td width="300" height="50" align="right" valign="middle">Display a Sidebar?:&nbsp;&nbsp;</td>
              <td width="405" height="50" align="left" valign="middle"><select name="sidebar" id="sidebar" onChange="awgr_do_change();">
                <option value="rightside"<?php if($sidebar_arr[0]=='rightside') echo "selected"; ?>>Display Right Sidebar</option>
                <option value="leftside"<?php if($sidebar_arr[0]=='leftside') echo "selected"; ?>>Display Left Sidebar</option>
                <option value="none"<?php if($sidebar_arr[0]=='none') echo "selected"; ?>>Do Not Display Sidebar</option>
                </select>
              <script>
                function awgr_do_change()
                {
                	q = document.getElementById('sidebar');
                	if(q.selectedIndex==0) //rightside
                	{
						awgr_show_hide('rightside', 'leftside');
		 			    a.style.display='none';						
                	}
                	if(q.selectedIndex==1) //leftside
                	{
                		awgr_show_hide('leftside', 'rightside');
		 			    a.style.display='none';						
                	}
					if(q.selectedIndex==2) //none
                	{
						mm_showHide1('none');
					}
                	
                }
              	function awgr_show_hide(what_show, what_hide)
              	{
              		
              		$(what_show+"1").style.display='table-row';
              		$(what_show+"2").style.display='table-row';
					$(what_show+"3").style.display='table-row';
					$(what_show+"4").style.display='table-row';
					$(what_show+"5").style.display='table-row';
					$(what_show+"6").style.display='table-row';

              		$(what_hide+"1").style.display='none';
              		$(what_hide+"2").style.display='none';
					$(what_hide+"3").style.display='none';
					$(what_hide+"4").style.display='none';
					$(what_hide+"5").style.display='none';
					$(what_hide+"6").style.display='none';

              	}
              	function $(id) { return document.getElementById(id); }
              	f=window.onload;
              	window.onload=function() {
              		if(f) f();
              		awgr_do_change();              		
              	};
              	
              </script><a href="#" onclick="mm_showHide('help_sidebar');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_sidebar">Select whether to display a right sidebar, left sidebar or no sidebar. </div></td>
            </tr>
            <tr id="rightside1">
              <td height="50" align="right" valign="middle">Right Sidebar Width (in %):&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input style="width:40px" name="rightside_width" value="<?php echo $sidebar_arr[1]; ?>" />
            %<a href="#" onclick="mm_showHide('help_rightside_width');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_rightside_width">Select the width of your right sidebar in %. </div></td>
            </tr>
            <tr id="rightside2">
              <td height="50" align="right" valign="middle">Right Sidebar Background Color:&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input name="rightside_bg_color" class="jscolor" value="<?php echo "#",$sidebar_arr[2]; ?>" /><a href="#" onclick="mm_showHide('help_rightside_bg_color');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_rightside_bg_color">Select the color you wish to have for your right sidebar background.</div></td>
            </tr>
            <tr id="rightside3">
              <td height="50" align="right" valign="middle">Right Sidebar Border Color:&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input name="rightside_border_color" class="jscolor" value="<?php echo "#",$sidebar_arr[3]; ?>" /><a href="#" onclick="mm_showHide('help_rightside_border_color');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_rightside_border_color">Select the color you wish to have for your right sidebar border. </div></td>
            </tr>
            <tr id="rightside4">
              <td height="50" align="right" valign="middle">Right Sidebar Border Width (in pixels):&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input style="width:40px" name="rightside_border_width" value="<?php echo $sidebar_arr[4]; ?>" />
              px<a href="#" onclick="mm_showHide('help_rightside_border_width');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_rightside_border_width">Select the width of your right sidebar border in pixels, use 0 for no border. </div></td>
            </tr>
            <tr id="leftside1">
              <td height="50" align="right" valign="middle">Left Sidebar Width (in %):&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input style="width:40px" name="leftside_width" value="<?php echo $sidebar_arr[5]; ?>" />
            %<a href="#" onclick="mm_showHide('help_leftside_width');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_leftside_width">Select the width of your left sidebar in %. </div></td>
            </tr>
            <tr id="leftside2">
              <td height="50" align="right" valign="middle">Left Sidebar Background Color:&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input name="leftside_bg_color" class="jscolor" value="<?php echo "#",$sidebar_arr[6]; ?>" /><a href="#" onclick="mm_showHide('help_leftside_bg_color');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_leftside_bg_color">Select the color you wish to have for your left sidebar background.</div></td>
            </tr>
            <tr id="leftside3">
              <td height="50" align="right" valign="middle">Left Sidebar Border Color:&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input name="leftside_border_color" class="jscolor" value="<?php echo "#",$sidebar_arr[7]; ?>" /><a href="#" onclick="mm_showHide('help_leftside_border_color');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_leftside_border_color">Select the color you wish to have for your left sidebar border. </div></td>
            </tr>
            <tr id="leftside4">
              <td height="50" align="right" valign="middle">Left Sidebar Border Width (in pixels):&nbsp;&nbsp;</td>
            <td height="50" align="left" valign="middle"><input style="width:40px" name="leftside_border_width" value="<?php echo $sidebar_arr[8]; ?>" />
              px<a href="#" onclick="mm_showHide('help_leftside_border_width');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top" /></a></td>
            </tr>
            <tr id="none">
              <td colspan="2" align="center" valign="middle"></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_leftside_border_width">Select the width of your left sidebar border in pixels, use 0 for no border. </div></td>
            </tr>
            
            <tr id="leftside5">
              <td height="50" colspan="2" align="center" valign="middle">Left Sidebar Content: <a href="#" onclick="mm_showHide('help_content');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_content">Enter your content for your left sidebar here using the WYSIWYG editor.
                  <br />
                There is no limit to the amount of information you place here but we suggest you add a little at a time and keep checking your page to make sure it looks OK.<br />
                If you would like to place adverts or any other code in this section then be sure to click on the <img src="images/source.png" width="59" height="22" align="absmiddle" /> button in the WYSIWYG editor and paste your code in 'source' view.<br />
                If you would like to promote InstantAzon in your sidebar via an image, you can find all the images you need, along with your affiliate link <a style="color:#0099FF" href="http://instant-azon.com/jv/" target="_blank">here</a>.<br />
                    <br />
                    We also recommend that if you are pasting a block of text in here, you paste your text in a basic notepad document first, then copy from there to here, so that it
                  removes all the hidden formatting and makes it simpler for you to edit.<br />
Use the WYSIWYG editor below to easily format your text.
              </div></td>
            </tr>
            <tr id="leftside6">
              <td height="50" colspan="2" align="center" valign="middle">
<table width="705" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top">
<textarea style="width:705px" name="leftcontent" rows="4" id="leftcontent" class="main_text"><?php echo $sidebar_arr[9]; ?></textarea>
<script>
			CKEDITOR.replace( 'leftcontent' );
		</script></td>
  </tr>
</table></td>
            </tr>
            
            
            <tr id="rightside5">
              <td height="50" colspan="2" align="center" valign="middle">Right Sidebar Content: <a href="#" onclick="mm_showHide('help_rightcontent');return false;"><img src="images/help.png" width="20" height="20" hspace="8" border="0" align="top" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle"><div class="userhelp_cell" id="help_rightcontent">Enter your content for your right sidebar here using the WYSIWYG editor.
                  <br />
                There is no limit to the amount of information you place here but we suggest you add a little at a time and keep checking your page to make sure it looks OK.<br />
        If you would like to place adverts or any other code in this section then be sure to click on the <img src="images/source.png" width="59" height="22" align="absmiddle" /> button in the WYSIWYG editor and paste your code in 'source' view.<br />
If you would like to promote InstantAzon in your sidebar via an image, you can find all the images you need, along with your affiliate link <a style="color:#0099FF" href="http://instant-azon.com/jv/" target="_blank">here</a>.<br />
                    <br />
                    We also recommend that if you are pasting a block of text in here, you paste your text in a basic notepad document first, then copy from there to here, so that it
                  removes all the hidden formatting and makes it simpler for you to edit.<br />
Use the WYSIWYG editor below to easily format your text.
              </div></td>
            </tr>
            <tr id="rightside6">
              <td height="50" colspan="2" align="center" valign="middle">
<table width="705" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top">
<textarea style="width:705px;" name="rightcontent" rows="4" id="rightcontent" class="main_text"><?php echo $sidebar_arr[10]; ?></textarea>
<script>
			CKEDITOR.replace( 'rightcontent' );
		</script></td>
  </tr>
</table></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 Sidebar 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 StoreBuildr.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>, StoreBuildr.com. All Rights Reserved.</strong></span></div>
</body>
</html>
