Esempio n. 1
0
 public function testUniqueness()
 {
     // Tests for uniqueness
     $ticket = new Ticket(null, $this->db);
     $text = explode("\n", shell_exec("python bingo.py"))[0];
     $ticket->fromString($text);
     $numbers = [];
     foreach ($ticket->getTicket() as $row) {
         foreach ($row as $number) {
             if ($number != "") {
                 $numbers[] = $number;
             }
         }
     }
     $isUnique = count($numbers) === count(array_unique($numbers, SORT_NUMERIC));
     $this->assertTrue($isUnique);
 }
Esempio n. 2
0
<?php

include 'admin_header.php';
$user = new User();
$view = new View();
$ticket = new Ticket();
$support_id = $ticket->getSupportId();
$uid = intval($_GET['uid']);
$ticket_id = intval($_GET['ticket_id']);
$selected_ticket = $ticket->getTicket($ticket_id);
$tickets = $ticket->getTickets($uid);
?>

<!-- content wrapper -->
<div class="container-full">

	<!-- page row -->
	<div class="row"> 

		<!-- sidebar -->
		<div class="col-sm-2 sidebar-wrapper">
			<ul class="sidebar-nav">
				<li class="sidebar-brand">
					<a href="#">
						Admin
					</a>
				</li>
				<!-- shows the categories as list elements -->
				<?php 
$view->showAdminMenu();
?>
Esempio n. 3
0
 public static function archivaTicket($id)
 {
     $db = Tool::_conectaBD();
     $archivado = false;
     if (!$db) {
         //error
         //echo "Error conectando <br/>";
     } else {
         if (!Ticket::estaArchivado($id)) {
             $aux = new Ticket();
             $aux->getTicket($id);
             $sql = "INSERT INTO HistoricoTickets (IdCompra,Codigo,IdTipo,Entregado) VALUES " . "('" . $aux->IdCompra . "','" . $aux->codigo . "','" . $aux->IdTipo . "',0)";
             if ($aux->codigo != "") {
                 if (Tool::ejecutaConsulta($sql, $db)) {
                     $archivado = true;
                 } else {
                     //error
                     echo "Error insertando " . $aux->codigo . "<br/>SQL: " . $sql . "</br>";
                 }
             } else {
                 //error
                 echo "Error obteniendo " . $id . "<br/>SQL: " . $sql . "</br>";
             }
         } else {
             $archivado = true;
         }
         if ($archivado) {
             Ticket::deleteTicket($id);
         }
     }
     Tool::_desconectaBD($db);
     return $archivado;
 }
session_start();
include "../../bossflex/Helpers/Reject.php";
Reject::permission($_SESSION['bfUser']);
include "../../bossflex/DB/Models/BossFlexEmployee.php";
include "../../bossflex/DB/Models/Employee.php";
include "../../bossflex/DB/Models/User.php";
include "../../bossflex/DB/Models/Company.php";
include "../../bossflex/DB/Models/Ticket.php";
include "../../bossflex/Helpers/Material.php";
include "../../bossflex/Helpers/BFPage.php";
$bfEmp = BossFlexEmployee::getEmployeeByBFID($_SESSION['bfUser']['EID']);
$user = User::getUserByUID($_SESSION['bfUser']['UID']);
$error = false;
$success = false;
if (isset($_GET['t'])) {
    $ticket = Ticket::getTicket($_GET['t']);
    Ticket::assignTicket($bfEmp, $ticket);
    $success = "Ticket " . $ticket->getTicketNum() . " Assigned to You";
}
$tickets = Ticket::unassignedTickets();
?>

<html>
<header>
    <?php 
Material::headers("Unassigned Tickets");
?>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css">

    <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js">
    </script>
Esempio n. 5
0
    if (isset($ticketNum) && !(isset($accept) || isset($decline))) {
        $ticket = Ticket::getTicket($ticketNum);
    } else {
        if (isset($decline) && isset($ticketNum)) {
            $ticket = Ticket::getTicket($ticketNum);
            if (!isset($comment) || !($comment > "")) {
                $error = "Closing Comment Must Be Set If Declining";
            } else {
                $ticket->setClosingComment($comment);
                Ticket::closeTicket($ticket, false);
                //decline ticket
                $getNextTicket = true;
            }
        } else {
            if (isset($accept) && isset($ticketNum)) {
                $ticket = Ticket::getTicket($ticketNum);
                Ticket::closeTicket($ticket, true);
                //accept ticket
                $getNextTicket = true;
            }
        }
    }
}
if ($getNextTicket) {
    $tickets = Ticket::assignedTicketList($bfEmp);
    if (!$tickets) {
        header("Location: Home.php?s=" . urlencode("All tickets reviewed!"));
        exit;
    }
    $ticket = reset($tickets);
    $ticketNum = $ticket->getTicketNum();