<?php 

if($_POST['ajax'] == 'new'){
	$name = $_POST['name'];
	$shop = "0";
	$dep = $_POST['dep'];
	$text = $_POST['text'];
	
	$ticketid = $this->createTicket($_SESSION['user_id'], $name, $dep, $shop);
	$this->addMessage($_SESSION['user_id'], $ticketid, $text);
	echo $ticketid;
	return true;
	exit();
}

$this->view(array("theme/_common/_header", "theme/tickets/new", "theme/_common/_footer"), array("user" => $this->user, "shops" => $this->shops)); 