* Created by PhpStorm.
 * User: randyjp
 * Date: 4/29/15
 * Time: 11:27 PM
 */
require_once "Complaint.php";
require_once "DataLayer.php";
require_once "lib.php";
$dl = new DataLayer();
$id = $_GET["id"];
$messages = array();
$success = true;
if (count($_POST) > 0) {
    $id = $_POST["hiddenId"];
    if (!empty($_POST["txtComments"])) {
        $dl->addCommentById($id, $_POST["txtComments"]);
        $messages[] = "Comment Added Successfully";
    } else {
        $messages[] = "Comments can't be empty.";
        $success = false;
    }
}
if (empty($id)) {
    header("location:index.php");
    die;
}
$complaint = $dl->findComplaintById($id);
?>

<!doctype html>
<html lang="en">