function listArticles(&$rec, $art_id, &$save) { $sql = "SELECT art_id,artname,parent_id FROM articles WHERE div_id='" . $_SESSION['div'] . "' AND parent_id='" . $art_id . "' ORDER BY artname COLLATE latin1_general_ci"; $res = mysql_query($sql) or die("<script>alert('ОШИБКА ЗАПРОСА 0');</script>"); while ($row = mysql_fetch_array($res)) { $rec = $row['artname']; $save = $row['art_id']; listArticles($rec, $row['art_id'], $save); } //if(!$save){$save=$art_id;} //if($save==$art_id){ //echo"<script>alert('".$art_id."');</script>"; $sql_out = "SELECT * FROM `inout` i, articles a WHERE i.art_id=a.art_id AND i.div_id='" . $_SESSION['div'] . "' AND i.art_id='" . $art_id . "' ORDER BY a.artname COLLATE latin1_general_ci"; $res_out = mysql_query($sql_out); $num = mysql_num_rows($res_out); if ($num) { echo path(&$out, $art_id); echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"; echo "<tr height='22' align='center' class='menu_header' style='color:white;font-family:Tahoma;font-size:14px'>" . "<td>Дата</td>" . "<td>От кого/Кому</td>" . "<td>Сумма, \$</td>" . "<td>Сумма, грн</td>" . "<td>Примечание</td>" . "<td>Удаление</td>" . "</tr>"; while ($row_out = mysql_fetch_array($res_out)) { if ($row_out['payment_dol'] < 0 or $row_out['payment_grn'] < 0) { $img = "io_out_small.gif"; } else { $img = "io_in_small.gif"; } echo "<tr><td><img src=img/" . $img . " border=0>" . $row_out['crdate'] . "</td><td>" . $row_out['payer_reciever'] . "</td><td>" . $row_out['payment_dol'] . "</td><td>" . $row_out['payment_grn'] . "</td><td>" . $row_out['notes'] . "</td><td>Удаление</td></tr>"; } echo "</table>"; } //} //$out=substr($rec,0,-1); //if($out==''){$out=$art_id;} //return $out; }
function listArticles(&$rec, $art_id) { $sql = "SELECT art_id,artname,parent_id FROM articles WHERE parent_id='" . $art_id . "' ORDER BY artname COLLATE latin1_general_ci"; $res = mysql_query($sql) or die("<script>alert('ОШИБКА ЗАПРОСА 0');</script>"); while ($row = mysql_fetch_array($res)) { $rec .= $row['art_id'] . ","; listArticles($rec, $row['art_id']); } $out = substr($rec, 0, -1); if ($out == '') { $out = $art_id; } return $out; }
login(); break; case 'logout': logout(); break; case 'newArticle': newArticle(); break; case 'editArticle': editArticle(); break; case 'deleteArticle': deleteArticle(); break; default: listArticles(); } function login() { $results = array(); $results['pageTitle'] = "Admin Login | Falcon"; if (isset($_POST['login'])) { // User has posted the login form: attempt to log the user in if ($_POST['username'] == ADMIN_USERNAME && $_POST['password'] == ADMIN_PASSWORD) { // Login successful: Create a session and redirect to the admin homepage $_SESSION['username'] = ADMIN_USERNAME; header("Location: admin.php"); } else { // Login failed: display an error message to the user $results['errorMessage'] = "Incorrect username or password. Please try again."; require TEMPLATE_PATH . "/admin/loginForm.php";
$password = $_SESSION['dbpass']; $dbname = $_SESSION['dbname']; $creatediv_id = $_SESSION['div']; $user_id = $_SESSION['id']; mysql_connect($hostname, $username, $password) or die("Нет связи с БД."); mysql_select_db($dbname) or die(mysql_error()); require "outfuntest.php"; echo "<html>\r\n <head>\r\n <TITLE>iBAG.Приход/Расход.Создание Прихода/Расхода.</TITLE>\r\n <link rel='StyleSheet' href='style/styleForIFrame.css' type='text/css'>\r\n\t </head>\r\n <meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>\r\n <body onLoad='sizeTd()'>"; echo "<IFRAME border=0 frameBorder=No height=0 name=helper scrolling=no width=439 leftmargin=0 topmargin=0>\r\n </IFRAME>"; echo "<FORM name='wsform' target='helper' action='uploader.php' method='post'>"; echo "<input name='oper' type='hidden' value=''>"; echo "<input name='inout_id' type='hidden' value=''>"; if (isset($_GET['id'])) { //$start=outTime(); //*listInOut(*/listArticles(&$rec,$_GET['id'])/*)*/; listInOut(listArticles(&$rec, $_GET['id'])); //$end=outTime(); //$total=($end - $start); //echo "<br>Запрос отработан за: ".substr($total,0,4)." сек."; } echo "</FORM>"; echo "</body>\r\n </html>"; ?> <SCRIPT LANGUAGE="JavaScript"> var curBgColor=new Array(); var curColor=new Array(); var color; function document_onmouseover(e){ var howChild=e.childNodes.length; if(e.id=='minus'){color='Maroon'}else{color='Seagreen'} for(var i=0;i<howChild;i++){
?> </ol> <?php foreach ($cats as $cat) { $catobj = new ZenpageCategory($cat); $h4 = $catobj->getTitle(); ?> <h4><a name="<?php echo $catobj->getTitlelink(); ?> "></a><?php echo $h4; ?> </h4> <?php listArticles($catobj); } function listArticles($cat) { global $counter; global $_zp_current_category; $_zp_current_category = $cat; $articles = $cat->getArticles(); if (!empty($articles)) { ?> <ol class="trouble"> <?php foreach ($articles as $titlelink) { $titlelink = $titlelink['titlelink']; $article = new ZenpageNews($titlelink); $counter++;
//$link = '['. FIGURE . $row['id'] . ']' . $row['name']; $paper = '[' . FIGURE . $row['id'] . ']' . $row['name'] . '.' . $row['description']; $text = '<label onClick="javascript:fileSelected(\'' . FIGURE . $row['id'] . '\');">' . $paper . '</label><br/>'; if ($hint == "") { $hint = $text; } else { $hint = $hint . $text; } } return $hint; } //lookup all links from the xml file if length of q>0 if (strlen($q) > 0) { $hint = ""; $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $text = listArticles($dbc, $q); if ($hint == "") { $hint = $text; } else { $hint = $hint . $text; } $text = listImages($dbc, $q); if ($hint == "") { $hint = $text; } else { $hint = $hint . $text; } $text = listConcepts($dbc, $q); if ($hint == "") { $hint = $text; } else {
} print ' <li id="logout"><a class="menu-elements" id="logout">Abmelden</a></li> <li id="user-home"><a class="menu-elements" id="uhome">' . $_SESSION["USERNAME"] . '</a></li> </ul> </div> </div> </nav> '; break; default: // Wenn keine der oberen case eintrifft wird default ausgeführt. // Das bedeutet das auf einen Menueintrag zu einem Thema gecklickt wurde, da alle anderen Varianten schon geprüft wurden. // Es wird die Methode listArticles() aufgerufen und alle Einträge bei denen ThemeName $clickedSubMenu entspricht, // werden sortiert nach ArticleID desc ausgegeben. Bedeutet die mit der kleineren ID oben. $row = listArticles("ThemeName", $clickedSubMenu, "ArticleID", "desc", $SQLiteDB); if (count($row)) { // Es werden alle Posts ausgegeben die als Thema den das geklickte Thema haben. // Wenn auf den Titel des Artikels geklickt wird, wird die Javascriptmethode showArticle() ausgeführt. Bei einem Click auf den Titel eines Artikels, // wird der Javascripthandler von getBlog aufgerufen der darauf die Javascriptmethode showBlog() ausführt. for ($i = 0; $i < count($row); $i++) { print "<div class='content-div'><h2 id='" . $row[$i]['id'] . "' onclick='showArticle(" . $row[$i]["id"] . ")'>" . $row[$i]['title'] . "</h2>"; print "<p name='" . $row[$i]['username'] . "' class='getBlog'>Blog: " . $row[$i]['username'] . "<br></p><br>"; $out = strlen($row[$i]['content']) > 500 ? substr($row[$i]['content'], 0, 500) . "..." : $row[$i]['content']; print $out . "</div>"; } } else { // Falls es keine Artikel in dieser Kategorie gibt. Wird eine Iformation ausgegeben. print "<div id='void-category' class='content-div'><h3>In dieser Kategorie gibt es noch keine Posts.</h3></div>"; } }