commit
71aea63ed1
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
class Ticket{
|
||||
private $tId;
|
||||
private $timestamp;
|
||||
private $title;
|
||||
private $status;
|
||||
private $queue;
|
||||
private $ticket_category;
|
||||
private $author;
|
||||
private $db;
|
||||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
||||
/*FUNCTION: getTicketTitlesOf()
|
||||
* return all ticket of the given author's id.
|
||||
*
|
||||
*/
|
||||
public static function getTicketsOf($author, $db_data) {
|
||||
$dbl = new DBLayer($db_data);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket INNER JOIN ticket_user ON ticket.Author = ticket_user.TUserId and ticket_user.ExternId=:id", array('id' => $author));
|
||||
$row = $statement->fetchAll();
|
||||
$result = Array();
|
||||
foreach($row as $ticket){
|
||||
$instance = new self($db_data);
|
||||
$instance->setTimestamp($ticket['Timestamp']);
|
||||
$instance->setTitle($ticket['Title']);
|
||||
$instance->setStatus($ticket['Status']);
|
||||
$instance->setQueue($ticket['Queue']);
|
||||
$instance->setTicket_Category($ticket['Ticket_Category']);
|
||||
$instance->setAuthor($ticket['Author']);
|
||||
$result[] = $instance;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*FUNCTION: create_Ticket()
|
||||
* creates a ticket + first initial reply and fills in the content of it!
|
||||
*
|
||||
*/
|
||||
public static function create_Ticket( $title, $content, $category, $author, $db_data) {
|
||||
|
||||
$ticket = new Ticket($db_data);
|
||||
$ticket->set($title,0,0,$category,$author);
|
||||
$ticket->create();
|
||||
$ticket_id = $ticket->getTId();
|
||||
|
||||
|
||||
$ticket_content = new Ticket_Content($db_data);
|
||||
$ticket_content->setContent($content);
|
||||
$ticket_content->create();
|
||||
$content_id = $ticket_content->getTContentId();
|
||||
|
||||
|
||||
$ticket_reply = new Ticket_Reply($db_data);
|
||||
$ticket_reply->set($ticket_id, $content_id, $author);
|
||||
$ticket_reply->create();
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
public function __construct($db_data) {
|
||||
$this->db = $db_data;
|
||||
}
|
||||
|
||||
|
||||
//Set ticket object
|
||||
public function set($t,$s,$q,$t_c,$a){
|
||||
$this->title = $t;
|
||||
$this->status = $s;
|
||||
$this->queue = $q;
|
||||
$this->ticket_category = $t_c;
|
||||
$this->author = $a;
|
||||
}
|
||||
|
||||
//create ticket by writing private data to DB.
|
||||
public function create(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "INSERT INTO ticket (Timestamp, Title, Status, Queue, Ticket_Category, Author) VALUES (now(), :title, :status, :queue, :tcat, :author)";
|
||||
$values = Array('title' => $this->title, 'status' => $this->status, 'queue' => $this->queue, 'tcat' => $this->ticket_category, 'author' => $this->author);
|
||||
$this->tId = $dbl->executeReturnId($query, $values); ;
|
||||
}
|
||||
|
||||
//return constructed element based on TId
|
||||
public function load_With_TId( $id) {
|
||||
$dbl = new DBLayer($this->db);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket WHERE TId=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$this->tId = $row['TId'];
|
||||
$this->timestamp = $row['Timestamp'];
|
||||
$this->title = $row['Title'];
|
||||
$this->status = $row['Status'];
|
||||
$this->queue = $row['Queue'];
|
||||
$this->ticket_category = $row['Ticket_Category'];
|
||||
$this->author = $row['Author'];
|
||||
}
|
||||
|
||||
|
||||
//update private data to DB.
|
||||
public function update(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "UPDATE ticket SET Timestamp = :timestamp, Title = :title, Status = :status, Queue = :queue, Ticket_Category = :tcat, Author = :author WHERE TId=:id";
|
||||
$values = Array('id' => $this->tId, 'timestamp' => $this->timestamp, 'title' => $this->title, 'status' => $this->status, 'queue' => $this->queue, 'tcat' => $this->ticket_category, 'author' => $this->author);
|
||||
$statement = $dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
||||
public function getTId(){
|
||||
return $this->tId;
|
||||
}
|
||||
|
||||
public function getTimestamp(){
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
||||
public function getTitle(){
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getStatus(){
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function getQueue(){
|
||||
return $this->queue;
|
||||
}
|
||||
|
||||
public function getTicket_Category(){
|
||||
return $this->ticket_category;
|
||||
}
|
||||
|
||||
public function getAuthor(){
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
||||
|
||||
public function setTId($id){
|
||||
$this->tId = $id;
|
||||
}
|
||||
|
||||
public function setTimestamp($ts){
|
||||
$this->timestamp = $ts;
|
||||
}
|
||||
|
||||
public function setTitle($t){
|
||||
$this->title = $t;
|
||||
}
|
||||
|
||||
public function setStatus($s){
|
||||
$this->status = $s;
|
||||
}
|
||||
|
||||
public function setQueue($q){
|
||||
$this->queue = $q;
|
||||
}
|
||||
|
||||
public function setTicket_Category($tc){
|
||||
$this->ticket_category = $tc;
|
||||
}
|
||||
|
||||
public function setAuthor($a){
|
||||
$this->author = $a;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
class Ticket_Category{
|
||||
|
||||
private $tCategoryId;
|
||||
private $name;
|
||||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//Creates a ticket_Catergory in the DB
|
||||
public static function createTicketCategory( $name ,$db ) {
|
||||
$dbl = new DBLayer($db);
|
||||
$query = "INSERT INTO ticket_category (Name) VALUES (:name)";
|
||||
$values = Array('name' => $name);
|
||||
$dbl->execute($query, $values);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//return constructed element based on TCategoryId
|
||||
public static function constr_TCategoryId( $id, $db_data) {
|
||||
$instance = new self($db_data);
|
||||
$instance->setTCategoryId($id);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
//returns list of all category objects
|
||||
public static function getAllCategories($db_data) {
|
||||
$dbl = new DBLayer($db_data);
|
||||
$statement = $dbl->executeWithoutParams("SELECT * FROM ticket_category");
|
||||
$row = $statement->fetchAll();
|
||||
$result = Array();
|
||||
foreach($row as $category){
|
||||
$instance = new self($db_data);
|
||||
$instance->tCategoryId = $category['TCategoryId'];
|
||||
$instance->name = $category['Name'];
|
||||
$result[] = $instance;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
|
||||
public function __construct($db_data) {
|
||||
$this->db = $db_data;
|
||||
}
|
||||
|
||||
//return constructed element based on TCategoryId
|
||||
public function load_With_TCategoryId( $id) {
|
||||
$dbl = new DBLayer($this->db);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_category WHERE TCategoryId=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$this->tCategoryId = $row['TCategoryId'];
|
||||
$this->name = $row['Name'];
|
||||
}
|
||||
|
||||
|
||||
//update private data to DB.
|
||||
public function update(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "UPDATE ticket_category SET Name = :name WHERE TCategoryId=:id";
|
||||
$values = Array('id' => $this->tCategoryId, 'name' => $this->name);
|
||||
$statement = $dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
||||
public function getName(){
|
||||
if ($this->name == ""){
|
||||
$this->load_With_TCategoryId($this->tCategoryId);
|
||||
}
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
public function getTCategoryId(){
|
||||
return $this->tCategoryId;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
||||
|
||||
public function setName($n){
|
||||
$this->name = $n;
|
||||
}
|
||||
|
||||
public function setTCategoryId($id){
|
||||
$this->tCategoryId = $id;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
class Ticket_Content{
|
||||
|
||||
private $tContentId;
|
||||
private $content;
|
||||
|
||||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
||||
//return constructed element based on TCategoryId
|
||||
public static function constr_TContentId( $id, $db_data) {
|
||||
$instance = new self($db_data);
|
||||
$instance->setTContentId($id);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
|
||||
public function __construct($db_data) {
|
||||
$this->db = $db_data;
|
||||
}
|
||||
|
||||
//Creates a ticket_content entry in the DB
|
||||
public function create() {
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "INSERT INTO ticket_content (Content) VALUES (:content)";
|
||||
$values = Array('content' => $this->content);
|
||||
$this->tContentId = $dbl->executeReturnId($query, $values); ;
|
||||
}
|
||||
|
||||
//return constructed element based on TContentId
|
||||
public function load_With_TContentId( $id) {
|
||||
$dbl = new DBLayer($this->db);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_content WHERE TContentId=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$this->tContentId = $row['TContentId'];
|
||||
$this->content = $row['Content'];
|
||||
}
|
||||
|
||||
//update private data to DB.
|
||||
public function update(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "UPDATE ticket_content SET Content = :content WHERE TContentId=:id";
|
||||
$values = Array('id' => $this->tContentId, 'content' => $this->content);
|
||||
$statement = $dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
||||
public function getContent(){
|
||||
if ($this->content == ""){
|
||||
$this->load_With_TContentId($this->tContentId);
|
||||
}
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
|
||||
public function getTContentId(){
|
||||
return $this->tContentId;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
||||
|
||||
public function setContent($c){
|
||||
$this->content = $c;
|
||||
}
|
||||
|
||||
public function setTContentId($c){
|
||||
$this->tContentId = $c;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
class Ticket_Reply{
|
||||
private $tReplyId;
|
||||
private $ticket;
|
||||
private $content;
|
||||
private $author;
|
||||
private $timestamp;
|
||||
private $db;
|
||||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
||||
//return constructed element based on TCategoryId
|
||||
public static function constr_TReplyId( $id, $db_data) {
|
||||
$instance = new self($db_data);
|
||||
$instance->setTReplyId($id);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
|
||||
public function __construct($db_data) {
|
||||
$this->db = $db_data;
|
||||
}
|
||||
|
||||
|
||||
//Set ticket_reply object
|
||||
public function set($t,$c,$a){
|
||||
$this->ticket = $t;
|
||||
$this->content = $c;
|
||||
$this->author = $a;
|
||||
}
|
||||
|
||||
//create ticket by writing private data to DB.
|
||||
public function create(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "INSERT INTO ticket_reply (Ticket, Content, Author, Timestamp) VALUES (:ticket, :content, :author, now())";
|
||||
$values = Array('ticket' => $this->ticket, 'content' => $this->content, 'author' => $this->author);
|
||||
$dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
//return constructed element based on TId
|
||||
public function load_With_TReplyId( $id) {
|
||||
$dbl = new DBLayer($this->db);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_reply WHERE TReplyId=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$this->tReplyId = $row['TReplyId'];
|
||||
$this->ticket = $row['Ticket'];
|
||||
$this->content = $row['Content'];
|
||||
$this->author = $row['Author'];
|
||||
$this->timestamp = $row['Timestamp'];
|
||||
}
|
||||
|
||||
//update private data to DB.
|
||||
public function update(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "UPDATE ticket SET Ticket = :ticket, Content = :content, Author = :author, Timestamp = :timestamp WHERE TReplyId=:id";
|
||||
$values = Array('id' => $this->tReplyId, 'timestamp' => $this->timestamp, 'ticket' => $this->ticket, 'content' => $this->content, 'author' => $this->author);
|
||||
$statement = $dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
||||
public function getTicket(){
|
||||
return $this->ticket;
|
||||
}
|
||||
|
||||
|
||||
public function getContent(){
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function getAuthor(){
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
public function getTimestamp(){
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
||||
|
||||
public function getTReplyId(){
|
||||
return $this->tReplyId;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
||||
|
||||
public function setTicket($t){
|
||||
$this->ticket = $t;
|
||||
}
|
||||
|
||||
|
||||
public function setContent($c){
|
||||
$this->content = $c;
|
||||
}
|
||||
|
||||
public function setAuthor($a){
|
||||
$this->author = $a;
|
||||
}
|
||||
|
||||
public function setTimestamp($t){
|
||||
$this->timestamp = $t;
|
||||
}
|
||||
|
||||
|
||||
public function setTReplyId($i){
|
||||
$this->tReplyId = $i;
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
class Ticket_User{
|
||||
|
||||
private $tUserId;
|
||||
private $permission;
|
||||
private $externId;
|
||||
private $db;
|
||||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
||||
//Creates a ticket_user in the DB
|
||||
public static function createTicketUser( $extern_id, $permission,$db ) {
|
||||
$dbl = new DBLayer($db);
|
||||
$query = "INSERT INTO ticket_user (Permission, ExternId) VALUES (:perm, :ext_id)";
|
||||
$values = Array('perm' => $permission, 'ext_id' => $extern_id);
|
||||
$dbl->execute($query, $values);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//return constructed element based on TUserId
|
||||
public static function constr_TUserId( $id, $db_data) {
|
||||
$instance = new self($db_data);
|
||||
$instance->setTUserId($id);
|
||||
return $instance;
|
||||
|
||||
}
|
||||
|
||||
//return constructed element based on ExternId
|
||||
public static function constr_ExternId( $id, $db_data ) {
|
||||
$instance = new self($db_data);
|
||||
$dbl = new DBLayer($instance->db);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_user WHERE ExternId=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$instance->tUserId = $row['TUserId'];
|
||||
$instance->permission = $row['Permission'];
|
||||
$instance->externId = $row['ExternId'];
|
||||
return $instance;
|
||||
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
public function __construct($db_data) {
|
||||
$this->db = $db_data;
|
||||
}
|
||||
|
||||
//return constructed element based on TUserId
|
||||
public function load_With_TUserId( $id) {
|
||||
$dbl = new DBLayer($this->db);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_user WHERE TUserId=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$instance->tUserId = $row['TUserId'];
|
||||
$instance->permission = $row['Permission'];
|
||||
$instance->externId = $row['ExternId'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
//update private data to DB.
|
||||
public function update(){
|
||||
$dbl = new DBLayer($this->db);
|
||||
$query = "UPDATE ticket_user SET Permission = :perm, ExternId = :ext_id WHERE TUserId=:id";
|
||||
$values = Array('id' => $this->tUserId, 'perm' => $this->permission, 'ext_id' => $this->externId);
|
||||
$statement = $dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
||||
public function getPermission(){
|
||||
if ($this->permission == ""){
|
||||
$this->load_With_TUserId($this->tUserId);
|
||||
}
|
||||
return $this->permission;
|
||||
}
|
||||
|
||||
|
||||
public function getExternId(){
|
||||
if ($this->ExternId == ""){
|
||||
$this->load_With_TUserId($this->tUserId);
|
||||
}
|
||||
return $this->externId;
|
||||
}
|
||||
|
||||
|
||||
public function getTUserId(){
|
||||
return $this->tUserId;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
||||
|
||||
public function setPermission($perm){
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
|
||||
public function setExternId($id){
|
||||
$this->externId = $id;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
function change_info(){
|
||||
|
||||
try{
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn()){
|
||||
|
||||
if(isset($_POST['target_id'])){
|
||||
|
||||
|
||||
if( ($_POST['target_id'] == $_SESSION['id']) || WebUsers::isAdmin() ){
|
||||
if($_POST['target_id'] == $_SESSION['id']){
|
||||
$target_username = $_SESSION['user'];
|
||||
}else{
|
||||
$target_username = WebUsers::getUsername($_POST['target_id']);
|
||||
}
|
||||
|
||||
$webUser = new WebUsers();
|
||||
//use current info to check for changes
|
||||
$current_info = $webUser->getInfo($_POST['target_id']);
|
||||
|
||||
|
||||
$current_info['FirstName'] = filter_var($current_info['FirstName'], FILTER_SANITIZE_STRING);
|
||||
$current_info['LastName'] = filter_var($current_info['LastName'], FILTER_SANITIZE_STRING);
|
||||
$current_info['Country'] = filter_var($current_info['Country'], FILTER_SANITIZE_STRING);
|
||||
$current_info['Gender'] = filter_var($current_info['Gender'], FILTER_SANITIZE_NUMBER_INT);
|
||||
|
||||
|
||||
$updated = false;
|
||||
$values = Array();
|
||||
$values['user'] = $target_username;
|
||||
|
||||
//make the query that will update the data.
|
||||
$query = "UPDATE ams_user SET ";
|
||||
if(($_POST['FirstName'] != "") && ($_POST['FirstName'] != $current_info['FirstName'])){
|
||||
$query = $query . "FirstName = :fName ";
|
||||
$updated = true;
|
||||
$values['fName'] = filter_var($_POST['FirstName'], FILTER_SANITIZE_STRING);
|
||||
}
|
||||
if(($_POST['LastName'] != "") && ($_POST['LastName'] != $current_info['LastName'])){
|
||||
if($updated){
|
||||
$query = $query . ", LastName = :lName ";
|
||||
}else{
|
||||
$query = $query . "LastName = :lName ";
|
||||
}
|
||||
$updated = true;
|
||||
$values['lName'] = filter_var($_POST['LastName'], FILTER_SANITIZE_STRING);
|
||||
}
|
||||
if(($_POST['Country'] != "AA") && ($_POST['Country'] != $current_info['Country'])){
|
||||
if($updated){
|
||||
$query = $query . ", Country = :country ";
|
||||
}else{
|
||||
$query = $query . "Country = :country ";
|
||||
}
|
||||
$updated = true;
|
||||
$values['country'] = filter_var($_POST['Country'], FILTER_SANITIZE_STRING);
|
||||
}
|
||||
if($_POST['Gender'] != $current_info['Gender']){
|
||||
if($updated){
|
||||
$query = $query . ", Gender = :gender ";
|
||||
}else{
|
||||
$query = $query . "Gender = :gender ";
|
||||
}
|
||||
$updated = true;
|
||||
$values['gender'] = filter_var($_POST['Gender'], FILTER_SANITIZE_NUMBER_INT);
|
||||
}
|
||||
//finish the query!
|
||||
$query = $query . "WHERE Login = :user";
|
||||
|
||||
//if some field is update then:
|
||||
if($updated){
|
||||
global $cfg;
|
||||
//execute the query in the web DB.
|
||||
$dbw = new DBLayer($cfg['db']['web']);
|
||||
$dbw->execute($query,$values);
|
||||
}
|
||||
|
||||
global $SITEBASE;
|
||||
require_once($SITEBASE . 'inc/settings.php');
|
||||
$result = settings();
|
||||
if($updated){
|
||||
$result['info_updated'] = "OK";
|
||||
}
|
||||
$result['permission'] = $_SESSION['permission'];
|
||||
$result['username'] = $_SESSION['user'];
|
||||
$result['no_visible_elements'] = 'FALSE';
|
||||
$result['target_id'] = $_POST['target_id'];
|
||||
helpers :: loadtemplate( 'settings', $result);
|
||||
exit;
|
||||
|
||||
}else{
|
||||
//ERROR: permission denied!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else{
|
||||
//ERROR: The form was not filled in correclty
|
||||
header("Location: index.php?page=settings");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
//ERROR: user is not logged in
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}catch (PDOException $e) {
|
||||
//go to error page or something, because can't access website db
|
||||
print_r($e);
|
||||
exit;
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
function change_mail(){
|
||||
|
||||
try{
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn()){
|
||||
|
||||
if(isset($_POST['target_id'])){
|
||||
|
||||
|
||||
if( ($_POST['target_id'] == $_SESSION['id']) || WebUsers::isAdmin() ){
|
||||
if($_POST['target_id'] == $_SESSION['id']){
|
||||
$target_username = $_SESSION['user'];
|
||||
}else{
|
||||
$target_username = WebUsers::getUsername($_POST['target_id']);
|
||||
}
|
||||
|
||||
$webUser = new WebUsers();
|
||||
$reply = $webUser->checkEmail($_POST['NewEmail']);
|
||||
|
||||
global $SITEBASE;
|
||||
require_once($SITEBASE . 'inc/settings.php');
|
||||
$result = settings();
|
||||
|
||||
if ( $reply != "success" ){
|
||||
$result['EMAIL_ERROR'] = 'TRUE';
|
||||
}else{
|
||||
$result['EMAIL_ERROR'] = 'FALSE';
|
||||
}
|
||||
$result['prevNewEmail'] = filter_var($_POST["NewEmail"], FILTER_SANITIZE_EMAIL);
|
||||
|
||||
if ($reply== "success"){
|
||||
$status = WebUsers::setEmail($target_username, filter_var($_POST["NewEmail"], FILTER_SANITIZE_EMAIL) );
|
||||
if($status == 'ok'){
|
||||
$result['SUCCESS_MAIL'] = "OK";
|
||||
}else if($status == 'shardoffline'){
|
||||
$result['SUCCESS_MAIL'] = "SHARDOFF";
|
||||
}
|
||||
$result['permission'] = $_SESSION['permission'];
|
||||
$result['no_visible_elements'] = 'FALSE';
|
||||
$result['username'] = $_SESSION['user'];
|
||||
$result['target_id'] = $_POST['target_id'];
|
||||
if(isset($_GET['id'])){
|
||||
if(WebUsers::isAdmin() && ($_POST['target_id'] != $_SESSION['id'])){
|
||||
$result['isAdmin'] = "TRUE";
|
||||
}
|
||||
}
|
||||
helpers :: loadtemplate( 'settings', $result);
|
||||
exit;
|
||||
|
||||
}else{
|
||||
$result['EMAIL'] = $reply;
|
||||
$result['permission'] = $_SESSION['permission'];
|
||||
$result['no_visible_elements'] = 'FALSE';
|
||||
$result['username'] = $_SESSION['user'];
|
||||
$result['target_id'] = $_POST['target_id'];
|
||||
if(isset($_GET['id'])){
|
||||
if(WebUsers::isAdmin() && ($_POST['target_id'] != $_SESSION['id'])){
|
||||
$result['isAdmin'] = "TRUE";
|
||||
}
|
||||
}
|
||||
helpers :: loadtemplate( 'settings', $result);
|
||||
exit;
|
||||
}
|
||||
|
||||
}else{
|
||||
//ERROR: permission denied!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else{
|
||||
//ERROR: The form was not filled in correclty
|
||||
header("Location: index.php?page=settings");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
//ERROR: user is not logged in
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}catch (PDOException $e) {
|
||||
//go to error page or something, because can't access website db
|
||||
print_r($e);
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
function create_ticket(){
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn() && isset($_SESSION['ticket_user'])){
|
||||
|
||||
if(isset($_POST['target_id'])){
|
||||
|
||||
//if target_id is the same as session id or is admin
|
||||
if( ($_POST['target_id'] == $_SESSION['id']) || WebUsers::isAdmin() ){
|
||||
|
||||
global $cfg;
|
||||
$category = filter_var($_POST['Category'], FILTER_SANITIZE_NUMBER_INT);
|
||||
$title = filter_var($_POST['Title'], FILTER_SANITIZE_STRING);
|
||||
$content = filter_var($_POST['Content'], FILTER_SANITIZE_STRING);
|
||||
try{
|
||||
if($_POST['target_id'] == $_SESSION['id']){
|
||||
$author = $_SESSION['ticket_user']->getTUserId();
|
||||
}else{
|
||||
$author= Ticket_User::constr_ExternId($_POST['target_id'], $cfg['db']['lib'])->getTUserId();
|
||||
}
|
||||
Ticket::create_Ticket($title, $content, $category, $author, $cfg['db']['lib'] );
|
||||
}catch (PDOException $e) {
|
||||
//ERROR: LIB DB is not online!
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else{
|
||||
//ERROR: permission denied!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else{
|
||||
//ERROR: The form was not filled in correclty
|
||||
header("Location: index.php?page=settings");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
//ERROR: user is not logged in
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
function createticket(){
|
||||
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn()){
|
||||
//in case user_id-GET param set it's value as target_id, if no user_id-param is given, use the session id.
|
||||
if(isset($_GET['user_id'])){
|
||||
|
||||
if(($_GET['user_id'] != $_SESSION['id']) && (!WebUsers::isAdmin()) ){
|
||||
|
||||
//ERROR: No access!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
|
||||
}else{
|
||||
//if user_id is given, then set it as the target_id
|
||||
$result['target_id'] = filter_var($_GET['user_id'], FILTER_SANITIZE_NUMBER_INT);
|
||||
}
|
||||
|
||||
}else{
|
||||
//set session_id as target_id
|
||||
$result['target_id'] = $_SESSION['id'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
//create array of category id & names
|
||||
global $cfg;
|
||||
$catArray = Ticket_Category::getAllCategories($cfg['db']['lib']);
|
||||
$result['category'] = Array();
|
||||
foreach($catArray as $catObj){
|
||||
$result['category'][$catObj->getTCategoryId()] = $catObj->getName();
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}else{
|
||||
//ERROR: not logged in!
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
function error(){
|
||||
if(isset($_SESSION['error_code'])){
|
||||
$result['error_code'] = $_SESSION['error_code'];
|
||||
unset($_SESSION['error_code']);
|
||||
}else{
|
||||
$result['error_code'] = "404";
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
function show_user(){
|
||||
//if logged in
|
||||
if(WebUsers::isLoggedIn()){
|
||||
|
||||
if( !isset($_GET['id']) || WebUsers::isAdmin() || $_GET['id'] == $_SESSION['id'] ){
|
||||
|
||||
if(isset($_GET['id'])){
|
||||
$result['target_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
|
||||
}else{
|
||||
$result['target_id'] = $_SESSION['id'];
|
||||
}
|
||||
$result['target_name'] = WebUsers::getUsername( $result['target_id']);
|
||||
$result['mail'] = WebUsers::getEmail( $result['target_id']);
|
||||
$info = WebUsers::getInfo($result['target_id']);
|
||||
$result['firstName'] = $info['FirstName'];
|
||||
$result['lastName'] = $info['LastName'];
|
||||
$result['country'] = $info['Country'];
|
||||
$result['gender'] = $info['Gender'];
|
||||
|
||||
global $cfg;
|
||||
$ticket_user = Ticket_User::constr_ExternId($result['target_id'],$cfg['db']['lib']);
|
||||
$ticketlist = Ticket::getTicketsOf($ticket_user->getTUserId(),$cfg['db']['lib']);
|
||||
$i = 0;
|
||||
$result['ticketlist'] = Array();
|
||||
foreach($ticketlist as $ticket){
|
||||
$result['ticketlist'][$i]['tId'] = $ticket->getTId();
|
||||
$result['ticketlist'][$i]['timestamp'] = $ticket->getTimestamp();
|
||||
$result['ticketlist'][$i]['title'] = $ticket->getTitle();
|
||||
|
||||
//get the status
|
||||
$statusId = $ticket->getStatus();
|
||||
if ($statusId == 0){
|
||||
$status = "Waiting on support..";
|
||||
}else if($statusId == 1){
|
||||
$status = "Being handled..";
|
||||
}else if($statusId == 2){
|
||||
$status = "Closed";
|
||||
}
|
||||
|
||||
$result['ticketlist'][$i]['statusText'] = $status;
|
||||
$result['ticketlist'][$i]['status'] = $statusId;
|
||||
//get the category
|
||||
$category = Ticket_Category::constr_TCategoryId($ticket->getTicket_Category(), $cfg['db']['lib']);
|
||||
$result['ticketlist'][$i]['category'] = $category->getName();
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}else{
|
||||
//ERROR: No access!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
//ERROR: not logged in!
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
function userlist(){
|
||||
if(WebUsers::isAdmin()){
|
||||
$users = WebUsers::getUsers();
|
||||
$i = 0;
|
||||
$pageResult['userlist'] = Array();
|
||||
while($row = $users->fetch(PDO::FETCH_ASSOC)){
|
||||
$pageResult['userlist'][$i]['id'] = $row['UId'];
|
||||
$pageResult['userlist'][$i]['username'] = $row['Login'];
|
||||
$pageResult['userlist'][$i]['permission'] = $row['Permission'];
|
||||
$pageResult['userlist'][$i]['email'] = $row['Email'];
|
||||
$i++;
|
||||
}
|
||||
return $pageResult;
|
||||
}else{
|
||||
//ERROR: No access!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Location: index.php?page=error");
|
||||
exit;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
@ -0,0 +1,209 @@
|
||||
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
||||
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
|
||||
|
||||
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
|
||||
USE `mydb` ;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`ticket_category`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`ticket_category` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`ticket_category` (
|
||||
`TCategoryId` INT NOT NULL AUTO_INCREMENT ,
|
||||
`Name` VARCHAR(45) NOT NULL ,
|
||||
PRIMARY KEY (`TCategoryId`) ,
|
||||
UNIQUE INDEX `Name_UNIQUE` (`Name` ASC) )
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`ticket_user`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`ticket_user` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`ticket_user` (
|
||||
`TUserId` INT(10) NOT NULL AUTO_INCREMENT ,
|
||||
`Permission` INT(3) NOT NULL DEFAULT 1 ,
|
||||
`ExternId` INT(10) NOT NULL ,
|
||||
PRIMARY KEY (`TUserId`) )
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`ticket`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`ticket` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`ticket` (
|
||||
`TId` INT NOT NULL AUTO_INCREMENT ,
|
||||
`Timestamp` TIMESTAMP NOT NULL ,
|
||||
`Title` VARCHAR(120) NOT NULL ,
|
||||
`Status` INT NULL DEFAULT 0 ,
|
||||
`Queue` INT NULL DEFAULT 0 ,
|
||||
`Ticket_Category` INT NOT NULL ,
|
||||
`Author` INT NOT NULL ,
|
||||
PRIMARY KEY (`TId`) ,
|
||||
INDEX `fk_ticket_ticket_category_idx` (`Ticket_Category` ASC) ,
|
||||
INDEX `fk_ticket_ams_user_idx` (`Author` ASC) ,
|
||||
CONSTRAINT `fk_ticket_ticket_category`
|
||||
FOREIGN KEY (`Ticket_Category` )
|
||||
REFERENCES `mydb`.`ticket_category` (`TCategoryId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_ticket_ams_user`
|
||||
FOREIGN KEY (`Author` )
|
||||
REFERENCES `mydb`.`ticket_user` (`TUserId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`assigned`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`assigned` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`assigned` (
|
||||
`Ticket` INT NOT NULL ,
|
||||
`User` INT NOT NULL ,
|
||||
INDEX `fk_assigned_ticket_idx` (`Ticket` ASC) ,
|
||||
PRIMARY KEY (`Ticket`, `User`) ,
|
||||
INDEX `fk_assigned_ams_user_idx` (`User` ASC) ,
|
||||
CONSTRAINT `fk_assigned_ticket`
|
||||
FOREIGN KEY (`Ticket` )
|
||||
REFERENCES `mydb`.`ticket` (`TId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_assigned_ams_user`
|
||||
FOREIGN KEY (`User` )
|
||||
REFERENCES `mydb`.`ticket_user` (`TUserId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`tag`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`tag` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`tag` (
|
||||
`TagId` INT NOT NULL AUTO_INCREMENT ,
|
||||
`Value` VARCHAR(60) NOT NULL ,
|
||||
PRIMARY KEY (`TagId`) ,
|
||||
UNIQUE INDEX `Value_UNIQUE` (`Value` ASC) )
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`tagged`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`tagged` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`tagged` (
|
||||
`Ticket` INT NOT NULL ,
|
||||
`Tag` INT NOT NULL ,
|
||||
PRIMARY KEY (`Ticket`, `Tag`) ,
|
||||
INDEX `fk_tagged_tag_idx` (`Tag` ASC) ,
|
||||
CONSTRAINT `fk_tagged_ticket`
|
||||
FOREIGN KEY (`Ticket` )
|
||||
REFERENCES `mydb`.`ticket` (`TId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_tagged_tag`
|
||||
FOREIGN KEY (`Tag` )
|
||||
REFERENCES `mydb`.`tag` (`TagId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`ticket_content`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`ticket_content` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`ticket_content` (
|
||||
`TContentId` INT NOT NULL AUTO_INCREMENT ,
|
||||
`Content` TEXT NULL ,
|
||||
PRIMARY KEY (`TContentId`) )
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARACTER SET = utf8;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`ticket_reply`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`ticket_reply` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`ticket_reply` (
|
||||
`TReplyId` INT NOT NULL AUTO_INCREMENT ,
|
||||
`Ticket` INT NOT NULL ,
|
||||
`Author` INT NOT NULL ,
|
||||
`Content` INT NOT NULL ,
|
||||
`Timestamp` TIMESTAMP NULL ,
|
||||
PRIMARY KEY (`TReplyId`) ,
|
||||
INDEX `fk_ticket_reply_ticket_idx` (`Ticket` ASC) ,
|
||||
INDEX `fk_ticket_reply_ams_user_idx` (`Author` ASC) ,
|
||||
INDEX `fk_ticket_reply_content_idx` (`Content` ASC) ,
|
||||
CONSTRAINT `fk_ticket_reply_ticket`
|
||||
FOREIGN KEY (`Ticket` )
|
||||
REFERENCES `mydb`.`ticket` (`TId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_ticket_reply_ams_user`
|
||||
FOREIGN KEY (`Author` )
|
||||
REFERENCES `mydb`.`ticket_user` (`TUserId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_ticket_reply_ticket_content`
|
||||
FOREIGN KEY (`Content` )
|
||||
REFERENCES `mydb`.`ticket_content` (`TContentId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`ticket_group`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`ticket_group` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`ticket_group` (
|
||||
`TGroupId` INT NOT NULL AUTO_INCREMENT ,
|
||||
`Title` VARCHAR(80) NOT NULL ,
|
||||
PRIMARY KEY (`TGroupId`) ,
|
||||
UNIQUE INDEX `Title_UNIQUE` (`Title` ASC) )
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `mydb`.`in_group`
|
||||
-- -----------------------------------------------------
|
||||
DROP TABLE IF EXISTS `mydb`.`in_group` ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mydb`.`in_group` (
|
||||
`Ticket_Group` INT NOT NULL ,
|
||||
`Ticket` INT NOT NULL ,
|
||||
PRIMARY KEY (`Ticket_Group`, `Ticket`) ,
|
||||
INDEX `fk_in_group_ticket_group_idx` (`Ticket_Group` ASC) ,
|
||||
INDEX `fk_in_group_ticket_idx` (`Ticket` ASC) ,
|
||||
CONSTRAINT `fk_in_group_ticket_group`
|
||||
FOREIGN KEY (`Ticket_Group` )
|
||||
REFERENCES `mydb`.`ticket_group` (`TGroupId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_in_group_ticket`
|
||||
FOREIGN KEY (`Ticket` )
|
||||
REFERENCES `mydb`.`ticket` (`TId` )
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
|
||||
|
||||
SET SQL_MODE=@OLD_SQL_MODE;
|
||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
Binary file not shown.
@ -0,0 +1,59 @@
|
||||
{block name=content}
|
||||
<div class="row-fluid sortable ui-sortable">
|
||||
<div class="box span8">
|
||||
<div class="box-header well" data-original-title="">
|
||||
<h2><i class="icon-th"></i> Create a new Ticket</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<div class="row-fluid">
|
||||
<form id="changePassword" class="form-vertical" method="post" action="index.php?page=createticket&id={$target_id}">
|
||||
<legend>New ticket</legend>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Title</label>
|
||||
<div class="controls">
|
||||
<div class="input-prepend">
|
||||
<input type="text" class="span8" id="Title" name="Title">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Category</label>
|
||||
<div class="controls">
|
||||
<select name="Category">
|
||||
{foreach from=$category key=k item=v}
|
||||
<option value="{$k}">{$v}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Description</label>
|
||||
<div class="controls">
|
||||
<div class="input-prepend">
|
||||
<textarea rows="12" class="span12" id="Content" name="Content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="function" value="create_ticket">
|
||||
<input type="hidden" name="target_id" value="{$target_id}">
|
||||
<div class="control-group">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary" style="margin-left:5px; margin-top:10px;">Send Ticket</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
{/block}
|
||||
|
@ -0,0 +1,86 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<style>
|
||||
*{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
body{
|
||||
font-family: 'Audiowide', cursive, arial, helvetica, sans-serif;
|
||||
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAUElEQVQYV2NkYGAwBuKzQAwDID4IoIgxIikAMZE1oRiArBDdZBSNMIXoJiFbDZYDKcSmCOYimDuNSVKIzRNYrUYOFuQgweoZbIoxgoeoAAcAEckW11HVTfcAAAAASUVORK5CYII=) repeat;
|
||||
background-color:#212121;
|
||||
color:white;
|
||||
font-size: 18px;
|
||||
padding-bottom:20px;
|
||||
}
|
||||
.error-code{
|
||||
font-family: 'Creepster', cursive, arial, helvetica, sans-serif;
|
||||
font-size: 200px;
|
||||
color: white;
|
||||
color: rgba(255, 255, 255, 0.98);
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
margin-top: 5%;
|
||||
text-shadow: 5px 5px hsl(0, 0%, 25%);
|
||||
float: left;
|
||||
}
|
||||
.not-found{
|
||||
width: 47%;
|
||||
float: right;
|
||||
margin-top: 5%;
|
||||
font-size: 50px;
|
||||
color: white;
|
||||
text-shadow: 2px 2px 5px hsl(0, 0%, 61%);
|
||||
padding-top: 70px;
|
||||
}
|
||||
.clear{
|
||||
float:none;
|
||||
clear:both;
|
||||
}
|
||||
.content{
|
||||
text-align:center;
|
||||
line-height: 30px;
|
||||
}
|
||||
input[type=text]{
|
||||
border: hsl(247, 89%, 72%) solid 1px;
|
||||
outline: none;
|
||||
padding: 5px 3px;
|
||||
font-size: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
a{
|
||||
text-decoration: none;
|
||||
color: #9ECDFF;
|
||||
text-shadow: 0px 0px 2px white;
|
||||
}
|
||||
a:hover{
|
||||
color:white;
|
||||
}
|
||||
|
||||
</style>
|
||||
<title>Error</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p class="error-code">
|
||||
{$error_code}
|
||||
</p>
|
||||
{if $error_code eq "404"}
|
||||
<p class="not-found">{$title404}</p>
|
||||
<div class="clear"></div>
|
||||
<div class="content">
|
||||
{$error_message404}
|
||||
{else if $error_code eq "403"}
|
||||
<p class="not-found">{$title403}</p>
|
||||
<div class="clear"></div>
|
||||
<div class="content">
|
||||
{$error_message403}
|
||||
{/if}
|
||||
<br/><a href="index.php">{$go_home}</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,117 @@
|
||||
{block name=content}
|
||||
<div class="row-fluid sortable ui-sortable">
|
||||
<div class="box span9">
|
||||
<div class="box-header well" data-original-title="">
|
||||
<h2><i class="icon-user"></i> Profile of {$target_name}</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<div class="row-fluid">
|
||||
<legend>Info</legend>
|
||||
<table class="table table-striped" >
|
||||
<tbody>
|
||||
<tr >
|
||||
<td><strong>Email:</strong></td>
|
||||
<td>{$mail}</td>
|
||||
</tr>
|
||||
{if $firstName neq ""}
|
||||
<tr>
|
||||
<td><strong>Firstname:</strong></td>
|
||||
<td>{$firstName}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $lastName neq ""}
|
||||
<tr>
|
||||
<td><strong>LastName:</strong></td>
|
||||
<td>{$lastName}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $country neq ""}
|
||||
<tr>
|
||||
<td><strong>Country:</strong></td>
|
||||
<td>{$country}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $gender neq 0}
|
||||
<tr>
|
||||
<td><strong>Gender:</strong></td>
|
||||
{if $gender eq 1}
|
||||
<td><strong>♂</strong></td>
|
||||
{else if $gender eq 2}
|
||||
<td><strong>♀</strong></td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
|
||||
<div class="box span3">
|
||||
<div class="box-header well" data-original-title="">
|
||||
<h2><i class="icon-th"></i>Actions</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<div class="row-fluid">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-primary btn-large dropdown-toggle" data-toggle="dropdown">Actions<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="divider"></li>
|
||||
<li><a href="index.php?page=settings&id={$target_id}">Edit User</a></li>
|
||||
<li><a href="index.php?page=createticket&user_id={$target_id}">Send Ticket</a></li>
|
||||
<li class="divider"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
|
||||
<div class="row-fluid sortable ui-sortable">
|
||||
<div class="box span9">
|
||||
<div class="box-header well" data-original-title="">
|
||||
<h2><i class="icon-tag"></i> Tickets of {$target_name}</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<div class="row-fluid">
|
||||
<legend>Tickets</legend>
|
||||
<table class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Category</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$ticketlist item=ticket}
|
||||
<tr>
|
||||
<td>{$ticket.title}</td>
|
||||
<td class="center"><i>{$ticket.timestamp}</i></td>
|
||||
<td class="center">{$ticket.category}</td>
|
||||
|
||||
<td class="center"><span class="label {if $ticket.status eq 0}label-success{else if $ticket.status eq 1}label-warning{else if $ticket.status eq 2}label-important{/if}">{$ticket.statusText}</span></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
{/block}
|
||||
|
@ -1,22 +1,46 @@
|
||||
{block name=content}
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="box span12">
|
||||
<div class="box-header well">
|
||||
<h2><i class="icon-info-sign"></i> {$userlist_info}</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-round" onclick="javascript:show_help('intro');return false;"><i class="icon-info-sign"></i></a>
|
||||
<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<p><strong>The shard/lib/web db user list</strong> You are about to see it here!</p>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="box span12">
|
||||
<div class="box-header well" data-original-title>
|
||||
<h2><i class="icon-user"></i> Members</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
|
||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<table class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Username</th>
|
||||
<th>Email</th>
|
||||
<th>Permission</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$userlist item=element}
|
||||
<tr>
|
||||
<td>{$element.id}</td>
|
||||
<td class="center"><a href="index.php?page=show_user&id={$element.id}">{$element.username}</a></td>
|
||||
<td class="center">{$element.email}</td>
|
||||
{if $element.permission eq 1}<td class="center"><span class="label label-success">User</span></td>{/if}
|
||||
{if $element.permission eq 2}<td class="center"><span class="label label-warning">Admin</span></td>{/if}
|
||||
<td class="center">
|
||||
<a class="btn btn-primary" href="index.php?page=show_user&id={$element.id}"><i class=" icon-pencil icon-white"></i>Show User</a>
|
||||
<a class="btn btn-info" href="index.php?page=settings&id={$element.id}"><i class=" icon-pencil icon-white"></i>Edit User</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
|
||||
</div><!--/row-->
|
||||
{/block}
|
||||
|
||||
|
Loading…
Reference in New Issue