<?php
	include('/var/www/html/uclit/protected/common/login/check.php');
	include('/var/www/html/uclit/protected/common/css_login/css_head2.php');
	include('/var/www/html/uclit/protected/connections/db_help.php');

// Establish Database Connection

/*	$dbserver = 'libitdb.lang.uc.edu';
	$dbuser = 'phpadmin';
	$dbpass = '25or624';
	$sqlConn = mysql_connect($dbserver, $dbuser, $dbpass) or die("Couldn't connect to database");
*/	$dbConn = mysql_select_db("comments", $commConn) or die("Couldn't select database");

// FORM DATA
$lib = $_POST['lib'];
$year = $_POST['year'];
$month = $_POST['month'];
$day = $_POST['day'];
$name = $_POST['name'];
$email = $_POST['email'];
$emailcheck = $_POST['emailcheck'];
$who = $_POST['who'];
$features = $_POST['features'];
$improve = $_POST['improve'];
$general = $_POST['general'];

// FORMATED FORM DATA
$visit_date = "$year-$month-$day";


echo "lib: $lib <br>";
echo "year: $year <br>";
echo "month: $month <br>";
echo "day: $day <br>";
echo "visit date: $visit_date <br>";
echo "name: $name <br>";
echo "email: $email <br>";
echo "emailcheck: $emailcheck <br>";
echo "who: $who <br>";
echo "features: $features <br>";
echo "improve: $improve <br>";
echo "general: $general <br>";

$sql = "
		INSERT into comments (id, lib, visit_date, comment_date, name, email, email_check, patron_type, comment_features, comment_improve, comment_general)
		VALUES ('', '$lib', '$visit_date', now(), '$name', '$email', '$email_check', '$who', '$features', '$improve', '$general')";

$result = @mysql_query($sql);

//echo $sql;


// MAIN OUTPUT
//header
		echo "<br />Thank you for your comment!";

//footer
	include('/var/www/html/uclit/protected/common/css_login/css_foot2.php');
?>  