82 lines
3.3 KiB
PHP
82 lines
3.3 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
|
|
if( $u->info['admin'] == 0 ) {
|
|
die('Ðàçäåë äëÿ àäìèíèñòðàòîðîâ, òû ÷åãî çäåñü çàáûë?');
|
|
}
|
|
|
|
if(isset($_POST['wtext'])) {
|
|
$txt = $_POST['wtext'];
|
|
$typ = (int)$_POST['select'];
|
|
if( $typ < 0 ) { $typ = 0; }
|
|
if( $typ > 5 ) { $typ = 5; }
|
|
mysql_query('INSERT INTO `worklist` (
|
|
`time`,`uid`,`text`,`complete`,`delete`,`prior`
|
|
) VALUES (
|
|
"'.time().'","'.$u->info['id'].'","'.mysql_real_escape_string($txt).'","0","0","'.mysql_real_escape_string($typ).'"
|
|
)');
|
|
header('location: /main.php?worklist&addgood');
|
|
die();
|
|
}elseif(isset($_GET['addgood'])) {
|
|
echo '<div><b><font color="red">Çàäàíèå óñïåøíî äîáàâëåíî. Òåïåðü îñòàëîñü åãî âûïîëíèòü!</font></b></div>';
|
|
}
|
|
|
|
?>
|
|
<table width="100%" cellspacing="0" cellpadding="0">
|
|
<form method="post" action="main.php?inv">
|
|
<tr>
|
|
<td valign="top" align="left"><img src="https://img.new-combats.com/1x1.gif" alt="" width="1" height="5" /><br />
|
|
</td>
|
|
<td align="center"><h3>Òåêóùèé ïëàí ïî çàõâàòó Ìèðà! :)</h3></td>
|
|
<td align="right">
|
|
<input class="btnnew" type="button" onclick="location.href='main.php?worklist'" name="edit" value="Îáíîâèòü" />
|
|
<input class="btnnew" type="submit" name="edit" value="Âåðíóòüñÿ" />
|
|
<br />
|
|
</td></tr>
|
|
<tr>
|
|
<td align="left"><hr /></td>
|
|
<td align="center"><hr /></td>
|
|
<td align="right"><hr /></td></tr>
|
|
</form>
|
|
<form id="form1" name="form1" method="post" action="">
|
|
<tr>
|
|
<td align="left"></td>
|
|
<td align="left">Äîáàâèòü íîâóþ çàïèñü:<br /><textarea name="wtext" style="width:100%;height:100px;"></textarea></td>
|
|
<td align="left"> <input class="btnnew" type="submit" value="Äîáàâèòü" /><br />
|
|
Ïðèîðèòåò:
|
|
<label for="select"></label>
|
|
<select name="select" id="select">
|
|
<option value="0" selected="selected">Íå âàæíî</option>
|
|
<option value="1">Ìåëî÷ü</option>
|
|
<option value="2">Íåäî÷åò</option>
|
|
<option value="3">Áàã</option>
|
|
<option value="4">Ñåðüåçíûé áàã</option>
|
|
<option value="5">ÂÀÆÍÎ!!!</option>
|
|
</select>
|
|
</td></tr></form>
|
|
<?
|
|
$sp = mysql_query('SELECT * FROM `worklist` WHERE `delete` = 0 ORDER BY `prior` DESC, `time` ASC');
|
|
while( $pl = mysql_fetch_array($sp) ) {
|
|
if(isset($_GET['del']) && $pl['id'] == $_GET['del']) {
|
|
mysql_query('UPDATE `worklist` SET `delete` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
|
}else{
|
|
$pl['text'] = str_replace("\n",'<br>',$pl['text']);
|
|
$plp = array(
|
|
'<font color=grey>Íå âàæíî</font>','<font color=maroon>Íå âàæíî</font>','<font color=green>Íåäî÷åò</font>','<font color=blue>Íå âàæíî</font>','<font color=red>Íå âàæíî</font>','<b><font color=red>ÂÀÆÍÎ!!!</font></b>',''
|
|
);
|
|
echo '<tr>
|
|
<td width="230" valign="top" align="left">#'.$pl['id'].' <small style="color:#adadad">|</small> '.date('d.m.Y H:i',$pl['time']).'<br>Ïðèîðèòåò: '.$plp[$pl['prior']].'</td>
|
|
<td align="left">'.$pl['text'].'</td>
|
|
<td align="right"> <input onclick="location.href=\'/main.php?worklist&del='.$pl['id'].'\';" class="btnnew" type="button" value="X" />
|
|
<br />
|
|
</td></tr><tr>
|
|
<td align="left"><hr /></td>
|
|
<td align="center"><hr /></td>
|
|
<td align="right"><hr /></td></tr>';
|
|
}
|
|
}
|
|
?>
|
|
</table>
|