function exe_reserve($sched, $Rdate) { $auto = rnd(); $sqlauto = 'SELECT `reservationID` from `reservations` WHERE reservationID="' . $auto . '"'; $auto_check = mysql_query($sqlauto); $checkauto = mysql_num_rows($auto_check); if ($checkauto > 0) { $auto = rnd(); } $sql = " INSERT INTO `reservations` (\n\t\t\t\t\t\t\t\t\t`reservationID`,\n\t\t\t\t\t\t\t\t\t`accountID`,\n\t\t\t\t\t\t\t\t\t`scheduleID`,\n\t\t\t\t\t\t\t\t\t`reservationDate`)\n\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t'" . $auto . "',\n\t\t\t\t\t\t\t\t\t'" . $_SESSION['UserID'] . "',\n\t\t\t\t\t\t\t\t\t'" . $sched . "',\n\t\t\t\t\t\t\t\t\t'" . $Rdate . "'\n\t\t\t\t\t\t\t\t\t)"; if (!mysql_query($sql)) { die(mysql_error()); } else { return true; } }
function exe_reserve($sched, $Rdate, $many) { $cleanDate = substr($Rdate, -10); $count = 0; while ($many > $count) { $auto = rnd(); $sqlauto = 'SELECT `reservationID` from `reservations` WHERE reservationID="' . $auto . '"'; $auto_check = mysql_query($sqlauto); $checkauto = mysql_num_rows($auto_check); if ($checkauto > 0) { $auto = rnd(); } $sql = " INSERT INTO `reservations` (\n\t\t\t\t\t\t\t\t\t\t\t`reservationID`,\n\t\t\t\t\t\t\t\t\t\t\t`accountID`,\n\t\t\t\t\t\t\t\t\t\t\t`scheduleID`,\n\t\t\t\t\t\t\t\t\t\t\t`reservationDate`)\n\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\t'" . $auto . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['UserID'] . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $sched . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $cleanDate . "'\n\t\t\t\t\t\t\t\t\t\t\t)"; if (!mysql_query($sql)) { die(mysql_error()); } else { $sql1 = "SELECT `email` FROM `accounts` WHERE accountID='" . $_SESSION['UserID'] . "'"; $rs = mysql_query($sql1); $row = mysql_fetch_row($rs); $query = 'SELECT reservations.reservationID,reservations.reservationDate,routes.route,schedules.DepTime from reservations INNER JOIN schedules ON reservations.scheduleID=schedules.scheduleID INNER JOIN routes ON routes.routeID=schedules.routeID WHERE reservations.accountID="' . $_SESSION['UserID'] . '" '; $result = mysql_query($query); $rw = mysql_fetch_row($result); $Ddate = $rw[1]; $Rroute = $rw[2]; $Rtime = $rw[3]; $message .= "\n\t\t\t\t\t\t\t<html>\n\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<title>Automated Ticket</title>\n\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<p>We would like to notify your ticket Below!</p>\n\t\t\t\t\t\t\t<p>Reservation ID: " . $auto . "</p>\n\t\t\t\t\t\t\t<p>Departure Date: " . $cleanDate . "</p>\n\t\t\t\t\t\t\t<p>Route: " . $Rroute . "</p>\n\t\t\t\t\t\t\t<p>Departure Time: " . $Rtime . "</p>\n\t\t\t\t\t\t\t<p>Please Present in terminal</p>\n\t\t\t\t\t\t\t<p>Have a nice Day Enjoy</p>\n\t\t\t\t\t\t\t</br>\n\t\t\t\t\t\t\t</body>\n\t\t\t\t\t\t\t</html>\n\t\t\t\t\t\t\t"; $count = $count + 1; } } $subject = "Batangas Reservation Ticket"; $to = $_SESSION['Email']; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: <*****@*****.**>' . "\r\n"; mail($to, $subject, $message, $headers); return true; }
function upperCaseORLowerCase($content) { $i = ''; $s = ''; $c = ''; $nRnd = ''; $c = ''; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); $nRnd = CInt(rnd() * 1); if ($nRnd == 0) { $c = $c . lCase($s); } else { $c = $c . uCase($s); } } $upperCaseORLowerCase = $c; return @$upperCaseORLowerCase; }
function foldingMenu($id, $s, $msg) { //On Error Resume Next $nRnd = ''; $c = ''; if ($id == '') { $nRnd = cLng(rnd() * 29252888); } else { $nRnd = $id; } $c = '<div style="width:100%; font-size:12px;;line-height:150%;margin-bottom:4px;">'; $c = $c . ' <label onClick="ERRORDIV' . $nRnd . '.style.display=(ERRORDIV' . $nRnd . '.style.display==\'none\'?\'\':\'none\')">'; $c = $c . ' <span style="background-color:#666;color:#FFFFFF;height:23px;font-size:14px;cursor:pointer">〖 ' . $s . ' 〗</span><br />'; $c = $c . ' </label>'; $c = $c . ' <div id="ERRORDIV' . $nRnd . '" style="width:100%;border:1px solid #820222;padding:5px;overflow:hidden;display:none;">'; $c = $c . $msg; $c = $c . ' </div>'; $c = $c . '</div>'; $foldingMenu = $c; return @$foldingMenu; }
function doError($s, $msg) { //On Error Resume Next $nRnd = ''; $c = ''; $nRnd = cLng(rnd() * 29252888); $c = '<br />'; $c = $c . '<div style="width:100%; font-size:12px;;line-height:150%">'; $c = $c . ' <label onClick="ERRORDIV' . $nRnd . '.style.display=(ERRORDIV' . $nRnd . '.style.display==\'none\'?\'\':\'none\')">'; $c = $c . ' <span style="background-color:#820222;color:#FFFFFF;height:23px;font-size:14px;cursor:pointer">〖 出错 提示信息 ERROR 〗</span><br />'; $c = $c . ' </label>'; $c = $c . ' <div id="ERRORDIV' . $nRnd . '" style="width:100%;border:1px solid #820222;padding:5px;overflow:hidden;">'; $c = $c . ' <span style="color:#FF0000;">出错描述</span> ' . $s . '<br />'; $c = $c . ' <span style="color:#FF0000;">回显信息</span> ' . $msg . '<br />'; $c = $c . ' </div>'; $c = $c . '</div>'; $c = $c . '<br />'; echo $c; die; //终止,程序停止 }
charges to all items in an order. The per item shipping costs have already been chosen from ship. In preparation, showcart.php and orderform.php accumulate two counters, $first_items and $second_items. first_items is the number of items that have at least a quantity of one, and second_items is an accumulation of the total quantity of items of two or more. The algorithm: if($qty==1){ $first_items++; } elseif($qty>1){ $first_items++; $second_items += ($qty-1); } Thus with two items of quantity 1 and 3 each, these variables are as follows: $first_items = 2 $second_items = 2 pass the amount to do shipping on in $shipsubtotal the shipping amount is given back in $shamt $fct is the FC_SQL class instance from the including script */ // first and second item costs apply across all items if ($first_items < 1) { $shamt = 0; } else { $shamt = rnd((double) $fct->f("shipitem") + (double) $fct->f("shipitem2") * (double) ($first_items - 1 + $second_items)); }
charges on a per line item basis. The per item shipping costs have already been chosen from ship. In preparation, showcart.php and orderform.php accumulate two counters, $first_items and $second_items. first_items is the number of items that have at least a quantity of one, and second_items is an accumulation of the total quantity of items of two or more. The algorithm: if($qty==1){ $first_items++; } elseif($qty>1){ $first_items++; $second_items += ($qty-1); } Thus with two items of quantity 1 and 3 each, these variables are as follows: $first_items = 2 $second_items = 2 pass the amount to do shipping on in $shipsubtotal the shipping amount is given back in $shamt $fct is the FC_SQL class instance from the including script */ // first and second item costs apply to each line item if ($first_items < 1) { $shamt = 0; } else { $shamt = rnd((double) $fct->f("shipitem") * (double) $first_items + (double) $fct->f("shipitem2") * (double) $second_items); }
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. N. Michael Brennen FishNet(R), Inc. 850 S. Greenville, Suite 102 Richardson, TX 75081 http://www.fni.com/ mbrennen@fni.com voice: 972.669.0041 fax: 972.669.8972 */ // This file calculates shipping as a percentage of the order total. // The shipping percentage has already been chosen from ship. // pass the amount to do shipping on in $shipsubtotal // the shipping amount is given back in $shamt // $fct is the FC_SQL class instance from the including script $shamt = rnd((double) $fct->f("shippercent") * $shipsubtotal);
if ($taxcmtn) { printf("%s: %s%.2f<br />", $taxcmtn, $csym, $tpn); } else { printf("%s%.2f<br />", $csym, $tpn); } $mtotal = rnd($mtotal + $tpn); } if ($taxpers) { // taxable shipping $tps = rnd($taxpers * ($ptaxsubtotal + $shamt)); if ($taxcmts) { printf("%s: %s%.2f<br />", $taxcmts, $csym, $tps); } else { printf("%s%.2f<br />", $csym, $tps); } $mtotal = rnd($mtotal + $tps); } ?> </td></tr> <?php } // taxper>0 if ($mtotal) { ?> <tr><td class="showcartcell" colspan="1" bgcolor="#FFFFFF"></td> <td class="showcartcell" colspan="2" align="left" valign="top" bgcolor="#FFFFFF"> <b><?php echo fc_text('psubtotal'); ?>
printf("%s%.2f<br />", $csym, $prodsettot); // accumulate setup into order total $stotal = rnd($prodsettot + $stotal); ?> </font> </td></tr> <?php } if ($zflag1 & $flag_zonecoupon) { // $stotal is the discounted product subtotal $cpndisc = coupon_discount($couponid, $stotal, $tqty); if ($cpndisc > 0) { $shipsubtotal = rnd($shipsubtotal - $cpndisc); $taxsubtotal = rnd($taxsubtotal - $cpndisc); $stotal = rnd($stotal - $cpndisc); $ototal = rnd($ototal - $cpndisc); ?> <tr><td class="previewcell" colspan="1" align="left" valign="top" bgcolor="#FFFFFF"> <font face="Arial,Helvetica" size="1"> <b><?php echo fc_text('coupondisc'); ?> </b><br /> </font> </td><td class="previewcell" colspan="1" align="right" valign="top" bgcolor="#FFFFFF"> <font face="Arial,Helvetica" size="1"> <?php printf("%s%.2f<br />", $csym, $cpndisc); ?> </font> </td><td class="previewcell" colspan="1" align="right" valign="top" bgcolor="#FFFFFF">
$fcl->next_record(); $oheadaban = (int) $fcl->f("cnt"); $fcl->free_result(); $fcl->query("select count(*) as cnt from ohead " . "where complete=1 and {$today}<=tstamp and tstamp<{$midnight}"); $fcl->next_record(); $oheadcomp = (int) $fcl->f("cnt"); $fcl->free_result(); $fcl->query("select sum(contrib) as cnt from ohead " . "where complete=1 and {$today}<=tstamp and tstamp<{$midnight}"); $fcl->next_record(); $contrib_total = (int) $fcl->f("cnt"); $fcl->free_result(); $fcl->query("select sum(ototal) as cnt from ohead " . "where complete=1 and {$today}<=tstamp and tstamp<{$midnight}"); $fcl->next_record(); $order_total = (int) $fcl->f("cnt"); $fcl->free_result(); $prod_total = rnd($order_total - $contrib_total); ?> <h2 align=center>Real-Time Order Statistics for <?php echo $today_mdy; ?> </h2> <hr> <center> <table width=650 border=0 bgcolor=#666666 cellpadding=3 cellspacing=1 class="text"> <tr><td colspan=2 bgcolor=#FFFFFF align=center> <a href="ordertoday.php?zoneid=<?php echo $zoneid; ?> &langid=<?php echo $langid; ?>
function PHPStr_Shuffle($content) { $i = ''; $s = ''; $c = ''; $n = ''; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); if ($c == '') { $c = $s; } else { if (len($c) == 1) { $n = CInt(rnd() * 100); if ($n > 50) { $c = $c . $s; } else { $c = $s . $c; } } else { $n = CInt(rnd() * len($c)) + 1; $c = mid($c, 1, $n) . $s . mid($c, $n + 1, -1); } } } $PHPStr_Shuffle = $c; return @$PHPStr_Shuffle; }
$fcp->query("select prodname,installinst from prodlang " . "where prodlzid={$zid} and prodlid={$lid} and prodlsku='{$sku}'"); $fcp->next_record(); // strip any HTML tags $dsc = ereg_replace("<[^>]+>", " ", $fcp->f("prodname")); $dsc = substr($dsc, 0, 35); $installinst = $fcp->f("installinst"); //$installinst=substr($installinst,0,35); $fcp->free_result(); // accumulate $popttotal, $poptsettot while (get_prodopts($csku)) { } // figure options modified product price, accumulate $prodsetttot // sets various globals $prodprice = prod_price($sku); $ltotal = line_total($qty, $prodprice); $tqty = rnd($tqty + $qty); if ($csku) { $body .= sprintf("\n%10s", $csku); // ProductNumber } else { $body .= sprintf("\n%10s", $sku); // ProductNumber } $body .= ' '; $body .= sprintf("%3d", $qty); // Quantity $body .= ' '; $body .= sprintf("%8.2f", $ltotal); // ExtPrice $body .= ' '; $body .= sprintf("%s", $dsc);
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. N. Michael Brennen FishNet(R), Inc. 850 S. Greenville, Suite 102 Richardson, TX 75081 http://www.fni.com/ mbrennen@fni.com voice: 972.669.0041 fax: 972.669.8972 */ // This file calculates shipping on either a threshold basis // or on a percentage of order total basis, depending on whether // the number in the threshold chart is a number > 1 or if it is // a decimal number between 0 and 1. // pass the amount to do shipping on in $shipsubtotal // the shipping amount is given back in $shamt // $fct is the FC_SQL class instance from the including script $fcth = new FC_SQL(); $fcth->query("select shipamt from shipthresh where " . "shipid={$curshipid} and shiplow < {$shipsubtotal} and shiphigh >= {$shipsubtotal}"); if (!$fcth->next_record()) { $shamt = 0; } else { $shamt = (double) $fcth->f("shipamt"); $fcth->free_result(); if ($shamt > 0 && $shamt < 1) { // percentage shipping $shamt = rnd($shamt * $shipsubtotal); } }
// collision is the count of rows found, leave loop when 0 $collision = (int) $fcc->f('cnt'); $fcc->free_result(); $i++; if ($i % 10 == 0) { global $gBitSystem; mail($gBitSystem->getErrorEmail(), " CUSTOMER ID COLLISION LOOP", "Order Number: {$cartid}\nLoop count: {$i}\n"); sleep(1); // try a 1 second sleep } } $btotal = rnd($ttotal + $mtotal); $res = $fcc->query("insert into cust (" . "custid," . "custbsal," . "custbfname," . "custbmname," . "custblname," . "custbcompany," . "custbemail," . "custbaddr1," . "custbaddr2," . "custbcity," . "custbstate," . "custbzip," . "custbzip4," . "custbnatl," . "custbacode," . "custbphone," . "custssal," . "custsfname," . "custsmname," . "custslname," . "custscompany," . "custsemail," . "custsaddr1," . "custsaddr2," . "custscity," . "custsstate," . "custszip," . "custszip4," . "custsnatl," . "custsacode," . "custsphone," . "custototal," . "custbtotal," . "custloamt," . "custlodate," . "custfodate," . "custpromoemail" . ") values (" . "{$custid}," . "'{$billing_sal}'," . "'{$billing_first}'," . "'{$billing_mi}'," . "'{$billing_last}'," . "'{$billing_company}'," . "'{$sql_billing_email}'," . "'{$billing_address1}'," . "'{$billing_address2}'," . "'{$billing_city}'," . "'{$billing_state}'," . "'{$billing_zip}'," . "'{$billing_zip4}'," . "'{$billing_country}'," . "'{$billing_acode}'," . "'{$billing_phone}'," . "'{$shipping_sal}'," . "'{$shipping_first}'," . "'{$shipping_mi}'," . "'{$shipping_last}'," . "'{$shipping_company}'," . "'{$sql_shipping_email}'," . "'{$shipping_address1}'," . "'{$shipping_address2}'," . "'{$shipping_city}'," . "'{$shipping_state}'," . "'{$shipping_zip}'," . "'{$shipping_zip4}'," . "'{$shipping_country}'," . "'{$shipping_acode}'," . "'{$shipping_phone}'," . "1," . "{$btotal}," . "{$btotal}," . "{$now}," . "{$now}," . "{$promoemail} " . ")"); } else { $ocount = (int) $fcc->f("custototal") + 1; $btotal = rnd((double) $fcc->f("custbtotal") + $ttotal + $mtotal); $fcc->free_result(); // update the customer record $fcc->query("update cust set " . "custbsal='{$billing_sal}'," . "custbfname='{$billing_first}'," . "custbmname='{$billing_mi}'," . "custblname='{$billing_last}'," . "custbcompany='{$billing_company}'," . "custbemail='{$sql_billing_email}'," . "custbaddr1='{$billing_address1}'," . "custbaddr2='{$billing_address2}'," . "custbcity='{$billing_city}'," . "custbstate='{$billing_state}'," . "custbzip='{$billing_zip}'," . "custbzip4='{$billing_zip4}'," . "custbnatl='{$billing_country}'," . "custbacode='{$billing_acode}'," . "custbphone='{$billing_phone}'," . "custbfacode='{$billing_facode}'," . "custbfax='{$billing_fax}'," . "custssal='{$shipping_sal}'," . "custsfname='{$shipping_first}'," . "custsmname='{$shipping_mi}'," . "custslname='{$shipping_last}'," . "custscompany='{$shipping_company}'," . "custsemail='{$sql_shipping_email}'," . "custsaddr1='{$shipping_address1}'," . "custsaddr2='{$shipping_address2}'," . "custscity='{$shipping_city}'," . "custsstate='{$shipping_state}'," . "custszip='{$shipping_zip}'," . "custszip4='{$shipping_zip4}'," . "custsnatl='{$shipping_country}'," . "custsacode='{$shipping_acode}'," . "custsphone='{$shipping_phone}'," . "custsfacode='{$shipping_facode}'," . "custsfax='{$shipping_fax}'," . "custototal={$ocount}," . "custbtotal={$btotal}," . "custloamt={$btotal}," . "custlodate={$now}," . "custpromoemail={$promoemail} " . "where {$cupdate}"); } $fcc->commit(); // set a three year cookie // force the cookie so custid and email addr is updated if changed if ($retain_addr) { setcookie("Cookie{$instid}CustID", base64_encode($custid . ":" . $billing_email), $now + 94608000, '/'); } else { setcookie("Cookie{$instid}CustID", "", time() - 1000, '/'); } if ($onoff == 'on') { $complete = 1; } elseif ($onoff == 'off') {
#!/usr/bin/php <?php srand(time() + rand(0, 9)); while (1) { echo rand(0, 20) . "\n"; } function rnd() { while (($i = rand(0, 1000000000) / 1000000000) == 1) { } return $i; } while (($i = round(rnd() * 15)) != 15) { echo $i . "\n"; } echo $i . "\n";
// for one time product setup regardless of qty, comment the line below $setup = $setup * $quantity; // put price in order record to track discounts $slb = (int) $fai->f("prodsalebeg"); $sle = (int) $fai->f("prodsaleend"); $flag1 = (int) $fai->f("prodflag1"); if ($slb < $now && $now < $sle) { $prc = (double) $fai->f("prodsaleprice"); $slprc = 1; } else { $prc = (double) $fai->f("prodprice"); } if ($npoptgrps) { // if product options if ($poptflag1 & $flag_poptprcrel) { $prc = rnd($prc + $popttotal); } else { $prc = $popttotal; } } $ordmax = (int) $fai->f("prodordmax"); $fai->free_result(); if ($ordmax && $quantity > $ordmax) { // can't order more than max; check before inventory $quantity = $ordmax; } if ($use && $quantity > 0 && $quantity > $inv) { $fao->query("insert into oline " . "(olid,olzone,ollang,orderid,sku,compsku,qty,invover,olprice) " . "values " . "({$olid},{$zid},{$lid},'{$cartid}','{$product}','{$csku}',{$inv},0,{$prc})"); } elseif ($quantity > 0) { $fao->query("insert into oline " . "(olid,olzone,ollang,orderid,sku,compsku,qty,invover,olprice) " . "values " . "({$olid},{$zid},{$lid},'{$cartid}','{$product}','{$csku}',{$quantity},0,{$prc})"); }
private function GenWord() { // Text $lines = file($this->dic, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES | FILE_TEXT); $linesNum = count($lines) - 1; shuffle($lines); $prefix = $lines[rnd($linesNum)]; $postfix = $lines[rnd($linesNum)]; $text = rtrim($prefix) . rtrim($postfix); $this->QXC->Request->Session('qxc_captcha_text', $text); return $text; }
} function exe_register($Tuser, $Tpass, $Tfull, $Tmail, $auto, $contact) { $sql = " INSERT INTO `temp` (\n\t\t\t\t\t\t\t\t\t`username`,\n\t\t\t\t\t\t\t\t\t`password`,\n\t\t\t\t\t\t\t\t\t`email`,\n\t\t\t\t\t\t\t\t\t`fullname`,\n\t\t\t\t\t\t\t\t\t`contact`,\n\t\t\t\t\t\t\t\t\t`valid`,\n\t\t\t\t\t\t\t\t\t`salt`\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t'" . $Tuser . "',\n\t\t\t\t\t\t\t\t\t'" . md5($Tpass) . "',\n\t\t\t\t\t\t\t\t\t'" . $Tmail . "',\n\t\t\t\t\t\t\t\t\t'" . $Tfull . "',\n\t\t\t\t\t\t\t\t\t'" . $contact . "',\n\t\t\t\t\t\t\t\t\t'" . $auto . "',\n\t\t\t\t\t\t\t\t\t'" . $Tpass . "'\n\t\t\t\t\t\t\t\t\t)"; if (!mysql_query($sql)) { die(mysql_error()); } else { return true; } } if ($_POST['submit'] == 'Sign up') { if (!is_numeric($_POST['contact'])) { header("location:../register.php?err=lkhgjasdg"); exit; } else { $Anum = rnd(); $sqluser = '******' . $_POST['user'] . '"'; $user_check = mysql_query($sqluser); $do_user_check = mysql_num_rows($user_check); if ($do_user_check > 0) { header("location:../register.php?err=plmoknijb"); } else { $sqlmail = 'SELECT `email` FROM `accounts` WHERE `email`="' . $_POST['xmail'] . '"'; $mail_check = mysql_query($sqlmail); $do_mail_check = mysql_num_rows($mail_check); if ($do_mail_check > 0) { header("location:../register.php?err=qazxswedc"); } else { if (!preg_match('#^\\w+$#ius', $_POST['user'])) { header("location:../register.php?err=asdfghjkl"); } else {
function coupon_discount($couponid, $stotal, $tqty) { global $now; $fccp = new FC_SQL(); $fccp->query("select discount,cpnredeem from coupon " . "where cpnid = '{$couponid}' and " . "(cpnstart = 0 or (cpnstart <> 0 and {$now} > cpnstart)) and " . "(cpnstart = 0 or (cpnstop <> 0 and {$now} < cpnstop)) and " . "(cpnminqty = 0 or ({$tqty} >= cpnminqty)) and " . "(cpnminamt = 0 or ({$stotal} >= cpnminamt)) and " . "(cpnredeem < cpnmaximum)"); if (!$fccp->next_record()) { $cpndisc = 0; } else { $cpndisc = (double) $fccp->f("discount"); if ($cpndisc > 0 && $cpndisc < 1) { $cpndisc = rnd($stotal * $cpndisc); } elseif ($cpndisc < 0) { $cpndisc = 0; } $fccp->free_result(); } return $cpndisc; }
function getRandomPhoneNumber($nCount) { $num1 = ''; $rndnum = ''; $j = ''; $c = ''; $c = ''; $rndnum = ''; $j = 1; while ($j < $nCount) { while (len($rndnum) < 9) { //产生随机数的个数 $num1 = cStr(chr((57 - 48) * rnd() + 48)); $rndnum = $rndnum . $num1; } $c = $c . 13 . $rndnum . vbCrlf(); $rndnum = ''; $j = $j + 1; } if ($c != '') { $c = left($c, len($c) - 2); } $getRandomPhoneNumber = $c; return @$getRandomPhoneNumber; }