<?php
#-----------------------------------------------------#
#          ********* Бизнес Сайты *********           #
#             Made by   :  BIZON                      #
#               E-mail  :  blin.alex@bk.ru            #
#                 Site  :  http://f913218p.bget.ru    #
#  Вы не имеете право вносить изменения в код скрипта #
#      это может повлечь неработоспособность сайта    #
#-----------------------------------------------------#
////////////////////////////////////////////////////////////// Навигация
echo'<div class="wrapper">';
echo'<div id="breadcrumb">';
echo'<ul>';
if($numaz != 0 && empty($st)){
echo'<li class="first">Галерея на сайте ('.all_dbname(s_gallery).')</li>';
}else{
echo'<li><a href="'.$link.SID.'">Галерея на сайте ('.all_dbname(s_gallery).')</a></li>';
echo'<li>&#187;</li>';
if($st==1)echo'<li class="first">Добавить снимок</li>';
if($st==2)echo'<li class="first">Мои снимки ('.all_dbnamewat(s_gallery,avtor,s_userdan(id)).')</li>';
}
echo'</ul>';
echo'</div></div>';
///////////////////////////////////////////////////////////// Середина
echo'<div class="wrapper">';
echo'<div class="container">';
echo'<div class="content">';
/////////////////////////////////
switch($st)
{
case 1:
if($numaz == 0){
echo'<div class="info">&nbsp;&nbsp;Добавлять снимки могут только авторизованные пользователи ! </div>';
}else{
if(!empty($N_error))echo'<div class="error">'.$N_error.'</div>';
echo'<form method="post" action="/?p='.$pages.'&amp;st='.$st.'&amp;'.SID.'" id="form" enctype="multipart/form-data">';
echo'<div class="field"><label>Описание:</label><div class="input"><input type="text" name="naznew"  maxlength="150" ></div></div>';
echo'<div class="field"><label>Формат файла <b>(JPG)</b></label><div class="input"><input type="file" name="filenew"></div></div>';
echo'<input type="hidden" name="addim" value="go"><div class="submit"><button type="submit">Добавить</button></div>';
echo'</form>';
}
break;
/////////////////////////
case 2:
if($numaz != 0){
$strSQL = "SELECT * FROM s_gallery WHERE `avtor`='".s_userdan(id)."'";
$rs = mysql_query($strSQL);
$total = mysql_num_rows( $rs );
if ($total>0){
echo'<h2>Всего: '.$total.'</h2>';
echo'<table summary="Summary Here" cellpadding="0" cellspacing="0" width="100%">';
echo'<thead><tr><th></th><th>Описание</th><th>Дата</th><th>Статус</th><th></th></tr></thead>';
if ($start < 0 || $start > $total){$start = 0;}
$strdb = "SELECT * FROM s_gallery WHERE `avtor`='".s_userdan(id)."'  ORDER BY time DESC LIMIT $start,7";
$rdd = mysql_query($strdb);
while($ron = mysql_fetch_array($rdd)){
if($ron['status']==0) $stata="<b>На проверке</b>"; else $stata="<s>Проверено</s>";
echo'<tr><td width="70px"><div align="center"><a rel="gallery" class="photo" href="gallery.php?url='.$ron['url'].'&amp;cat=images/gallery" title="'.$ron['nazvan'].'"><img src="ipg.php?url=images/gallery/'.$ron['url'].'&amp;h=58&amp;w=58" alt="pix"></a></div></td><td>'.$ron['nazvan'].'</td><td width="80px" align="center"><b>'.date("d.m.y",$ron['time']).'</b></td>';
echo'<td width="80px" align="center">'.$stata.'</td><td width="18px"><form action="'.$link.'st='.$st.'&amp;'.SID.'" method="post"><input type="hidden" name="delet" value="'.$ron['id'].'"><input type=image src="images/del.gif" name="sub"></form></td>';
echo'</tr>';
}
echo'</table>';
if($total>7)page_strnavigation($link.'st='.$st.'&amp;', 7, $start, $total);
}else{echo'<h1>Снимков нет</h1>';}

}
break;
/////////////////////////

default:
$total = all_dbnamewat(s_gallery,status,1);
if ($total>0){
if ($start < 0 || $start > $total){$start = 0;}
$db_gall= "SELECT * FROM s_gallery WHERE `status`='1' ORDER BY time DESC LIMIT $start,20";
$db_vig = mysql_query($db_gall);
echo'<div align="center">';
while($gall_v = mysql_fetch_array($db_vig)){
++$i;
echo'<a rel="gallery" class="photo" href="gallery.php?url='.$gall_v['url'].'&amp;cat=images/gallery" title="'.$gall_v['nazvan'].'"><img src="gallery.php?url='.$gall_v['url'].'&amp;small=130&amp;cat=images/gallery" alt="" /></a>';
}
echo'</div>';
if($total>20)page_strnavigation($link, 20, $start, $total);
}else{echo'<h2> Галерея пуста </h2>';}
}
echo'</div><div class="column">';
echo'<div class="subnav">';
echo'<h2>Навигация</h2>';
echo'<ul>';
echo'<li><a href="'.$link.SID.'">Галерея ('.all_dbnamewat(s_gallery,status,1).')</a></li>';
if ($numaz != 0){
echo'<li><li><a href="'.$link.'st=1&amp;'.SID.'">Добавить снимок</a></li>';
echo'<li><a href="'.$link.'st=2&amp;'.SID.'">Мои снимки ('.all_dbnamewat(s_gallery,avtor,s_userdan(id)).')</a></li>';
}
echo'</div>';
echo'</div>';
///////////////////////////////////// низ
echo'<br class="clear" />';
echo'</div>';
echo'</div>';

?>