| Current Path : /var/www/cesa.co.za/Mailer/ |
| Current File : /var/www/cesa.co.za/Mailer/doUpdateNewsletter.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";
}
$h_notes = str_replace("'", '´', $_POST['notes']);
$h_notes = str_replace('\"', '"', $h_notes);
$sql = "UPDATE Newsletter\n" .
"SET sTitle = '" . str_replace("'", '´', $_POST['title']) . "', sHeading= '" . str_replace("'", '´', $_POST['heading']). "', txtNotes = '" . $h_notes;
if(intval($_POST['previousIssueID']) > 0) {
$sql .= "', idPreviousIssue=" . $_POST['previousIssueID'] . "\n";
} else {
$sql .= "'\n";
}
$sql .= "where idNewsletter = " . $_POST['updateid'];
//echo $sql;
$db = $_SESSION['database'];
if ($db->Execute($sql) === false) {
die("Could not update newsletter");
} else {
?>
<script language="JavaScript" type="text/javascript">
//window.close();
window.location = "doLogin.php";
</script>
<?php
}
}
?>