Example #1
0
function sendNewsletter($from, $newsTitle, $newsBody)
{
    $sql = "SELECT * FROM mailing_list WHERE active='1'";
    $result = MYSQL_QUERY($sql);
    $numberOfRows = MYSQL_NUMROWS($result);
    $i = 0;
    while ($i < $numberOfRows) {
        $thisEmail = MYSQL_RESULT($result, $i, "email");
        $thisUid = MYSQL_RESULT($result, $i, "uid");
        $thisName = MYSQL_RESULT($result, $i, "full_name");
        /* recipients */
        $to = $thisEmail;
        // note the comma
        /* subject */
        $subject = $newsTitle;
        /* message */
        $message = "Dear {$thisName} <br>";
        $message .= $newsBody . '<br><br><a href="' . _PREF . 'modules/mailing_ilst/deleteMailing_list.php?thisEmailField=' . $thisEmail . '&thisUidField=' . $thisUid . '">
			To unsubscribe please click here</a>';
        /* To send HTML mail, you can set the Content-type header. */
        $headers = "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
        /* additional headers */
        $headers .= "To:" . $thisEmail . "\r\n";
        $headers .= "From: " . $from;
        /* and now mail it */
        $s = mail($to, $subject, $message, $headers);
        $i++;
    }
    if ($s) {
        echo '<script>correctMessage("Message Sent successfuly");</script>';
    } else {
        echo '<script>errorMessage("Sorry message has not been sent, an error has occurred");</script>';
    }
}
Example #2
0
<?php

include_once "../common/dbConnection.php";
include_once "../common/header.php";
$thisCHARACTER_SET_NAME = $_REQUEST['CHARACTER_SET_NAMEField'];
$sql = "SELECT   * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = '{$thisCHARACTER_SET_NAME}'";
$result = MYSQL_QUERY($sql);
$numberOfRows = MYSQL_NUMROWS($result);
if ($numberOfRows == 0) {
    ?>

Sorry. No records found !!

<?php 
} else {
    if ($numberOfRows > 0) {
        $i = 0;
        $thisCHARACTER_SET_NAME = MYSQL_RESULT($result, $i, "CHARACTER_SET_NAME");
        $thisDEFAULT_COLLATE_NAME = MYSQL_RESULT($result, $i, "DEFAULT_COLLATE_NAME");
        $thisDESCRIPTION = MYSQL_RESULT($result, $i, "DESCRIPTION");
        $thisMAXLEN = MYSQL_RESULT($result, $i, "MAXLEN");
    }
}
?>

View Record<br><br>

<table>
<tr height="30">
	<td align="right"><b>CHARACTER_SET_NAME : </b></td>
	<td><?php 
Example #3
0
function updateAfterDelete($table, $newId)
{
    $test = 1;
    echo $newId;
    $s = "select * from {$table} ";
    $r = mysql_query($s);
    $numberOfRows = MYSQL_NUMROWS($r);
    $iz = 0;
    $newId = explode(',', $newId);
    while ($iz < $numberOfRows) {
        $id = MYSQL_RESULT($r, $iz, "id");
        $arr = MYSQL_RESULT($r, $iz, "collage_id");
        $selected_ids = explode(',', $arr);
        $n = "";
        foreach ($selected_ids as $c) {
            if (!in_array($c, $newId) || $c === '0') {
                $n .= $c . ",";
            } else {
                $test = 0;
            }
        }
        if ($test == 0) {
            $n = str_replace(',,', ',', $n);
            $wq = 'UPDATE ' . $table . ' SET `collage_id`="' . $n . '" WHERE id=' . $id;
            mysql_query($wq);
        }
        $n = "";
        $test = 1;
        $iz++;
    }
}
Example #4
0
                      <thead>
                  <tr>
                              <td width="697" align="left" bgcolor="#cccccc"><strong>Comment</strong></td>
                              
                              <td width="64" align="center" bgcolor="#cccccc">Post</td>
                              <td width="85" align="center" bgcolor="#cccccc">Delete</td>
                            </tr>
                            </thead>
                            <?php 
