View file index.php

File size: 4.16Kb
<? //by rine(Andrey Arapov) & BEPDuKT(Aleksey Ivanov) site: dizkod.ru
include_once('config/config.php');
if(@$_COOKIE[user] == 1){
header('Location: /aut.php');
}

Base::$site = $url;
$kol_news=mysql_result(mysql_query("SELECT COUNT(*) from `news` "),0);
$kol_rev=mysql_result(mysql_query("SELECT COUNT(*) from `reviews` "),0);
$kol_port=mysql_result(mysql_query("SELECT COUNT(*) from `prace` "),0);
Base::head();
echo "<div class='title'>&nbsp;Последняя новость</div>";
echo '<div class="bepdukt">';

$q=mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
$news=mysql_fetch_array($q);
     if(!$news){
    	echo 'Новых новостей нет!';
    	}else{
 $kol=mysql_result(mysql_query("SELECT COUNT(*) from `news_komm` WHERE `id_news`='".$news[id]."' "),0);
    	
    		echo "<b>".$news[title]."</b><br/> <span style='color:green'>".$news['date']."</span><br />";
    		echo ''.$news[msg].'<br />';
    		echo '<a href="news/index.php?p=komm&amp;id='.$news[id].'">Комментарии</a>&nbsp;('.$kol.')';
        }


echo "</div>";
echo "<div class='title'>&nbsp;Последняя работа</div>";
echo '<div class="bepdukt">';
$q=mysql_query("SELECT * FROM `prace` ORDER BY `id` DESC LIMIT 1");
$portfolio=mysql_fetch_array($q);
     if(!$portfolio){
    	echo 'Последних работ нет!';
    	}else{
 echo 'Название:&nbsp;<a href="portfolio/port_list.php?id='.$portfolio[id].'">'.$portfolio[name].'</a><a href="portfolio/files/'.$portfolio[files].'"><img class="left" src="portfolio/files/'.$portfolio[files].'"  width="35" height="43" alt="'.$portfolio[name].'"  title="'.$portfolio[name].'"/></a>';

    		if ($portfolio['stat']==1){
    		echo '<br />Статус : Продан<br />';
    		}else{
    		echo '<br />Статус : Продаётся<br />';
    		}
    		echo 'Цена:'.$portfolio[prace].'<br />';
    		if($access==1){
            echo '<span style="color:red">[<a href="dedit.php?d=del&amp;id='.$portfolio['id'].'">del</a>|<a href="dedit.php?d=edit&amp;id='.$portfolio['id'].'">edit</a>]</span><br />';
    		}}

echo "</div>";
echo "<div class='title'>&nbsp;Последний Отзыв</div>";
echo '<div class="bepdukt">';
$w=mysql_query("SELECT * FROM `reviews` ORDER BY `id` DESC  LIMIT 1");
$reviews=mysql_fetch_array($w);
  if(!$reviews){
    	echo 'Отзывов нет!';
    	}else{


   			if($reviews['stat']==1){
   			echo '<b>Положительный отзыв</b><br />';
   			}else{
   				echo '<b>Отрицательный отзыв</b><br />';
   				}
   			echo ''.$reviews['msg'].'';}
echo "</div>";

echo "<div class='title'>&nbsp;Авторизация</div>";
echo '<div class="bepdukt">';
echo '<form action="aut.php" method="post" >
<input type="text" name="login" maxlength="15" size="5" value="Логин"/>
<input type="password" name="password" maxlength="15" size="6" value="Пароль"/>&nbsp;
<input type="submit"  value="Вход"/></form>
<br/>
&nbsp;<img src="'.$url.'/style/images/icon.png" alt="logotip" /> <a href="/registration.php" title="Registration">Регистрация</a></div>';
echo "<div class='title'>&nbsp;Информация</div>";
echo "<div class='raine'>";
echo "<img src='".$url."/style/images/icon.png' alt='logotip' /> <a href='/news/'>Новости (".$kol_news.")</a><br/></div>";
echo "<div class='raine'>";
echo "<img src='".$url."/style/images/icon.png' alt='logotip' /> <a href='/reviews/'>Отзывы (".$kol_rev.")</a><br/></div>";
echo "<div class='raine'>";
echo "<img src='".$url."/style/images/icon.png' alt='logotip' /> <a href='/portfolio/'>Портфолио (".$kol_port.")</a><br /></div>";
echo "<div class='raine'>";
echo "<img src='".$url."/style/images/icon.png' alt='logotip' /> <a href='/facilities.php'>Наши услуги</a><br/></div>";
echo "<div class='raine'>";
echo "<img src='".$url."/style/images/icon.png' alt='logotip' /> <a href='/agreement.php'>Соглашение</a><br/></div>";
echo "<div class='raine'>";
echo "<img src='".$url."/style/images/icon.png' alt='logotip' /> <a href='/aboutproject.php'>О проекте</a><br /></div>";
Base::foot();
?>