Location: PHPKode > projects > QUICKLYWEB > quicklyweb/admin/man_paypal.php
<?
session_start();
header("Cache-control: private");

require("quicklyweb.php");
require("security/secure.php");
adminify($_SESSION['sess_user'], $_SESSION['sess_admin']);

beginDocument("Paypal Configuration", $_SESSION['sess_user']);

$db = getDBConnection(); 

if ($_POST['updater'] == "paypal") {
	$result = DBquery("UPDATE PaypalConfig SET Enabled='$_POST[Enabled]', Email='$_POST[Email]', Currency='$_POST[Currency]', PaymentTypeID='$_POST[PaymentTypeID]'", $db);
	checkDBerror($db);
	
	if(!(is_integer($result)) or ($result == 1)) {
		beginPrettyTable("1", "Paypal Update");
		echo "<tr>\n";
		echo " <td>\n";
		echo "   <div class=data>Paypal settings updated successfully <a href='administration.php'>$lAdminPage</a></div>\n";
		echo "  </td>\n";
		echo "</tr>\n";
		endPrettyTable();
	} else {
		beginPrettyTable("1", "Paypal Update");
		echo "<tr> <td><div class=data>Paypal settings update failed: ";
		echo mysql_error();
		echo "</div></td></tr>\n";
		endPrettyTable();
	}
} else {

	$result = DBquery("SELECT * FROM PaypalConfig", $db);
	$paypal_row = DBfetch_array($result);

	openForm("paypal", $_SERVER['PHP_SELF']);
		makeHiddenField("updater", "paypal");
		beginPrettyTable("2", "Paypal Configuration");
		beginBorderedTable("2");
			
			if ($paypal_row["Enabled"] == 1) {
			makeCheckBox("Enabled", "Enabled", "1", "checked");
			} else {
			makeCheckBox("Enabled", "Enabled", "1", " "); }
			makeTextField("Primary Email", "Email", $paypal_row["Email"]);
			echo "<tr class=\"small\"><td><b>Currency:</b></td><td><select name=\"Currency\">\n";
				if ($paypal_row["Currency"] == "GBP") {
  				echo "<option value=\"GBP\" selected>Pounds Sterling</option>";
				} else {
				echo "<option value=\"GBP\">Pounds Sterling</option>"; 
				}
				if ($paypal_row["Currency"] == "CAD") {
  				echo "<option value=\"CAD\" selected>Canadian Dollars</option>";
				} else {
				echo "<option value=\"CAD\">Canadian Dollars</option>";
				}
				if ($paypal_row["Currency"] == "EUR") {
  				echo "<option value=\"EUR\" selected>Euros</option>";
				} else {
				echo "<option value=\"EUR\">Euros</option>";
				}
				if ($paypal_row["Currency"] == "JPY") {
  				echo "<option value=\"JPY\" selected>Japanese Yen</option>";
				} else {
				echo "<option value=\"JPY\">Japanese Yen</option>";
				}
				if ($paypal_row["Currency"] == "USD") {
  				echo "<option value=\"USD\" selected>US Dollars</option>";
				} else {
				echo "<option value=\"USD\">US Dollars</option>";
				}
			echo "</select></td></tr>\n";
			makeTextField("PaymentTypeID", "PaymentTypeID", $paypal_row["PaymentTypeID"]);
			makeSubmitter();
		endBorderedTable();
		endPrettyTable();
	closeForm();
}
endDocument();
?>
Return current item: QUICKLYWEB