static function cacheIdFromWP($wp)
 {
     $cacheid = 0;
     if (mb_strtoupper(mb_substr($wp, 0, 2)) == 'GC') {
         $rs = sql("SELECT `cache_id` FROM `caches` WHERE `wp_gc_maintained`='&1'", $wp);
         if (sql_num_rows($rs) != 1) {
             sql_free_result($rs);
             return null;
         }
         $r = sql_fetch_assoc($rs);
         sql_free_result($rs);
         $cacheid = $r['cache_id'];
     } else {
         if (mb_strtoupper(mb_substr($wp, 0, 1)) == 'N') {
             $rs = sql("SELECT `cache_id` FROM `caches` WHERE `wp_nc`='&1'", $wp);
             if (sql_num_rows($rs) != 1) {
                 sql_free_result($rs);
                 return null;
             }
             $r = sql_fetch_assoc($rs);
             sql_free_result($rs);
             $cacheid = $r['cache_id'];
         } else {
             $cacheid = sql_value("SELECT `cache_id` FROM `caches` WHERE `wp_oc`='&1'", 0, $wp);
         }
     }
     return $cacheid;
 }
Beispiel #2
0
function showlist($query, $type, $template)
{
    if (is_array($query)) {
        if (sizeof($query) == 0) {
            return 0;
        }
        call_user_func('listplug_' . $type, $template, 'HEAD');
        foreach ($query as $currentObj) {
            $template['current'] = $currentObj;
            call_user_func('listplug_' . $type, $template, 'BODY');
        }
        call_user_func('listplug_' . $type, $template, 'FOOT');
        return sizeof($query);
    } else {
        $res = sql_query($query);
        // don't do anything if there are no results
        $numrows = sql_num_rows($res);
        if ($numrows == 0) {
            return 0;
        }
        call_user_func('listplug_' . $type, $template, 'HEAD');
        while ($template['current'] = sql_fetch_object($res)) {
            call_user_func('listplug_' . $type, $template, 'BODY');
        }
        call_user_func('listplug_' . $type, $template, 'FOOT');
        sql_free_result($res);
        // return amount of results
        return $numrows;
    }
}
Beispiel #3
0
function get_page_tok_strange($newest = false)
{
    check_permission(PERM_ADDER);
    $res = sql_query("SELECT timestamp, param_value FROM stats_values WHERE param_id=7 ORDER BY timestamp DESC LIMIT 1");
    $r = sql_fetch_array($res);
    $out = array('timestamp' => $r['timestamp'], 'coeff' => $r['param_value'] / 1000, 'broken' => array(), 'items' => array());
    $res = sql_fetchall(sql_query("SELECT param_value FROM stats_values WHERE param_id=28 ORDER BY param_value"));
    $res1 = sql_prepare("SELECT tf_text, sent_id FROM tokens WHERE tf_id=? LIMIT 1");
    foreach ($res as $r) {
        sql_execute($res1, array($r['param_value']));
        $r1 = sql_fetch_array($res1);
        $out['broken'][] = array('token_text' => $r1['tf_text'], 'sent_id' => $r1['sent_id']);
    }
    $res1->closeCursor();
    $comments = array();
    $res = sql_query("SELECT ts.sent_id, ts.pos, ts.border, ts.coeff, s.source, p.book_id FROM tokenizer_strange ts LEFT JOIN sentences s ON (ts.sent_id=s.sent_id) LEFT JOIN paragraphs p ON (s.par_id=p.par_id) ORDER BY " . ($newest ? "ts.sent_id DESC" : "ts.coeff DESC"));
    $res1 = sql_prepare("SELECT comment_id FROM sentence_comments WHERE sent_id=? LIMIT 1");
    foreach (sql_fetchall($res) as $r) {
        if (!isset($comments[$r['sent_id']])) {
            sql_execute($res1, array($r['sent_id']));
            $comments[$r['sent_id']] = sql_num_rows($res1) > 0 ? 1 : -1;
        }
        $out['items'][] = array('sent_id' => $r['sent_id'], 'book_id' => $r['book_id'], 'coeff' => $r['coeff'], 'border' => $r['border'], 'lcontext' => mb_substr($r['source'], max(0, $r['pos'] - 10), min(10, $r['pos'])), 'focus' => mb_substr($r['source'], $r['pos'], 1), 'rcontext' => mb_substr($r['source'], $r['pos'] + 1, 9), 'comments' => $comments[$r['sent_id']]);
    }
    return $out;
}
Beispiel #4
0
function NewLinks($newlinkshowdays)
{
    global $ModPath, $ModStart, $links_DB;
    include "header.php";
    mainheader('nl');
    $counter = 0;
    $allweeklinks = 0;
    while ($counter <= 7 - 1) {
        $newlinkdayRaw = time() - 86400 * $counter;
        $newlinkday = date("d-M-Y", $newlinkdayRaw);
        $newlinkView = date("F d, Y", $newlinkdayRaw);
        $newlinkDB = Date("Y-m-d", $newlinkdayRaw);
        $result = sql_query("SELECT * FROM " . $links_DB . "links_links WHERE date LIKE '%{$newlinkDB}%'");
        $totallinks = sql_num_rows($result);
        $counter++;
        $allweeklinks = $allweeklinks + $totallinks;
    }
    $counter = 0;
    $allmonthlinks = 0;
    while ($counter <= 30 - 1) {
        $newlinkdayRaw = time() - 86400 * $counter;
        $newlinkDB = Date("Y-m-d", $newlinkdayRaw);
        $result = sql_query("SELECT * FROM " . $links_DB . "links_links WHERE date LIKE '%{$newlinkDB}%'");
        $totallinks = sql_num_rows($result);
        $allmonthlinks = $allmonthlinks + $totallinks;
        $counter++;
    }
    echo '
   
   <div class="card card-block">
   <h3>' . translate("New links") . '</h3>
   ' . translate("Total new links: Last week") . ' : ' . $allweeklinks . ' -/- ' . translate("Last 30 days") . ' : ' . $allmonthlinks;
    echo "<br />\n";
    echo "<blockquote>" . translate("Show:") . " [<a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinks&newlinkshowdays=7\" class=\"noir\">" . translate("week") . "</a>, <a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinks&newlinkshowdays=14\" class=\"noir\">2 " . translate("weeks") . "</a>, <a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinks&newlinkshowdays=30\" class=\"noir\">30 " . translate("days") . "</a>]</<blockquote>";
    $counter = 0;
    $allweeklinks = 0;
    echo '
    <blockquote>
    <ul>';
    while ($counter <= $newlinkshowdays - 1) {
        $newlinkdayRaw = time() - 86400 * $counter;
        $newlinkday = date("d-M-Y", $newlinkdayRaw);
        $newlinkView = date(str_replace("%", "", translate("linksdatestring")), $newlinkdayRaw);
        $newlinkDB = Date("Y-m-d", $newlinkdayRaw);
        $result = sql_query("SELECT * FROM " . $links_DB . "links_links WHERE date LIKE '%{$newlinkDB}%'");
        $totallinks = sql_num_rows($result);
        $counter++;
        $allweeklinks = $allweeklinks + $totallinks;
        if ($totallinks > 0) {
            echo "<li><a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinksDate&selectdate={$newlinkdayRaw}\">{$newlinkView}</a>&nbsp( {$totallinks} )</li>";
        }
    }
    echo '
    </blockquote>
    </ul>
    </div>';
    $counter = 0;
    $allmonthlinks = 0;
    include "footer.php";
}
Beispiel #5
0
 public function menu_create()
 {
     global $g5;
     // 1단계 분류 판매 가능한 것만
     $hsql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where length(ca_id) = '2' and ca_use = '1' order by ca_order, ca_id ";
     $hresult = sql_query($hsql);
     $gnb_zindex = 999;
     // gnb_1dli z-index 값 설정용
     for ($i = 0; $row = sql_fetch_array($hresult); $i++) {
         $gnb_zindex -= 1;
         // html 구조에서 앞선 gnb_1dli 에 더 높은 z-index 값 부여
         // 2단계 분류 판매 가능한 것만
         $sql2 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where LENGTH(ca_id) = '4' and SUBSTRING(ca_id,1,2) = '{$row['ca_id']}' and ca_use = '1' order by ca_order, ca_id ";
         $result2 = sql_query($sql2);
         $count = sql_num_rows($result2);
         $menu[$i] = $row;
         $menu[$i]['href'] = G5_SHOP_URL . '/list.php?ca_id=' . $row['ca_id'];
         $menu[$i]['count'] = $count;
         $loop =& $menu[$i]['submenu'];
         for ($j = 0; $row2 = sql_fetch_array($result2); $j++) {
             $row2['href'] = G5_SHOP_URL . '/list.php?ca_id=' . $row2['ca_id'];
             $loop[$j] = $row2;
         }
         $menu[$i]['cnt'] = count($loop);
     }
     return $menu;
 }
