当前位置: 首页>>代码示例>>PHP>>正文


PHP sql_num_rows函数代码示例

本文整理汇总了PHP中sql_num_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP sql_num_rows函数的具体用法?PHP sql_num_rows怎么用?PHP sql_num_rows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sql_num_rows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cacheIdFromWP

 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;
 }
开发者ID:PaulinaKowalczuk,项目名称:oc-server3,代码行数:28,代码来源:cache.class.php

示例2: showlist

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;
    }
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:30,代码来源:showlist.php

示例3: get_page_tok_strange

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;
}
开发者ID:gisly,项目名称:opencorpora,代码行数:26,代码来源:lib_qa.php

示例4: NewLinks

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";
}
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:60,代码来源:links-2.php

示例5: menu_create

 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;
 }
开发者ID:l2zeo,项目名称:eyoom_builder-1,代码行数:27,代码来源:shop.class.php

示例6: marquetapage

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);
    }
}
开发者ID:npds,项目名称:npds_dune,代码行数:58,代码来源:marquetapage.php

示例7: toggleReg

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;
	}
}
开发者ID:pedrosino,项目名称:cubecomps.com,代码行数:55,代码来源:lib_reg.php

示例8: getNewIdCommon

 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;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:11,代码来源:LabelAlms.php

示例9: couponcode

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);
        }
    }
}
开发者ID:blynch-newpi,项目名称:IS4C,代码行数:52,代码来源:mcoupon.php

示例10: nexttransno

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);
}
开发者ID:blynch-newpi,项目名称:IS4C,代码行数:13,代码来源:loadconfig.php

示例11: addEve

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));
	}
}
开发者ID:pedrosino,项目名称:cubecomps.com,代码行数:14,代码来源:lib_eve.php

示例12: finish

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");
}
开发者ID:BackupTheBerlios,项目名称:jonescms,代码行数:14,代码来源:login.php

示例13: printDetails

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 = "<a href='http://localhost/modules.php?name=Your_Account&op=userinfo&username={$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>";
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:14,代码来源:index.php

示例14: clubCard

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();
        }
    }
}
开发者ID:blynch-newpi,项目名称:IS4C,代码行数:49,代码来源:clubCard.php

示例15: news

 /**
  * 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;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:19,代码来源:lib.loginlayout.php


注:本文中的sql_num_rows函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。