<?php

session_start();
include "../config.php";
include "../header.php";
include "../style.php";
if( isset($_SESSION["alogin"]) ) {

?><table>

<tr>

<td width="15%" valign=top><br>

<? include("adminnavigation.php"); ?>

</td>

<td valign="top" align="center" width="5%">

<td valign="top" align="center" ><br><br> <?

echo "<font size=2 face='$fonttype' color='$fontcolour'><p><center>";

if ($action=="save") {


$update1=mysql_query("update settings set setting='".dbput($sitenamep)."' where name='sitename'");
$update2=mysql_query("update settings set setting='".dbput($domainp)."' where name='domain'");
$update3=mysql_query("update settings set setting='".dbput($adminpwp)."' where name='adminpw'");
$update4=mysql_query("update settings set setting='".dbput($adminemailp)."' where name='adminemail'");
$update5=mysql_query("update settings set setting='".dbput($paypalp)."' where name='paypal'");
$update6=mysql_query("update settings set setting='".dbput($safepay_emailp)."' where name='safepay_email'");
$update7=mysql_query("update settings set setting='".dbput($safepay_passphrasep)."' where name='safepay_passphrase'");
$update8=mysql_query("update settings set setting='".dbput($moneybookers_emailp)."' where name='moneybookers_email'");
$update9=mysql_query("update settings set setting='".dbput($moneybookers_idp)."' where name='moneybookers_id'");
$update10=mysql_query("update settings set setting='".serialize($pay_withp)."' where name='pay_with'");
$update11=mysql_query("update settings set setting='".dbput($jvsignupp)."' where name='jvsignup'");
//$update12=mysql_query("update settings set setting='".dbput($buttondisplayp)."' where name='buttondisplay'");
$update13=mysql_query("update settings set setting='".dbput($basecolourp)."' where name='basecolour'") ;
$update14=mysql_query("update settings set setting='".dbput($contrastcolourp)."' where name='contrastcolour'");
$update15=mysql_query("update settings set setting='".dbput($fonttypep)."' where name='fonttype'");
$update16=mysql_query("update settings set setting='".dbput($fontcolourp)."' where name='fontcolour'");
$update17=mysql_query("update settings set setting='".dbput($adminnamep)."' where name='adminname'");
$update18=mysql_query("update settings set setting='".dbput($adminaddressp)."' where name='adminaddress'");
$update19=mysql_query("update settings set setting='".dbput($conteststartp)."' where name='conteststart'");
$update20=mysql_query("update settings set setting='".dbput($alertpayp)."' where name='alertpay'");
$update21=mysql_query("update settings set setting='".dbput($seccodep)."' where name='seccode'");
$update22=mysql_query("update settings set setting='".dbput($nav_bgp)."' where name='nav_bg'");	
$update23=mysql_query("update settings set setting='".dbput($nav_hoverp)."' where name='nav_hover'");	
$update24=mysql_query("update settings set setting='".dbput($nav_textp)."' where name='nav_text'");	
$update25=mysql_query("update settings set setting='".dbput($drawingp)."' where name='drawing'");
$update26=mysql_query("update settings set setting='".dbput($drawwinnerp)."' where name='drawwinner'");
$update27=mysql_query("update settings set setting='".dbput($drawpricep)."' where name='drawprice'");;
//$update28=mysql_query("update settings set setting='".dbput($linkgoodp)."' where name='linkgood'");
$update29=mysql_query("update settings set setting='".dbput($pointratep)."' where name='pointrate'");
$update30=mysql_query("update settings set setting='".dbput($adminnoticep)."' where name='adminnotice'");
//$update31=mysql_query("update settings set setting='".dbput($linksgoodp)."' where name='linksgood'");
$update45=mysql_query("update settings set setting='".dbput($backupemailp)."' where name='backupemail'");
$update45=mysql_query("update settings set setting='".dbput($backuptofolderp)."' where name='backuptofolder'");
$update33=mysql_query("update settings set setting='$stripep' where name='stripe'");
$update34=mysql_query("update settings set setting='$stripeptcp' where name='stripeptc'");
$update35=mysql_query("update settings set setting='$stripeurlp' where name='stripeurl'");
$update36=mysql_query("update settings set setting='".dbput($sjvjvboxes)."' where name='sjvjvinfo'");



echo "<p><b>Your settings have been saved.</b></p>";
echo '<head> <META HTTP-EQUIV="Refresh"CONTENT="1; URL=siteprofile.php"></head>';

}

else {

?>

<H2><? echo $sitename; ?> Site Profile Settings</H2>

<p>Is is absolutely vital you set this up first before doing anything else.<br>You can change your settings at any time you wish.</p>

<form method="GET" action="siteprofile.php">

<input type="hidden" name="action" value="save">

<center>

<hr>

<p><b>Site settings</b></p>

Sitename<br>

<input type="text" name="sitenamep" value="<? echo $sitename; ?>"><br><br>

The url to where your script is installed including http:// (no trailing '/')<br>

<input type="text" name="domainp" value="<? echo $domain; ?>"><br><br>


The url that Stripe will use to connect for payments.<br>Same as url above, but MUST be https:// (no trailing '/')<br>

<input type="text" name="stripeurlp" value="<? echo $stripeurl; ?>"><br><br>


Admin password<br>

<input type="text" name="adminpwp" value="<? echo $adminpw; ?>"><br><br>

Admin name<br>

<input type="text" name="adminnamep" value="<? echo $adminname; ?>"><br><br>

Admin address<br>

<input type="text" name="adminaddressp" value="<? echo $adminaddress; ?>"><br><br>

Admin contact email<br><font color="red">MUST be site domain name based only! - No Gmail, Yahoo etc.</font><br>

<input type="text" name="adminemailp" value="<? echo $adminemail; ?>"><br><br>

Your Primary PayPal email <br>

<input type="text" name="paypalp" value="<? echo $paypal; ?>"> <br><br>

Your Payza email (leave blank if you do not wish to offer Payza as a payment method)<br>

You must put this url as the IPN: <? echo $domain; ?>/Payza_ipn.php<br>

<input type="text" name="alertpayp" value="<? echo $alertpay; ?>"> <br><br>

Your Payza security code<br>

<input type="text" name="seccodep" value="<? echo $seccode; ?>"> <br><br>

Your Safepay username (leave blank if you do not wish to offer safepay as a payment method)<br>

<input type="text" name="safepay_emailp" value="<? echo $safepay_email; ?>"> <br><br>



Your Safepay security passphrase (encrypted)<br>

<input type="text" name="safepay_passphrasep" value="<? echo $safepay_passphrase; ?>"> <br><br>

Your Moneybookers email (leave blank if you do not wish to offer moneybookers as a payment method)<br>

<input type="text" name="moneybookers_emailp" value="<? echo $moneybookers_email; ?>"> <br><br>

Your Moneybookers account id<br>

<input type="text" name="moneybookers_idp" value="<? echo $moneybookers_id; ?>"> <br><br>

To Enable Stripe<br>(Only Enter 1 or leave blank to enable/disable Stripe.<br>This only enables the payment buttons!)<br><font color="red">You MUST enter your sk/pk keys in the Stripe/syek.php folder before use.<br>DO NOT enter any other information in this box because it won't work!</font><br>
<input type="text" name="stripep" value="<? echo $stripe; ?>"> <br><br>

Enable Stripe PTC (Enter 1 or leave blank to enable/disable Stripe PTC)<br>
<font color="red">It is NOT adviseable to enable this as it's against Stripes Terms Of Service</font><br>
<input type="text" name="stripeptcp" value="<? echo $stripeptc; ?>"> <br><br>

Pay members commissions with<br>

<input type="checkbox" name="pay_withp[paypal]" value="1"<? if($pay_with['paypal']) echo " CHECKED"; ?>> Paypal<br>

<input type="checkbox" name="pay_withp[alertpay]" value="1"<? if($pay_with['alertpay']) echo " CHECKED"; ?>> Cash App<br>

<input type="checkbox" name="pay_withp[safepay]" value="1"<? if($pay_with['safepay']) echo " CHECKED"; ?>> Zelle Pay<br>

<input type="checkbox" name="pay_withp[moneybookers]" value="1"<? if($pay_with['moneybookers']) echo " CHECKED"; ?>> Wise<br>

<br><br>



Set signups as JV members<br>

<input type="radio" name="jvsignupp" value="1"<? if($jvsignup) echo " CHECKED"; ?>> Yes <input type="radio" name="jvsignupp" value="0"<? if(!$jvsignup) echo " CHECKED"; ?>> No <br><br>


Disable Main Index SJV and JV Information Boxes<br>
(Only works when "Set signups as JV members" is set to No)<br>

<input type="radio" name="sjvjvboxes" value="1"<? if($sjvjvinfo) echo " CHECKED"; ?>> Yes <input type="radio" name="sjvjvboxes" value="0"<? if(!$sjvjvinfo) echo " CHECKED"; ?>> No <br><br><br>       

Referral Contest Date<br>

<input type="text" name="conteststartp" value="<? echo $conteststart; ?>"><br><br>




Commission exchange rate<br>

1$ = <input type="text" name="pointratep" value="<? echo $pointrate; ?>"> points<br><br>

Notify Admin On New Signup<br>
<input type="radio" name="adminnoticep" value="1"<? if($adminnotice) echo " CHECKED"; ?>> Yes <input type="radio" name="adminnoticep" value="0"<? if(!$adminnotice) echo " CHECKED"; ?>> No <br><br>

Your automatic back-ups email<br>
<input type="text" name="backupemailp" value="<? echo $backupemail; ?>"><br><br>

Save a copy of the automatic backup onto your server? 1 for Yes, 0 for No<br>
<input type="text" name="backuptofolderp" value="<? echo $backuptofolder; ?>"><br><br>

<hr>



<p><b>Misc settings</b></p>

<p>If you are stuck, use basecolour #E2E2E2, contrastcolour #C0C0C0, fonttype Tahoma and fontcolour #5C5C5C.</p>

Base colour<br>

<input type="text" name="basecolourp" value="<? echo $basecolour; ?>"><br><br>

Contrast colour<br>

<input type="text" name="contrastcolourp" value="<? echo $contrastcolour; ?>"><br><br>

Font type<br>

<input type="text" name="fonttypep" value="<? echo $fonttype; ?>"><br><br>

Font colour<br>

<input type="text" name="fontcolourp" value="<? echo $fontcolour; ?>"><br><br>

Navigation background color<br>

<input type="text" name="nav_bgp" value="<? echo $nav_bg; ?>"><br><br>

Navigation mouseover color<br>

<input type="text" name="nav_hoverp" value="<? echo $nav_hover; ?>"><br><br>

Navigation "Recommended Systems" color<br>

<input type="text" name="nav_textp" value="<? echo $nav_text; ?>"><br><br>

<hr>

<p><b>Misc settings</b></p>
Enable drawing<br>
<input type="radio" name="drawingp" value="1"<? if($drawing==1) echo ' CHECKED'; ?>> Yes <input type="radio" name="drawingp" value="0"<? if($drawing==0) echo ' CHECKED'; ?>> No<br><br>

Price per ticket<br>
<input type="text" name="drawpricep" value="<? echo $drawprice; ?>"> points<br><br>

Draw Winner<br>
<input type="text" name="drawinnerp" value="<? echo $drawwinner; ?>"> <br><br>
<br>


<input type="submit" value=" Save Settings ">

</form></center>

<? }

echo "</td><td valign=top align=center width=5%></tr></table>";

}

else  {

echo "Unauthorised Access!";

}

include "../footer.php";

mysql_close($dblink);

?>