Beispiel #6
0
function marquetapage()
{
    global $cookie;
    if ($cookie[0] != '') {
        global $REQUEST_URI, $title, $post, $NPDS_Prefix;
        if ($ibid = theme_image("modules/add.gif")) {
            $add = $ibid;
        } else {
            $add = "modules/marquetapage/add.gif";
        }
        if ($ibid = theme_image("modules/addj.gif")) {
            $addj = $ibid;
        } else {
            $addj = "modules/marquetapage/addj.gif";
        }
        $result = sql_query("SELECT uri, topic FROM " . $NPDS_Prefix . "marquetapage WHERE uid='{$cookie['0']}' ORDER BY topic ASC");
        if (sql_num_rows($result)) {
            $tmp_toggle = '<a class="tog" id="show_fav" title="' . translate("Show list") . '"><i id="i_lst_fav" class="fa fa-caret-right fa-2x" ></i></a>';
            $content = "\n   <script type=\"text/javascript\">\n   //<![CDATA[\n   tog = function(lst,sho,hid){\n      \$(document).on('click', 'a.tog', function() {\n         var buttonID = \$(this).attr('id');\n         lst_id = \$('#'+lst);\n         i_id=\$('#i_'+lst);\n         btn_show=\$('#'+sho);\n         btn_hide=\$('#'+hid);\n         if (buttonID == sho) {\n            lst_id.fadeIn(1000);//show();\n            btn_show.attr('id',hid)\n            btn_show.attr('title','" . translate("Hide list") . "');\n            i_id.attr('class','fa fa-caret-up fa-2x');\n         } else if (buttonID == hid) {\n            lst_id.fadeOut(1000);//hide();\n            btn_hide=\$('#'+hid);\n            btn_hide.attr('id',sho);\n            btn_hide.attr('title','" . translate("Show list") . "');\n            i_id.attr('class','fa fa-caret-down fa-2x');\n        }\n       });\n   };\n   //]]>\n   </script>";
            $content .= '
   <h6>
   <a class="tog" id="show_fav" title="' . translate("Show list") . '"><i id="i_lst_fav" class="fa fa-caret-right fa-2x" ></i>&nbsp;Bookmarks </a><span class="tag tag-pill tag-default pull-right">' . sql_num_rows($result) . '</span>
   </h6>
   <ul id="lst_fav" style="display:none;" >
   
   <a href="modules.php?ModPath=marquetapage&amp;ModStart=marquetapage&amp;op=supp_all&amp;uri=' . $_SERVER['PHP_SELF'] . '"><i class="fa fa-trash-o text-danger" title="' . translate("Delete") . '" data-toggle="tooltip"></i></a>';
            while (list($uri, $topic) = sql_fetch_row($result)) {
                $content .= '
      <li><a href="' . $uri . '" style="font-size:.7rem;">' . $topic . '</a>
            <span class="float-xs-right"><a href="modules.php?ModPath=marquetapage&amp;ModStart=marquetapage&amp;op=supp&amp;uri=' . urlencode($uri) . '"><i class="fa fa-trash-o text-danger" title="' . translate("Delete") . '" data-toggle="tooltip"></i></a></span></li>';
            }
            $content .= '
   </ul>
   <script type="text/javascript">
   //<![CDATA[
      tog("lst_fav","show_fav","hide_fav");
   //]]>
   </script>';
        }
        global $block_title;
        $uri = urlencode($REQUEST_URI);
        if ($post) {
            $title .= "/" . $post;
        }
        if ($title == '') {
            $title_MTP = basename(urldecode($uri));
        } else {
            $title_MTP = $title;
        }
        $boxTitle = '<span><a href="modules.php?ModPath=marquetapage&amp;ModStart=marquetapage&amp;op=add&amp;uri=' . $uri . '&amp;topic=' . urlencode($title_MTP) . '"><i class="fa fa-bookmark-o " title="' . translate("Add") . ' ' . translate("favourite") . '" data-toggle="tooltip"></i></a></span>';
        if ($block_title == '') {
            $boxTitle .= '&nbsp;MarqueTaPage';
        } else {
            $boxTitle .= '&nbsp;' . $block_title;
        }
        themesidebox($boxTitle, $content);
    }
}
Beispiel #7
0
function toggleReg($comp_id,$cat_id)
{
	global $eventstable, $compstable, $regstable;
	$comp_id = (int)$comp_id;
	$cat_id = (int)$cat_id;
	$competitor = strict_query("SELECT cat? AS cat FROM $compstable WHERE id=?", array($cat_id,$comp_id));
	if(!sql_num_rows($competitor)) return "";
	$_X = "X"; // Do not change!
	$_w = "-"; //       "
	$event = strict_query("SELECT r1_open, r2_open, r1_groupsize FROM $eventstable WHERE id=?", array($cat_id));
	$groupsize = cased_mysql_result($event,0,"r1_groupsize");
	if (sql_num_rows($event) && !cased_mysql_result($event,0,"r2_open"))
	{
		if (cased_mysql_result($event,0,"r1_open"))
		{
			$regs = strict_query("SELECT COUNT(*) as count FROM $regstable WHERE cat_id=? AND round=1", array($cat_id));
			$nregs = cased_mysql_result($regs,0,"count");
		}
		else
			$nregs = $groupsize;

		$hl = NULL;
		if (!cased_mysql_result($competitor,0,"cat"))
		{
			if ($nregs < $groupsize)
			{
				$newValue = $_X;
				strict_query("INSERT INTO $regstable VALUES (?,1,?)", array($cat_id,$comp_id));
			}
			else
				$newValue = $_w;
		}
		elseif (compHasTimesR1($comp_id,$cat_id)) 
			return $_X;
		else
		{
			$newValue = "";
			if (cased_mysql_result($event,0,"r1_open") && cased_mysql_result($competitor,0,"cat")==$_X)
			{
				$waiting = strict_query("SELECT id FROM $compstable WHERE cat?='$_w' ORDER BY id LIMIT 1", array($cat_id));
				if (!sql_num_rows($waiting))
					strict_query("DELETE FROM $regstable WHERE cat_id=? AND round=1 AND comp_id=?", array($cat_id,$comp_id));
				else
				{
					strict_query("UPDATE $compstable SET cat?='$_X' WHERE id=".cased_mysql_result($waiting,0,"id"), array($cat_id));
					strict_query("UPDATE $regstable SET comp_id='" .cased_mysql_result($waiting,0,"id"). "' WHERE cat_id=? AND round=1 AND comp_id=?", array($cat_id,$comp_id));
					$hl = "td".cased_mysql_result($waiting,0,"id")."_".$cat_id;
				}
			}
		}
		strict_query("UPDATE $compstable SET cat?='$newValue' WHERE id=?", array($cat_id,$comp_id));
		if ($hl) $newValue .= "/".$hl;
		return $newValue;
	}
}
Beispiel #8
0
 public function getNewIdCommon()
 {
     $query = "SELECT MAX(id_common_label)" . " FROM %lms_label";
     $result = sql_query($query);
     if (sql_num_rows($result)) {
         list($res) = sql_fetch_row($result);
         $res++;
         return $res;
     }
     return 1;
 }
