".$link_name." "; }else{ $link_temp="".$link_name." "; } return $link_temp; }else{ return "".$link_name." "; } } function get_link_header($h_link_page,$h_link_query,$h_flag_path){ if($h_flag_path==1){ $vowels = array("?", "=", "&"); $c=str_replace($vowels,"/",$h_link_query); $link_temp=$h_link_page.$c; return $link_temp; }else{ return $h_link_page.$h_link_query; } } function cvk($text,$ktype){ $cvfn = mb_convert_kana($text,$ktype); return $cvfn; } function cvi($text){ $cvin = mb_convert_encoding($text, "ISO-2022-JP","AUTO"); return $cvin; } function cvf($text){ $cvfn = mb_convert_encoding($text, "EUC-JP","SJIS"); return $cvfn; } function cvr($text){ $cvrn = mb_convert_encoding($text, "SJIS","EUC-JP"); return $cvrn; } /*function cvr($text, $kana=''){ if($kana!=''){ $cvrn = JcodeConvert($text, 0, 1); $cvrn = base2pack(mb_convert_kana($cvrn, $kana), 1); }else{ $cvrn = base2pack($text, 1); } return $cvrn; }*/ function cvu($text){ $cvu = mb_convert_encoding($text, "UTF-8", "auto"); return $cvu; } function cvur($text){ $cvu = mb_convert_encoding($text, "SJIS", "auto"); return $cvu; } //================================================================================ function calculate_price($cart) { $price = 0.0; if(is_array($cart)) { foreach($cart as $pr_itemid => $qty) { $query = "select * from product_fl where pr_itemid='$pr_itemid'"; $result = mysql_query($query); if ($result){ $product = mysql_fetch_array($result); $drate = $product["pr_discount_rate"]; $basicprice=$product["pr_basicprice"]; $price_dc = $basicprice*$drate/100; $price_dc = round($price_dc); $price2=$basicprice-$price_dc; $price +=$price2*$qty; } } } return $price; } //================================================================================ /*function calculate_dc($cart) { $price = 0.0; $td1=date("Y-m-d"); if(is_array($cart)){ foreach($cart as $pr_itemid => $qty) { $query = "select * from product_fl where pr_itemid='$pr_itemid'"; $result = mysql_query($query); if ($result) { $product = mysql_fetch_array($result); $item_price = $product["pr_basicprice"]; $dc = $product["pr_discount_rate"]; $sqlprom1="select * from promotion_discount_fl where pro_itemid='$pr_itemid'"; $queryprom1=mysql_query($sqlprom1); if(mysql_num_rows($queryprom1)){ $ras1=mysql_fetch_array($queryprom1); if($ras1['pro_status']==1 && $ras1['pro_eddate']>=$td1){ $sprom="1"; }else{$sprom="0";} }else{ $sprom="0"; } if($sprom!="0"){ $price_dc=$item_price*($ras1['pro_dc']/100); }else{ $price_dc=$item_price*$dc/100; } $total_price_dc+=$price_dc*$qty; $item_price1+=$item_price*$qty; } } $price=$item_price1-ceil($total_price_dc); } return ceil($price); }*/ //================================================================================ function calculate_all($cart) { $price = 0.0; if(is_array($cart)){ foreach($cart as $pr_itemid => $qty) { $query = "select * from product_fl where pr_itemid='$pr_itemid'"; $result = mysql_query($query); if ($result) { $product = mysql_fetch_array($result); $item_price = $product["pr_basicprice"]; $dc = $product["pr_discount_rate"]; $price_dc=$item_price*$dc/100; $total_price_dc+=$price_dc*$qty; $item_price1+=$item_price*$qty; } } $price=$item_price1-ceil($total_price_dc); //$price=$item_price1; //$price=$total_price_dc; } return ceil($price); } //================================================================================ function calculate_items($cart){ $items = 0; if(is_array($cart)) { foreach($cart as $pr_itemid => $qty) { $items += $qty; } } return $items; } //================================================================================= function calculate_type($cart) { $type = 0; if(is_array($cart)) { foreach($cart as $pr_itemid => $qty) { $type ++; } } return $type; } //===================== SEND BONUS IN CART ========== 2004/5/7 ============================= BY AE function getbonus($b_cust_id,$b_order_id){ if(!empty($b_cust_id)){ $sql="SELECT a.cust_id,b.item_name,a.id_bonus FROM bonus_detail a,bonus b WHERE a.item_bonus=b.item_id and a.cust_id = '".$b_cust_id."' and a.item_bonus>3 and (a.bonus_status='' or a.bonus_status='".$b_order_id."')"; //echo($sql); $data1=mysql_query($sql); $rows3=mysql_num_rows($data1); //echo $rows3; if($rows3){ ?>
わくわくプレゼント当選商品
をこのご注文と一緒にお届けします
わくわくプレゼント当選商品
をこのご注文と一緒にお届けします
"; echo ""; echo "
商品番号
商 品 名
単 価
数 量
金 額
"; echo "
"; $i=0; foreach ($cart as $pr_itemid => $qty){ $prd = get_details($pr_itemid); echo($key); echo " ".$prd["pr_itemid"]." ".cvr($prd["pr_itemname"])."
".$prd["pr_basicprice"]."
".$prd["pr_basicprice"]*$qty." 円
"; $i++; }//".getitem($new,"")." echo("
"); if($add=="ok"){ echo"
";} else{echo" ";} if($check2==1){$price_pos=2500;}else{$price_pos=0;} $sup_price=$upoint*3; $dc_price=$total_price-$total_dc; $total=$total_dc-$sup_price; $total=$total+$price_pos; echo ""; if($upoint!=""&&$check2==1){ echo "
今回ご注文のポイント数: ".$total_point."ポイント
"; } elseif($upoint!=""&&$check2!=1){ echo "
今回ご注文のポイント数: ".$total_point."ポイント
";} elseif($upoint==""&&$check2==1){ echo "
今回ご注文のポイント数: ".$total_point."ポイント
";} else{ echo "
今回ご注文のポイント数: ".$total_point."ポイント
";} echo "
小 計
"; echo "
".$total_price." 円
"; echo ""; echo "
ポイント割引
-".$dc_price." 円
"; if($upoint){ echo "
ポイント割引
-".$sup_price." 円
"; } if($check2){ echo "
クイック転送サービス
+".$price_pos." 円
"; } //$tax_price=round($total/105*5); echo "
合 計
".$total." 円
消費税は内税です。

"; //echo(getbonus($cust_id,$order_id)); } //================================================================================= function display_cart($cart,$total_priceall,$typecart){ global $items; global $total_price; global $total_priceall; global $total_point; global $cust_id; global $order_id; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $i=0; foreach ($cart as $pr_itemid => $qty){ $prd = get_details($pr_itemid); $prix=$prd["pr_basicprice"]*$prd["pr_discount_rate"]/100; $prix=round($prix); $re_price=$prd["pr_basicprice"]-$prix; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $i++; } echo " "; echo "
商品番号 商 品 名 単 価 数 量 金 額
".$prd["pr_itemid"]." ".cvr($prd["pr_itemname"])."".$re_price.""; echo "

"; echo " "; echo " "; echo "

