source: Section.php

Last change on this file was 1, checked in by george, 15 years ago
  • Import souborů projektu.
File size: 1.5 KB
Line 
1<?php
2 include 'includes/Global.php';
3
4 function WriteArticles($Line)
5 { // BEGIN function WriteArticles
6 global $Icons;
7 global $AdminLevel;
8
9 echo '<div class="ArticlesItem"><span class="ArticlesName">'.$Line['Name'].'</span> - <span class="ArticlesDescription">'.$Line['Description'].'</span> - <span class="Date">'.$Line['Date'].'</span>';
10
11 if ($AdminLevel > 1) // level 2
12 echo '<a href="/Administrace/AddArticles.php?Mode=FormEdit&amp;ID='.$Line['ID'].'"> '.$Icons['Edit'].'</a>';
13 if ($AdminLevel > 3) // level 4
14 echo '<a href="/Administrace/AddArticles.php?Mode=DelArticle&amp;Section='.$Line['ID'].'" '.JavaQuestionDel().'> '.$Icons['Del'].'</a>';
15
16 echo '<br />'.$Line['Text'].'</div>';
17 } // END function WriteArticles
18
19
20
21 if (array_key_exists('Section', $_GET)) {
22 $Section = $_GET['Section'];
23
24 $sql = "SELECT * FROM articles WHERE SectionID = '$Section'";
25 // echo $sql;
26 $ID = $db->SQLCommand($sql);
27 // echo '<table border="0">';
28 while($Line = mysql_fetch_array($ID)) {
29 WriteArticles($Line);
30 }
31 // echo '</table>';
32 }
33
34 if (array_key_exists('Article', $_GET)) {
35 $Article = $_GET['Article'];
36
37 $sql = "SELECT * FROM articles WHERE ID = '$Article'";
38 // echo $sql;
39 $ID = $db->SQLCommand($sql);
40 // echo '<table border="0">';
41 while($Line = mysql_fetch_array($ID)) {
42 WriteArticles($Line);
43 }
44 // echo '</table>';
45 }
46
47 ShowFooter();
48?>
Note: See TracBrowser for help on using the repository browser.