+++ /dev/null
-<?php\r
-/************************************************************************/\r
-/* ATutor */\r
-/************************************************************************/\r
-/* Copyright (c) 2002-2010 */\r
-/* Inclusive Design Institute */\r
-/* http://atutor.ca */\r
-/* This program is free software. You can redistribute it and/or */\r
-/* modify it under the terms of the GNU General Public License */\r
-/* as published by the Free Software Foundation. */\r
-/************************************************************************/\r
-define('AT_INCLUDE_PATH', '../../include/');\r
-require (AT_INCLUDE_PATH.'vitals.inc.php');\r
-admin_authenticate(AT_ADMIN_PRIV_ECOMM);\r
-\r
-if (isset($_POST['cancel'])) {\r
- $msg->addFeedback('CANCELLED');\r
- header('Location: payments_admin.php');\r
- exit;\r
-} else if (isset($_POST['submit'])) {\r
-\r
- $_POST['ec_uri'] = trim($_POST['ec_uri']);\r
- $_POST['ec_vendor_id'] = trim($_POST['ec_vendor_id']);\r
- $_POST['ec_password'] = trim($_POST['ec_password']);\r
- $_POST['ec_contact_email'] = trim($_POST['ec_contact_email']);\r
- $_POST['ec_contact_address'] = trim($_POST['ec_contact_address']);\r
- $_POST['ec_allow_instructors'] = intval($_POST['ec_allow_instructors']);\r
- $_POST['ec_email_admin'] = intval($_POST['ec_email_admin']);\r
- $_POST['ec_email_admin'] = intval($_POST['ec_email_admin']);\r
- $_POST['ec_log_file'] = $addslashes($_POST['ec_log_file']);\r
- $_POST['ec_store_log'] = intval($_POST['ec_store_log']);\r
-\r
-\r
- if (!$_POST['ec_uri']){\r
- $msg->addError('EC_URL_EMPTY');\r
- }\r
- if (!$_POST['ec_vendor_id']){\r
- $msg->addError('EC_ID_EMPTY');\r
- }\r
- //if (!$_POST['ec_password']){\r
- //$msg->addError('EC_PASSWORD_EMPTY');\r
- //} \r
- if (!$msg->containsErrors()) {\r
- $_POST['ec_gateway'] = $addslashes($_POST['ec_gateway']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_gateway', '$_POST[ec_gateway]')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_uri'] = $addslashes($_POST['ec_uri']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_uri', '$_POST[ec_uri]')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_vendor_id'] = $addslashes($_POST['ec_vendor_id']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_vendor_id', '$_POST[ec_vendor_id]')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_password'] = $addslashes($_POST['ec_password']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_password', '$_POST[ec_password]')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_currency'] = $addslashes($_POST['ec_currency']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_currency', '$_POST[ec_currency]')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_currency_other'] = $addslashes($_POST['ec_currency_other']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_currency_other', '$_POST[ec_currency_other]')";\r
- mysql_query($sql, $db);\r
-\r
- if($_POST['ec_currency_other']){\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_currency', '')";\r
- mysql_query($sql, $db);\r
- }\r
-\r
- $_POST['ec_currency_symbol'] = $_POST['ec_currency_symbol'];\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_currency_symbol', '$_POST[ec_currency_symbol]')";\r
- mysql_query($sql, $db);\r
-\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_allow_instructors', '{$_POST['ec_allow_instructors']}')";\r
- mysql_query($sql, $db);\r
-\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_email_admin', '{$_POST['ec_email_admin']}')";\r
- mysql_query($sql, $db);\r
-\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_store_log', '{$_POST['ec_store_log']}')";\r
- mysql_query($sql, $db);\r
-\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_log_file', '{$_POST['ec_log_file']}')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_contact_email'] = $addslashes($_POST['ec_contact_email']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_contact_email', '$_POST[ec_contact_email]')";\r
- mysql_query($sql, $db);\r
-\r
- $_POST['ec_contact_address'] = $addslashes($_POST['ec_contact_address']);\r
- $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('ec_contact_address', '$_POST[ec_contact_address]')";\r
- mysql_query($sql, $db);\r
-\r
- $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
-\r
- header('Location: '.$_SERVER['PHP_SELF']);\r
- exit;\r
- }\r
-}\r
-\r
-$_config['ec_allow_instructors'] = isset($_config['ec_allow_instructors']) ? $_config['ec_allow_instructors'] : 0;\r
-$_config['ec_email_admin'] = isset($_config['ec_email_admin']) ? $_config['ec_email_admin'] : 0;\r
-$_config['ec_uri'] = isset($_config['ec_uri']) ? $_config['ec_uri'] : '';\r
-$_config['ec_currency'] = isset($_config['ec_currency']) ? $_config['ec_currency'] : 'USD';\r
-$_config['ec_currency_symbol'] = isset($_config['ec_currency_symbol']) ? $_config['ec_currency_symbol'] : '$';\r
-\r
-require (AT_INCLUDE_PATH.'header.inc.php');\r
-\r
-?>\r
-\r
-<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">\r
- <div class="input-form">\r
-\r
- <div class="row">\r
- <p><?php echo _AT('ec_location_text'); ?></p>\r
- </div>\r
- <div class="row">\r
- <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="uri"><?php echo _AT('ec_gateway'); ?></label><br/>\r
- <select name="ec_gateway">\r
- <option value="BeanStream"<?php if($_config['ec_gateway'] == "BeanStream"){ echo ' selected="selected"';} ?>>BeanStream</option>\r
- <option value="PayPal" <?php if($_config['ec_gateway'] == "PayPal"){ echo ' selected="selected"';} ?>>PayPal</option>\r
- <option value="MiraPay"<?php if($_config['ec_gateway'] == "MiraPay"){ echo ' selected="selected"';} ?>>MiraPay</option>\r
- </select>\r
- </div>\r
-\r
- <div class="row">\r
- <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="uri"><?php echo _AT('ec_location'); ?></label><br/>\r
- <input type="text" name="ec_uri" value="<?php echo htmlspecialchars($_config['ec_uri']); ?>" id="uri" size="80" />\r
- </div>\r
- <div class="row">\r
- <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="ec_vendor_id"><?php echo _AT('ec_vendor_id'); ?></label><br/>\r
- <input type="text" name="ec_vendor_id" value="<?php echo htmlspecialchars($_config['ec_vendor_id']); ?>" id="ec_vendor_id" size="40"/>\r
- </div>\r
- <div class="row">\r
- <label for="ec_password"><?php echo _AT('ec_password'); ?></label><br/>\r
- <input type="password" name="ec_password" value="<?php echo htmlspecialchars($_config['ec_password']); ?>" id="ec_password" size="20" />\r
- </div>\r
- <div class="row">\r
- <?php echo _AT('ec_currency'); ?><br/>\r
- <input type="radio" name="ec_currency" value="USD" id="currusd" <?php if ($_config['ec_currency'] == 'USD') { echo 'checked="checked"'; } ?>><label for="currusd">USD</label>\r
- <input type="radio" name="ec_currency" value="CAD" id="currcad" <?php if ($_config['ec_currency'] == 'CAD') { echo 'checked="checked"'; } ?>><label for="currcad">CAD</label>\r
- <input type="radio" name="ec_currency" value="EUR" id="curreur" <?php if ($_config['ec_currency'] == 'EUR') { echo 'checked="checked"'; } ?>><label for="curreur">EUR</label> \r
-\r
- <?php echo _AT('or'); ?>\r
-\r
- <label for="ec_currency_other"><?php echo _AT('ec_currency_other'); ?></label>\r
- <input type="text" name="ec_currency_other" size="3" value="<?php echo $_config['ec_currency_other']; ?>" id="ec_currency_other" size="3" />\r
- </div>\r
- <div class="row">\r
- <label for="ec_currency_symbol"><?php echo _AT('ec_currency_symbol'); ?></label><br/>\r
- <input type="text" name="ec_currency_symbol" size="3" value="<?php echo $_config['ec_currency_symbol']; ?>" id="ec_currency_symbol" size="3" />\r
- </div>\r
- <div class="row">\r
- <label for="ec_contact_email"><?php echo _AT('ec_contact_email'); ?></label><br/>\r
- <input type="text" name="ec_contact_email" size="50" value="<?php echo htmlspecialchars($_config['ec_contact_email']); ?>" id="ec_contact_email" size="20" />\r
- </div>\r
-\r
- <div class="row">\r
- <label for="ec_contact_address"><?php echo _AT('ec_contact_address'); ?></label><br/>\r
- <textarea name="ec_contact_address" id="ec_contact_address" cols="20" rows="5" class="input"/><?php echo htmlspecialchars($_config['ec_contact_address']); ?></textarea>\r
- </div>\r
-\r
- <div class="row">\r
- <?php echo _AT('ec_allow_instructors'); ?><br/>\r
- <input type="radio" name="ec_allow_instructors" value="1" id="allow1" <?php if ($_config['ec_allow_instructors']){ echo 'checked="checked"'; } ?>/><label for="allow1"><?php echo _AT('enable'); ?></label>\r
-\r
- <input type="radio" name="ec_allow_instructors" value="0" id="allow0" <?php if (!$_config['ec_allow_instructors']){ echo 'checked="checked"'; } ?>/><label for="allow0"><?php echo _AT('disable'); ?></label>\r
- </div> \r
- <div class="row">\r
- <?php echo _AT('ec_email_admin'); ?><br/>\r
- <input type="radio" name="ec_email_admin" value="1" id="email1" <?php if ($_config['ec_email_admin']){ echo 'checked="checked"'; } ?>/><label for="email1"><?php echo _AT('enable'); ?></label>\r
-\r
- <input type="radio" name="ec_email_admin" value="0" id="email0" <?php if (!$_config['ec_email_admin']){ echo 'checked="checked"'; } ?>/><label for="email0"><?php echo _AT('disable'); ?></label>\r
- </div>\r
- <div class="row">\r
- <?php echo _AT('ec_store_log'); ?><br/>\r
- <input type="radio" name="ec_store_log" value="1" id="ipn1" <?php if ($_config['ec_store_log']){ echo 'checked="checked"'; } ?>/><label for="ipn1"><?php echo _AT('enable'); ?></label>\r
-\r
- <input type="radio" name="ec_store_log" value="0" id="ipn0" <?php if (!$_config['ec_store_log']){ echo 'checked="checked"'; } ?>/><label for="ipn0"><?php echo _AT('disable'); ?></label>\r
- </div> \r
- <div class="row">\r
- <label for="ec_log_file"><?php echo _AT('ec_log_file'); ?></label><br/>\r
- <input type="text" name="ec_log_file" value="<?php echo htmlspecialchars($_config['ec_log_file']); ?>" id="ec_log_file" size="60"/>\r
- </div>\r
- <div class="row buttons">\r
- <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" class="button" accesskey="s" />\r
- <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" class="button" />\r
- </div>\r
- </div>\r
-</form>\r
-\r
-<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file