".$re_price*$qty." 円
"; echo " "; echo " "; echo " "; echo " "; echo " "; //echo " "; //echo " "; //echo " "; //echo " "; $tax_price=round($total_price/105*5); echo " "; //echo " "; echo " "; echo " "; echo " "; echo "
"./*$total_point.*/" 小 計 ".$total_price." 円
会員割引 - 円
合 計 (内税 ".$tax_price." 円) 合 計 ".$total_priceall." 円
"; //echo(getbonus($cust_id,$order_id)); } //================================================================================= function finish_cart($cart,$total_priceall,$sup){ global $items; global $total_price; global $total_priceall; global $total_point; global $sup; global $cust_id; global $order_id; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $i=0; foreach ($cart as $pr_itemid => $qty){ $prd = get_details($pr_itemid); $prix=$prd["pr_basicprice"]*$prd["pr_discount_rate"]/100; $prix=round($prix); $re_price=$prd["pr_basicprice"]-$prix; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; if(($sup!="")||($sup!='0')){ $supoint=$sup*3; $tprice2=$total_priceall-$supoint; $total_po=round($tprice2/100); } /* $item_price = $prd["pr_basicprice"]; $item_point = $prd["pr_pointrate"]; $supoint = $sup*3; $tp=$item_price*$qty; $tp2=$tp-$supoint; $po=100/$item_point; $total_po+=round($tp2/$po); */ $i++; } echo " "; echo "
商品番号 商 品 名 単 価 数 量 金 額
".$prd["pr_itemid"]."".cvr($prd["pr_itemname"])."".$re_price.""; echo "

"; echo " "; echo " "; echo "

".$re_price*$qty." 円
"; echo " "; echo " "; echo " "; echo " "; echo " "; if($sup!=0){ $sup_price=$sup*3; echo " "; echo " "; echo " "; echo " "; } $tax_price=round($total_price/105*5); $tprice=$total_priceall-$sup_price; echo " "; //echo " "; echo " "; echo " "; echo " "; echo "
"./*$total_po.*/" 小 計 ".$total_price." 円
ポイント割引 - ".$sup_price." 円
合 計 (内税 ".$tax_price." 円) 合 計 ".$tprice." 円
"; //echo(getbonus($cust_id,$order_id)); } //================================================================================= function finish_cart1($cart,$total_priceall,$upoint,$check2,$sup) { global $items; global $total_price; global $total_priceall; global $cust_id; global $order_id; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $i=0; foreach ($cart as $pr_itemid => $qty){ $prd = get_details($pr_itemid); $prix=$prd["pr_basicprice"]*$prd["pr_discount_rate"]/100; $prix=round($prix); $re_price=$prd["pr_basicprice"]-$prix; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; if(($sup!="")||($sup!='0')){ $supoint=$sup*3; $tprice2=$total_priceall-$supoint; $total_po=round($tprice2/100); } /* $item_price = $prd["pr_basicprice"]; $item_point = $prd["pr_pointrate"]; $supoint = $sup*3; $tp=$item_price*$qty; $tp2=$tp-$supoint; $po=100/$item_point; $total_po+=round($tp2/$po); */ $i++; } echo " "; echo "
商品番号 商 品 名 単 価 数 量 金 額
".$prd["pr_itemid"]."".cvr($prd["pr_itemname"])."".$re_price.""; echo "

"; //echo " "; echo " $qty"; //echo " "; echo "

".$re_price*$qty." 円
"; echo " "; echo " "; echo " "; echo " "; echo " "; if($upoint!=0){ $sup_price=$upoint*3; echo " "; echo " "; echo " "; echo " "; } if($check2==1){$price_pos=2500;}else{$price_pos=0;} if($check2==1){ echo " "; echo " "; echo " "; echo " "; } $tax_price=round($total_price/105*5); $tprice=($total_priceall-$sup_price)+$price_pos; echo " "; echo " "; //echo " "; echo " "; echo " "; echo "
"./*$total_po.*/" 小 計 ".$total_price." 円
ポイント割引 - ".$sup_price." 円
今回ご注文のポイント数 + ".$price_pos." 円
合 計 合 計 (内税 ".$tax_price." 円) ".$tprice." 円
"; //echo(getbonus($cust_id,$order_id)); } //================================================================================= function finish_cart2($cart,$total_priceall,$upoint,$check2,$sup,$total_price) { global $items; global $total_price; global $total_priceall; global $total_point; global $cust_id; global $order_id; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $i=0; foreach ($cart as $pr_itemid => $qty){ $prd = get_details($pr_itemid); $prix=$prd["pr_basicprice"]*$prd["pr_discount_rate"]/100; $prix=round($prix); $re_price=$prd["pr_basicprice"]-$prix; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; if(($sup!="")||($sup!='0')){ $supoint=$sup*3; $tprice2=$total_priceall-$supoint; $total_po=round($tprice2/100); } /* $item_price = $prd["pr_basicprice"]; $item_point = $prd["pr_pointrate"]; $supoint = $sup*3; $tp=$item_price*$qty; $tp2=$tp-$supoint; $po=100/$item_point; $total_po+=round($tp2/$po); */ $i++; } echo " "; echo "
商品番号 商 品 名 単 価 数 量 金 額
".$prd["pr_itemid"]."".cvr($prd["pr_itemname"])."".$re_price.""; echo "

"; //echo " "; echo " $qty"; //echo " "; echo "

".$re_price*$qty." 円
"; echo " "; echo " "; echo " "; echo " "; echo " "; if($upoint!=0){ $sup_price=$upoint*3; echo " "; echo " "; echo " "; echo " "; } if($check2==1){$price_pos=2500;}else{$price_pos=0;} if($check2==1){ echo " "; echo " "; echo " "; echo " "; } $tax_price=round($total_price/105*5); $tprice=($total_priceall-$sup_price)+$price_pos; echo " "; //echo " "; echo " "; echo " "; echo " "; echo "
"./*$total_po.*/" 小 計 ".$total_price." 円
ポイント割引 - ".$sup_price." 円
今回ご注文のポイント数 + ".$price_pos." 円
合 計 (内税 ".$tax_price." 円) 合 計 ".$tprice." 円
"; //echo(getbonus($cust_id,$order_id)); } //================================================================================= function display_nocart(){ echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; echo "
商品番号 商 品 名 単 価 数 量 金 額
- --"; echo "

"; echo " -"; echo "

- 円
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
小 計 - 円
合 計 - 円
"; } //================================================================================= function edit_cart($od_id,$cart,$total_dc) { global $items; global $total_price; global $dc; global $total; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; foreach ($cart as $pr_itemid => $qty) { $prd = get_details($pr_itemid); echo""; echo""; echo ""; echo ""; echo ""; echo ""; echo""; echo""; echo""; echo""; } $total=$total_price-$total_dc; echo""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
商品番号
商     品     名
単 価
数 量
金 額
".$prd["pr_itemid"]."".cvr($prd["pr_itemname"])."".$prd["pr_basicprice"].""; echo ""; echo ""; echo""; echo"
 "; echo"
"; echo "
"; echo ""; echo ""; echo "
".$prd["pr_basicprice"]*$qty." 
"; echo"
小   計
"; echo ""; echo ""; echo "
  ポイント割引