Beispiel #9
0
function couponcode($upc)
{
    $man_id = substr($upc, 3, 5);
    $fam = substr($upc, 8, 3);
    $val = substr($upc, -2);
    $db = pDataConnect();
    $query = "select * from couponcodes where code = '" . $val . "'";
    $result = sql_query($query, $db);
    $num_rows = sql_num_rows($result);
    if ($num_rows == 0) {
        boxMsg("coupon type unknown<br>please enter coupon<br>manually");
    } else {
        $row = sql_fetch_array($result);
        $value = $row["Value"];
        $qty = $row["Qty"];
        if ($fam == "992") {
            $value = truncate2($value);
            $_SESSION["couponupc"] = $upc;
            $_SESSION["couponamt"] = $value;
            maindisplay("coupondeptsearch.php");
        } else {
            sql_close($db);
            $fam = substr($fam, 0, 2);
            $query = "select " . "max(unitPrice) as total, " . "max(department) as department, " . "sum(ItemQtty) as qty, " . "sum(case when trans_status = 'C' then -1 else quantity end) as couponqtty " . "from localtemptrans where substring(upc, 4, 5) = '" . $man_id . "' " . "group by substring(upc, 4, 5)";
            $db = tDataConnect();
            $result = sql_query($query, $db);
            $num_rows = sql_num_rows($result);
            if ($num_rows > 0) {
                $row = sql_fetch_array($result);
                if ($row["couponqtty"] < 1) {
                    boxMsg("Coupon already applied<BR>for this item");
                } else {
                    $dept = $row["department"];
                    $act_qty = $row["qty"];
                    if ($qty <= $act_qty) {
                        if ($value == 0) {
                            $value = -1 * $row["total"];
                        }
                        $value = truncate2($value);
                        addcoupon($upc, $dept, $value);
                        lastpage();
                    } else {
                        boxMsg("coupon requires " . $qty . "items<BR>there are only " . $act_qty . " item(s)<BR>in this transaction");
                    }
                }
            } else {
                boxMsg("product not found<BR>in transaction");
            }
            // sql_close($db);
        }
    }
}
Beispiel #10
0
function nexttransno()
{
    $next_trans_no = 1;
    $db = pDataConnect();
    sql_query("update globalvalues set transno = transno + 1", $db);
    $result = sql_query("select transno from globalvalues", $db);
    $num_rows = sql_num_rows($result);
    if ($num_rows != 0) {
        $row = sql_fetch_array($result);
        $next_trans_no = $row["transno"];
    }
    sql_close($db);
}
Beispiel #11
0
function addEve($eve_id)
{
	$eve_id = (int)$eve_id;
	global $eventstable, $compstable;
	//
	$result = strict_query("SELECT id FROM $eventstable WHERE id=?", array($eve_id));
	if (sql_num_rows($result)) return;
	$result = strict_query("SELECT * FROM categories WHERE id=?", array($eve_id));
	if (sql_num_rows($result))
	{
		strict_query("INSERT INTO $eventstable SET id=?, r1=1, r1_format=" . substr(cased_mysql_result($result,0,"possible_formats"),0,1) . ", r1_groupsize=999", array($eve_id));
		strict_query("ALTER TABLE $compstable ADD cat? VARCHAR( 1 ) NOT NULL", array($eve_id));
	}
}
Beispiel #12
0
function finish($uname, $pwd)
{
    global $dbi;
    $md5_pwd = md5($pwd);
    $l_result = sql_query("select * from jones_user where uname='{$uname}' and pwd='{$md5_pwd}'", $dbi);
    if (sql_num_rows($l_result, $dbi) == 0) {
        $error = "Incorrect username or password";
        Header("Location: login.php?error={$error}");
        die;
    }
    list($uid, $uname, $pwd, $fname, $lname, $email, $privs) = sql_fetch_row($l_result, $dbi);
    sendCookie($uid, $uname, $pwd, $fname, $lname, $email, $privs);
    Header("Location: index.php");
}
Beispiel #13
0
function printDetails($query, $type)
{
    global $admin, $user, $cookie, $prefix, $dbi, $user_prefix;
    $result = sql_query($query, $dbi);
    $numrows = sql_num_rows($result, $dbi);
    echo "<Br><B>Your " . $type . " : " . $numrows . "</B><HR>";
    echo "<table width=\"60%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" . "<tr><td bgcolor=\"#000000\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">" . "</tr><tr>" . "<th height=\"25\" colspan=\"1\" align=\"center\" wrap><font color=\"#28313C\"><strong>Name</strong></font></th>" . "<th height=\"15\" colspan=\"1\" align=\"center\" wrap><font color=\"#28313C\"><strong>UserId</strong></font></th>" . "<th height=\"10\" colspan=\"1\" align=\"center\" wrap><font color=\"#28313C\"><strong>Year</strong></font></th>" . "<th height=\"10\" colspan=\"1\" align=\"center\" wrap><font color=\"#28313C\"><strong>Company</strong></font></th>" . "</tr>";
    while (list($name, $username, $gradyear, $company) = sql_fetch_row($result, $dbi)) {
        $username = "******" . $username . "</a>";
        echo "<tr><td class=\"row1\">" . $name . "</td>" . "<td  class=\"row2\">" . $username . "</td>" . "<td  class=\"row1\">" . $gradyear . "</td>" . "<td  class=\"row2\">" . $company . "</td>" . "</tr>";
        //echo    $name . " [" . $username . "]" . "<BR>";
    }
    echo "</table>";
}
Beispiel #14
0
function clubCard($intItemNum)
{
    $query = "select * from localtemptrans where trans_id = " . $intItemNum;
    $connection = tDataConnect();
    $result = sql_query($query, $connection);
    $row = sql_fetch_array($result);
    $num_rows = sql_num_rows($result);
    if ($num_rows > 0) {
        $strUPC = $row["upc"];
        $strDescription = $row["description"];
        $dblVolSpecial = $row["VolSpecial"];
        $dblquantity = -0.5 * $row["quantity"];
        $dblTotal = truncate2(-1 * 0.5 * $row["total"]);
        // invoked truncate2 rounding function to fix half-penny errors apbw 3/7/05
        $strCardNo = $_SESSION["memberID"];
        $dblDiscount = $row["discount"];
        $dblmemDiscount = $row["memDiscount"];
        $intDiscountable = $row["discountable"];
        $dblUnitPrice = $row["unitPrice"];
        $intScale = nullwrap($row["scale"]);
        if ($row["foodstamp"] != 0) {
            $intFoodStamp = 1;
        } else {
            $intFoodStamp = 0;
        }
        $intdiscounttype = nullwrap($row["discounttype"]);
        if ($row["voided"] == 20) {
            boxMsg("Discount already taken");
        } elseif ($row["trans_type"] == "T" or $row["trans_status"] == "D" or $row["trans_status"] == "V" or $row["trans_status"] == "C") {
            boxMsg("Item cannot be discounted");
        } elseif (strncasecmp($strDescription, "Club Card", 9) == 0) {
            //----- edited by abpw 2/15/05 -----
            boxMsg("Item cannot be discounted");
        } elseif ($_SESSION["tenderTotal"] < 0 and $intFoodStamp == 1 and -1 * $dblTotal > $_SESSION["fsEligible"]) {
            boxMsg("Item already paid for");
        } elseif ($_SESSION["tenderTotal"] < 0 and -1 * $dblTotal > $_SESSION["runningTotal"] - $_SESSION["taxTotal"]) {
            boxMsg("Item already paid for");
        } else {
            // --- added partial item desc to club card description - apbw 2/15/05 ---
            addItem($strUPC, "Club Card: " . substr($strDescription, 0, 19), "I", "", "J", $row["department"], $dblquantity, $dblUnitPrice, $dblTotal, 0.5 * $row["regPrice"], $intScale, $row["tax"], $intFoodStamp, $dblDiscount, $dblmemDiscount, $intDiscountable, $intdiscounttype, $dblquantity, $row["volDiscType"], $row["volume"], $dblVolSpecial, 0, 0, 0);
            $update = "update localtemptrans set voided = 20 where trans_id = " . $intItemNum;
            $connection = tDataConnect();
            sql_query($update, $connection);
            $_SESSION["TTLflag"] = 0;
            $_SESSION["TTLRequested"] = 0;
            lastpage();
        }
    }
}
 /**
  * The news link for the home pages
  * @return <html>
  */
 public static function news($hnumber = 2)
 {
     $html = '<div id="news">';
     $textQuery = "\r\n\t\tSELECT idNews, publish_date, title, short_desc\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news\r\n\t\tWHERE language = '" . getLanguage() . "'\r\n\t\tORDER BY important DESC, publish_date DESC\r\n\t\tLIMIT 0," . Get::sett('visuNewsHomePage');
     //do query
     $result = sql_query($textQuery);
     if (sql_num_rows($hnumber)) {
         $html .= '<p>' . Lang::set('_NO_CONTENT', 'login') . '</p>';
     }
     while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) {
         $html .= '<h' . $hnumber . '>' . '<a href="index.php?modname=login&amp;op=readnews&amp;idNews=' . $idNews . '">' . $title . '</a>' . '</h' . $hnumber . '>' . '<p class="news_textof">' . '<span class="news_data">' . Format::date($publish_date) . ' - </span>' . $short_desc . '</p>';
     }
     $html .= '</div>';
     return $html;
 }
