Location: PHPKode > projects > Gsys > admin/minute_functions.php
<?PHP
//Filename : minute_functions.php
//Description : Functions for minute maintenance
//Author :  darc
//Last modified :  2006.12.20

    include '../includes/auth_ec.php';  //authenticate
    include '../includes/db.php'; //setup database

switch($_GET["cat"])
{

	case "add_minutes":
	{  //Add meeting minutes to database.
		$date = $_POST['year']."-".$_POST['month']."-".$_POST['day'];
		$body = $_POST['content'];
		$link = ""; //Add this to enable link functionality
		$description = $_POST['description'];

		$sql = "INSERT INTO meeting_minutes (date, body, link, description) VALUES ('$date', '$body', '$link', '$description')";
		$result = mysql_query($sql,$connection) or die(mysql_error());

		
                echo "<html><head><title>Add Minutes</title><link href=\"../includes/index.css\" rel=\"stylesheet\" type=\"text/css\"></head><body class=\"body\">
<br />
<table width=\"810\" height=\"626\" border=\"0\" align=\"center\" cellpadding=\"15\">
  <tr> 
    <td height=\"128\" colspan=\"2\"><img src=\"../images/eg_banner.gif\" width=\"810\" height=\"172\"></td>
  </tr>
  <tr> 
    <td width=\"27%\" height=\"488\" valign=\"top\">"; include '../includes/nav.inc'; echo "</td>
    <td width=\"53%\">The minutes from $date have been succesfully added to the database.   </td>
  </tr>
</table></body></html>";
		

		break;
	}

	case "update_minutes":
	{
		$date = $_POST['date'];;
		$body = $_POST['content'];
                $link = ""; //Add this to enable link functionality
		$description = $_POST['description'];

		$sql = "UPDATE meeting_minutes SET body = '$content', link = '$link', description = '$description' WHERE date = '$date'";
		$result = mysql_query($sql,$connection) or die(mysql_error());
	
                echo "<html><head><title>Minutes for $date Updated</title><link href=\"../includes/index.css\" rel=\"stylesheet\" type=\"text/css\"></head><body class=\"body\">
<br />
<table width=\"810\" height=\"626\" border=\"0\" align=\"center\" cellpadding=\"15\">
  <tr> 
    <td height=\"128\" colspan=\"2\"><img src=\"../images/eg_banner.gif\" width=\"810\" height=\"172\"></td>
  </tr>
  <tr> 
    <td width=\"27%\" height=\"488\" valign=\"top\">"; include '../includes/nav.inc'; echo "</td>
    <td width=\"53%\"><center>
		The minutes for <strong>$date</strong> have been updated as follows:<br /><br />
		<strong>Description:</strong><br />  $description <br /><br />
		<strong>Minutes:</strong><br />$body</center></td>
  </tr>
</table></body></html>";


		break;
	}

	case "delete_minutes":
	{
		$date = $_POST['date_select'];
		$sql = "DELETE FROM meeting_minutes WHERE date = '$date'";
		$result = mysql_query($sql,$connection) or die(mysql_error());
		echo "<html><head><title>Minutes for $date DELETED</title><link href=\"../includes/index.css\" rel=\"stylesheet\" type=\"text/css\"></head><body class=\"body\">
<br />
<table width=\"810\" height=\"626\" border=\"0\" align=\"center\" cellpadding=\"15\">
  <tr> 
    <td height=\"128\" colspan=\"2\"><img src=\"../images/eg_banner.gif\" width=\"810\" height=\"172\"></td>
  </tr>
  <tr> 
    <td width=\"27%\" height=\"488\" valign=\"top\">"; include '../includes/nav.inc'; echo "</td>
    <td width=\"53%\"><center>The minutes for <strong>$date</strong> have been deleted.</center></td>
  </tr>
</table></body></html>";

		break;
	}


//Default case, error
    default :
    {
      echo "No instructions supplied...";
      break;
    }
}
?>
Return current item: Gsys