Просмотр файла stol/doneadm.php

Размер файла: 2.85Kb
<?

require_once ( "../includes/start.php" );
require_once ( "../includes/functions.php" );
require_once ( "../includes/header.php" );
include_once ( "../themes/" . $config['themes'] . "/index.php" );
if ( is_admin( array( 101, 102, 103, 105 ) ) )
{
		include_once ( "../includes/db.php" );
		show_title( 'partners.gif', 'Стол заказов.' );
		if ( isset( $_GET['d'] ) )
		{
				if ( isset( $_GET['ok'] ) )
				{
						mysql_query( "UPDATE `stol` SET `status` = '2' WHERE `id` = '" . intval( $_GET['ok'] ) .
								"'" );
						echo 'Одобрено<br />';
				} elseif ( isset( $_GET['del'] ) )
				{

						mysql_query( "DELETE FROM `stol` WHERE `id` = '" . ( int )$_GET['del'] . "' LIMIT 1" );
						echo 'Удалено<br />';
				}
				$total = mysql_num_rows( mysql_query( "SELECT `id` FROM `stol` WHERE `status` = '1'" ) );
				if ( $total <= '0' )
						echo 'Заказов в базе нет' ;
				if ( $start < 0 || $start >= $total )
				{
						$start = 0;
				}
				if ( $total < $start + $config['chatpost'] )
				{
						$end = $total;
				}
				else
				{
						$end = $start + $config['chatpost'];
				}
				$q = mysql_query( "SELECT * FROM `stol` WHERE `id` = '" . ( int )$_GET['d'] . "' LIMIT 1" );
				for ( $i = $start; $i < $end; $i++ )
				{
						while ( $done = mysql_fetch_array( $q ) )
						{
								echo 'ID: ' . $done['id'] . '<br />';
								echo 'Тема: ' . $done['them'] . '<br />';
								echo 'Подробно: ' . $done['text'] . '<br />';
								echo 'Срочность: ';
								if ( $done['sroch'] == 1 )
										echo 'Не срочный<br />';
								if ( $done['sroch'] == 2 )
										echo 'Не тороплю, но не затягивайте<br />';
								if ( $done['sroch'] == 3 )
										echo 'Срочно, но могу подождать<br />';
								if ( $done['sroch'] == 4 )
										echo 'Срочно<br />';
								if ( $done['sroch'] == 5 )
										echo 'Очень срочно<br />';

								echo "Выполнил:  <a href='".BASEDIR."pages/anketa.php?uz=$done[user2]&".SID."'>" . $done['user2'] . "</a><br />";
								echo "URL: " . $done['url'] . "<br />";
								echo "------<br /><a href='?d=" . intval( $_GET['d'] ) . "&amp;ok=$done[id]&".SID."'>Одобрить</a><br />
                        <a href='set.php?done=" . intval( $_GET['d'] ) .
										"&".SID."'>Изменить</a><br />
                        <a href='?d=" . intval( $_GET['d'] ) . "&amp;del=$done[id]&".SID."'>Удалить</a>";
								echo "</div>";
						}
				}
				page_jumpnavigation( 'doneadm.php?', $config['chatpost'], $start, $total );
				page_strnavigation( 'doneadm.php?', $config['chatpost'], $start, $total );
				echo '<br />&laquo;<a href="index.php?'.SID.'">Назад</a>';
		}
}
else
		echo "Вам тут делать нехуй!!!";
include_once ( "../themes/" . $config['themes'] . "/foot.php" );

?>