

</div>
<div class="main-content">
<div class="main-content-inner">
<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
    </script>
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
        </li>
        <li class="active">Tickets</li>
    </ul>
    <!-- /.breadcrumb -->
    <div class="nav-search" id="nav-search">
        <form method="POST" action="search">
            <span class="input-icon">
            <input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
            <i class="ace-icon fa fa-search nav-search-icon"></i>
            </span>
        </form>
    </div>
    <!-- /.nav-search -->
</div>
<div class="page-content">
<div class="row-fluid">
<?php
    if(!defined('panel'))
    	die('Nope.');
    if(!isset($_SESSION['user']) && !isset(Config::$_url[1])) 
    {
    	echo '<div class="alert alert-danger">Trebuie s&#259; fii logat pentru a vedea aceast&#259; pagin&#259;!</div>';
    	echo '<meta http-equiv="refresh" content="5;URL=\''.Config::$_PAGE_URL.'login\'/>';
    	return;
    }
    
    if(isset(Config::$_url[1]) == "start") { ?>
<title>Create Ticket - <?php echo Config::$_SITE_NAME; ?></title>
<div class="row-fluid">
    <h4>Deschide tichet ajutor</h4>
     <p>
    	Deobicei la tickete se raspunde in maxim 24 de ore, dar nu garantam ca nu pot aparea intarzieri.
		Cei ce deschid tickete aiurea, pot primi suspend pe panel, asadar aveti grija pentru ce deschideti ticket.
    </p>
    <hr>
    <h5 class="bold"><i class="icon-file-text red"></i> Nu imi pot accesa contul din joc</h5>
    <p>
        Daca nu mai stii ce parola ai, incearca sa folosesti <a href="<?php echo Config::$_PAGE_URL; ?>recover">optiunea de recuperare parola (click)</a>.
        Daca nu ai un email setat pe cont, nu iti poti recupera parola si contul.<br>
        Daca ai un email setat pe cont pe care nu-l poti accesa, nu iti poti recupera contul.<br>
        Daca are altcineva acces la contul tau, este DOAR din vina ta, iar adminii nu te vor ajuta sa-l recuperezi.<br>
        Nu se pot deschide tichete pentru conturi pierdute/sparte deoarece adminii nu se ocupa de recuperarea conturilor pierdute de playeri.
    </p>
    <hr>
    <h5 class="bold"><i class="icon-file-text red"></i> <a href="<?php echo Config::$_PAGE_URL; ?>ticketgeneral">Tichet general</a></h5>
    <p>
        Daca ai o problema legata de server, poti deschide un tichet aici.<br>
        Daca ai o problema cu un cont de pe forum, specifica numele contului de pe forum.<br>
    </p>
    <hr>
    <h5 class="bold"><i class="icon-file-text red"></i> <a href="<?php echo Config::$_PAGE_URL; ?>ticketpay">Probleme cu platile pentru puncte premium</a></h5>
    <p>
        Daca ai o problema legata de cumpararea punctelor premium, deschide un tichet aici.<br>
        Se pot face plati DOAR prin paysafecard. Nu se stie cand/daca vor fi adaugate alte metode de plata.<br>
        Poti verifica cati bani ai pe un card paysafecard <a href="https://www.paysafecard.com/ro-ro/interogare-sold/">aici (click)</a>. Tot acolo poti verifica si ce plati ai facut cu cardul paysafecard.<br>
        Daca ai facut o plata trebuie sa astepti sa iti fie trimise punctele premium, acest proces poate dura maxim 24 de ore.<br>
        Daca nu ti-au fost retrasi, poti incerca sa faci plata din nou.<br>
        Daca ti-au fost retrasi, fa un screenshot cu platile ce apar <a href="https://www.paysafecard.com/ro-ro/interogare-sold/">pe site-ul paysafecard (click)</a> si deschide un tichet.<br>
    </p>
</div>
<?php } else {
    ?>
<?php
    if(Config::getData('users','Admin',$_SESSION['user']))
    {
    if(isset($_POST['delete'])) {
    	$q = Config::$g_con->prepare('DELETE FROM `tickets` WHERE `id` = ?');
    	$q->execute(array($_POST['delete']));
    	
    	echo '<meta http-equiv="refresh" content="0;URL=\''.Config::$_PAGE_URL.'tickets\'/>';
    }
    ?>
<title>Tickete curente - <?php echo Config::$_SITE_NAME; ?></title>
<a href="<?php echo Config::$_PAGE_URL; ?>tickets/start" class="btn btn-danger">New Ticket</a>
<br /><br />
<h4>Ticketele curente</h4>
<div class="table-responsive">
    <table id="login-table" class="table table-striped table-hover table-bordered">
        <thead>
            <tr>
                <td>Title</td>
                <td>User Name</td>
                <td><i class='icon-time'></i> Date</td>
                <td>Status</td>
            </tr>
        </thead>
        <tbody>
            <?php
                $q = Config::$g_con->prepare('SELECT * FROM `tickets` ORDER BY `id` DESC');
                $q->execute();
                while($row = $q->fetch(PDO::FETCH_OBJ)) {
                	echo 
                	"<tr>
                		<td><a href=" . Config::$_PAGE_URL . "ticket/" . $row->id . "> ".($row->type ? 'Probleme cu platile pentru puncte premium' : 'Problema generala')."</a></td>
                        <td>{$row->Name}</td>
						<td>{$row->time}</td>
                		<td>" . ($row->Status ? 'Closed' : 'Open') . "</td>";
                	echo "</tr>";
                }
                ?>
        </tbody>
    </table>
</div>
<?php
    } else {
    ?>
<title>My Tickets - <?php echo Config::$_SITE_NAME; ?></title>
<a href="<?php echo Config::$_PAGE_URL; ?>tickets/start" class="btn btn-danger">New Ticket</a>
<br /><br />
<div class="table-responsive">
    <table id="login-table" class="table table-striped table-hover table-bordered">
        <thead>
            <tr>
                <td>Title</td>
                <td><i class='icon-time'></i> Date</td>
                <td>Status</td>
            </tr>
        </thead>
        <tbody>
            <?php
                $q = Config::$g_con->prepare('SELECT * FROM `tickets` WHERE `Name` = ? ORDER BY `id` DESC');
                $q->execute(array(Config::getData('users','name', $_SESSION['user'])));
                while($row = $q->fetch(PDO::FETCH_OBJ)) {
                	echo 
                	"<tr>
                		<td><a href=" . Config::$_PAGE_URL . "ticket/" . $row->id . "> ".($row->type ? 'Probleme cu platile pentru puncte premium' : 'Problema generala')."</a></td>
                		<td>{$row->time}</td>
                		<td>" . ($row->Status ? 'Closed' : 'Open') . "</td>";
                	echo "</tr>";
                }
                ?>
        </tbody>
    </table>
</div>
<?php
    } }
    ?>
