<?php
if(isset($_POST['submit'])) {
	$subject=addslashes($_POST['subject']);
	$message=addslashes($_POST['message']);
	$error_msg="";
	
	if(strlen($subject) == 0) {
		$error_msg.="<li> Subject is blank</li>";
	}
	if(strlen($message) == 0) {
		$error_msg.="<li> Message is blank</li>";
	}
	if($error_msg != "") {
		$error_msg="Please correct the following errors".$error_msg;
	}
	else {
		mysqli_query($connectionString,"INSERT INTO `messages` (`id` ,`number` ,`date` ,`subject` ,`message` ,`status`)VALUES (NULL , '$accid', NOW( ) , '$subject', '$message', '0')");
		redirect("?r=service_center&&success");
	}
}

$rendered_page='service.html';

?>
