remove obsolete code

This commit is contained in:
lopar 2019-06-22 13:05:59 +03:00
parent 29fd975054
commit 28615eec69

View File

@ -50,58 +50,15 @@ class zayavka
return $team;
}
/**
* @param int $razdel - тип поединка (1-нубы,2-физы,4-группы,5-хаос)
* @param null $level - показывать заявки только N уровня
* @param null $id
* @return mixed
* @throws \Krugozor\Database\Mysql\Exception
*/
function getlist($razdel = 1, $level = null, $id = null)
{
/*
* $level - заявки какого уровня мне показывать
* $razdel - тип поединка
* 1 - нубы
* 2 - физы
* 4 - группы
* 5 - хаос
*
* if ($level AND $razdel==4 AND $id):
* SELECT * FROM `zayavka` WHERE
* (`t1min` <= {$level} OR `t1min` = 99) AND
* (`t1max` >= {$level} OR `t1max` = 99) AND
* (`t2min` <= {$level} OR `t2min` = 99) AND
* (`t2max` >= {$level} OR `t2max` = 99) AND
* `level` = {$razdel} AND
* `id` = {$id}
*
* if ($level AND $razdel!=4 AND $id):
* SELECT * FROM `zayavka` WHERE
* (`t1min` <= {$level} OR `t1min` = 99) AND
* (`t1max` >= {$level} OR `t1max` = 99) AND
* `level` = {$razdel} AND
* `id` = {$id}
*
* if ($level AND $razdel!=4 AND !$id):
* SELECT * FROM `zayavka` WHERE
* (`t1min` <= {$level} OR `t1min` = 99) AND
* (`t1max` >= {$level} OR `t1max` = 99) AND
* `level` = {$razdel}
*
* if ($level AND $razdel==4 AND !$id):
* SELECT * FROM `zayavka` WHERE
* (`t1min` <= {$level} OR `t1min` = 99) AND
* (`t1max` >= {$level} OR `t1max` = 99) AND
* (`t2min` <= {$level} OR `t2min` = 99) AND
* (`t2max` >= {$level} OR `t2max` = 99) AND
* `level` = {$razdel}
*
* if (!$level AND $id):
* SELECT * FROM `zayavka` WHERE
* `level` = {$razdel}
* `id` = {$id}
*
* if (!$level AND !$id):
* SELECT * FROM `zayavka` WHERE
* `level` = {$razdel}
*
* Пидорасы!
*/
$sql = db::c()->prepare('SELECT * FROM `zayavka` WHERE `level` = ?i', $razdel);
if (!is_null($level)) {
$sql .= db::c()->prepare(' AND (`t1min` <= ?i OR `t1min` = 99) AND (`t1max` >= ?i OR `t1max` = 99)', $level, $level);
@ -115,22 +72,6 @@ class zayavka
$fict = db::c()->query($sql);
// $fict = mysql_query("
//SELECT * FROM `zayavka`
//WHERE " .
// (($level != null) ?
// " ((`t1min` <= '{$level}' OR `t1min` = '99') AND (`t1max` >= '{$level}' OR `t1max` = '99') "
// . (($razdel == 4) ?
// "AND (`t2min` <= '{$level}' OR `t2min` = '99') AND (`t2max` >= '{$level}' OR `t2max` = '99')"
// : "")
// . ") AND "
// : "")
// . " `level` = {$razdel} "
// . (($id != null) ?
// " AND `id` = {$id} "
// : "")
// . " ORDER BY `podan` DESC");
while ($row = $fict->fetch_assoc()) {
if (($row['start'] + 300) < time()) {
if (db::c()->query('DELETE FROM `zayavka` WHERE `id` = ?i', $row['id'])) {
@ -149,7 +90,7 @@ class zayavka
return $zay;
}
function addteam($team = 1, $id, $zay, $r)
function addteam($team, $id, $zay, $r)
{
global $user;
$owntravma = mysql_fetch_array(mysql_query("SELECT `id`, `type` FROM `effects` WHERE `owner` = " . $id . " AND (`type` = 12 OR `type` = 13)"));