]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-payments.php
New (template) wrapper function fixEmptyContentToDashes() introduced, EL rewrites:
[mailer.git] / inc / modules / admin / what-payments.php
index ec6151629836185a603edebc8dd997018cb9a628..f61bf694f1684af704e189857c67cb7e3f6625f0 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -51,9 +52,9 @@ if (((!isPostRequestParameterSet(('t_wait'))) || (!isPostRequestParameterSet(('p
 if (isFormSent()) {
        switch (getRequestParameter('do')) {
                case 'add':
-                       addSql("INSERT INTO `{?_MYSQL_PREFIX?}_payments` (time, payment, mail_title, price) VALUES ('".postRequestParameter('t_wait')."','".postRequestParameter('payment')."','".postRequestParameter('title')."','".postRequestParameter('price')."')");
-                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payments` WHERE time='%s' LIMIT 1",
-                       array(postRequestParameter('t_wait')), __FILE__, __LINE__);
+                       addSql("INSERT INTO `{?_MYSQL_PREFIX?}_payments` (`time`, `payment`, `mail_title`, `price`) VALUES ('".postRequestParameter('t_wait')."','".postRequestParameter('payment')."','".postRequestParameter('title')."','".postRequestParameter('price')."')");
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `time`='%s' LIMIT 1",
+                               array(postRequestParameter('t_wait')), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Re-init the array here
                                initSqls();
@@ -65,13 +66,13 @@ if (isFormSent()) {
 
                case 'edit':
                        foreach (postRequestParameter('time') as $id => $value) {
-                               addSql("UPDATE `{?_MYSQL_PREFIX?}_payments` SET time='".$value."', payment='".postRequestParameter('pay', $id)."', price='".postRequestParameter('price', $id)."', mail_title='".postRequestParameter('title', $id)."' WHERE `id`='".$id."' LIMIT 1");
+                               addSql("UPDATE `{?_MYSQL_PREFIX?}_payments` SET `time`='" . $value . "', `payment`='".postRequestParameter('pay', $id)."', price='".postRequestParameter('price', $id)."', mail_title='".postRequestParameter('title', $id)."' WHERE `id`='".$id."' LIMIT 1");
                        }
                        break;
 
                case 'del':
                        foreach (postRequestParameter('id') as $id => $value) {
-                               addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`='".$id."' LIMIT 1");
+                               addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=" . bigintval($id) . " LIMIT 1");
                        }
                        break;
        } // END - switch
@@ -88,7 +89,7 @@ if (isFormSent()) {
 
        // Output template
        loadTemplate('admin_settings_saved', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete entries here
        $OUT = ''; $SW = 2;
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -112,7 +113,7 @@ if (isFormSent()) {
 
        // Load main template
        loadTemplate('admin_del_payments', false, $OUT);
-} elseif ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit entries
        $OUT = ''; $SW = 2;
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -148,14 +149,14 @@ if (isFormSent()) {
                // List already existing categories for editing
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare array for the row template
-                       // @TODO Rewritings: title->mail_title, pay->payment in template
+                       // @TODO Rewritings: title->mail_title in template
                        $content = array(
-                               'sw'    => $SW,
-                               'id'    => $content['id'],
-                               'time'  => $content['time'],
-                               'title' => $content['mail_title'],
-                               'pay'   => translateComma($content['payment']),
-                               'price' => translateComma($content['price'])
+                               'sw'      => $SW,
+                               'id'      => $content['id'],
+                               'time'    => $content['time'],
+                               'title'   => $content['mail_title'],
+                               'payment' => translateComma($content['payment']),
+                               'price'   => translateComma($content['price'])
                        );
 
                        // Load row template and switch colors