"; echo ""; echo ""; echo "
合   計
"; echo ""; echo ""; echo "
消費税は内税です。
"; } //================================================================================= function get_details($pr_itemid) { if (!$pr_itemid || $pr_itemid=="") return false; $query = "select * from product_fl where pr_itemid='$pr_itemid'"; $result = mysql_query($query); if (!$result) return false; $result = mysql_fetch_array($result); return $result; } //================================================================================= function get_details1($pr_itemid) { if (!$pr_itemid || $pr_itemid=="") return false; // $query = "select * from product_category_fl where pc_id='$pr_itemid'"; $result = mysql_query($query); if (!$result) return false; $result = mysql_fetch_array($result); return $result; } //================================================================================= function createid($date1) { $setnum=1; // $query1="select * from count"; if($query1){ $result1 = mysql_query($query1); $rs = mysql_fetch_array($result1); if($rs["dateid"]==$date1){ $n_num=$rs["num"];$new=$n_num+1; $query2="update count set num='$new' where dateid='$date1'"; $result2 = mysql_query($query2); return $new; }else{ $query3="update count set num='$setnum',dateid='$date1' where dateid='$rs[dateid]'"; $result3 = mysql_query($query3); return $setnum; /*$query3="insert into count (dateid,num) values ('$date1','$setnum')"; $result3 = mysql_query($query3); return $setnum;*/ } }else{ $query4="insert into count (dateid,num) values ('$date1','$setnum')"; $result4=mysql_query($query4); return $setnum; } //} } //================================================================================= /*function orderstate($cart) { foreach ($cart as $pr_itemid => $qty) { $prd = get_details($pr_itemid) echo "$prd[pr_itemid] $prd[pr_itemname] $prd[pr_basicprice] $qty; $prd[pr_basicprice]*$qty;" } }*/ //================================================================================= function mailorder($id,$oid,$check1,$check2,$newaddr,$total_price,$total,$total_dc,$cart) { global $items; global $total_price; global $dc; global $total; $sql1 = "select * from cust_fl where cust_userid='$id'"; $db_query1 = mysql_query ($sql1); $rs = mysql_fetch_array($db_query1); $sql2 = "select * from order_product_fl where odp_id='$oid'"; $db_query2 = mysql_query ($sql2); $rs2 = mysql_fetch_array($db_query2); //$sql3 = "select * from product_fl where cust_userid='$id'"; //$db_query3 = mysql_query ($sql3); //$rs3 = mysql_fetch_array($db_query3); $sql4 = "select * from order_fl where od_id='$oid'"; $db_query4 = mysql_query ($sql4); $rs4 = mysql_fetch_array($db_query4); if($check1=="1"){$ch1="変更あり";}else{$ch1="-";} if($check2=="1"){$ch2="利用する";$qt=$newaddr;}else{$ch2="-";$qt="-";} $ma="$rs[cust_email]"; $emailto=$rs[cust_email]; $emailto1="sales@t-dm.co.jp"; $subject="$rs[cust_name]さま"; $subject1="$rs[cust_name]さま"; $message=" 受付番号:$oid 高岡 英樹$rs[cust_name] ご注文ありがとうございます。 このメールはお客様に自動的に返信されております。 18時間以内に改めてご案内申し上げますのでお待ちください。 このメールに覚えがない場合は、お手数でもご連絡ください。 ------------------ お名前:高岡 英樹 様 かな :$rs[cust_name] 年齢 :$rs[cust_age] ご住所:$rs[cust_zipcode] $rs[cust_address1] $rs[cust_address2] かな :$rs[cust_address1_kana] $rs[cust_address2_kana] 電話 :$rs[cust_phone] メール:$ma 変更 :$ch1 転送 :$ch2 転送先:$qt [お届け時のお名前] 氏名 :$rs[cust_name2] かな :$rs[cust_name2_kana] -------------------------------------------------------- ユーザーID :$rs[cust_userid] パスワード :$rs[cust_passwd] -------------------------------------------------------- [ご注文明細] 品番、品名、単価、数量、金額の順で表示しています。 --------------------------------------------------\n"; foreach ($cart as $pr_itemid => $qty) { $prd = get_details($pr_itemid); $numitem=$prd[pr_basicprice]*$qty; $message.="$prd[pr_itemid] $prd[pr_itemname] $prd[pr_basicprice] $qty $numitem\n"; } $message.=" 【商品代計】:$total_price 【会員割引】:-$total 【合計金額】:$total_dc 今回のポイント数:$rs4[od_point] ※累積ポイントは下記のページの「お買い物履歴」でご確認ください。 http://localhost/work/shop/ -------------------------------------------------------- [商品代金振込先] 銀行名 :UFJ銀行(旧三和銀行) 支店名 :五反田支店 (ごたんだ) 口座番号:(普通)3728737 口座名 :(株)ティーディーエム ---------------------------------- 輸入代行のオーエムエス 株式会社ティーディーエム 160-0023 東京都新宿区西新宿6-12-1 パークウエストビル 11階 TEL 03-5325-3205 FAX 03-5325-3131 sales@t-dm.co.jp "; $header="From: sales@t-dm.co.jp\r\n"; $header1="From: $rs[cust_email]\r\n"; if(mb_send_mail($emailto,$subject,$message,$header)) { //mail($emailto1,$subject1,$message,$header1); return true; } else { return false; } } //================================================================================= function calculate_totalprice($price_temp){ //$sum=$total_dc-$price_temp; $sum=$price_temp; return $sum; } //================================================================================= function listpro($cid){ $sqla0="select pc_id from product_category_fl where pc_category like '%$cid%'"; $db_querya0 = mysql_db_query ($dbname, $sqla0); $nums_rowsa0 = mysql_num_rows($db_querya0);//echo $nums_rowsa0; $resulta0 = mysql_fetch_array($db_querya0); for ($i=0;$i<$nums_rowsa0;$i++) { $sqlz="select * from product_fl where pr_itemid='$resulta0[$i]'"; $db_queryz = mysql_db_query ($dbname, $sqlz); $resultz = mysql_fetch_array($db_queryz); echo"
  • \">
  • "; } } function filled_out($form_vars) { foreach($form_vars as $key=>$value) { if(!isset($key)||($value=="")) { return false; } return true; } } function findprovince($prov) { $sql="select DISTINCT(zp_pref) from zipcode_fl"; $data1=mysql_query($sql); while($rs1=mysql_fetch_array($data1)){ if(cvr($rs1['zp_pref'])==$prov){ echo(""); }else{ echo(""); } } } function listmenu($mcase) { if($mcase=="cust") { for($i=1;$i<=12;$i++) { echo($mcus2."|"); } } } //------------------devide page of database--------------------- function devidepage($pmethod,$anclink,$tpage,$ttotalpage) { // if(filled_out($HTTP_POST_VARS)) // if($pmethod) // { // echo "\t".$tpage."\n"; // } // else // { for($i=1;$i<$tpage;$i++) { echo("\t $i | \n"); } echo "\t".$tpage." | \n"; for($i=$tpage+1;$i<=$ttotalpage;$i++) { echo("$i | "); } // } } function add_wishlist($cart,$cust_id,$regdate) { if(is_array($cart)) { foreach($cart as $pr_itemid => $qty) { $query = "insert into wish_list_fl (wl_custid,wl_itemid,wl_regdate) values ('$cust_id','$pr_itemid','$regdate')"; $result = mysql_query($query); } } } //---------------------function1--------------- //------------------ImageSizeMedium------- function ImageSize($image,$altname) { global $imgpath; global $img; $xword = $altname; $altname = str_replace("
    ", "", $xword); if($image != ""){ // $pic="img/$image"; $pic="$img/$image"; if (file_exists("$pic")){ $size = GetImageSize("$pic"); $pic=$imgpath.$image; $h=$size[1]; $w=$size[0]; if($w>$h){$h1= round(($h/($w/110))); $w1= round(($w/($w/110))); return "\"$altname\""; }else {$w2=round(($w/($h/65))); $h2=round(($h/($h/65))); return "\"$altname\""; } }else return "NO IMAGE"; }else return "NO IMAGE"; } //------------------ImageSizeMedium------- function ImageSize_fpage($image,$altname) { global $imgpath; $img="home/shop/img"; if($image != ""){ // $pic="img/$image"; $pic="$img/$image"; if (file_exists("$pic")){ $size = GetImageSize("$pic"); $pic=$imgpath.$image; $h=$size[1]; $w=$size[0]; if($w>$h){$h1= round(($h/($w/110))); $w1= round(($w/($w/110))); return "\"$altname\""; }else {$w2=round(($w/($h/100))); $h2=round(($h/($h/100))); return "\"$altname\""; } }else return "NO IMAGE"; }else return "NO IMAGE"; } //-----------------ImageSizeBig------------- function ImageSize2($image,$altname) { global $imgpath; global $img; if($image != ""){ // $pic="img/$image"; $pic="$img/$image"; if (file_exists("$pic")){ $size = GetImageSize("$pic"); $pic=$imgpath.$image; $h=$size[1]; $w=$size[0]; if($w>$h){$h1=round(($h/($w/160))); $w1=round(($w/($w/160))); return "\"$altname\""; }else{$w2=round(($w/($h/150))); $h2=round(($h/($h/150))); return "\"$altname\""; } }else return "NO IMAGE"; }else return "NO IMAGE"; } //------------ImageSizeSmall--------- function ImageSize3($image,$altname) { global $imgpath; global $img; if($image != ""){ // $pic="img/$image"; $pic="$img/$image"; if (file_exists("$pic")){ $size = GetImageSize("$pic"); $pic=$imgpath.$image; $h=$size[1]; $w=$size[0]; if($w>$h){$h1=round(($h/($w/75))); $w1=round(($w/($w/75))); return "\"$altname\""; }else {$w2=round(($w/($h/65))); $h2=round(($h/($h/65))); return "\"$altname\""; } }else return "NO IMAGE"; }else return "NO IMAGE"; } //------------ImageSizeSmall-Small-------- function ImageSize4($image,$altname) { global $imgpath; global $img; if($image != ""){ // $pic="img/$image"; $pic="$img/$image"; if (file_exists("$pic")){ $size = GetImageSize("$pic"); $pic=$imgpath.$image; $h=$size[1]; $w=$size[0]; if($w>$h){$h1=round(($h/($w/50))); $w1=round(($w/($w/50))); return "\"$altname\""; }else {$w2=round(($w/($h/40))); $h2=round(($h/($h/40))); return "\"$altname\""; } }else return "NO IMAGE"; }else return "NO IMAGE"; } function ImageSize4_ssl($image,$altname) { if($image != ""){ $pic ="img/$image"; if (file_exists("$pic")){ // $pic ="http://localhost/work/shop_pathinfo/img/$image"; $size = GetImageSize("$pic"); $h=$size[1]; $w=$size[0]; if($w>$h){$h1=round(($h/($w/50))); $w1=round(($w/($w/50))); return "\"$altname\""; }else {$w2=round(($w/($h/40))); $h2=round(($h/($h/40))); return "\"$altname\""; } }else return "NO IMAGE"; }else return "NO IMAGE"; } //-----------end function1--------------- //----------get discount rate-------- function finddiscount($pr_id,$pr_price){ /* $sql="select pr_discount_rate from product_fl where pr_itemid='".$pr_id."'"; $data=mysql_query($sql); $rs=mysql_fetch_array($data); return ($rs[0]*$pr_price) / 100; */ return $rs[0]=0; } //----------get product name------------- function getproduct_name($pr_id){ $sql="select pr_itemname from product_fl where pr_itemid='".trim($pr_id)."'"; $data1=mysql_query($sql); // echo(mysql_num_rows($data1)); $result=mysql_fetch_array($data1); return($result[0]); mysql_free_result($result); } //----------get product_price----------- function getproduct_price($pr_id){ // $sql="select pr_basicprice-(pr_basicprice*(pr_discount_rate/100)) from product_fl where pr_itemid='".trim($pr_id)."'"; $sql="select pr_basicprice from product_fl where pr_itemid='".trim($pr_id)."'"; // echo($sql); $data1=mysql_query($sql); $result=mysql_fetch_array($data1); return($result[0]); mysql_free_result($result); } //==========Add Random============ function addrand($page,$num,$query){ $today = date("Y-m-d H:i:s"); $sql_c="SELECT DATE_ADD(rand_date, INTERVAL 24 HOUR ) FROM rand_fl WHERE rand_id ='$page'"; $query_c=mysql_query($sql_c); $rs_c=mysql_fetch_array($query_c); $check_time=$rs_c[0]; if($check_time<$today) { /* $sql3 = "select a.pc_id from product_category_fl a,product_fl b where a.pc_id=b.pr_itemid and b.pr_delete='1' and a.pc_category not like '01%' order by RAND() LIMIT 0,10"; $db_query3 = mysql_query ($sql3); $num_rows = mysql_num_rows($query); if ($num_rows>0){ for ($i=0;$i<$num_rows;$i++){ $result = mysql_fetch_array($query); $pc_id[$i]=$result[0]; } }*/ $sql_ran="select * from rand_fl WHERE rand_id ='$page'"; $query_ran=mysql_query($sql_ran); $rs_ran=mysql_fetch_array($query_ran); if($rs_ran==""){ $sql_a = "insert into rand_fl (rand_id,rand_num,rand_date) values ('$page','$num','$today')"; $query_a = mysql_query($sql_a); $num_rows = mysql_num_rows($query); for ($i=0;$i<$num_rows;$i++){ $result = mysql_fetch_array($query); $sql1 = "insert into rand_product_fl (randpro_id,randpro_itemid) values ('$page','$result[0]')"; $query1 = mysql_query($sql1); } }else{ $sql_upd="update rand_fl set rand_date='$today' where rand_id='$page'"; $query_upd=mysql_query($sql_upd); $sql_b="delete from rand_product_fl where randpro_id='$page'"; $query_b=mysql_query($sql_b); $num_rows = mysql_num_rows($query); for ($i=0;$i<$num_rows;$i++){ $result = mysql_fetch_array($query); $sql1 = "insert into rand_product_fl (randpro_id,randpro_itemid) values ('$page','$result[0]')"; $query1 = mysql_query($sql1); } } } } //========================Nat=================== $base_datapath = "/home/homepage/public_html/home/shop"; $offset=0; function offset_time() { global $offset; $offsettime = time()+$offset; $localtime = getdate($offsettime); $i = 0; while(list($k,$v) = each($localtime)){ if($i == 0){ $detik = $v; if($detik < 10){ $detik = "0".$detik; } }elseif($i == 1){ $menit = $v; if($menit < 10){ $menit = "0".$menit; } }elseif($i == 2){ $jam = $v; if($jam < 10){ $jam = "0".$jam; } }elseif($i == 3){ $tanggal = $v; if($tanggal < 10) { $tanggal = "0".$tanggal; } }elseif($i == 5){ $bulan = $v; if($bulan < 10) { $bulan = "0".$bulan; } }elseif($i == 6){ $tahun = $v; } $i++; } $offset_time = "$tahun$bulan$tanggal$jam$menit$detik"; return $offset_time; } function daily_count($counter_file_name, $visitor_file_name, $rest_from_yesterday=0){ global $base_datapath, $offset, $REMOTE_ADDR, $HTTP_USER_AGENT, $HTTP_REFERER; if(empty($counter_file_name)){ $counter_file_name = "daily_count.wmn"; } if(empty($visitor_file_name)){ $visitor_file_name = "daily_visitors.wmn"; } $counter_file_path = $base_datapath."/".$counter_file_name; $visitor_file_path = $base_datapath."/".$visitor_file_name; $backup_file_path = $base_datapath."/".$counter_file_name.".backup"; /* Something happened with my counter file, restore from yesterday backup */ if($rest_from_yesterday == "1"){ $f_b_contents = file("$backup_file_path"); while(list($lineno,$row) = each($f_b_contents)){ $fo = fopen($counter_file_path,"w+"); fwrite($fo,$row); fclose($fo); } } $get_visitors = 0; $get_total = 0; $new = 1; $newday = 0; $visitor_found = 0; $elap_time = 3600; $visitor_host = gethostbyaddr($REMOTE_ADDR); if(!$visitor_host){ $visitor_host = $REMOTE_ADDR; } $offset_time = offset_time(); $currTime = time() + $offset; $tahun = substr($offset_time,0,4); $bulan = substr($offset_time,4,2); $hari = substr($offset_time,6,2); $currDate = $tahun."-".$bulan."-".$hari; //$currDate = $hari."-".$bulan."-".$tahun; $firstDate = $currDate; if(file_exists($counter_file_path) && file_exists($visitor_file_path)){ $new = 0; $f_c_contents = file("$counter_file_path"); while(list($lineno,$row) = each($f_c_contents)){ $row_content = explode("|",$row); if($row_content[0] == $currDate){ $f_v_contents = file("$visitor_file_path"); $get_visitors = $row_content[1]; while(list($v_lineno,$v_row) = each($f_v_contents)){ $row_v_content = explode("|",$v_row); if(($row_v_content[1] == $REMOTE_ADDR) && (($row_v_content[0] + $elap_time) > $currTime)) { $visitor_found = 1; } } }else{ $newday = 1; $fo = fopen($backup_file_path,"w+"); fwrite($fo,$row); fclose($fo); } $firstDate = $row_content[3]; $get_total = $row_content[2]; } } if(!$visitor_found){ $get_visitors = $get_visitors + 1; $get_total = $get_total + 1; if($newday || $new){ $fo = fopen($visitor_file_path,"w+"); }else{ $fo = fopen($visitor_file_path,"a+"); } fwrite($fo,"$currTime|$REMOTE_ADDR|$visitor_host|$HTTP_USER_AGENT|$HTTP_REFERER\n"); fclose($fo); $fo = fopen($counter_file_path,"w"); fwrite($fo,"$currDate|$get_visitors|$get_total|$firstDate"); fclose($fo); } $return = array("$get_visitors","$get_total","$firstDate"); return $return; } $toprowcol = "#059AEB"; // Top Row of the table $bgcol = "#FFFFFF"; // What is the white color? $grey = "#E4E4E4"; // What is the grey color? function daily_stats($visitor_file_name){ global $base_datapath, $bgcol, $toprowcol, $grey; if(!$visitor_file_name || empty($visitor_file_name)){ $visitor_file_name = "daily_visitors.wmn"; } $visitor_file_path = $base_datapath."/".$visitor_file_name; if(file_exists("$visitor_file_path")){ $fcontents = file("$visitor_file_path"); $i = 0; while(list($lineno, $row) = each($fcontents)){ $row_content = explode("|",$row); $i++; /* Collect OS first */ if(preg_match("/Windows NT [\d\.\d]+|WinNT|Windows [\d]+|Win9[\d]+|Win 9[\d]+/i",$row_content[3])){ preg_match("/Windows NT [\d\.\d]+|WinNT|Windows [\d]+|Win9[\d]+|Win 9[\d]+/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ if(preg_match("/Win9[\d]+/i",$value)){ $version = preg_replace("/Win/","Windows ",$value); }elseif(preg_match("/Win 9[\d]+/i",$value)){ $version = preg_replace("/Win /","Windows ",$value); }elseif(preg_match("/Windows [\d]+/i",$value)){ $version = preg_replace("/Windows /","Windows ",$value); /* }elseif(preg_match("/WinNT|Windows 2000/i",$value)){ $version = preg_replace("/WinNT|Windows 2000/","Windows NT/2000",$value); }else{ $version = preg_replace("/NT/","NT/2000",$value); */ }else{ if(preg_match("/NT 5.0/i",$value)){ $version = "Windows 2000"; }elseif(preg_match("/NT 5.1/i",$value)){ $version = "Windows XP"; }else{ $version = "Windows NT"; } } } $OS["$version"]++; }elseif(preg_match("/Mac_PowerPC/i",$row_content[3]) || preg_match("/Macintosh/i",$row_content[3])){ $OS["Macintosh"]++; }elseif(preg_match("/Linux [\d\.]*|Linux/i",$row_content[3])){ preg_match("/Linux [\d\.]*|Linux/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = $value; } $OS["$version"]++; }elseif(preg_match("/SunOS [\d\.]*|SunOS/i",$row_content[3])){ preg_match("/SunOS [\d\.]*|SunOS/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = $value; } $OS["$version"]++; }elseif(preg_match("/FreeBSD/i",$row_content[3])){ $OS["FreeBSD"]++; }elseif(preg_match("/OS\/2/i",$row_content[3])){ $OS["OS/2"]++; }elseif(preg_match("/WebTV/i",$row_content[3])){ $OS["WebTV"]++; }else{ if(preg_match("/Lynx|X11|nix/i",$row_content[3])){ $OS["Unix"]++; }elseif(preg_match("/ZyBorg|WebCrawler|Slurp|Googlebot|MuscatFerret|ia_archiver/i",$row_content[3])){ $OS["Web Indexing Robot"]++; }else{ //if(!empty($row_content[3])){ echo $row_content[3]; } //die; $OS["Unresolved Platform"]++; } } /* Then the browsers */ if(preg_match("/Opera/i",$row_content[3])){ preg_match("/Opera\/[\d\.]*|Opera [\d\.]*/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = preg_replace("/\//"," ",$value); } $browser["$version"]++; }elseif(preg_match("/MSIE/i",$row_content[3])){ if(preg_match("/WebTV\/[\d.]+|WebTV [\d.]+/i",$row_content[3])){ preg_match("/WebTV\/[\d\.]+|WebTV [\d.]+/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = $value; $version = preg_replace("/\//"," ",$version); } $browser["$version"]++; }else{ preg_match("/MSIE [\d\.\w]*/",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = preg_replace("/MSIE/","",$value); } $browser["Internet Explorer $version"]++; } }elseif(preg_match("/ZyBorg|WebCrawler|Slurp|Googlebot|MuscatFerret|ia_archiver/i",$row_content[3])){ $browser["Web Indexing Robot"]++; }elseif(preg_match("/Konqueror\/[a-zA-Z0-9.]+/i",$row_content[3])){ preg_match("/Konqueror\/[a-zA-Z0-9.]+/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = preg_replace("/Konqueror\//","",$value); } $browser["Konqueror $version"]++; /* }elseif(preg_match("/Mozilla\/5/i",$row_content[3])){ $browser["Netscape Navigator 6"]++; */ }elseif(preg_match("/Netscape\/[\d\.\w]*/i",$row_content[3])){ preg_match("/Netscape\/[\d\.\w]*/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = preg_replace("/Netscape\//","",$value); } $browser["Netscape $version"]++; }elseif(preg_match("/Lynx\/[\d\.\w]*/i",$row_content[3])){ preg_match("/Lynx\/[\d\.\w]*/i",$row_content[3],$matches); while(list($key,$value) = each($matches)){ $version = preg_replace("/\//"," ",$value); } $browser["$version"]++; }elseif(!empty($row_content[3]) && !preg_match("/unknown/i",$row_content[3])){ $other_browser = $row_content[3]; $other_browser = preg_replace("/\//"," ",$other_browser); $browser["$other_browser"]++; }else{ $browser["Unresolved Browser"]++; } /* Next step is Domain referer */ $get_referer = chop($row_content[4]); if(empty($get_referer)){ $get_referer = "No Referer"; }else{ //preg_match("/http:\/\/[\w\-]*\.?[\w\-]*\.?[\w\-]+\.[a-z]{2,4}|http:\/\/[\w\-]*\.?[\w\-]*\.?[\w\-]+\.[a-z]{2,4}\:\d{2}|http:\/\/\d+.\d+.\d+.\d+[\:\d]*/i",$row_content[4],$matches); preg_match("/http:\/\/[\w\-\d\.]*[\:\d]*|https:\/\/[\w\-\d\.]*[\:\d]*/i",$get_referer,$matches); while(list($key,$value) = each($matches)){ $get_referer = $value; } } $referer["$get_referer"]++; /* Then collect Page referer */ $get_pagereferer = chop($row_content[4]); if(empty($get_pagereferer)){ $get_pagereferer = "No Referer"; /* }else{ if(strlen($get_pagereferer) > 80){ $get_pagereferer = substr($get_pagereferer,0,79)." { CUT - TOO LONG }"; }*/ } $pagereferer["$get_pagereferer"]++; /* Next..., Visitors host */ $get_visitorhost = chop($row_content[2]); if(empty($get_visitorhost)){ $get_visitorhost = "No host logged!"; }else{ if(preg_match("/(^[\d\.]+\.[\d]+)/i",$get_visitorhost)){ $get_visitorhost = "Unresolved IP"; }elseif(preg_match("/\.[a-zA-Z_-]*\.[a-zA-Z0-9_-]+\.[A-Za-z]{2,4}$/",$get_visitorhost)){ preg_match("/\.[a-zA-Z_-]*\.[a-zA-Z0-9_-]+\.[A-Za-z]{2,4}$/",$get_visitorhost,$matches); while(list($key,$value) = each($matches)){ $get_visitorhost = $value; } }elseif(preg_match("/\.[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]+\.[A-Za-z]{2,4}$/",$get_visitorhost)){ preg_match("/\.[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]+\.[A-Za-z]{2,4}$/",$get_visitorhost,$matches); while(list($key,$value) = each($matches)){ $get_visitorhost = preg_replace("/^\.[a-zA-Z0-9_-]+|^\.[\d]+/","",$value); } }elseif(preg_match("/[a-zA-Z0-9]*\.[a-zA-Z_-]+\.[A-Za-z]{2,4}$/",$get_visitorhost)){ preg_match("/[a-zA-Z0-9]*\.[a-zA-Z_-]+\.[A-Za-z]{2,4}$/",$get_visitorhost,$matches); while(list($key,$value) = each($matches)){ $get_visitorhost = preg_replace("/^[a-zA-Z0-9]+|^[\d]+/","",$value); } } $get_visitorhost = preg_replace("/^\./","",$get_visitorhost); } $visitorhost["$get_visitorhost"]++; /* Next..., visitors country */ $get_visitorcountry = chop($row_content[2]); if(empty($get_visitorcountry)){ $get_visitorcountry = "No host logged!"; }else{ if(preg_match("/(^[\d\.]+\.[\d]+)/i",$get_visitorcountry)){ $get_visitorcountry = "Unresolved IP"; }elseif(preg_match("/\.[A-Za-z]{2,4}$/",$get_visitorcountry)){ preg_match("/\.[A-Za-z]{2,4}$/",$get_visitorcountry,$matches); while(list($key,$value) = each($matches)){ $get_visitorcountry = strtolower($value); } } $get_visitorcountry = preg_replace("/^\./","",$get_visitorcountry); } $visitorcountry["$get_visitorcountry"]++; } /* Open Table */ $return = "$i Unique Visitors Profile Today

    "; $return .= "\n
    "; $return .= "\n"; /* Display Visitors OS */ $arr = 0; while(list($key,$value) = each($OS)){ $sort_os[$arr]['value'] = $value; $sort_os[$arr]['key'] = $key; $arr++; } usort($sort_os, sort_gnrl); $rn = 0; $return .= "\n"; while(list($key,$value) = each($sort_os)){ $persentase = $value['value'] / $i * 100; $bi = get_barimage(round($persentase)); $persentase = number_format($persentase,2)."%"; $rn++; $tc = get_bgcolor($rn); $opsy = $value['key']." (".$value['value'].")"; $return .= "\n"; } /* Display Visitors Browser */ $arr = 0; while(list($key,$value) = each($browser)){ $sort_browser[$arr]['value'] = $value; $sort_browser[$arr]['key'] = $key; $arr++; } usort($sort_browser, sort_gnrl); $rn = 0; $return .= "\n"; while(list($key,$value) = each($sort_browser)){ $persentase = $value['value'] / $i * 100; $bi = get_barimage(round($persentase)); $persentase = number_format($persentase,2)."%"; $rn++; $tc = get_bgcolor($rn); $brws = $value['key']." (".$value['value'].")"; $return .= "\n"; } /* Display Domain Referer */ $arr = 0; while(list($key,$value) = each($referer)){ $sort_referer[$arr]['value'] = $value; $sort_referer[$arr]['key'] = $key; $arr++; } usort($sort_referer, sort_gnrl); $rn = 0; $return .= "\n"; while(list($key,$value) = each($sort_referer)){ if($value['key'] != "No Referer") { $link = "" . $value['key'] . "" . " (" . $value['value'] . ")"; }else{ $link = $value['key'] . " (" . $value['value'] . ")"; } $persentase = $value['value'] / $i * 100; $bi = get_barimage(round($persentase)); $persentase = number_format($persentase,2)."%"; $rn++; $tc = get_bgcolor($rn); $return .= "\n"; } /* Display Page Referer */ $arr = 0; while(list($key,$value) = each($pagereferer)){ $sort_preferer[$arr]['value'] = $value; $sort_preferer[$arr]['key'] = $key; $arr++; } usort($sort_preferer, sort_gnrl); $rn = 0; $return .= "\n"; while(list($key,$value) = each($sort_preferer)){ //if($value['key'] == "No Referer" || preg_match("/CUT - TOO LONG/",$value['key'])) { if($value['key'] == "No Referer") { $link = $value['key'] . " (" . $value['value'] . ")"; }else{ if(strlen($value['key']) > 80){ $display_link = substr($value['key'],0,79) . " { CUT - TOO LONG }"; }else{ $display_link = $value['key']; } $link = "" . $display_link . "" . " (" . $value['value'] . ")"; } $persentase = $value['value'] / $i * 100; $bi = get_barimage(round($persentase)); $persentase = number_format($persentase,2)."%"; $rn++; $tc = get_bgcolor($rn); $return .= "\n"; } /* Display Visitors Hostname */ $rn = 0; $return .= "\n"; arsort($visitorhost); reset($visitorhost); while(list($key,$value) = each($visitorhost)){ $persentase = $value / $i * 100; $bi = get_barimage(round($persentase)); $persentase = number_format($persentase,2)."%"; $rn++; $tc = get_bgcolor($rn); $return .= "\n"; } /* Countries Code */ $negara = array( "ad" => "Andorra", "ae" => "United Arab Emirates", "af" => "Afghanistan", "ag" => "Antigua and Barbuda", "ai" => "Anguilla", "al" => "Albania", "am" => "Armenia", "an" => "Netherlands Antilles", "ao" => "Angola", "aq" => "Antarctica", "ar" => "Argentina", "as" => "American Samoa", "at" => "Austria", "au" => "Australia", "aw" => "Aruba", "az" => "Azerbaijan", "ba" => "Bosnia Herzegovina", "bb" => "Barbados", "bd" => "Bangladesh", "be" => "Belgium", "bf" => "Burkina Faso", "bg" => "Bulgaria", "bh" => "Bahrain", "bi" => "Burundi", "bj" => "Benin", "bm" => "Bermuda", "bn" => "Brunei Darussalam", "bo" => "Bolivia", "br" => "Brazil", "bs" => "Bahamas", "bt" => "Bhutan", "bv" => "Bouvet Island", "bw" => "Botswana", "by" => "Belarus", "bz" => "Belize", "ca" => "Canada", "cc" => "Cocos (Keeling) Islands", "cf" => "Central African Republic", "cg" => "Congo", "ch" => "Switzerland", "ci" => "Cote DIvoire", "ck" => "Cook Islands", "cl" => "Chile", "cm" => "Cameroon", "cn" => "China", "co" => "Colombia", "cr" => "Costa Rica", "cs" => "Czechoslovakia", "cu" => "Cuba", "cv" => "Cape Verde", "cx" => "Christmas Island", "cy" => "Cyprus", "cz" => "Czech Republic", "de" => "Germany", "dj" => "Djibouti", "dk" => "Denmark", "dm" => "Dominica", "do" => "Dominican Republic", "dz" => "Algeria", "ec" => "Ecuador", "ee" => "Estonia", "eg" => "Egypt", "eh" => "Western Sahara", "er" => "Eritrea", "es" => "Spain", "et" => "Ethiopia", "fi" => "Finland", "fj" => "Fiji", "fk" => "Falkland Islands (Malvinas)", "fm" => "Micronesia", "fo" => "Faroe Islands", "fr" => "France", "fx" => "France (Metropolitan)", "ga" => "Gabon", "gb" => "Great Britain (UK)", "gd" => "Grenada", "ge" => "Georgia", "gf" => "French Guiana", "gh" => "Ghana", "gi" => "Gibraltar", "gl" => "Greenland", "gm" => "Gambia", "gn" => "Guinea", "gp" => "Guadeloupe", "gq" => "Equatorial Guinea", "gr" => "Greece", "gs" => "S. Georgia and S. Sandwich Islands", "gt" => "Guatemala", "gu" => "Guam", "gw" => "Guinea-Bissau", "gy" => "Guyana", "hk" => "Hong Kong", "hm" => "Heard and McDonald Islands", "hn" => "Honduras", "hr" => "Croatia (Hrvatska)", "ht" => "Haiti", "hu" => "Hungary", "id" => "Indonesia", "ie" => "Ireland", "il" => "Israel", "in" => "India", "io" => "British Indian Ocean Territory", "iq" => "Iraq", "ir" => "Iran", "is" => "Iceland", "it" => "Italy", "jm" => "Jamaica", "jo" => "Jordan", "jp" => "Japan", "ke" => "Kenya", "kg" => "Kyrgyzstan", "kh" => "Cambodia", "ki" => "Kiribati", "km" => "Comoros", "kn" => "Saint Kitts and Nevis", "kp" => "North Korea", "kr" => "South Korea", "kw" => "Kuwait", "ky" => "Cayman Islands", "kz" => "Kazakhstan", "la" => "Laos", "lb" => "Lebanon", "lc" => "Saint Lucia", "li" => "Liechtenstein", "lk" => "Sri Lanka", "lr" => "Liberia", "ls" => "Lesotho", "lt" => "Lithuania", "lu" => "Luxembourg", "lv" => "Latvia", "ly" => "Libya", "ma" => "Morocco", "mc" => "Monaco", "md" => "Moldova", "mg" => "Madagascar", "mh" => "Marshall Islands", "mk" => "Macedonia", "ml" => "Mali", "mm" => "Myanmar", "mn" => "Mongolia", "mo" => "Macau", "mp" => "Northern Mariana Islands", "mq" => "Martinique", "mr" => "Mauritania", "ms" => "Montserrat", "mt" => "Malta", "mu" => "Mauritius", "mv" => "Maldives", "mw" => "Malawi", "mx" => "Mexico", "my" => "Malaysia", "mz" => "Mozambique", "na" => "Namibia", "nc" => "New Caledonia", "ne" => "Niger", "nf" => "Norfolk Island", "ng" => "Nigeria", "ni" => "Nicaragua", "nl" => "Netherlands", "no" => "Norway", "np" => "Nepal", "nr" => "Nauru", "nt" => "Neutral Zone", "nu" => "Niue", "nz" => "New Zealand (Aotearoa)", "om" => "Oman", "pa" => "Panama", "pe" => "Peru", "pf" => "French Polynesia", "pg" => "Papua New Guinea", "ph" => "Philippines", "pk" => "Pakistan", "pl" => "Poland", "pm" => "St. Pierre and Miquelon", "pn" => "Pitcairn", "pr" => "Puerto Rico", "pt" => "Portugal", "pw" => "Palau", "py" => "Paraguay", "qa" => "Qatar", "re" => "Reunion", "ro" => "Romania", "ru" => "Russian Federation", "rw" => "Rwanda", "sa" => "Saudi Arabia", "sb" => "Solomon Islands", "sc" => "Seychelles", "sd" => "Sudan", "se" => "Sweden", "sg" => "Singapore", "sh" => "St. Helena", "si" => "Slovenia", "sj" => "Svalbard and Jan Mayen Islands", "sk" => "Slovak Republic", "sl" => "Sierra Leone", "sm" => "San Marino", "sn" => "Senegal", "so" => "Somalia", "sr" => "Suriname", "st" => "Sao Tome and Principe", "su" => "USSR (Former)", "sv" => "El Salvador", "sy" => "Syria", "sz" => "Swaziland", "tc" => "Turks and Caicos Islands", "td" => "Chad", "tf" => "French Southern Territories", "tg" => "Togo", "th" => "Thailand", "tj" => "Tajikistan", "tk" => "Tokelau", "tm" => "Turkmenistan", "tn" => "Tunisia", "to" => "Tonga", "tp" => "East Timor", "tr" => "Turkey", "tt" => "Trinidad and Tobago", "tv" => "Tuvalu", "tw" => "Taiwan", "tz" => "Tanzania", "ua" => "Ukraine", "ug" => "Uganda", "uk" => "United Kingdom", "um" => "US Minor Outlying Islands", "us" => "United States", "uy" => "Uruguay", "uz" => "Uzbekistan", "va" => "Vatican City State (Holy See)", "vc" => "Saint Vincent and the Grenadines", "ve" => "Venezuela", "vg" => "Virgin Islands (British)", "vi" => "Virgin Islands (US)", "vn" => "Vietnam", "vu" => "Vanuatu", "wf" => "Wallis and Futuna Islands", "ws" => "Samoa", "ye" => "Yemen", "yt" => "Mayotte", "yu" => "Yugoslavia", "za" => "South Africa", "zm" => "Zambia", "zr" => "Zaire", "zw" => "Zimbabwe", "biz" => "Business", "com" => "Commercial", "edu" => "Educational", "gov" => "US Government", "int" => "International", "mil" => "US Military", "net" => "Network", "org" => "Non-Profit Organization", "info" => "Info", "arpa" => "Old-Style Arpanet", "nato" => "NATO Field" ); /* Prepare Visitors Country Data */ $arr = 0; while(list($key,$value) = each($visitorcountry)){ $sort_visitorcountry[$arr]['refernya'] = $value; $sort_visitorcountry[$arr]['negaranya'] = $key; $sort_visitorcountry[$arr]['nama_negaranya'] = $negara["$key"]; $arr++; } usort($sort_visitorcountry, sort_country); /* Display Visitors Country */ $rn = 0; $return .= "\n"; while(list($key,$value) = each($sort_visitorcountry)){ if($value['negaranya'] != "Unresolved IP"){ $kode_negara = $value['negaranya']; $country = $value['nama_negaranya']." - ".$value['negaranya']." (".$value['refernya'].")"; }else{ $country = $value['negaranya']." (".$value['refernya'].")"; } $persentase = $value['refernya'] / $i * 100; $bi = get_barimage(round($persentase)); $persentase = number_format($persentase,2)."%"; $rn++; $tc = get_bgcolor($rn); $flagfile = $value['negaranya'] . ".png"; if(file_exists("images/flags/$flagfile")){ $bendera = " "; }else{ $bendera = ""; } $return .= "\n"; } /* Done! Close the table and sending results */ $return .= "\n
    Operating System
    $rn$opsy$bi$persentase
    Browser
    $rn$brws$bi$persentase
    Domain Referer
    $rn$link$bi$persentase
    Page Referer
    $rn$link$bi$persentase
    Hostname
    $rn$key ($value)$bi$persentase
    Country
    $rn$bendera$country$bi$persentase
    "; $return .= "\n
    "; return $return; }else{ return "Is WMCounter already installed? Have you run it before? If not please run it now!"; } } /* * ====================== * function get_bgcolor() * Table row color * ---------------------- */ function get_bgcolor($tr){ global $bgcol, $grey; if(!empty($tr)){ if($tr % 2 == 1){ $rc = $bgcol; }else{ $rc = $grey; } }else{ $rc = "#FFFFFF"; } return $rc; } /* * ================================= * function get_barimage($prs) * calculate how length of image bar * --------------------------------- */ function get_barimage($p){ if($p == 0){ $return = ""; }else{ $return = ""; } return $return; } /* * ============================= * function sort_country($a, $b) * to sort visitors country * ----------------------------- */ function sort_country($a, $b){ if($a['refernya'] == $b['refernya']){ if($a['nama_negaranya'] == $b['nama_negaranya']){ return 0; }elseif($a['nama_negaranya'] > $b['nama_negaranya']){ return 1; }else{ return -1; } }else{ if($a['refernya'] > $b['refernya']){ return -1; }else{ return 1; } } } /* * ===================================== * function sort_gnrl($a,$b) * sort anything except visitors country * ------------------------------------- */ function sort_gnrl($a,$b){ if($a['value'] == $b['value']){ if($a['key'] == $b['key']){ return 0; }elseif($a['key'] > $b['key']){ return 1; }else{ return -1; } }else{ if($a['value'] > $b['value']){ return -1; }else{ return 1; } } } function genidrf(){ $pass_len=8; $alpha= array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","0","1","2","3","4","5","6","7","8","9"); srand((double) microtime() * 1000000); for ($loop = 0; $loop < $pass_len; $loop++) { $password=array_rand($alpha, 1); $pwd.=$alpha[$password]; } //echo $pwd; return $pwd; } function chkhttp($strurl){ if(substr($strurl,0,7)!="http://"){ $newurl="http://".$strurl; }else{ if(substr($strurl,8,7)=="http://"){ $newurl=substr_replace($strurl,'',8,7); }else{ $newurl=$strurl; } } return $newurl; } ?> <? echo cvr($row_mcontrolpage['cs_nameweb']);?>
     
     

       
       
     
     
    0){ if ($nums_rows1 <= $list_page) { $num_p=1; } elseif(($nums_rows1 % $list_page)==0 ){ $num_p=($nums_rows1 / $list_page); }else{ $num_p=($nums_rows1 / $list_page)+1; } $num_p=(int)$num_p; $sql1 .=" LIMIT $start_p,$list_page"; $result = mysql_query($sql1); while($rs= mysql_fetch_array($result)) { $pc_id=$rs[0]; $sql3="select * from product_fl where pr_itemid='$pc_id'"; $db_query3 = mysql_query($sql3); $rs3 = mysql_fetch_array($db_query3); ?>
     
     
    ¥         
    数量:
    在庫切れ  
    ", $show,"?itemid=". $rs3[pr_itemid],$flag_pathinfo); ?>  

    "; echo "$nums_rows1 件あります
    "; echo "$str_p - $end_p 件を表示
    "; for ($i=1;$i<=$num_p;$i++){ if($i!=$page){ echo(get_link("[ $i ]",$category_show,"?catid=".$catid."&page=".$i,$flag_pathinfo)); }else{ echo " $i "; } } echo "
    "; } ?>

    お探しの商品は見つかりませんでした。