Ejemplo n.º 1
0
		{
			if(!isset($_POST['cid']))
				echo "<p>The contact was not selected. Please try again.</p>";
			else {
				$cid = $_POST['cid'];
				$cm->displayForm($mysql, $cid, $uid);
			}
			break;
		}
		case 'Delete' :
		{
			if(!isset($_POST['cid']))
				echo "<p>The contact was not selected. Please try again.</p>";
			else {
				$cid = $_POST['cid'];
				$cm->deleteContact($mysql, $cid, $uid);
			}
			break;
		}
		case 'Save' :
		{
			if(!isset($_POST['cname']))
				echo "<p>The contact cannot be empty.</p>";
			else {
				$name = $_POST['cname'];
				$email = $_POST['email'];
				$phone = $_POST['phone'];
				$cid = $_POST['cid'];
				if($cid == 0)
					$cm->addContact($mysql, $name, $email, $phone, $uid);
				else