<?php
####################################################################################
##                                      WARNING!                                  ##
##                                                                                ##
##             This script is copyrighted to Free Monthly Websites.               ##
##               Duplication, selling, or transferring of this script             ##
##              is a violation of the copyright and purchase agreement.           ##
##                   Please read the Terms and Conditions here:                   ##
##   https://freemonthlywebsites2.com/legal/Copyright_Terms_and_Conditions.pdf    ##
##      Any violation of these terms will be dealt with serious 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/optin_settings.txt";
		
		if($handle = @fopen($filename, 'r')) 
		  {
			 $contents = fread($handle, filesize($filename));
             fclose($handle);
		     $argument_arr=explode("#_1_#",$contents);
			 $optin_arr=explode("#_1_#",$contents);
		  }
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Admin Control Panel</title>
<link href="css/admin_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
#help_text { display:none; }
#help_meta { display:none; }
#help_unit { display:none; }
#help_redirect { display:none; }
#help_disp_aweber { display:none; }
#help_disp_alternate { display:none; }
#help_grlist { display:none; }
#help_grref { display:none; }
#help_prlist { display:none; }
#help_prmeta { display:none; }
#help_wizref { 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;
}
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 = 'gr';
		$(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 = 'ps';
		$(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 = 'aweber';
		$(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 = 'wz';
		$(what_hide+"1").style.display='none';
		$(what_hide+"2").style.display='none';
		$(what_hide+"3").style.display='none';
		$(what_hide+"4").style.display='none';
    }
    return false;
}
</script>
</head>
<body>
<table width="914" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="160" colspan="3" align="center" valign="middle" class="header">
	</td>
  </tr>
  <tr>
    <td colspan="3" align="center" valign="top" class="main_mid"><table width="888" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="3" height="5" class="table_topl">&nbsp;</td>
        <td width="220" height="5" class="table_top">&nbsp;</td>
        <td width="5" class="table_topr">&nbsp;</td>
        <td width="1" rowspan="3">&nbsp;</td>
        <td width="3" class="table_topl">&nbsp;</td>
        <td width="645" class="table_top">&nbsp;</td>
        <td width="5" height="5" class="table_topr">&nbsp;</td>
      </tr>
      <tr>
        <td width="3" class="table_left">&nbsp;</td>
        <td width="220" align="center" valign="top"><table width="215" border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="215" height="80" colspan="2" align="center" valign="middle" class="admin_button"><a href="../" target="_blank"><strong>View Your Website</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="welcome.php"><strong>Home</strong></a></td>
            </tr>
          <tr>
            <td height="60" colspan="2" align="center" valign="middle"><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"><span class="style1">Standard Settings</span><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="admin_settings.php"><strong>Admin Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="personal_settings.php"><strong>Personal Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="website_settings.php"><strong>Basic Website Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="seo_settings.php"><strong>S.E.O Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="theme_settings.php"><strong>Theme Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="advert_settings.php"><strong>Advert Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="affiliate_settings.php"><strong>Affiliate Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="optin_settings.php"><strong>Optin Form Settings</strong></a></td>
          </tr>
          <tr>
            <td height="60" colspan="2" align="center" valign="middle"><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"><span class="style1">Article Settings</span><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="add_content_pages.php"><strong>Add/Remove Article Pages</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="edit_content_pages.php"><strong>Edit Article Pages</strong></a></td>
          </tr>
          <tr>
            <td height="60" colspan="2" align="center" valign="middle"><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"><span class="style1">Other</span><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"></td>
          </tr>

          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="https://freemonthlywebsites2.com/legal/Copyright_Terms_and_Conditions.pdf" target="_blank"><strong>Terms and Conditions</strong></a></td>
          </tr>
          <tr>
            <td height="30" colspan="2" align="center" valign="middle">&nbsp;</td>
            </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="logout.php"><strong>Logout</strong></a></td>
          </tr>
          <tr>
            <td height="30" colspan="2" align="center" valign="middle">&nbsp;</td>
          </tr>
        </table>
        <td width="5" class="table_right">&nbsp;</td>
        <td width="3" class="table_left">&nbsp;</td>
        <td width="645" align="center" valign="top"><table width="645" 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="optin_settings_write">
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="title1">Opt-in Form Settings </td>
            </tr>
            <?php
		if($_REQUEST['flag']==1)
		  {
?>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="title1">&gt;&gt; <span class="style3">Data saved successfully</span> &lt;&lt;</td>
            </tr>
            <?php
		}
?>
            
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><p><br>
                Your   mailing list is a very important part of your website. You can use an autoresponder service like <a href="https://freemonthlywebsites2.com/special/aweber" target="_blank"><u><strong>AWeber</strong></u></a> to collect email addresses in a secure database, which will allow your   visitors to  opt-in to your subscriber list, this will allow you to send   them broadcast and predefined email responses.<br>
                      <br>
                      <a href="https://freemonthlywebsites2.com/special/aweber" target="_blank"><u>An autoresponder service</u></a> will allow you to securely   and safely, send emails to your subscriber list without fear of spam complaints.
                    These emails can include any website updates, product offers, sales, news, tips   and so on.<br>
                    <br>
                    This is a highly recommended service and we urge you not to ignore   this section.
                    <br>
                    <br>
                    </p>
                  </td>
            </tr>
            <tr>
              <td width="245" height="50" align="center" valign="middle" class="main2">Your Optin Introduction Text:</td>
              <td width="400" height="50" align="left" valign="middle" class="main2"><textarea name="text" rows="4" id="text" style="width:280px"><?php echo $argument_arr['0']; ?></textarea>
                <a href="#" onClick="mm_showHide('help_text');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_text">
                  <p><br>
                    This is basically some text explaining to your potential signup exactly what they will get when they sign up with you.<br>
                    <br>
                    It is recommended that you give your visitors a gift or some kind of incentive for signing up. </p>
                <p><strong>example text </strong>: Subscribe to our newsletter for FREE and get a mystery gift. <br>
                      <br>
                      <br>
                  </p>
              </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle" class="main2">Your Optin Confirm URL: </td>
              <td height="50" align="left" valign="middle" class="main2"><input name="redirect" type="text" id="redirect" value="<?php echo $argument_arr['3']; ?>" style="width:280px">
                <a href="#" onClick="mm_showHide('help_redirect');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_redirect">
                  <p><br>
                    This is simply a link to a 'Please confirm your email address' or a 'Thanks for subscribing' page.</p>
                <p>It can be any page you like, autoresponders usually have a 'default' confirmation page. </p>
                <p><strong>Please Note*</strong> <u>Your form may not work if you leave this blank</u>.<br>
                                </p>
                <p><strong>example re-direct url </strong>: https://my_site.com/my_confirm_page.html<br>
                      <br>
                      <br>
                  </p>
              </div></td>
            </tr>
            <tr>
              <td height="90" align="center" valign="middle" class="main2"><label>Select Your Autoresponder</label></td>
              <td height="90" align="left" valign="middle" class="main2">
                <select name="autoresponder" id="autoresponder" onChange="awgr_do_change();">
                <option value="aweber"<?php if($optin_arr['9']=='aweber') echo "selected"; ?>>AWeber</option>
                <option value="gr"<?php if($optin_arr['9']=='gr') echo "selected"; ?>>GetResponse</option>
                <option value="ot" onClick="mm_showHide1('help_disp_alternate');" <?php if($optin_arr['9']=='ot') echo "selected"; ?>>Other</option>
                            </select>
              <script>
                function awgr_do_change()
                {
                	q = document.getElementById('autoresponder');
                	if(q.selectedIndex==0) //AWeber
                	{
                		awgr_show_hide('aweber', 'gr');
		 			    a.style.display='none';						
                	}
                	if(q.selectedIndex==1) //Getresponse
                	{
                		awgr_show_hide('gr', 'aweber');
		 			    a.style.display='none';						
                	}
                	if(q.selectedIndex==2) //Other
                	{
						mm_showHide1('help_disp_alternate');
					}
                }
              	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_hide+"1").style.display='none';
              		$(what_hide+"2").style.display='none';
              		$(what_hide+"3").style.display='none';
              		$(what_hide+"4").style.display='none';
              	}
              	function $(id) { return document.getElementById(id); }
              	//var selected=0; //aveber
              	f=window.onload;
              	window.onload=function() {
              		if(f) f();
              		awgr_do_change();              		
              	};
              	
              </script>                              </td>
            </tr>
            <tr id="aweber3">
              <td height="50" align="center" valign="middle" class="main2">Your Aweber List Name:<br>
                (Unique List ID) </td>
              <td height="50" align="left" valign="middle" class="main2"><input name="unit" type="text" id="unit" value="<?php echo $argument_arr['2']; ?>" style="width:280px">
                <a href="#" onClick="mm_showHide('help_unit');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr id="aweber4">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_unit">
                  <p><br>
                    You can find this  in AWeber &gt; List Options &gt; List Settings (Unique List ID)<br>
                      <br>
                      <br>
                  </p>
                </div></td>
            </tr>
            <tr id="aweber1">
              <td height="50" align="center" valign="middle" class="main2">Your Aweber Meta Web Form ID:</td>
              <td height="50" align="left" valign="middle" class="main2"><input name="meta_web" type="text" value="<?php echo $argument_arr['1']; ?>" style="width:280px">
                <a href="#" onClick="mm_showHide('help_meta');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr id="aweber2">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_meta">
                  <p><br>
                    This setting can be found if you login to Aweber and click on 'Web Forms'<br>
                    and  then click 'Create Web Form', simply create a basic web form and then save it,<br>
                    then click on 'get HTML'.</p>
                  <p>This is not essential, it is purely for tracking purposes.</p>
                  <p><strong>example meta web form id</strong>: 1234567890 <br>
                      <br>
                      <br>
                  </p>
              </div></td>
            </tr>
            <tr id="gr1">
              <td height="50" align="center" valign="middle" class="main2">Your Getresponse Campaign Token:</td>
              <td height="50" align="left" valign="middle" class="main2"><input name="grlist" type="text" id="grlist" value="<?php echo $argument_arr['7']; ?>" style="width:280px">
                <a href="#" onClick="mm_showHide('help_grlist');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr id="gr2">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_grlist">
                  <p><br>
                    This setting can be found in your Getresponse control panel <a href="https://app.getresponse.com/lists" target="_blank">here</a>.<br>
                    Just view the settings of your required list to see the List Token
                      <br>
                      <br>
                  </p>
                  </div></td>
            </tr>
            <tr id="gr3">
              <td></td>
            </tr>
            <tr id="gr4">
              <td></td>
            </tr>
            <tr id="ps1">
              <td></td>
            </tr>
            <tr id="ps2">
              <td></td>
            </tr>
            <tr id="ps3">
              <td></td>
            </tr>
            <tr id="ps4">
              <td></td>
            </tr>
            <tr id="wz1">
              <td></td>
            </tr>
            <tr id="wz2">
              <td></td>
            </tr>
            <tr id="wz3">
              <td></td>
            </tr>
            <tr id="wz4">
              <td></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div align="center" id="help_disp_alternate">Your Alternate Autoresponder Web Form or Javascript:
                <textarea name="form" style="width:500px" rows="12" id="form"><?php echo $argument_arr['5']; ?></textarea>
                      <p><br>
                        This is the HTML optin form or javascript code that you receive from your autoresponder.<br>
                        <br>
                        If you are unsure, then ask your autoresponder service provider where you can get your web form<br>
                        for your website.<br>
                        <br>
                        <br>
                      </p>
                </div></td>
            </tr>
            <tr>
              <td height="50" colspan="2" align="center" valign="bottom" class="main2">&nbsp;</td>
              </tr>
            <tr>
              <td height="50" align="center" valign="middle" class="main2">Display  Optin Signup Form on Website: </td>
              <td height="50" align="left" valign="middle" class="main2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <input name="to_display_form" type="checkbox" id="to_display_form" value="1" <?php
		  if($argument_arr['4']==1)
		  {
			  echo "checked";
		  }
		  ?>>
                <a href="#" onClick="mm_showHide('help_disp_aweber');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_disp_aweber">
                  <p><br>
                    Tick this box to display your optin signup form on your website. <br>
                    <br>
                    <br>
                  </p>
              </div></td>
            </tr>
            
            
            <tr>
              <td width="245" height="50" align="center" valign="middle" class="main2">&nbsp;</td>
              <td width="400" height="50" align="center" valign="middle" class="main2">&nbsp;</td>
            </tr>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="main2"><p>
                  <input type="submit" name="Submit" value="Save Optin Form Settings">
              </p></td>
            </tr>
          </form>
        </table></td>
        <td width="5" class="table_right">&nbsp;</td>
      </tr>
      <tr>
        <td width="3" height="6" class="table_botl">&nbsp;</td>
        <td width="220" height="6" class="table_bot">&nbsp;</td>
        <td width="5" class="table_botr">&nbsp;</td>
        <td width="3" class="table_botl">&nbsp;</td>
        <td width="645" class="table_bot">&nbsp;</td>
        <td width="5" height="6" class="table_botr">&nbsp;</td>
      </tr>
    </table></td>
  </tr> 
  <tr>
    <td height="60" colspan="3" align="center" valign="middle" class="footer">    </td>
  </tr>
  <tr class="footer_bg">
    <td width="8" height="30">&nbsp;</td>
    <td width="898" height="30"><table width="898" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center" valign="middle" class="copyright">Copyright &copy; <a href="https://freemonthlywebsites2.com" target="_blank">Free Monthly Websites 2.0</a>. All Rights Reserved.</td>
      </tr>
      <tr>
        <td align="center" valign="middle" class="powered">Powered By: <a href="https://freemonthlywebsites2.com" target="_blank">Free Monthly Websites 2.0</a></td>
      </tr>
    </table></td>
    <td width="8" height="30">&nbsp;</td>
  </tr>
</table>
</body>
</html>