Location: PHPKode > projects > Mozart > Mozart-0.0.4/delappt.php
<?
// called from: calendar.php
// description: deletes entry from APPOINTMENT table
//
include("connect.inc");
include("reqlogin.inc");
?>
<html>
<title>Mozart: Delete Appointment</title>
<body>
<?

// delete appointment 
$DelAppointmentSQL = "DELETE FROM appointment WHERE appt_id = '$id'";
$DelAppointment = mysql_query($DelAppointmentSQL,$db);

// delete appointment from APPTXPROJ
$DelApptXSQL = "DELETE FROM apptxproj WHERE xappt_id = '$id'";
$DelApptX = mysql_query($DelApptXSQL);

// delete appointment from contxappt
$DelContXSQL = "DELETE FROM contxappt WHERE xappt_id = '$id'";
$DelContX = mysql_query($DelContXSQL);

// delete appointment from userxappt
$DelUserXApptSQL = "DELETE FROM userxappt WHERE xappt_id = '$id'";
$DelUserXAppt    = mysql_query($DelUserXApptSQL);

$errno = mysql_errno($db);
$error = mysql_error($db);
if ($errno == 0) {
	$Message = "Appointment Deleted Successfully";
}
else {
	$Message = "Error $errno: $error";
}
include("calendar.php");
exit;
?>
Return current item: Mozart