<?php
touch("./infusion-config.php");
include "./infusion-config.php";

//echo $infusion_key;
//echo $infusion_app;
/*
$connInfo = array('ekaram:ekaram:i:9b01a5fcaae1dc3eedae55dc60204015:This is the connection for applicationName.infusionsoft.com');
*/

?>
</head><title>CBFuse - Application Setup</title>
<link href="//apps.ekaram.net/styles/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="//apps.ekaram.net/styles/css/bootstrap-responsive.css" rel="stylesheet">
<alink href="//apps.ekaram.net/styles/css/bureau.min.css" rel="stylesheet">

</head>


 <body>

<div class="page-header">
<center><h1>Infusionsoft Application and <br>Clickbank Account Setup</h1></center>
</div>    
      <center> <table style="width:600px;" class="table table-striped table-hover">

        <!-- New row -->
     
 
   <form action="editinfusion.php" method="post">
   	<tr><td>
Infusion App Name:</td><td>	<input name="infusion_app" value="<? if (isset($_REQUEST['infusion_app'])) echo $_REQUEST['infusion_app']; else echo "$infusion_app";?>">.infusionsoft.com
</td><td></td></tr>
<tr><td>
Infusion API Key:</td><td>	<input style="width:300px;"  name="infusion_key"value="<? if (isset($_REQUEST['infusion_key'])) echo $_REQUEST['infusion_key']; else echo "$infusion_key";?>">
<td></td>
</td></tr>


	<tr><td>
Clickbank Secret Key:</td><td>	<input style="width:300px;"  name="cbsecret_key"value="<? if (isset($_REQUEST['cbsecret_key'])) echo $_REQUEST['cbsecret_key']; else echo "$cbsecret_key";?>">
<td></td>
</tr>



<tr><td>
Clickbank Notification URL:</td><td>  <input style="width:350px;"  readonly name="cbnotification_url" value="https://www.cbfuse.com/aksidkkdo/dok938dk.php">
<td></td>
</td></tr>


<tr><td></td><td>

	         <div style="float:left"><input type="submit" class="btn btn-success" value="Save">
           </form></div>
           <div style="float:right"><form action="./config.php" name="goback">
            <input type="submit" value="Go Back" class="btn btn-danger"></form></div>

           </td><td></td></tr>


          

</form>

      </table>
<center>

</center>


<?

if (!isset($_REQUEST[infusion_app])) {
    

?>

<?
}
else
{
?>

<?

$infusion_app=$_REQUEST['infusion_app'];
$infusion_key=$_REQUEST['infusion_key'];
$cbsecret_key=$_REQUEST['cbsecret_key'];


$fp = fopen("./infusion-config.php", "w");


$file_data= "


<?php
$"."infusion_app='$infusion_app';
$"."infusion_key='$infusion_key';
$"."cbsecret_key='$cbsecret_key';
?>
";

fputs($fp,$file_data);

fclose($fp) or die ("Error closing file!");

echo "Done...";
}
?>