include "include/dbconnection.php";
// sending query
$result = mysql_query("SELECT * FROM comment WHERE status='unpost' ORDER BY date");
if (!$result) {
    die("Query to show fields from table failed");
}
$rows = MYSQL_NUMROWS($result);
if ($rows == 0) {
    echo '<div style=" color:red; text-align:center;"><h5>No Comments Found!</h5></div>';
} else {
    if ($rows > 0) {
        $i = 0;
        while ($i < $rows) {
            if ($i % 2 == 0) {
                $bgcolor = '#FFFFFF';
            } else {
                $bgcolor = '@C0C0C0';
            }
            $comment = MYSQL_RESULT($result, $i, "comment");
            $comment_id = MYSQL_RESULT($result, $i, "comment_id");
            ?>
                            <tr>
<body onLoad="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php 
require DIR_WS_INCLUDES . 'header.php';
?>
<!-- header_eof //-->
<?php 
error_reporting(7);
if ($cID == "") {
    echo "'cID' Can not be empty <input type=\"button\" name=\"Submit2\" value=\"hitstory\" onClick=\"javascript:history.go(-1);\" />";
    exit;
}
$sql = "select * from website where web_cid=" . $cID;
$rs = mysql_query($sql);
if (MYSQL_NUMROWS($rs) == 0) {
    echo "'cID' Can not be empty <a href=product_acquisition_add.php?cID=" . $cID . ">Enter</a>";
    exit;
}
$web_name = mysql_result($rs, 0, "web_name");
$coding = mysql_result($rs, 0, "web_coding");
$fun_name = mysql_result($rs, 0, "web_fun_name");
$fun = mysql_result($rs, 0, "web_fun_content");
$content = mysql_result($rs, 0, "web_fun_remarks");
$replacement = mysql_result($rs, 0, "web_replace");
$discount1 = mysql_result($rs, 0, "web_fun_a");
$discount2 = mysql_result($rs, 0, "web_fun_b");
$testurl = mysql_result($rs, 0, "web_test_url");
//$testurl = str_replace("&","||||||",str_replace("?","______",$testurl));
$arr_fun_name = split(", ", $fun_name);
$arr_fun = split(", ", $fun);
Example #6
0
function setSEO($lang, $file, $title, $des, $keywords = '')
{
    $des = strip_tags($des);
    $title = strip_tags($title);
    $sql = "SELECT * FROM seo WHERE filename = '{$file}' ";
    $result = MYSQL_QUERY($sql);
    $numberOfRows = MYSQL_NUMROWS($result);
    if ($numberOfRows > 0) {
        $SQL = "UPDATE seo SET title_" . $lang . " = '{$title}' , keywords_" . $lang . " = '{$keywords}' , description_" . $lang . " = '{$des}' WHERE filename = '{$file}' ";
        $result = mysql_query($SQL);
    } else {
        $SQL = "INSERT INTO seo (filename , title_" . $lang . " , keywords_" . $lang . " , description_" . $lang . " ) VALUES \n\t\t('{$file}' , '{$title}' , '{$keywords}' , '{$des}')";
        $result = mysql_query($SQL);
    }
}
Example #7
0
<?
include 'kart2.php';
?>
</TD>
<TD valign="top" width="100%">
<br>
<span class="tittel">Informasjon om innmeldt sak</span><br><br>
<?
include 'config.php';

	// 
	$today = date("Ymd");
   $query = "select * from fiksgrafitti where id = $id"; 

	$result = MYSQL_QUERY($query);
    $number = MYSQL_NUMROWS($result);
	MYSQL_CLOSE();

 // lag HTML
 if ($number == 0)
 {
	  print " <table width=\"100%\" border=0 bgcolor=\"#ffffff\>\n";
	print "<tr>\n";
	print "<td class=\"tittel\">Det er ikke registrert noen saker</td>\n";
	print "</tr>\n";
	 print " </table>\n";
 }
 else
 {
	 $i = 0;
	 WHILE ($i < $number):
Example #8
0
function show_all_history_stat($link)
{
    global $o;
    global $detailed;
    global $mode;
    global $lang;
    global $settings;
    global $utime;
    if ($lang == 0) {
        include "../inc/ru.php";
    }
    if ($lang == 1) {
        include "../inc/en.php";
    }
    $page = (int) $_GET['page'];
    // ----------------------------
    $pagestep = $settings['pagelen'];
    //-----------------------------
    $cquery = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];
    if (0 < strpos($cquery, "&page=")) {
        $cquery = substr($cquery, 0, strpos($cquery, "&page="));
    }
    echo "<br><center><p style=\"font-size: 12\">";
    $result = mysql_query("SELECT count(site) as rec FROM site", $link);
    $pages = floor(mysql_result($result, 0, "rec") / $pagestep);
    if ($page != 0) {
        echo "<a href=\"{$cquery}" . "&page=0\"><<</a> ";
    }
    if ($page > 10) {
        echo "<a href=\"{$cquery}&page=" . ($page - 10) . "\"><</a> ";
    }
    if ($page - 5 > 0) {
        for ($i = $page - 5; $i < $page; $i++) {
            echo "<a href=\"{$cquery}&page={$i}\">{$i}</a> ";
        }
    } else {
        for ($i = 1; $i < $page; $i++) {
            echo "<a href=\"{$cquery}&page={$i}\">{$i}</a> ";
        }
    }
    echo "<b>{$page}</b> ";
    if ($page + 5 < $pages) {
        for ($i = $page + 1; $i < $page + 6; $i++) {
            echo "<a href=\"{$cquery}&page={$i}\">{$i}</a> ";
        }
    } else {
        for ($i = $page + 1; $i < $pages; $i++) {
            echo "<a href=\"{$cquery}&page={$i}\">{$i}</a> ";
        }
    }
    if ($page + 10 < $pages) {
        echo "<a href=\"{$cquery}&page=" . ($page + 10) . "\">></a> ";
    }
    if ($page < $pages) {
        echo "<a href=\"{$cquery}&page=" . $pages . "\">>></a> ";
    }
    echo "</p>";
    switch ($o) {
        case "sizeD":
            $orderby = "size DESC";
            $o1 = "?o=sizeA";
            $o2 = "?o=siteA";
            $b1 = "#93BEE2";
            $b2 = "#FFFFFF";
            $p1 = "<A HREF=\"index.php{$o1}\"><IMG ALT=\"{$web_client_order_desc}\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/desc.gif></A>&nbsp;";
            $p2 = "";
            break;
        case "sizeA":
            $orderby = "size ASC";
            $o1 = "?o=sizeD";
            $o2 = "?o=siteA";
            $b1 = "#93BEE2";
            $b2 = "#FFFFFF";
            $p1 = "<A HREF=\"index.php{$o1}\"><IMG ALT=\"{$web_client_order_asc}\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/asc.gif></A>&nbsp;";
            $p2 = "";
            break;
        case "siteD":
            $orderby = "site DESC";
            $o1 = "?o=sizeA";
            $o2 = "?o=siteA";
            $b1 = "#FFFFFF";
            $b2 = "#93BEE2";
            $p1 = "";
            $p2 = "<A HREF=\"index.php{$o2}\"><IMG ALT=\"{$web_client_order_desc}\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/desc.gif></A>&nbsp;";
            break;
        case "siteA":
            $orderby = "site ASC";
            $o1 = "?o=sizeA";
            $o2 = "?o=siteD";
            $b1 = "#FFFFFF";
            $b2 = "#93BEE2";
            $p1 = "";
            $p2 = "<A HREF=\"index.php{$o2}\"><IMG ALT=\"{$web_client_order_asc}\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/asc.gif></A>&nbsp;";
            break;
        default:
            $orderby = "size DESC";
            $o1 = "?o=sizeA";
            $o2 = "?o=siteA";
            $b1 = "#93BEE2";
            $b2 = "#FFFFFF";
            $p1 = "<A HREF=\"index.php{$o1}\"><IMG ALT=\"{$web_client_order_asc}\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/asc.gif></A>&nbsp;";
            $p2 = "";
    }
    echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>";
    echo "<TR>";
    echo "<TD BGCOLOR=#93BEE2>";
    echo "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1>";
    echo "<TR>";
    echo "<TD ALIGN=CENTER BGCOLOR={$b1}>{$p1}<B><A HREF=\"index.php{$o1}&type=allshist&utime={$utime}\" STYLE=\"color:#000000; text-decoration: underline\">{$web_client_downloaded}</A></B></TD>";
    echo "<TD ALIGN=CENTER BGCOLOR={$b2}>{$p2}<B><A HREF=\"index.php{$o2}&type=allshist&utime={$utime}\" STYLE=\"color:#000000; text-decoration: underline\">{$web_client_site}</A></B></TD>";
    #echo "<TD ALIGN=CENTER BGCOLOR=#bfbfbf><B>$web_client_futime</B></TD>";
    #echo "<TD ALIGN=CENTER BGCOLOR=#bfbfbf><B>$web_client_lutime</B></TD>";
    echo "</TR>";
    #$res = mysql_query("SELECT * FROM site WHERE u_id=$id ORDER BY $orderby", $link);
    #$res = mysql_query("SELECT u_id, utime, qtime, ip_addr, code, size, url FROM detail WHERE url like('%".mysql_escape_string($site)."%')  ORDER BY $orderby limit ".($page*$pagestep).",$pagestep", $link);
    #$res = mysql_query("SELECT * FROM site ORDER BY $orderby LIMIT ".($page*$pagestep).",$pagestep", $link);
    $res = mysql_query("SELECT s.site as site, s.size as size FROM uhistory u, shistory s WHERE u.utime={$utime} and u.id=s.uh_id ORDER BY {$orderby} LIMIT " . $page * $pagestep . ",{$pagestep}", $link);
    #$res = mysql_query("SELECT s.site as site, s.size as size FROM uhistory u, shistory s WHERE u.utime=$utime and u.id=s.uh_id LIMIT ".($page*$pagestep).",$pagestep", $link);
    #$res = mysql_query("SELECT s.site as site, s.size as size FROM uhistory u, shistory s WHERE u.utime=$utime and u.id=s.uh_id", $link);
    #$res = mysql_query("SELECT * FROM shistory ORDER BY $orderby LIMIT ".($page*$pagestep).",$pagestep", $link);
    if (!$res) {
        return 3;
    }
    for ($i = 0; $i < MYSQL_NUMROWS($res); $i++) {
        $site = mysql_result($res, $i, "site");
        $size = mysql_result($res, $i, "size");
        #$lutime = mysql_result($res,$i,"lutime");
        #$futime = mysql_result($res,$i,"futime");
        echo "<TR>\n<TD BGCOLOR=#FFF7E5 ALIGN=RIGHT>" . dotize($size) . "</TD>\n<TD BGCOLOR=#FFF7E5>";
        if ($detailed == 1) {
            if ($mode == "admin") {
                //{echo "<a href=\"index.php?id=$id&type=detail&site=$site\">";}
                //{echo "<a href=\"index.php?type=alldetail&site=$site\">";}
                //  else
                //{echo "<a href=\"index.php?type=detail&site=$site\">";};
                //{echo "<a href=\"index.php?type=alldetail&site=$site\">";};
                echo "{$site}";
            }
        }
        if ($detailed == 1) {
            echo "</a>";
        }
        #echo "<TD BGCOLOR=#FFF7E5>".strftime ("%B %d, %T", (int)$futime)."</TD>";
        #echo "<TD BGCOLOR=#FFF7E5>".strftime ("%B %d, %T", (int)$lutime)."</TD>";
        echo "</TD></TR>";
    }
    echo "</TABLE></TD>\n</TR>\n</TABLE>\n";
    #$res = mysql_query("SELECT SUM(size) FROM site WHERE u_id=$id", $link);
    #$res = mysql_query("SELECT SUM(size) FROM site", $link);
    #$res = mysql_query("SELECT SUM(size) FROM shistory", $link);
    $res = mysql_query("SELECT SUM(s.size) as size FROM uhistory u, shistory s WHERE u.utime={$utime} and u.id=s.uh_id", $link);
    $sum = mysql_result($res, 0);
    #$res = mysql_query("SELECT count(site) FROM site WHERE u_id=$id", $link);
    #$res = mysql_query("SELECT count(site) FROM site", $link);
    #$res = mysql_query("SELECT count(site) FROM shistory", $link);
    $res = mysql_query("SELECT SUM(s.site) as site FROM uhistory u, shistory s WHERE u.utime={$utime} and u.id=s.uh_id", $link);
    $sites = mysql_result($res, 0);
    mysql_close();
    echo "<BR><SPAN CLASS=\"smalltext\"><B>{$word_total}:</B> " . dotize($sum) . " {$word_byte} {$web_client_downloaded_from} {$sites} {$web_client_sites_wrd}.</SPAN>";
    return true;
}
$parser->set_option('XML_OPTION_TRIM_DATA_NODES');
// Set the handlers
$parser->set_element_handler('openHandler', 'closeHandler');
// Parse the document
$parser->parse($html);
// Begin creation of the RSS feed.
$rss = new UniversalFeedCreator();
$rss->title = $blogtitle;
$rss->description = $blogexp;
$rss->link = $blogurl;
$rss->syndicationURL = $blogrss;
$rss->copyright = strftime("%Y") . " " . $blogauthor;
// Grab the most recent 100 of the cached URLs (i.e. building permit summaries) from the MySQL table.
$query = "SELECT url,heading,dateadded,filesize from permitcache order by dateadded DESC limit 10";
$result = MYSQL_QUERY($query);
$howmanyrecords = MYSQL_NUMROWS($result);
$currentrecord = 0;
while ($currentrecord < $howmanyrecords) {
    $url = mysql_result($result, $currentrecord, "url");
    $heading = mysql_result($result, $currentrecord, "heading");
    $dateadded = mysql_result($result, $currentrecord, "dateadded");
    $filesize = mysql_result($result, $currentrecord, "filesize");
    // Parse apart the date into its component parts.
    list($date, $time) = explode(" ", $dateadded);
    list($year, $month, $day) = explode("-", $date);
    list($hour, $minute, $second) = explode(":", $time);
    $date_number = mktime($hour, $minute, $second, $month, $day, $year);
    // Add a channel item to the RSS feed.
    $item = new FeedItem();
    $item->title = $heading . " Building Permit Summary";
    $item->link = "http://www.city.charlottetown.pe.ca/" . $url;
Example #10
0
    ?>
	<input type='submit' style='width:200px; margin-left:15px;' name='id' value='Friends' >
	
	<?php 
}
?>
    </td>
    </tr>
      </table> 
      <table class="table2" style="margin-top:10px;">
           <tr>
            <td>
			<?php 
$o = "SELECT * FROM friends WHERE(friend_one ='{$member_id}' OR friend_two ='{$member_id}') AND status='1'";
$rsut = mysql_query($o);
$numberOfRows = MYSQL_NUMROWS($rsut);
echo '<a href=friendsfriends.php?id=' . $row["user_id"] . '>' . "Friends" . '   (' . $numberOfRows . ')' . '</a>';
?>
    </td>
            </tr>
          </table>	
      <br />        
	   </nav>
   <?php 
include 'mainpage1.php';
?>
    
   
        </body>
</html>        
		
Example #11
0
						<p class="graph_type">User</p>
					  </div>
                     <div class="graph_previous">
                        <p class="graph_day"></p>
						<p class="graph_count"><?php 
//echo "On";
?>
</p>
						<p class="graph_type"></p>
					  </div>   
                   </article>
                     <?php 
$cw = mysql_query("SELECT * FROM user_details WHERE join_date=' " . date('Y-m-d') . "'");
$no = MYSQL_NUMROWS($cw);
$wc = mysql_query("SELECT * FROM user_details");
$on = MYSQL_NUMROWS($wc);
?>
                        
                    <article class="stats_overview">
                        <div class="overview_today">
                        <p class="overview_day">Registered Today</p>
						<p class="overview_count"><?php 
echo $no;
?>
</p>
						<p class="overview_type">User</p>
						</div>
                        <div class="overview_previous">
                        <p class="overview_day">Total</p>
						<p class="overview_count"><?php 
echo $on;
 $days = floor($row['TimeSpent'] / (60 * 60 * 24));
 $remainder = $row['TimeSpent'] % (60 * 60 * 24);
 $hours = floor($remainder / (60 * 60));
 $remainder = $remainder % (60 * 60);
 $minutes = floor($remainder / 60);
 $seconds = $remainder % 60;
 if ($days > 0) {
     echo date('F d Y', $row['date_created']);
 } elseif ($days == 0 && $hours == 0 && $minutes == 0) {
     echo "few seconds ago";
 } elseif ($days == 0 && $hours == 0) {
     echo $minutes . ' minutes ago';
 }
 echo '</font><br />';
 $qqq = mysql_query("SELECT * FROM postcomment WHERE post_id='" . $row['post_id'] . "'");
 $numberOfRows = MYSQL_NUMROWS($qqq);
 if ($numberOfRows > 0) {
     if ($numberOfRows == 1) {
         echo '<a HREF="postcomment.php?pid=' . $row['post_id'] . '"><small>1 comment</small></a>';
     }
     if ($numberOfRows == 3 || $numberOfRows == 2) {
         echo '<a HREF="postcomment.php?pid=' . $row['post_id'] . '"><small>' . $numberOfRows . " comments</small></a>";
     }
     if ($numberOfRows >= 4) {
         echo '<a HREF="postcomment.php?pid=' . $row['post_id'] . '"><small>(' . $numberOfRows . ')View all comments</small></a>';
     }
 }
 echo '<br /><br />';
 $query1 = "SELECT *,\n\t\tUNIX_TIMESTAMP() - date_created AS CommentTimeSpent FROM postcomment WHERE post_id=" . $row['post_id'] . " ORDER BY comment_id ASC LIMIT 3";
 $result1 = mysql_query($query1);
 while ($row1 = mysql_fetch_assoc($result1)) {
Example #13
0
function getTopParent($pageLang, $menu_id)
{
    $curr = $menu_id;
    while ($curr != 0) {
        $menu = MYSQL_QUERY("SELECT p_id FROM menus WHERE (lang = '{$pageLang}') AND menu_id={$curr}");
        //echo ("SELECT p_id FROM menus WHERE (lang = '$pageLang') AND menu_id=$curr");
        if (MYSQL_NUMROWS($menu) == 0) {
            return 0;
        }
        $p_id = MYSQL_RESULT($menu, 0, "p_id");
        if ($p_id == 0) {
            return $curr;
        } else {
            $curr = $p_id;
        }
    }
    return 0;
}
Example #14
0
//echo '<font size="2" color="red"><b>(' . $numofmsg . ')</b></font>';
?>
</a></td>
            </tr>
            <tr>
            <td><a href="friend_list.php">Request &nbsp;<?php 
$c = mysql_query("SELECT * FROM friends WHERE(friend_two ='{$userid}') AND status='0'");
$numberOfRows = MYSQL_NUMROWS($c);
echo '<font size="2" color="red"><b>(' . $numberOfRows . ')</b></font>';
?>
            </a></td>
            </tr>
            <tr>
            <td><a href="allfriends.php">All Friends &nbsp;<?php 
$c = mysql_query("SELECT * FROM friends WHERE(friend_two ='{$userid}' or friend_one ='{$userid}') AND status='1'");
$numberOfRows = MYSQL_NUMROWS($c);
echo '<font size="2" color="red"><b>(' . $numberOfRows . ')</b></font>';
?>
</a></td>
            </tr>
            <tr>
            <td><a href="find_friends.php">Find Friends</a></td>
            </tr>
           </table>
           <br />	
           <hr />	
           <div class="notify">
           <h3>Notifications</h3>
           <marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()">
           <?php 
$noti = mysql_query("SELECT * from event WHERE people = '{$userid}' or people = 'ALL'");
Example #15
0
<?php

header("Cache-Control: no-cache, must-revalidate");
include "../../../configure.php";
$connect = @mysql_pconnect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die('could not connect:' . mysql_error());
mysql_select_db(DB_DATABASE) or die('no' . mysql_error());
$search = trim($_POST['search']);
$sql = "select products_keyword_title from products_keyword where products_keyword_title like '" . $search . "%' order by products_keyword_hits desc";
$rs = mysql_query($sql);
$num = MYSQL_NUMROWS($rs);
$str = '';
if ($num > 10) {
    $num = 10;
}
for ($i = 0; $i < $num; $i++) {
    $str .= '<div id="search_result" class="suggest_link" style="cursor:pointer;" onmouseover="javascript:suggestOver(this);" onmouseout="javascript:sugggestOut(this);" onclick="javascript:setSearch(this.innerHTML);">' . mysql_result($rs, $i, "products_keyword_title") . '</div>';
}
echo $str;
Example #16
0
function show_acl($link)
{
    global $o, $word_total, $web_admin_description, $web_admin_name;
    switch ($o) {
        case "nameD":
            $orderby = "name DESC";
            $o1 = "?o=nameA";
            $o2 = "?o=descA";
            $b1 = "#93BEE2";
            $b2 = "#FFFFFF";
            $p1 = "<A HREF=\"index.php" . $o1 . "&type=acl\"><IMG ALT=\"Отсортировано в обратном порядке\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/desc.gif></A>&nbsp;";
            $p2 = "";
            break;
        case "nameA":
            $orderby = "name ASC";
            $o1 = "?o=nameD";
            $o2 = "?o=descA";
            $b1 = "#93BEE2";
            $b2 = "#FFFFFF";
            $p1 = "<A HREF=\"index.php" . $o1 . "&type=acl\"><IMG ALT=\"Отсортировано в прямом порядке\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/asc.gif></A>&nbsp;";
            $p2 = "";
            break;
        case "descD":
            $orderby = "vname DESC";
            $o1 = "?o=nameA";
            $o2 = "?o=descA";
            $b1 = "#FFFFFF";
            $b2 = "#93BEE2";
            $p1 = "";
            $p2 = "<A HREF=\"index.php" . $o2 . "&type=acl\"><IMG ALT=\"Отсортировано в обратном порядке\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/desc.gif></A>&nbsp;";
            break;
        case "descA":
            $orderby = "vname ASC";
            $o1 = "?o=nameA";
            $o2 = "?o=descD";
            $b1 = "#FFFFFF";
            $b2 = "#93BEE2";
            $p1 = "";
            $p2 = "<A HREF=\"index.php" . $o2 . "&type=acl\"><IMG ALT=\"Отсортировано в прямом порядке\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/asc.gif></A>&nbsp;";
            break;
        default:
            $orderby = "id ASC";
            $o1 = "?o=nameA";
            $o2 = "?o=descD";
            $b1 = "#FFFFFF";
            $b2 = "#93BEE2";
            $p1 = "<A HREF=\"index.php" . $o2 . "&type=acl\"><IMG ALT=\"Отсортировано в прямом порядке\" BORDER=0 HEIGHT=7 WIDTH=7 SRC=../images/asc.gif></A>&nbsp;";
            $p2 = "";
    }
    echo "<a href=\"index.php?type=acled&id=0\">add new acl</a>\r\n<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>\n<TD BGCOLOR=#93BEE2><TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1><TR>\r\n</tr>\r\n<tr>\n<TD ALIGN=CENTER BGCOLOR={$b2}>{$p2}<B><A HREF=\"index.php{$o2}\" STYLE=\"color:#000000; text-decoration: underline\">{$web_admin_description}</A></B></TD>\n<TD ALIGN=CENTER BGCOLOR={$b1}>{$p1}<B><A HREF=\"index.php{$o1}\" STYLE=\"color:#000000; text-decoration: underline\">{$web_admin_name}</A></B></TD>";
    $res = mysql_query("SELECT sysname, vname, id FROM acl ORDER BY {$orderby}", $link);
    if (!$res) {
        return 3;
    }
    for ($i = 0; $i < MYSQL_NUMROWS($res); $i++) {
        $descr = mysql_result($res, $i, "vname");
        $name = mysql_result($res, $i, "sysname");
        $id = mysql_result($res, $i, "id");
        echo "<TR>\n<TD BGCOLOR=#FFF7E5 ALIGN=LEFT><a href=\"index.php?type=acled&id={$id}\">" . $descr . "</a></TD>\n<TD BGCOLOR=#FFF7E5 ALIGN=LEFT>" . $name . "</TD>\n</TR>\n";
    }
    echo "<TD BGCOLOR=#FFF7E5 ALIGN=LEFT>{$word_total}</TD><TD BGCOLOR=#FFF7E5 ALIGN=LEFT>" . dotize($acl_count) . "</TD></TR>";
    echo "</TABLE></TD>\n</TR>\n</TABLE>\n";
    $res = mysql_query("SELECT count(id) FROM acl", $link);
    $acl_count = mysql_result($res, 0);
    mysql_close();
    //echo "<BR><SPAN CLASS=\"smalltext\"><B>Итого:</B> " . dotize ( $acl_count ) . " правил.</SPAN>";
    return 0;
}