Beispiel #16
0
function setDrawerKickLater()
{
    // 	this more complex version can be modified to kick the drawer under whatever circumstances the FE Mgr sees fit
    //	it currently kicks the drawer *only* for cash in & out
    $db = tDataConnect();
    $query = "select * from localtemptrans where trans_subtype = 'CA' and total <> 0";
    $result = sql_query($query, $db);
    $num_rows = sql_num_rows($result);
    $row = sql_fetch_array($result);
    if ($num_rows != 0) {
        $_SESSION["kick"] = 1;
    } else {
        $_SESSION["kick"] = 0;
    }
}
Beispiel #17
0
function marquetapage()
{
    global $cookie;
    if ($cookie[0] != "") {
        global $REQUEST_URI, $title, $post, $NPDS_Prefix;
        if ($ibid = theme_image("modules/add.gif")) {
            $add = $ibid;
        } else {
            $add = "modules/marquetapage/add.gif";
        }
        if ($ibid = theme_image("modules/addj.gif")) {
            $addj = $ibid;
        } else {
            $addj = "modules/marquetapage/addj.gif";
        }
        $result = sql_query("select uri, topic from " . $NPDS_Prefix . "marquetapage where uid='{$cookie['0']}' order by topic ASC");
        if (sql_num_rows($result)) {
            $tmp_toggle = '<span id="show_fav" title="' . translate("Show list") . '"><img src="images/admin/ws/toggle_plus.gif" style="vertical-align:middle;" alt="' . translate("Show list") . '" /></span>';
            $content = "<script type=\"text/javascript\" src=\"lib/yui/build/yui/yui-min.js\"></script>";
            $content .= "<script type=\"text/javascript\">\n         //<![CDATA[\n         tog =function(lst,sho,hid){\n           YUI().use('transition', 'node-event-delegate', function (Y) {\n             Y.delegate('click', function(e) {\n              var buttonID = e.currentTarget.get('id'),\n              lst_id = Y.one('#'+lst);\n              btn_show=Y.one('#'+sho);\n              btn_hide=Y.one('#'+hid);\n              if (buttonID === sho) {\n                 lst_id.show(true);\n                 btn_show.set('id',hid);\n                 btn_show.set('title','" . translate("Hide list") . "');\n                 btn_show.setContent('<img src=\"images/admin/ws/toggle_minus.gif\" style=\"vertical-align:middle;\" alt=\"" . translate("Hide list") . "\" />');\n              } else if (buttonID == hid) {\n                 lst_id.transition({\n                   duration: 0.2,\n                   easing: 'ease-out',\n                   opacity: 0\n                 });\n                 btn_hide=Y.one('#'+hid);\n                 lst_id.hide(true);\n                 btn_hide.set('id',sho);\n                 btn_hide.set('title','" . translate("Show list") . "');\n                 btn_hide.setContent('<img src=\"images/admin/ws/toggle_plus.gif\" style=\"vertical-align:middle;\" alt=\"" . translate("Show list") . "\" />');\n              }\n             }, document, 'span');\n           });\n         }\n         //]]>\n         </script>";
            $content .= "\n<table width=\"100%\" id=\"lst_fav\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" style=\"display:none;\" >\n<thead>\n<tr>\n<th><img src=\"{$addj}\" border=\"0\" style=\"vertical-align:middle\" alt=\"" . translate("Add") . " " . translate("favourite") . "\" title=\"" . translate("Add") . " " . translate("favourite") . "\" />&nbsp;Bookmarks [" . sql_num_rows($result) . "]</th><th align=\"right\"><a href=\"modules.php?ModPath=marquetapage&amp;ModStart=marquetapage&amp;op=supp_all&amp;uri=" . $_SERVER['PHP_SELF'] . "\"><img src=\"modules/marquetapage/del.gif\" border=\"0\" alt=\"" . translate("Delete") . "\" title=\"" . translate("Delete") . "\" style=\"vertical-align: middle;\" /></a></th>\n</tr>\n</thead>\n<tbody>";
            while (list($uri, $topic) = sql_fetch_row($result)) {
                $content .= "\n<tr>\n<td align=\"left\" width=\"95%\"><a href=\"{$uri}\" style=\"font-size: 10px;\">" . $topic . "</a></td>\n";
                $content .= "<td align=\"right\"><a href=\"modules.php?ModPath=marquetapage&amp;ModStart=marquetapage&amp;op=supp&amp;uri=" . urlencode($uri) . "\"><img src=\"modules/marquetapage/del.gif\" border=\"0\" alt=\"" . translate("Delete") . "\" title=\"" . translate("Delete") . "\" style=\"vertical-align: middle;\" /></a></td>\n</tr>\n";
            }
            $content .= "</tbody>\n</table>\n";
            $content .= "\n<script type=\"text/javascript\">\n         //<![CDATA[\n         tog('lst_fav','show_fav','hide_fav');\n         //]]>\n         </script>\n";
        }
        global $block_title;
        $uri = urlencode($REQUEST_URI);
        if ($post) {
            $title .= "/" . $post;
        }
        if ($title == "") {
            $title_MTP = basename(urldecode($uri));
        } else {
            $title_MTP = $title;
        }
        $boxTitle = "<span><a href=\"modules.php?ModPath=marquetapage&amp;ModStart=marquetapage&amp;op=add&amp;uri={$uri}&amp;topic=" . urlencode($title_MTP) . "\"><img src=\"{$add}\" name=\"image\" onmouseover=\"image.src='{$addj}';\" onmouseout=\"image.src='{$add}';\" border=\"0\" style=\"vertical-align:middle\" alt=\"" . translate("Add") . " " . translate("favourite") . "\" title=\"" . translate("Add") . " " . translate("favourite") . "\" /></a></span>";
        if ($block_title == "") {
            $boxTitle .= "&nbsp;MarqueTaPage " . $tmp_toggle;
        } else {
            $boxTitle .= "&nbsp;" . $block_title . " " . $tmp_toggle;
        }
        themesidebox($boxTitle, $content);
    }
}
function viewdownloadcomments($lid, $ttitle)
{
    global $prefix, $dbi, $admin, $bgcolor2, $module_name;
    include "header.php";
    include "modules/{$module_name}/d_config.php";
    menu(1);
    echo "<br>";
    $result = sql_query("SELECT ratinguser, rating, ratingcomments, ratingtimestamp FROM " . $prefix . "_downloads_votedata WHERE ratinglid = {$lid} AND ratingcomments != '' ORDER BY ratingtimestamp DESC", $dbi);
    $totalcomments = sql_num_rows($result, $dbi);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $transfertitle = stripslashes($transfertitle);
    $displaytitle = $transfertitle;
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br><br>";
    downloadinfomenu($lid, $ttitle);
    echo "<br><br><br>" . _TOTALOF . " {$totalcomments} " . _COMMENTS . "</font></center><br>" . "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"450\">";
    $x = 0;
    while (list($ratinguser, $rating, $ratingcomments, $ratingtimestamp) = sql_fetch_row($result, $dbi)) {
        $ratingcomments = stripslashes($ratingcomments);
        ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
        $ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
        $date_array = explode("-", $ratingtime);
        $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
        $formatted_date = date("F j, Y", $timestamp);
        /* Individual user information */
        $result2 = sql_query("SELECT rating FROM " . $prefix . "_downloads_votedata WHERE ratinguser = '******'", $dbi);
        $usertotalcomments = sql_num_rows($result2, $dbi);
        $useravgrating = 0;
        while (list($rating2) = sql_fetch_row($result2, $dbi)) {
            $useravgrating = $useravgrating + $rating2;
        }
        $useravgrating = $useravgrating / $usertotalcomments;
        $useravgrating = number_format($useravgrating, 1);
        echo "<tr><td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b> " . _USER . ": </b><a href=\"{$nukeurl}/modules.php?name=Your_Account&amp;op=userinfo&amp;username={$ratinguser}\">{$ratinguser}</a></font>" . "</td>" . "<td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b>" . _RATING . ": </b>{$rating}</font>" . "</td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"right\">" . "<font class=\"content\">{$formatted_date}</font>" . "</td>" . "</tr>" . "<tr>" . "<td valign=\"top\">" . "<font class=\"tiny\">" . _USERAVGRATING . ": {$useravgrating}</font>" . "</td>" . "<td valign=\"top\" colspan=\"2\">" . "<font class=\"tiny\">" . _NUMRATINGS . ": {$usertotalcomments}</font>" . "</td>" . "</tr>" . "<tr>" . "<td colspan=\"3\">" . "<font class=\"content\">";
        if (is_admin($admin)) {
            echo "<a href=\"admin.php?op=DownloadsModDownload&amp;lid={$lid}\"><img src=\"modules/{$module_name}/images/editicon.gif\" border=\"0\" alt=\"" . _EDITTHISDOWNLOAD . "\"></a>";
        }
        echo " {$ratingcomments}</font>" . "<br><br><br></td></tr>";
        $x++;
    }
    echo "</table><br><br><center>";
    downloadfooter($lid, $ttitle);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Beispiel #19
0
function mblock()
{
    global $hlpfile, $NPDS_Prefix, $f_meta_nom, $f_titre, $adminimg;
    include "header.php";
    GraphicAdmin($hlpfile);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo '
   <hr />
   <h3>' . adm_translate("Edition du Bloc Principal") . '</h3>';
    $result = sql_query("SELECT title, content FROM " . $NPDS_Prefix . "mainblock");
    if (sql_num_rows($result) > 0) {
        while (list($title, $content) = sql_fetch_row($result)) {
            echo '
         <form id="fad_mblock" action="admin.php" method="post">
            <div class="form-group row">
               <label class="form-control-label col-xs-12" for="title">' . adm_translate("Titre") . '</label>
               <div class="col-xs-12">
                  <textarea class="form-control" type="text" id="title" name="title" maxlength="255" placeholder="' . adm_translate("Titre :") . '">' . $title . '</textarea>
                  <span class="help-block text-xs-right"><span id="countcar_title"></span></span>
               </div>
            </div>
            <div class="form-group row">
               <label class="form-control-label col-xs-12" for="content">' . adm_translate("Contenu") . '</label>
               <div class="col-xs-12">
                  <textarea class="form-control" rows="25" id="content" name="content">' . $content . '</textarea>
               </div>
            </div>
            <input type="hidden" name="op" value="changemblock" />
            <div class="form-group row">
               <div class="col-xs-12">
                  <button class="btn btn-outline-primary btn-block" type="submit"><i class ="fa fa-check fa-lg"></i>&nbsp;' . adm_translate("Valider") . '</button>
               </div>
            </div>
         </form>
         <script type="text/javascript">
         //<![CDATA[
            $(document).ready(function() {
               inpandfieldlen("title",255);
            });
         //]]>
         </script>';
        }
    }
    adminfoot('fv', '', '', '');
}
Beispiel #20
0
function getChgName()
{
    $query = "select LastName, FirstName from custdata where CardNo = '" . $_SESSION["memberID"] . "'";
    $connection = pDataConnect();
    $result = sql_query($query, $connection);
    $row = sql_fetch_array($result);
    $num_rows = sql_num_rows($result);
    if ($num_rows > 0) {
        if (strlen($_SESSION["memberID"]) != 4) {
            $_SESSION["ChgName"] = $row["LastName"];
        } elseif (strlen($_SESSION["memberID"]) == 4) {
            $LastInit = substr($row["LastName"], 0, 1) . ".";
            $_SESSION["ChgName"] = trim($row["FirstName"]) . " " . $LastInit;
        } else {
            $_SESSION["ChgName"] = $_SESSION["memMsg"];
        }
    }
    sql_close($connection);
}
Beispiel #21
0
function loadUnreaded()
{
    $id_course = $_SESSION['idCourse'];
    if (!isset($_SESSION['unreaded_forum'][$id_course])) {
        unset($_SESSION['unreaded_forum']);
        //-find last access---------------------------------------------------------------
        $no_entry = false;
        $reLast = sql_query("\r\n\t\tSELECT UNIX_TIMESTAMP(last_access)\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_forum_timing\r\n\t\tWHERE idUser = '******' AND idCourse = '" . $_SESSION['idCourse'] . "'");
        if (sql_num_rows($reLast)) {
            list($last_forum_access_time) = sql_fetch_row($reLast);
        } else {
            $last_forum_access_time = 0;
            $no_entry = true;
        }
        $unreaded = array();
        $reUnreaded = sql_query("\r\n\t\tSELECT t.idThread, t.idForum, m.generator, COUNT(m.idMessage)\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_forumthread AS t JOIN " . $GLOBALS['prefix_lms'] . "_forummessage AS m\r\n\t\tWHERE t.idThread = m.idThread AND m.author <> '" . getLogUserId() . "' AND UNIX_TIMESTAMP(m.posted) >= '" . $last_forum_access_time . "'\r\n\t\tGROUP BY t.idThread, t.idForum, m.generator");
        while (list($id_thread, $id_forum, $is_generator, $how_much_mess) = sql_fetch_row($reUnreaded)) {
            if ($is_generator) {
                if (isset($unreaded[$id_forum]['new_thread'])) {
                    $unreaded[$id_forum][$id_thread] = 'new_thread';
                } else {
                    $unreaded[$id_forum][$id_thread] = 'new_thread';
                }
            } else {
                if (isset($unreaded[$id_forum][$id_thread])) {
                    $unreaded[$id_forum][$id_thread] += $how_much_mess;
                } else {
                    $unreaded[$id_forum][$id_thread] = $how_much_mess;
                }
            }
        }
        $_SESSION['unreaded_forum'][$id_course] = $unreaded;
        //-set as now the last forum access------------------------------------------------
        if ($no_entry) {
            sql_query("\r\n\t\t\tINSERT INTO  " . $GLOBALS['prefix_lms'] . "_forum_timing\r\n\t\t\tSET last_access = NOW(),\r\n\t\t\t\tidUser = '******',\r\n\t\t\t\tidCourse = '" . $_SESSION['idCourse'] . "'");
        } else {
            sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forum_timing\r\n\t\t\tSET  last_access = NOW()\r\n\t\t\tWHERE idUser = '******' AND idCourse = '" . $_SESSION['idCourse'] . "'");
        }
        //reset the number of unread messages of the user
        sql_query("\r\n\t    UPDATE " . $GLOBALS['prefix_lms'] . "_courseuser\r\n\t    SET  new_forum_post = 0\r\n\t    WHERE idUser = '******' AND idCourse = '" . $_SESSION['idCourse'] . "'");
    }
}
Beispiel #22
0
 /**
  * Shows maximum $max comments to the given item using the given template
  * returns the amount of shown comments (if maxToShow = -1, then there is no limit)
  *
  * @param template
  *		template to use
  * @param maxToShow
  *		max. comments to show
  * @param showNone
  *		indicates if the 'no comments' thingie should be outputted when there are no comments
  *		(useful for closed items)
  * @param highlight
  *		Highlight to use (if any)
  */
 function showComments($template, $maxToShow = -1, $showNone = 1, $highlight = '')
 {
     global $CONF, $manager;
     // create parser object & action handler
     $actions =& new COMMENTACTIONS($this);
     $parser =& new PARSER($actions->getDefinedActions(), $actions);
     $actions->setTemplate($template);
     $actions->setParser($parser);
     if ($maxToShow == 0) {
         $this->commentcount = $this->amountComments();
     } else {
         $query = 'SELECT c.citem as itemid, c.cnumber as commentid, c.cbody as body, c.cuser as user, c.cmail as userid, c.cemail as email, c.cmember as memberid, c.ctime, c.chost as host, c.cip as ip, c.cblog as blogid' . ' FROM ' . sql_table('comment') . ' as c' . ' WHERE c.citem=' . $this->itemid . ' ORDER BY c.ctime';
         $comments = sql_query($query);
         $this->commentcount = sql_num_rows($comments);
     }
     // if no result was found
     if ($this->commentcount == 0) {
         // note: when no reactions, COMMENTS_HEADER and COMMENTS_FOOTER are _NOT_ used
         if ($showNone) {
             $parser->parse($template['COMMENTS_NONE']);
         }
         return 0;
     }
     // if too many comments to show
     if ($maxToShow != -1 && $this->commentcount > $maxToShow) {
         $parser->parse($template['COMMENTS_TOOMUCH']);
         return 0;
     }
     $parser->parse($template['COMMENTS_HEADER']);
     while ($comment = sql_fetch_assoc($comments)) {
         $comment['timestamp'] = strtotime($comment['ctime']);
         $actions->setCurrentComment($comment);
         $actions->setHighlight($highlight);
         $manager->notify('PreComment', array('comment' => &$comment));
         $parser->parse($template['COMMENTS_BODY']);
         $manager->notify('PostComment', array('comment' => &$comment));
     }
     $parser->parse($template['COMMENTS_FOOTER']);
     sql_free_result($comments);
     return $this->commentcount;
 }
function viewdownloadeditorial($lid, $ttitle)
{
    global $prefix, $dbi, $admin, $module_name;
    include "header.php";
    include "modules/{$module_name}/d_config.php";
    menu(1);
    $result = sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $prefix . "_downloads_editorials WHERE downloadid = {$lid}", $dbi);
    $recordexist = sql_num_rows($result, $dbi);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $transfertitle = stripslashes($transfertitle);
    $displaytitle = $transfertitle;
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br>";
    downloadinfomenu($lid, $ttitle);
    if ($recordexist != 0) {
        while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($result, $dbi)) {
            $editorialtitle = stripslashes($editorialtitle);
            $editorialtext = stripslashes($editorialtext);
            ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
            $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode("-", $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
            $formatted_date = date("F j, Y", $timestamp);
            echo "<br><br>";
            OpenTable2();
            echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br><br>" . "{$editorialtext}";
            CloseTable2();
        }
    } else {
        echo "<br><br><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>";
    }
    echo "<br><br><center>";
    downloadfooter($lid, $ttitle);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Beispiel #24
0
function addCom($wcaid,$name,$birthday,$country,$gender,$importing=false,$id=0)
{
	global $compstable;
	//
	$name = preg_replace("~[\\\\\"\;]~","",$name);
	$wcaid = strtoupper($wcaid);
	if ($wcaid && !preg_match("/^\d{4}[A-Z]{4}\d{2}$/",$wcaid))
		return addCom_err("Invalid WCA id format",$wcaid,$name,$importing);
	if (!checkdate((int)substr($birthday,5,2),(int)substr($birthday,8,2),(int)substr($birthday,0,4)))
		return addCom_err("Invalid date [$birthday]",$wcaid,$name,$importing);
	$gender = strtolower($gender);
	if ($gender!="f" && $gender!="m")
		return addCom_err("Invalid gender",$wcaid,$name,$importing);
	//
	if ($wcaid && !$id)
	{
		$result = strict_query("SELECT * FROM $compstable WHERE WCAid=?", array($wcaid));
		if (sql_num_rows($result))
			return addCom_err("WCA id already exists",$wcaid,$name,$importing);
	}
	$result = strict_query("SELECT * FROM countries WHERE id=?", array($country));
	if (!sql_num_rows($result))
		return addCom_err("Invalid country: ".$country,$wcaid,$name,$importing);
	if (!$id)
	{
		$result = strict_query("SELECT * FROM $compstable WHERE name=? AND country_id=? AND birthday=?", array($name,$country,$birthday));
		if (sql_num_rows($result))
			return addCom_err("Competitor already inserted",$wcaid,$name,$importing);
	}
	//
	if ($id)
		strict_query("UPDATE $compstable SET WCAid=?, name=?, country_id=?, birthday=?, gender=? WHERE id=?", array($wcaid,$name,$country,$birthday,$gender,$id));
	else
		strict_query("INSERT INTO $compstable SET WCAid=?, name=?, country_id=?, birthday=?, gender=?", array($wcaid,$name,$country,$birthday,$gender));
	//
	return ($id?(int)$id:sql_insert_id());
}
Beispiel #25
0
$sql_common = " from {$g5['g5_shop_order_address_table']} where mb_id = '{$member['mb_id']}' ";
$sql = " select count(ad_id) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows);
// 전체 페이지 계산
if ($page < 1) {
    $page = 1;
}
// 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows;
// 시작 열을 구함
$sql = " select *\n            {$sql_common}\n            order by ad_default desc, ad_id desc\n            limit {$from_record}, {$rows}";
$result = sql_query($sql);
if (!sql_num_rows($result)) {
    alert_close('배송지 목록 자료가 없습니다.');
}
$list = array();
$sep = chr(30);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
    $list[$i] = $row;
    $list[$i]['addr'] = $row['ad_name'] . $sep . $row['ad_tel'] . $sep . $row['ad_hp'] . $sep . $row['ad_zip1'] . $sep . $row['ad_zip2'] . $sep . $row['ad_addr1'] . $sep . $row['ad_addr2'] . $sep . $row['ad_addr3'] . $sep . $row['ad_jibeon'] . $sep . $row['ad_subject'];
    $list[$i]['addr'] = get_text($list[$i]['addr']);
    $list[$i]['ad_name'] = get_text($list[$i]['ad_name']);
    $list[$i]['ad_subject'] = get_text($list[$i]['ad_subject']);
    $list[$i]['del_href'] = $_SERVER['SCRIPT_NAME'] . '?w=d&amp;ad_id=' . $row['ad_id'];
    $list[$i]['print_addr'] = print_address($row['ad_addr1'], $row['ad_addr2'], $row['ad_addr3'], $row['ad_jibeon']);
}
$action_url = G5_HTTPS_SHOP_URL . '/orderaddressupdate.php';
$write_pages = G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'];
Beispiel #26
0
        if (sql_num_rows($lm_result3, $dbi) == 0) {
            $link = "page.php?id={$page_id}";
        } else {
            $link = "#";
        }
        ?>
            <li>
              <a href="<?php 
        echo $link;
        ?>
