2007-03-18 04:38:53 +00:00
|
|
|
<? // Preamble
|
|
|
|
$pageName = "Post a new Plan Entry";
|
|
|
|
$need = 'auth';
|
|
|
|
require "parts/preamble.php"; // Load most of document
|
|
|
|
|
2007-03-22 05:54:08 +00:00
|
|
|
need ("boxes html news sql");
|
2007-03-18 04:38:53 +00:00
|
|
|
|
|
|
|
// set up local vars
|
|
|
|
$mode = $_REQUEST['mode'];
|
2007-03-18 09:27:20 +00:00
|
|
|
$planSubj = addSlashes ($_REQUEST['planSubj']);
|
|
|
|
$planText = addSlashes ($_REQUEST['planText']);
|
2007-03-18 04:38:53 +00:00
|
|
|
$user = $userInfo['u_displayname'];
|
|
|
|
|
|
|
|
if ($planText && $planSubj && $mode == "Post") {
|
2007-03-18 09:27:10 +00:00
|
|
|
$query = 'INSERT INTO plans (p_date, p_user, p_title, p_plan) VALUES ('
|
2007-03-18 09:26:46 +00:00
|
|
|
."NOW(), '$user', '$planSubj', '$planText')";
|
2007-03-18 04:38:53 +00:00
|
|
|
|
2007-03-18 09:26:46 +00:00
|
|
|
$rows = sqlWriteQuery ($query);
|
2007-03-18 09:27:10 +00:00
|
|
|
if ($rows) {
|
2007-03-18 09:26:46 +00:00
|
|
|
echo '<P>Your plan entry has been posted successfully.</P>';
|
2007-03-18 04:38:53 +00:00
|
|
|
} else {
|
2007-03-18 09:26:46 +00:00
|
|
|
echo "<P>Somebody screwed up, MySQL said '$sqlError'. Bug a project admin or somethin', eh?</P>";
|
2007-03-18 04:38:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$date = date ('d M Y');
|
|
|
|
|
|
|
|
newsBoxOpen ();
|
|
|
|
if ($planText) {
|
|
|
|
newsBoxTitle ("Latest Plan for $user (Preview)");
|
|
|
|
printNews ($date, $user, stripSlashes ($planText));
|
|
|
|
}
|
|
|
|
newsBoxTitle ("Post Plan Entry");
|
|
|
|
$form = '<FORM action="' . thisURL . '" method="post">'
|
2007-03-22 05:54:08 +00:00
|
|
|
. 'Subject: '
|
|
|
|
. '<INPUT type="text" name="planSubj" size="59" value="'
|
|
|
|
. convertFromHTML (stripSlashes ($planSubj)) . '">'
|
|
|
|
. '</INPUT><BR>'
|
2007-03-18 04:38:53 +00:00
|
|
|
. '<TEXTAREA name="planText" rows="25" cols="64">'
|
2007-03-22 05:54:08 +00:00
|
|
|
. convertFromHTML (stripSlashes ($planText))
|
2007-03-18 04:38:53 +00:00
|
|
|
. '</TEXTAREA><BR>'
|
|
|
|
. '<INPUT align="center" type="submit" name="mode" value="Post"></INPUT>'
|
|
|
|
. '<INPUT align="center" type="submit" name="mode" value="Preview"></INPUT>'
|
|
|
|
.'</FORM>';
|
|
|
|
printNews ($date, $user, $form);
|
|
|
|
newsBoxClose ();
|
|
|
|
}
|
|
|
|
?>
|