[go: up one dir, main page]

Menu

[r110]: / code / top.php  Maximize  Restore  History

Download this file

143 lines (118 with data), 6.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
echo "<div > ";
$lmitems = mysql_query("select * from leftmenu where permission<=$permis order by morder");
$lmitemcount = mysql_num_rows($lmitems);
$k=0;//Находим максимальное число пунктов подменю
for($i=0;$i<$lmitemcount;$i++) {
$lmsitemsstr = "select * from leftsubmenu where parent=".mysql_result($lmitems,$i,0)." and permission<=$permis order by morder";
$lmsitems = mysql_query($lmsitemsstr);
$lmsitemcount = mysql_num_rows($lmsitems);
if($k<$lmsitemcount) $k = $lmsitemcount;
}
for($i=0;$i<$lmitemcount;$i++) {
$toptable[0][$i*2]="<td><img src=\"".$design_path.mysql_result($lmitems,$i,4)." \"></td>\n";//Взять картинку иконки левого меню
$toptable[0][$i*2+1]="<td class=\"left_menu\">".mysql_result($lmitems,$i,1)."</td>\n";//Взять название пункта левого меню
$lmsitemsstr = "select * from leftsubmenu where parent=".mysql_result($lmitems,$i,0)." and permission<=$permis order by morder";//Находим пункты каждого подменю
$lmsitems = mysql_query($lmsitemsstr);
for($j=0;$j<$k;$j++) {
if(mysql_result($lmsitems,$j,3)<=$permis) {
$toptable[$j+1][$i*2]="<td>&nbsp;</td>\n";
//if( mysql_result($lmsitems,$j,5)!="" ) ;// echo"<td><p class=\"left_menu_item\"><a href=\"".mysql_result($lmsitems,$j,5)."\" class=\"left_menu_item\" target=\"blanc\"></a></p></td>\n";
//else echo "<td><p class=\"left_menu_item\"><a href=\"?lsm=".mysql_result($lmsitems,$j,0)."\" class=\"left_menu_item\"></a></p></td>\n";
if(mysql_result($lmsitems,$j,1)!="") {
if( mysql_result($lmsitems,$j,5)!="" ) $toptable[$j+1][$i*2+1] =$toptable[$j+1][$i*2+1]."<td><p class=\"left_menu_item\"><a href=\"".mysql_result($lmsitems,$j,5)."\" class=\"left_menu_item\" target=\"blanc\">".mysql_result($lmsitems,$j,1)."</a></p></td>\n";
else $toptable[$j+1][$i*2+1] =$toptable[$j+1][$i*2+1]."<td><p class=\"left_menu_item\"><a href=\"?lsm=".mysql_result($lmsitems,$j,0)."\" class=\"left_menu_item\">".mysql_result($lmsitems,$j,1)."</a></p></td>\n";
}
else $toptable[$j+1][$i*2+1]="<td>&nbsp;</td>\n";
}
else {
$toptable[$j+1][$i*2]="<td>&nbsp;</td>\n";
$toptable[$j+1][$i*2+1]="<td>&nbsp;</td>\n";
}
}
}
//Вывод короткого меню
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
for($i=0;$i<$k+1;$i++) {
echo " <tr>\n";
for($j=0;$j<$lmitemcount*2;$j++) {
echo $toptable[$i][$j];
}
echo " </tr>\n";
}
echo "</table>";
echo "</div>";
echo "<br>";
//Вывод баннеров
$page_request = "select * from banners where >;
$p = mysql_query($page_request);
$pageexsist = mysql_num_rows($p);
if($pageexsist) {
echo "<div align=\"center\">";
echo "<table width=\"80%\" align=\"center\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\">\n";
echo "<tr>\n";
for($i=0;$i<$pageexsist;$i++){
echo "<tr><td>\n";
echo "<a href=\"".mysql_result($p,$i,3)."\">";
echo "<img src=\"http://".$GLOBALS[HTTP_HOST]."/".mysql_result($p,$i,2)."\">";
echo "</a>\n";
echo "</td>\n";
}
echo "</tr>";
echo "</table>\n";
echo "</div>";
}
//Вывод новостей и объявлений
$now_date = date("Y-m-d");
$messagesitems = mysql_query("select * from messages where >\"1\" and permis<=$permis and actual_date>=\"$now_date\" order by messagesdate DESC");
$messagesitemcount = mysql_num_rows($messagesitems );
$newsitems = mysql_query("select * from news where >\"1\" and permis<=$permis order by newsdate DESC");
$newsitemcount = mysql_num_rows($newsitems );
echo "<br><br > ";
echo "<div > ";
echo "<table width=\"80%\" align=\"center\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\">\n";
echo "<tr>\n";
if($messagesitemcount>0) {
echo " <td class=\"news_top_text\" width=\"50%\">\n";
echo "<a class=\"news_top\" href=\"/?mm=4&sm=18\" >Объявления</a>";
echo " </td>\n";
}
if($newsitemcount>0) {
echo " <td class=\"news_top_text\">\n";
echo "<a class=\"news_top\" href=\"/?mm=4&sm=17\" >Последние новости</a>\n";
echo " </td>\n";
}
echo "</tr>\n";
echo "<tr>\n";
//Содержание объявлений
if($messagesitemcount>0) {
echo " <td valign=\"top\">\n" ;
for($i=0;$i<$messagesitemcount;$i++) {
echo "<b>".MStrToDate(mysql_result($messagesitems ,$i,1))." : ".mysql_result($messagesitems ,$i,2)."</b><br>".mysql_result($messagesitems ,$i,3)."<br>";
echo "<table width=\"100%\" border=\"0\"><tr><td aling=\"left\" width=\"50%\">";
if(mysql_result($messagesitems ,$i,4)!="") echo "<a href=\"/?mm=4&sm=18&messagesid=".mysql_result($messagesitems ,$i,0)."\"><img src=\"".$design_path."details.png\"></a>";
echo "</td><td align=\"right\">";
echo "<a href=\"/?mm=4&sm=18&messagesid=".mysql_result($messagesitems ,$i,0)."\"><img src=\"".$design_path."link.png\"></a>";
echo "</td></tr></table>";
echo "<hr>";
}
echo " </td>\n";
}
if($newsitemcount>0) {
echo " <td valign=\"top\">\n";
//Содержание новостей
for($i=0;$i<$newsitemcount;$i++) {
echo "<b>".MStrToDate(mysql_result($newsitems ,$i,1))." : ".mysql_result($newsitems ,$i,2)."</b><br>".mysql_result($newsitems ,$i,3)."<br>";
echo "<table width=\"100%\" border=\"0\"><tr><td aling=\"left\" width=\"50%\">";
if(mysql_result($newsitems ,$i,4)!="") echo "<a href=\"/?mm=4&sm=17&newsid=".mysql_result($newsitems ,$i,0)."\"><img src=\"".$design_path."details.png\"></a> ";
echo "</td><td align=\"right\">";
echo "<a href=\"/?mm=4&sm=17&newsid=".mysql_result($newsitems ,$i,0)."\"><img src=\"".$design_path."link.png\"></a>";
echo "</td></tr></table>";
echo "<hr>";
}
echo " </td>\n";
}
echo "</tr>\n";
echo "</table>";
echo "</div>";
?>