$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"); } break; case 'del': foreach (postRequestParameter('id') as $id => $value) { addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=" . bigintval($id) . " LIMIT 1"); } break; } // END - switch // Save settings if (countSqls() > 0) { // Run all queries runFilterChain('run_sqls'); $content = '{--SETTINGS_SAVED--}'; } else { // Nothing has changed! $content = '{--SETTINGS_NOT_SAVED--}'; } // Output template loadTemplate('admin_settings_saved', false, $content); } elseif ((isFormSent('del')) && (ifPostContainsSelections())) { // Delete entries here $OUT = ''; foreach (postRequestParameter('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__); list($time, $title) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Prepare array for the row template $content = array( 'id' => $id, 'time' => $time, 'title' => $title, ); // Load row template and switch colors $OUT .= loadTemplate('admin_del_payments_row', true, $content); } // END - foreach // Load main template loadTemplate('admin_del_payments', false, $OUT); } elseif ((isFormSent('edit')) && (ifPostContainsSelections())) { // Edit entries $OUT = ''; foreach (postRequestParameter('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__); list($time, $pay, $title, $price) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Prepare array for the row template $content = array( 'id' => $id, 'time' => $time, 'title' => $title, 'pay' => $pay, 'price' => $price, ); // Load row template and switch colors $OUT .= loadTemplate('admin_edit_payments_row', true, $content); } // END - foreach // Load main template loadTemplate('admin_edit_payments', false, $OUT); } else { // Referal levels $result = SQL_QUERY("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `time` ASC", __FILE__, __LINE__); if (!SQL_HASZERONUMS($result)) { // Make referal levels editable and deletable $OUT = ''; // List already existing categories for editing while ($content = SQL_FETCHARRAY($result)) { // Load row template and switch colors $OUT .= loadTemplate('admin_list_payments_row', true, $content); } // END - switch // Free memory SQL_FREERESULT($result); // Load main template loadTemplate('admin_list_payments', false, $OUT); } // END - if // Form for adding new referal levels loadTemplate('admin_add_payment'); } // [EOF] ?>