| Current Path : /var/www/cesa.co.za/Mailer/ |
| Current File : /var/www/cesa.co.za/Mailer/newsletterUpdate.php |
<?php
require_once ('includes/globals.php');
if (isset($_SESSION['database'])) {
if (isset($_SESSION['userid'])) {
$userid = $_SESSION['userid'];
} else {
echo "<script>document.location.href='index.php';</script>\n";
}
$db = $_SESSION['database'];
//echo 'no: ' . $_POST['numberOut'];
if (isset($_POST['numberOut'])) {
$loop = intval($_POST['numberOut']);
for ($i = 1; $i <= $loop; $i++) {
$h_id = $_POST['id'.$i];
//echo $i . ' - ' . $s_id . '; ';
$sql = "UPDATE Headlines\n" .
"SET nOrder = " . $i . "\n" .
"where idHeadline = " . $h_id;
if ($db->Execute($sql) === false) {
die("Could not update headline order");
}
}
}
echo "<script>document.location.href='manageNewsletter.php?id=" . $_POST['parent'] . "&pid=" . $_POST['mysteryIdentifier'] . "';</script>\n";
}
?>