<h1>Вип задания</h1>
<?php
$db = new db(dbHost, dbUser, dbPass, dbName);
$page = 1;
if(is_numeric($_GET['page'])){
$page = $_GET['page'];
}
$page_2 = $page*10;
$page_1 = $page_2-10;
$page_down = 1;
if(is_numeric($_GET['page_down'])){
$page_down = $_GET['page_down'];
}
$page_2_down = $page_down*10;
$page_1_down = $page_2_down-10;
$task = array();
if (($h = @fopen(F."/config/task-i1A9nj779lr2PD7mFyQGvv5i6daGV0K8.conf", "r"))) {
while (($c = fgets($h, 4096)) !== false) {
$c = explode(':',$c);
if(!empty($c[0]) && !empty($c[1])){
$task[trim($c[0])] = trim($c[1]);
}
}
fclose($h);
}
if(is_numeric($_GET['delid'])){
$delid = $_GET['delid'];
$db->query("DELETE FROM `mod_task_vip` WHERE `id`='$delid'");
echo '<div class="alert alert-success"><strong>ВИП с задания удалены успешно</strong></div>';
}
if(is_numeric($_POST['delid'])){
$delid = $_GET['delid'];
$db->query("DELETE FROM `mod_task_vip`");
echo '<div class="alert alert-success"><strong>ВИП с заданий удалены успешно</strong></div>';
}
if(is_numeric($_GET['delid_down'])){
$delid = $_GET['delid'];
$db->query("DELETE FROM `mod_task_vip_down` WHERE `id`='$delid'");
echo '<div class="alert alert-success"><strong>ВИП с задания удалены успешно</strong></div>';
}
if(is_numeric($_POST['delid_down'])){
$delid = $_GET['delid'];
$db->query("DELETE FROM `mod_task_vip_down`");
echo '<div class="alert alert-success"><strong>ВИП с заданий удалены успешно</strong></div>';
}
$complaint = $db->query("SELECT * FROM `mod_task_vip` ORDER BY `id` DESC LIMIT $page_1, 10");
$complaint_numRows = $complaint->numRows();
$complaint_fetchAll = $complaint->fetchAll();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Настройка ВИП-заданий</h3>
</div>
<span><b>Файл /config/tassk.conf</b><br>Стоимость ВИП (vip_money) - <?php echo $task['vip_money']; ?> RUB<br>Стоимость ВИП топ 2 (vip_money_down) - <?php echo $task['vip_money_down']; ?> RUB<br>Таймер (vip_timer) - <?php echo $task['vip_timer']; ?> часа</span>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Список ВИП верху <form method="POST" style="display: inline;"><input type="hidden" name="delid" value="1"><input type="submit" value="Удалить все ВИП"></form></h3>
</div>
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
<th><button class="btn-link btn_sort">№ </button></th>
<th><button class="btn-link btn_sort">№ Задания </button></th>
<th><button style="font-size: 12px;" class="btn-link btn_sort">Стоимость </button></th>
<th><button style="font-size: 12px;" class="btn-link btn_sort">Дата </button></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach($complaint_fetchAll as $row){
echo '<tr>';
echo '<td style="max-width: 100px;">'.$row['id'].'</td>';
echo '<td style="max-width: 100px;">'.$row['id_task'].'</td>';
echo '<td style="max-width: 100px;">'.$row['money'].'</td>';
echo '<td>'.date("Y-m-d H:i:s", $row['date']).'</td>';
echo '<td><a href="/'.$GLOBALS['adm'].'/mav_task?Id='.$row['id_task'].'" target="_blank" alt="Включить задание"><i class="fa fa-link"></i></a><br><br><a href="?delid='.$row['id'].'" target="_blank" alt="Удалить жалобу"><i class="fa fa-trash"></i></a></td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
<?php
if($page>1){
$a = $page-1;
echo '<a href="?page='.$a.'" style="padding: 16px; background: #000; border-radius: 12px; color: #fff;"><-----</a>';
}
if($complaint_numRows==10){
$b = $page+1;
echo '<a href="?page='.$b.'" style="padding: 16px; background: #000; border-radius: 12px; color: #fff;">-----></a>';
}
$complaint = $db->query("SELECT * FROM `mod_task_vip_down` ORDER BY `id` DESC LIMIT $page_1_down, 10");
$complaint_numRows = $complaint->numRows();
$complaint_fetchAll = $complaint->fetchAll();
?>
<br><br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Список ВИП внизу <form method="POST" style="display: inline;"><input type="hidden" name="delid_down" value="1"><input type="submit" value="Удалить все ВИП"></form></h3>
</div>
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
<th><button class="btn-link btn_sort">№ </button></th>
<th><button class="btn-link btn_sort">№ Задания </button></th>
<th><button style="font-size: 12px;" class="btn-link btn_sort">Стоимость </button></th>
<th><button style="font-size: 12px;" class="btn-link btn_sort">Дата </button></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach($complaint_fetchAll as $row){
echo '<tr>';
echo '<td style="max-width: 100px;">'.$row['id'].'</td>';
echo '<td style="max-width: 100px;">'.$row['id_task'].'</td>';
echo '<td style="max-width: 100px;">'.$row['money'].'</td>';
echo '<td>'.date("Y-m-d H:i:s", $row['date']).'</td>';
echo '<td><a href="/'.$GLOBALS['adm'].'/mav_task?Id='.$row['id_task'].'" target="_blank" alt="Включить задание"><i class="fa fa-link"></i></a><br><br><a href="?delid_down='.$row['id'].'" target="_blank" alt="Удалить жалобу"><i class="fa fa-trash"></i></a></td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
<?php
if($page_down>1){
$a = $page_down-1;
echo '<a href="?page_down='.$a.'" style="padding: 16px; background: #000; border-radius: 12px; color: #fff;"><-----</a>';
}
if($complaint_numRows==10){
$b = $page_down+1;
echo '<a href="?page_down='.$b.'" style="padding: 16px; background: #000; border-radius: 12px; color: #fff;">-----></a>';
}
?>
<br><br>