"><?php 
        echo $page_label;
        ?>
</a>
<?php 
        if (sql_num_rows($lm_result3, $dbi) > 0) {
            echo "<ul class=\"subNavList\">\n";
            while (list($sub_page_id, $sub_page_title) = sql_fetch_row($lm_result3, $dbi)) {
                ?>
              <li><a href="page.php?id=<?php 
                echo $sub_page_id;
                ?>
"><?php 
                echo $sub_page_title;
                ?>
</a></li>
<?php 
            }
            echo "</ul>\n";
        }
        ?>
Beispiel #27
0
    $post_aff = ' ';
} else {
    $post_aff = " AND post_aff='1' ";
}
$sql = "SELECT * FROM " . $NPDS_Prefix . "posts WHERE topic_id='{$topic}' and post_id='{$post_id}'" . $post_aff;
if (!($result = sql_query($sql))) {
    forumerror(01);
}
$myrow = sql_fetch_assoc($result);
if ($allow_upload_forum) {
    $visible = '';
    if (!$Mmod) {
        $visible = ' AND visible = 1';
    }
    $sql = "SELECT att_id FROM {$upload_table} WHERE apli='forum_npds' && topic_id = '{$topic}' {$visible}";
    $att = sql_num_rows(sql_query($sql));
    if ($att > 0) {
        include "modules/upload/include_forum/upload.func.forum.php";
    }
}
echo "<tr align=\"left\">";
$posterdata = get_userdata_from_id($myrow['poster_id']);
echo "<td width=\"15%\" valign=\"top\">";
$posts = $posterdata['posts'];
echo $posterdata['uname'];
echo '<br />';
echo member_qualif($posterdata['uname'], $posts, $posterdata['rank']);
echo '<br /><br />';
if ($smilies) {
    if ($posterdata['user_avatar'] != '') {
        if (stristr($posterdata['user_avatar'], "users_private")) {
<?php

include_once './_common.php';
if ($is_guest) {
    exit;
}
$price = $_POST['price'];
$send_cost = $_POST['send_cost'];
// 쿠폰정보
$sql = " select *\n            from {$g5['g5_shop_coupon_table']}\n            where mb_id IN ( '{$member['mb_id']}', '전체회원' )\n              and cp_method = '3'\n              and cp_start <= '" . G5_TIME_YMD . "'\n              and cp_end >= '" . G5_TIME_YMD . "'\n              and cp_minimum <= '{$price}' ";
$result = sql_query($sql);
$count = sql_num_rows($result);
?>

<!-- 쿠폰선택 시작 { -->
<div id="sc_coupon_frm">
    <?php 
if ($count > 0) {
    ?>
    <div class="tbl_head02 tbl_wrap">
        <table>
        <caption>쿠폰 선택</caption>
        <thead>
        <tr>
            <th scope="col">쿠폰명</th>
            <th scope="col">할인금액</th>
            <th scope="col">적용</th>
        </tr>
        </thead>
        <tbody>
        <?php 
Beispiel #29
0
        // 회원목록
        $sql = " select * from {$g5['sms5_history_table']} where wr_no = '{$wr_no}' and bk_no > 0 ";
        $qry = sql_query($sql);
        $tot = sql_num_rows($qry);
        if ($tot > 0) {
            $str = '재전송그룹 (' . number_format($tot) . '명)';
            $val = 'p,';
            while ($row = sql_fetch_array($qry)) {
                $val .= $row['bk_no'] . ',';
            }
            echo "hp_list.options[hp_list.length] = new Option('{$str}', '{$val}');\n";
        }
        // 비회원 목록
        $sql = " select * from {$g5['sms5_history_table']} where wr_no = '{$wr_no}' and bk_no = 0 ";
        $qry = sql_query($sql);
        $tot = sql_num_rows($qry);
        if ($tot > 0) {
            while ($row = sql_fetch_array($qry)) {
                $str = "{$row['hs_name']} ({$row['hs_hp']})";
                $val = "h,{$row['hs_name']}:{$row['hs_hp']}";
                echo "hp_list.options[hp_list.length] = new Option('{$str}', '{$val}');\n";
            }
        }
        echo "</script>\n";
    }
    ?>
<script>
$(function(){
    $(".box_txt").bind("focus keydown", function(){
        $("#wr_message_lbl").hide();
    });
Beispiel #30
0
     $UsersID = -1;
     $PreUsersName = GetUserName($UsersID, $Settings['sqltable'], $SQLStat);
 }
 $UsersName = $PreUsersName['Name'];
 $UsersHidden = $PreUsersName['Hidden'];
 if ($UsersName == "Guest") {
     $UsersName = $GuestsName;
     if ($UsersName == null) {
         $UsersName = "Guest";
     }
 }
 if ($PermissionInfo['CanViewForum'][$ForumID] == "yes" && $CatPermissionInfo['CanViewCategory'][$CategoryID] == "yes" && $TopicStat >= 0 && $TopicStat < 3 || $PermissionInfo['CanViewForum'][$ForumID] == "yes" && $CatPermissionInfo['CanViewCategory'][$CategoryID] == "yes" && $PermissionInfo['CanModForum'][$ForumID] == "yes" && $TopicStat == 3) {
     $LastReply = "&nbsp;<br />&nbsp;";
     $glrquery = sql_pre_query("SELECT * FROM \"" . $Settings['sqltable'] . "posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
     $glrresult = sql_query($glrquery, $SQLStat);
     $glrnum = sql_num_rows($glrresult);
     if ($glrnum > 0) {
         $ReplyID1 = sql_result($glrresult, 0, "id");
         $UsersID1 = sql_result($glrresult, 0, "UserID");
         $GuestsName1 = sql_result($glrresult, 0, "GuestName");
         $TimeStamp1 = sql_result($glrresult, 0, "TimeStamp");
         $TimeStamp1 = GMTimeChange($_SESSION['iDBDateFormat'] . ", " . $_SESSION['iDBTimeFormat'], $TimeStamp1, $_SESSION['UserTimeZone'], 0, $_SESSION['UserDST']);
         $PreUsersName1 = GetUserName($UsersID1, $Settings['sqltable'], $SQLStat);
         if ($PreUsersName1['Name'] === null) {
             $UsersID1 = -1;
             $PreUsersName1 = GetUserName($UsersID1, $Settings['sqltable'], $SQLStat);
         }
         $UsersName1 = $PreUsersName1['Name'];
         $UsersHidden1 = $PreUsersName1['Hidden'];
     }
     $NumPages = null;