************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
switch ($_GET['do'])
{
case "add":
- $SQL[] = "INSERT INTO "._MYSQL_PREFIX."_payments (time, payment, mail_title, price) VALUES ('".$_POST['t_wait']."', '".$_POST['payment']."', '".$_POST['title']."', '".$_POST['price']."')";
+ $SQL[] = "INSERT INTO "._MYSQL_PREFIX."_payments (time, payment, mail_title, price) VALUES ('".$_POST['t_wait']."','".$_POST['payment']."','".$_POST['title']."','".$_POST['price']."')";
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_payments WHERE time='%s' LIMIT 1",
array($_POST['t_wait']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1)
break;
case "edit":
- foreach ($_POST['time'] as $id=>$value)
+ foreach ($_POST['time'] as $id => $value)
{
$SQL[] = "UPDATE "._MYSQL_PREFIX."_payments SET time='".$value."', payment='".$_POST['pay'][$id]."', price='".$_POST['price'][$id]."', mail_title='".$_POST['title'][$id]."' WHERE id='".$id."' LIMIT 1";
}
break;
case "del":
- foreach ($_POST['id'] as $id=>$value)
+ foreach ($_POST['id'] as $id => $value)
{
$SQL[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_payments WHERE id='".$id."' LIMIT 1";
}
{
// Delete entries here
$SW = 2; $OUT = "";
- foreach ($_POST['sel'] as $id=>$value)
+ foreach ($_POST['sel'] as $id => $value)
{
$result = SQL_QUERY_ESC("SELECT time, mail_title FROM "._MYSQL_PREFIX."_payments WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
{
// Edit entries
$SW = 2; $OUT = "";
- foreach ($_POST['sel'] as $id=>$value)
+ foreach ($_POST['sel'] as $id => $value)
{
$result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM "._MYSQL_PREFIX."_payments WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);