"; require_once 'librarys/html.lib.php'; $form = new form; require_once 'librarys/db.lib.php'; require_once 'modules/manage/member.list.php'; include_once('zi_init.php'); // 共用自訂函數與變數設定 $form = new form; $mnews_mode = $_REQUEST["mnews_mode"]; $ms_num = $_REQUEST["ms_num"]; $mmenu = $_REQUEST["mmenu"]; // 連結選項 $mgo_url = $_REQUEST["mgo_url"]; $f_page = $_REQUEST["f_page"]; $f_que = $_REQUEST["f_que"]; $mpd01 = $_REQUEST["mpd01"]; // 留言用的 post 資料 Begin ..// $f_mm02 = addslashes($_REQUEST["f_mm02"]); // 姓名 $f_mm06 = $_REQUEST["f_mm06"]; // 郵件 $f_mm08 = addslashes($_REQUEST["f_mm08"]); // 內容 // 留言用的 post 資料 End ....// // 回覆留言用的 post 資料 Begin ..// $f_s_num = $_REQUEST["f_s_num"]; // 留言板-主檔-序-關聯 msg_detail.md01 $f_md03 = $_REQUEST["f_md03"]; // 訪客姓名 $f_md07 = $_REQUEST["f_md07"]; // 電子郵件 $f_md09 = $_REQUEST["f_md09"]; // 回覆內容 // 回覆留言用的 post 資料 End ....// // 加入會員 post 資料 Begin ..// $f_mb02 = addslashes($_REQUEST["f_mb02"]); // 中文姓名-名 $f_mb03 = $_REQUEST["f_mb03"]; // 會員帳號 $f_mb04 = $_REQUEST["f_mb04"]; // 密碼 $f_mb05 = $_REQUEST["f_mb05"]; // 聯絡電話 $f_mb06 = addslashes($_REQUEST["f_mb06"]); // 通訊地址 $f_mb07 = $_REQUEST["f_mb07"]; // 電子郵件 $f_mb08 = $_REQUEST["f_mb08"]; // 訂閱電子報 //echo $_POST["tst"]; $f_mb11 = $_REQUEST["f_mb11_1"].'-'.$_REQUEST["f_mb11_2"].'-'.$_REQUEST["f_mb11_3"]; // 生日 $f_mb12 = $_REQUEST["f_mb12"]; // 性別 $f_mb13 = $_REQUEST["f_mb13"]; // 手機 $f_omb04 = $_REQUEST["f_omb04"]; // 原密碼 // 加入會員 post 資料 End ....// // 紅利積點 post 資料 Begin ..// $f_bonus = $_REQUEST["f_bonus"]; // 紅利商品 // 紅利積點 post 資料 End ....// // 訂單查詢 post 資料 Begin ..// $f_om01 = $_REQUEST["f_om01"]; // 訂單編號 $mwhere_bonus = "d_date='0000-00-00 00:00:00'"; if(empty($mnews_mode)) { $mnews_mode = 'all'; } if(!empty($mgo_url)) { //echo $mgo_url.'
'; $mgo_url="indexmain.php"; ?> assignInclude ( "tp_rmain" , $mr_main ); $tp_index -> assignInclude ( "tp_login" , $mlogin_form ); $tp_index -> assignInclude ( "tp_que_prud" , "que_pruduct.htm" ); $tp_index -> assignInclude ( "tp_news" , $mnews_form ); $tp_index -> assignInclude ( "tp_news_nothome" , $mnews_form_nothome ); $tp_index -> assignInclude ( "tp_newsm" , $mnews_formm ); $tp_index -> assignInclude ( "tp_ad" , $mad_form ); $tp_index -> assignInclude ( "tp_pkind" , $mpkind_form ); $tp_index -> assignInclude ( "tp_icontent" , $mr_main2 ); $tp_index -> assignInclude ( "tp_classb" , $mpclass_form ); $tp_index -> assignInclude ( "tp_book" , $mpbook_form ); $tp_index -> assignInclude ( "tp_rss" , $mprss_form ); $tp_index -> assignInclude ( "tp_video" , $mpvideo_form ); $tp_index -> assignInclude ( "tp_sitem" , $mpsitem_form ); $tp_index -> prepare(); ////////////////////// 輸出內文區塊 $tp_index-> newBlock ("tp_out_content"); $tp_index-> assign("content",$icontent); // 標題 //adverta(); //callbottomadv(); u_classb(); u_istem() ; ////////////////////////////////////////////////////// $tp_index-> newBlock ( "tp_randswf" ); // 瀏覽 block $tp_index-> assign ( "tp_randswf.swf" , rand(1,4) ); // //////////////////////////////////////////////////// require_once 'tempfunc.php'; $tp_index-> printToScreen (); //--- footer begin --- // include_once("footer.inc.php"); //--- footer end --- ?> newBlock ( "tp_no_login" ); // 瀏覽 block }else{ $tp_index-> newBlock ( "tp_login" ); // 瀏覽 block $tp_index-> assign ( "uid" , $_SESSION["muser_name"] ); // s_num } } //**************** function homevideodisp() { global $link; global $tp_index; // 最新活動/消息 ---------------------------------------------------------- $EVENTS_STRING = ""; /////////////////////////////// //取得影音播放設定 $queryset = db_query("select * from videoset", $link); list($videoset) = db_fetch_row($queryset); //echo $videoset; if ($videoset==2){ $mwhere=" order by rand()"; }else { $mwhere=" order by up_date desc"; } if ($videoset==3){ $mloop="true"; $mplaycount="200"; }else { $mloop="false"; $mplaycount="0"; } ///////////////////////////////// $query = db_query("select image_name,image_link,image_comment,image_type from videonews where ('".date("Y-m-d")."' between startdate and enddate) $mwhere", $link); $iiss=0; while (list($_image_name,$_image_link,$_image_comment,$_image_type) = db_fetch_row($query)) { //if ($iiss==0){ //$iiia="videofile/0.wpi"; //} if ($iiss==0){ $iiia=$_image_link; $iiiav=$_image_comment; } $opt3 = $opt3 .""; //$opt3 = $opt3 .""; $iiss=$iiss+1; } if ($iiss==0){ }else { $videoc="
現播放: $iiiav
"; } $tp_index-> newBlock ( "tp_homevideo" ); // 瀏覽 block 回覆檔 $tp_index-> assign ( "tp_homevideolist" , $videoc ); } //************** function u_classb() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_class = "select * from info where infocate=3 and infoid<>3426 and infoid<>3428 order by importseq limit 0,4"; $result_class = mysql_query($query_class); while ($row_class = mysql_fetch_array($result_class)){ //echo $row_class["infoid"]."
"; $tp_index-> newBlock ( "tp_newclass" ); // 瀏覽 block $tp_index-> assign ( "title" , mb_substr(($row_class["title"]),0,8,"UTF-8") ); // 產品解說 $tp_index-> assign ( "infoid" , $row_class["infoid"] ); // 產品解說 } } function u_classbook() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_class = "select * from products order by rand() limit 0,1"; $result_class = mysql_query($query_class); while ($row_class = mysql_fetch_array($result_class)){ $tp_index-> newBlock ( "tp_newbook" ); // 瀏覽 block $tp_index-> assign ( "title" , mb_substr(($row_class["proname"]),0,8,"UTF-8") ); // 產品解說 $tp_index-> assign ( "imagepath" , $row_class["prophotos"] ); // 產品解說 list($width, $height, $value, $params) = GetImageSize($row_class["prophotos"]); $stdwidth=170; $stdheight=180; list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ( "width" , $width ); // 產品解說 $tp_index-> assign ( "height" , $height ); // 產品解說 $tp_index-> assign ( "link" , "indexmain.php?mmenu=12-1" ); // 產品解說 } } function u_rss() { global $tp_index; require_once("rsslib.php"); $decho=RSS_display("http://www.tftf.org.tw/board/feed.php", 5); $tp_index-> newBlock ( "tp_rss" ); // 瀏覽 block $tp_index-> assign ( "rss" , $decho ); // 產品解說 } ////////////////////////////////////START function u_p2_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=1 and infoid=2674"; $result_product = mysql_query($query_product); $row_product = mysql_fetch_array($result_product); $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $query_product = "select * from info_k_i where infocate=".$companycateid; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { //$tp_index-> newBlock ("tp_p2_list_01"); unset($filelist); $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , ($row_product["content"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd04" , ($row_product["title"]) ); // 產品解說 /////////////////////////////////////////////////////////////////////////// 取出圖片列表 $photo_dir = "data/info_i/" . $row_product["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $photolist = ""; if($filelist) { foreach($filelist as $key=>$val) { $link = $photo_dir . "/" . $val; $photolist .= "

"; } } /////////////////////////////////////////////////////////////////////////// $tp_index-> assign ( "tp_p2_list_01_001.photolist" , $photolist ); // 產品圖檔(小) } //return; } function u_p2_1b() { global $tp_index; global $form; $cateid_k=$_GET['cateid_k']; $query_photo2 = "SELECT * FROM info_i where infocate=3 and scate=1 and cshow=2 order by porder"; $result_photo2 = mysql_query($query_photo2); $photornd=0; while($row_photo2 = mysql_fetch_array($result_photo2)) { // echo "ff"; $query_photo22 = "SELECT * FROM info_k_i where infocate=".$row_photo2['infoid']; $result_photo22 = mysql_query($query_photo22); $isget=0; while($row_photo22 = mysql_fetch_array($result_photo22)){ $photo_dir = "data/info_i/" . $row_photo22["infoid"]."/" ; //echo $photo_dir; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[$photornd]['filen'] .= $photo_dir.$file; $filelist[$photornd]['title'] .= $row_photo2["ititle"]." ".$row_photo2["title"] ; $filelist[$photornd]['rown'] .= $row_photo2["infoid"]; $filelist[$photornd]['idn'] .= $photornd; $photornd++; $isget=1; } if ($isget==1){ break;} } if ($isget==1){ break;} } } if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $photornd=0; if($filelist) { foreach($filelist as $key=>$val) { if (($val['idn']>=$msnum) and ($val['idn']<=($msnum+15))){ $link = $val['filen']; list($width, $height, $value, $params) = GetImageSize($link); //////////////////////////////////////////////////// $stdwidth=120; $stdheight=150; //echo $width; list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $photoshow[$photornd] = "
大宇宙-記者群-".$nowkind."-".
".$val["title"]."
"; $photornd=$photornd+1; } } } $tp_index-> newBlock ("tp_photo_table"); $tp_index-> assign ( "tp_photo_table" , $form->tablegrid($photoshow, 4, "95%", 150, "ffffff", "center $tr_mouse", "align=center cellpadding=7'", "bottom style='border: 496eb5 1px dotted;'") ); // 訂單日期 $tp_index-> newBlock ( "tp_p4_02" ); // 瀏覽 block //$tp_index-> assign ( "spage" , $form->html_page("indexmain.php?mmenu=788&cateid=".$_GET['cateid']."&cateid_k=".$_GET['cateid_k'],count($filelist),'','',$msnum,0,'',16) ); } function u_p_home() { global $tp_index; global $link; } function u_p1_1(){ //最新消息列表 global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p1_1 = "select * from info where infocate=10 order by infoid desc"; $result_u_p1_1 = mysql_query($query_u_p1_1); $mmax_qty = mysql_num_rows($result_u_p1_1); $query_u_p1_1 = "select * from info where infocate=10 order by infoid desc limit $msnum,10"; $result_u_p1_1 = mysql_query($query_u_p1_1); while ($row_u_p1_1 = mysql_fetch_array($result_u_p1_1)) { $tp_index-> newBlock ( "tp_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , mb_substr(($row_u_p1_1["title"]),0,30,"UTF-8") ); // 內容 $tp_index-> assign ( "up_date" , substr($row_u_p1_1["up_date"],0,10) ); // 內容 $tp_index-> assign ( "link" , "indexmain.php?mmenu=1-1-1&sum=".$row_u_p1_1["infoid"] ); // 內容 $tp_index-> assign ( "id" , $row_u_p1_1["infoid"] ); // 內容 $tp_index-> assign ( "content" , ($row_u_p1_1["content"]) ); // 內容 if (!($row_u_p1_1["ititlelink"]=='')) $tp_index-> assign ( "link" , $row_u_p1_1["ititlelink"] ); // 內容 } $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=1-1&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function advert0(){ global $tp_index; global $link; $_b00_advert_string = ""; $b01 = "200x150-1"; $b01 = "right-1"; $query = db_query("select image_name,image_link,image_comment,image_type from advert where ('".date("Y-m-d")."' between startdate and enddate) and is_default='N' and kind='$b01' order by rand()", $link); while (list($_image_name,$_image_link,$_image_comment,$_image_type) = db_fetch_row($query)) { ++$_b00_advert; $_b00_AD[$_b00_advert][0] = $_image_name; $_b00_AD[$_b00_advert][1] = $_image_link; $_b00_AD[$_b00_advert][2] = $_image_comment; if ($_image_link==''){ $_b00_AD[$_b00_advert][1]=str_replace("_s/","/",$_b00_AD[$_b00_advert][0]); $_image_link= $_image_name; } } if (empty($_b00_advert)) { $query = db_query("select image_name,image_link,image_comment,image_type from advert where is_default='Y' and kind='$b01'", $link); while (list($_image_name,$_image_link,$_image_comment,$_image_type) = db_fetch_row($query)) { ++$_b00_advert; $_b00_AD[$_b00_advert][0] = $_image_name; $_b00_AD[$_b00_advert][1] = $_image_link; $_b00_AD[$_b00_advert][2] = $_image_comment; } } if (is_array($_b00_AD)) { $_rand_keys = array_rand ($_b00_AD, $_b00_advert); if (is_array($_rand_keys)) { foreach ($_rand_keys as $_rand_key => $_rand_value) { $_b00_advert_string .= "b00_AD[$_rand_key] = '".$_b00_AD[$_rand_value][0]."';\r\n"; $_b00_advert_string .= "b00_ADlink[$_rand_key] = '".$_b00_AD[$_rand_value][1]."';\r\n"; $_b00_advert_string .= "b00_ADtitle[$_rand_key] = '".$_b00_AD[$_rand_value][2]."';\r\n"; } } else { $_rand_key = 0; $_rand_value = 1; $_b00_advert_string .= "b00_AD[$_rand_key] = '".$_b00_AD[$_rand_value][0]."';\r\n"; $_b00_advert_string .= "b00_ADlink[$_rand_key] = '".$_b00_AD[$_rand_value][1]."';\r\n"; $_b00_advert_string .= "b00_ADtitle[$_rand_key] = '".$_b00_AD[$_rand_value][2]."';\r\n"; } } if($_b00_AD[1][0]) { ## 完全無廣告 $img = ""; $img = "
"; $img = "
"; $_b00_advert_ = " " .$img."
"; } $tp_index-> newBlock ("tp_advert0"); $tp_index-> assign ( "advert0" , $_b00_advert_ ); // 訂單日期 } function advert1(){ global $tp_index; global $link; ## 位置一(左側-上) $_b01_advert_string = ""; $b01 = "200x80-c"; $b01 = "right-2"; $query = db_query("select image_name,image_link,image_comment,image_type from advert where ('".date("Y-m-d")."' between startdate and enddate) and is_default='N' and kind='$b01' order by rand()", $link); while (list($_image_name,$_image_link,$_image_comment,$_image_type) = db_fetch_row($query)) { ++$_b01_advert; $_b01_AD[$_b01_advert][0] = $_image_name; $_b01_AD[$_b01_advert][1] = $_image_link; $_b01_AD[$_b01_advert][2] = $_image_comment; if ($_image_link==''){ $_b01_AD[$_b01_advert][1]=str_replace("_s/","/",$_b01_AD[$_b01_advert][0]); $_image_link= $_image_name; } } if (empty($_b01_advert)) { $query = db_query("select image_name,image_link,image_comment,image_type from advert where is_default='Y' and kind='$b01'", $link); while (list($_image_name,$_image_link,$_image_comment,$_image_type) = db_fetch_row($query)) { ++$_b01_advert; $_b01_AD[$_b01_advert][0] = $_image_name; $_b01_AD[$_b01_advert][1] = $_image_link; $_b01_AD[$_b01_advert][2] = $_image_comment; } } if (is_array($_b01_AD)) { $_rand_keys = array_rand ($_b01_AD, $_b01_advert); if (is_array($_rand_keys)) { foreach ($_rand_keys as $_rand_key => $_rand_value) { $_b01_advert_string .= "b01_AD[$_rand_key] = '".$_b01_AD[$_rand_value][0]."';\r\n"; $_b01_advert_string .= "b01_ADlink[$_rand_key] = '".$_b01_AD[$_rand_value][1]."';\r\n"; $_b01_advert_string .= "b01_ADtitle[$_rand_key] = '".$_b01_AD[$_rand_value][2]."';\r\n"; } } else { $_rand_key = 0; $_rand_value = 1; $_b01_advert_string .= "b01_AD[$_rand_key] = '".$_b01_AD[$_rand_value][0]."';\r\n"; $_b01_advert_string .= "b01_ADlink[$_rand_key] = '".$_b01_AD[$_rand_value][1]."';\r\n"; $_b01_advert_string .= "b01_ADtitle[$_rand_key] = '".$_b01_AD[$_rand_value][2]."';\r\n"; } } if($_b01_AD[1][0]) { ## 完全無廣告 $img = ""; $_b01_advert_ = "" ."" .$img."
"; } $tp_index-> newBlock ("tp_advert1"); $tp_index-> assign ( "advert1" , $_b01_advert_ ); // 訂單日期 } function u_p5_1(){ //最新消息列表 global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p1_1 = "select * from info where infocate=3 and scate=1 order by up_date"; $result_u_p1_1 = mysql_query($query_u_p1_1); $mmax_qty = mysql_num_rows($result_u_p1_1); while ($row_u_p1_1 = mysql_fetch_array($result_u_p1_1)) { $tp_index-> newBlock ( "tp_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p1_1["title"] ); // 內容 $tp_index-> assign ( "up_date" , $row_u_p1_1["imaster"] ); // 內容 $tp_index-> assign ( "link" , "indexmain.php?mmenu=5-1-1&sum=".$row_u_p1_1["infoid"] ); // 內容 } $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=5-1-1&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function u_p5_2(){ //最新消息列表 global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p1_1 = "select * from info where infocate=3 and scate=2 order by up_date"; $result_u_p1_1 = mysql_query($query_u_p1_1); $mmax_qty = mysql_num_rows($result_u_p1_1); while ($row_u_p1_1 = mysql_fetch_array($result_u_p1_1)) { $tp_index-> newBlock ( "tp_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p1_1["title"] ); // 內容 $tp_index-> assign ( "up_date" , $row_u_p1_1["imaster"] ); // 內容 $tp_index-> assign ( "link" , "indexmain.php?mmenu=5-2-1&sum=".$row_u_p1_1["infoid"] ); // 內容 } $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=5-2-1&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function u_p5_3(){ //最新消息列表 global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p1_1 = "select * from info where infocate=3 and scate=3 order by up_date"; $result_u_p1_1 = mysql_query($query_u_p1_1); $mmax_qty = mysql_num_rows($result_u_p1_1); while ($row_u_p1_1 = mysql_fetch_array($result_u_p1_1)) { $tp_index-> newBlock ( "tp_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p1_1["title"] ); // 內容 $tp_index-> assign ( "up_date" , $row_u_p1_1["imaster"] ); // 內容 $tp_index-> assign ( "link" , "indexmain.php?mmenu=5-3-1&sum=".$row_u_p1_1["infoid"] ); // 內容 } $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=5-3-1&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function u_p5_4(){ //最新消息列表 global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p1_1 = "select * from info where infocate=3 and scate=4 order by up_date"; $result_u_p1_1 = mysql_query($query_u_p1_1); $mmax_qty = mysql_num_rows($result_u_p1_1); while ($row_u_p1_1 = mysql_fetch_array($result_u_p1_1)) { $tp_index-> newBlock ( "tp_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p1_1["title"] ); // 內容 $tp_index-> assign ( "up_date" , $row_u_p1_1["imaster"] ); // 內容 $tp_index-> assign ( "link" , "indexmain.php?mmenu=5-4-1&sum=".$row_u_p1_1["infoid"] ); // 內容 } $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=5-4-1&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function u_p4_3() { global $tp_index; global $link; $query_product = "select * from info where infocate=36"; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { // // if (($mnum%2)==0){ $photolist=""; $tp_index-> newBlock ( "tp_4_3" ); // 瀏覽 block //} $tp_index-> assign ( "title" , ($row_product["title"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_num /////////////////////////////////////////////////////////////////////////// // $photolist=""; $photo_dir = "data/infofile/" . $row_product["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } unset($filelist); $photo_dir = "data/infofile/" . $row_product["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } $mnum++; return; } function u_p3_1_5_1() { global $tp_index; global $link; $query_data = " insert into member (member_userid , member_username , member_nickname , password , hint , email , sex , address , phone , mobilephone , personal , epaper ,member_grade , register_date , up_user , up_date , mkind ) values ('".$_POST['cno']."', '".$_POST['companyname']."', '".$_POST['companyname']."', '".$_POST['f_mb041']."', '$f_mb04', '".$_POST['email']."', 'G', '".$_POST['address']."', '".$_POST['phone']."', '".$_POST['phone']."', '".$_POST['man']."', 'Y','1', '".date("Y-m-d H:i:s")."', '$f_mb03', '$mm_date', '1' ) "; if (mysql_query($query_data)) { $mto = 'tftf@tftf.com.tw'; $mremail = "tftf@tftf.com.tw"; //如果網站的mail無法加入中文姓名,請將以下兩行 // 刪除 Add by Tony 2005.09.07 //$mto = $f_mb07; //$mremail = $mservermail; $msubject = $mservername."-有新廠商".$_POST['companyname']." ".$_POST['cno']."加入,請至後台審核(如審核通過請將鎖定改為否)"; $msubject = "=?UTF-8?B?" . base64_encode($msubject) . "?="; $mexdata = "Content-Type:text/html;charset=utf-8\n"; $mexdata .= "From:".$mremail."\nReply-To:".$mremail; if (!mail( $mto , $msubject , $mbody , "$mexdata")){ }else{ } ?> newBlock ( "tp_3_1_5_1" ); // 瀏覽 block $tp_index-> assign ( "cno" , $_POST['cno'] ); // s_num $tp_index-> assign ( "pwd" , $_POST['f_mb041'] ); // s_num }else{ ?> newBlock ( "tp_3_1_5_1" ); // 瀏覽 block $tp_index-> assign ( "cno" , $_POST['cno'] ); // s_num $tp_index-> assign ( "pwd" , $_POST['f_mb041'] ); // s_num }else{ ?> newBlock ( "tp_3_1_5_1" ); // 瀏覽 block $tp_index-> assign ( "cno" , $_POST['cno'] ); // s_num $tp_index-> assign ( "pwd" , $_POST['f_mb041'] ); // s_num }else{ ?> '; $mbody .= ' '.'
'; $mbody .= '您的帳號密碼如下: '.'
'; $mbody .= ' '.'
'; $mbody .= '登錄帳號:'.$member_userid .'
'; $mbody .= '重設密碼:'.$newpwd.' '.'
'; $mbody .= ' '.'
'; $mbody .= '請妥善保管您的帳號和密碼。 '.'
'; $mbody .= ' '.'
'; $mbody .= '再次感謝您加入'.$mservername.',此郵件是由'.$mservername.'發出的系統郵件,請勿直接回覆!'.'
'; //echo $mto; //exit; if(mail( $mto , $msubject , $mbody , "$mexdata")) { ?> newBlock ( "tp_p3_1_9" ); // 瀏覽 block $tp_index-> assign ( "companyname" , ($member_username) ); // s_num $tp_index-> assign ( "cno" , ($member_userid) ); // s_num $tp_index-> assign ( "phone" , ($phone) ); // s_num $tp_index-> assign ( "address" , ($address) ); // s_num $tp_index-> assign ( "email" , ($email) ); // s_num $tp_index-> assign ( "man" , ($personal) ); // s_num }else{ ?> newBlock ( "tp_p3_1_9" ); // 瀏覽 block $tp_index-> assign ( "companyname" , ($row_data["member_username"]) ); // s_num $tp_index-> assign ( "cno" , ($row_data["member_userid"]) ); // s_num $tp_index-> assign ( "phone" , ($row_data["phone"]) ); // s_num $tp_index-> assign ( "address" , ($row_data["address"]) ); // s_num $tp_index-> assign ( "email" , ($row_data["email"]) ); // s_num $tp_index-> assign ( "man" , ($row_data["personal"]) ); // s_num }else{ ?> newBlock ( "tp_p3_1_nologon" ); // 瀏覽 block }else{ // $tp_index-> newBlock ( "tp_p3_1_logon" ); // 瀏覽 block // $tp_index-> assign ( "uid" , $_SESSION["muser_name"] ); // s_num } return; } function u_p3_1_6() { global $tp_index; global $link; if (($_SESSION["muser_id"])==''){ $tp_index-> newBlock ( "tp_p3_1_nologon" ); // 瀏覽 block ?> newBlock ( "tp_3_1_6_progress" ); // 瀏覽 block $tp_index-> assign ( "s".$row_product['progress'] , "style12" ); // s_num $tp_index-> newBlock ( "tp_3_1_6_snno" ); // 瀏覽 block $tp_index-> assign ( "snno" , $_GET['snno'] ); // s_num $tp_index-> newBlock ( "tp_p3_1_6_man" ); // 瀏覽 block $tp_index-> assign ( "companyname" , $_SESSION["muser_id"] ); // s_num $tp_index-> assign ( "nowtime" , date("Y-m-d H:i:s") ); // s_num $tp_index-> assign ( "serviceman" , $row_product['serviceman'] ); // s_num $query_product = "select * from mesg where snno='".$_GET['snno']."' and type=0 order by mesgid desc"; $result_product = mysql_query($query_product); $mnum=mysql_num_rows($result_product); $tp_index-> newBlock ( "tp_3_1_6_num" ); // 瀏覽 block $tp_index-> assign ( "mnum" , $mnum ); // s_num $tp_index-> assign ( "snno" , $_GET['snno'] ); // s_num $mailicon=array("1"=>"mail02.gif","0"=>"mail01.gif"); while ($row_product = mysql_fetch_array($result_product)) { //echo $row_product['isread']; $tp_index-> newBlock ( "tp_3_1_6_msg" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_product['title'] ); // s_num $tp_index-> assign ( "cdate" , $row_product['cdate'] ); // s_num $tp_index-> assign ( "mesgid" , $row_product['mesgid'] ); // s_num $tp_index-> assign ( "mailicon" , $mailicon[$row_product['isread']] ); // s_num if ($row_product['isread']==0) $tp_index-> assign ( "readstatus" , "未讀閱" ); // s_num if ($row_product['isread']==1) $tp_index-> assign ( "readstatus" , "已讀閱" ); // s_num $query_product33 = "select * from mesg where remesgid='".$row_product['mesgid']."' and type=1 order by mesgid desc"; $result_product33 = mysql_query($query_product33); while ($row_product33 = mysql_fetch_array($result_product33)) { $tp_index-> newBlock ( "tp_3_1_6_msg" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_product33['title'] ); // s_num $tp_index-> assign ( "cdate" , $row_product33['cdate'] ); // s_num $tp_index-> assign ( "mesgid" , $row_product33['mesgid'] ); // s_num $tp_index-> assign ( "mailicon" , $mailicon[$row_product33['isread']] ); // s_num if ($row_product33['isread']==0) $tp_index-> assign ( "readstatus" , "未讀閱" ); // s_num if ($row_product33['isread']==1) $tp_index-> assign ( "readstatus" , "已讀閱" ); // s_num } } } return; } function u_p3_1_5_3() { global $tp_index; global $link; unset($_SESSION["muser_id"]); ?> "; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { // // if (($mnum%2)==0){ $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block //} $tp_index-> assign ( "tp_p2_list_01_001.title" , nl2br($row_product["title"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imaster" , ($row_product["imaster"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imonitor" , nl2br($row_product["imonitor"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.idesign" , nl2br($row_product["idesign"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itotaldate" , nl2br($row_product["itotaldate"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.irange" , nl2br($row_product["irange"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itype" , nl2br($row_product["itype"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.inote" , nl2br($row_product["inote"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.content" , ($row_product["content"]) ); // s_num /////////////////////////////////////////////////////////////////////////// // $photolist=""; $photo_dir = "data/engineer/" . $row_product["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $stdwidth=171; $stdheight=129; if($filelist) { asort($filelist); foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; $tp_index-> newBlock ("tp_p2_list_01"); $tp_index-> assign ("tp_p2_list_01.imgpath" , $link1 ); // s_num $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_product["infoid"]." order by imgnote" , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); $tp_index-> assign ("tp_p2_list_01.imgtext" , $imgnote ); // s_num $tp_index-> assign ("tp_p2_list_01.height" , $height ); // s_num $tp_index-> assign ("tp_p2_list_01.width" , $width ); // s_num } } } $mnum++; return; } function u_p5_1_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; global $f_que; global $f_page; global $mpd01; global $mtable_company_k; global $mbgpdc_path; global $link; $query_product = "select * from info where infoid=".$_GET['sid']; $query_product = "select * from info where infoid=".$_GET['sum']; // echo $query_product."
"; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { // // if (($mnum%2)==0){ $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block //} $tp_index-> assign ( "tp_p2_list_01_001.title" , nl2br($row_product["title"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imaster" , ($row_product["imaster"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imonitor" , nl2br($row_product["imonitor"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.idesign" , nl2br($row_product["idesign"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itotaldate" , nl2br($row_product["itotaldate"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.irange" , nl2br($row_product["irange"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itype" , nl2br($row_product["itype"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.inote" , nl2br($row_product["inote"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.content" , ($row_product["content"]) ); // s_num /////////////////////////////////////////////////////////////////////////// // $photolist=""; $photo_dir = "data/engineer/" . $row_product["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $stdwidth=171; $stdheight=129; if($filelist) { foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; $tp_index-> newBlock ("tp_p2_list_01"); $tp_index-> assign ("tp_p2_list_01.imgpath" , $link1 ); // s_num $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_product["infoid"] , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); $tp_index-> assign ("tp_p2_list_01.imgtext" , $imgnote ); // s_num list($width, $height, $value, $params) = GetImageSize($link1); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ("tp_p2_list_01.height" , $height ); // s_num $tp_index-> assign ("tp_p2_list_01.width" , $width ); // s_num } } } $mnum++; return; } function u_p6_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; global $f_que; global $f_page; global $mpd01; global $mtable_company_k; global $mbgpdc_path; global $link; $query_productm = "select * from info where infocate=4 order by infoid desc"; $result_productm = mysql_query($query_productm); if (mysql_num_rows($result_productm )>0){ $iix=1; while ($row_productm = mysql_fetch_array($result_productm)) { if ($iix==1) $uid=$row_productm["infoid"]; $tp_index-> newBlock ( "tp_p2_list_01_blist" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_blist.title" , nl2br($row_productm["title"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_blist.link" , "indexmain.php?mmenu=6-1&sid=".$row_productm["infoid"] ); // s_num $iix++; } }else{ exit; } if ($_GET['sid']) { $query_product = "select * from info where infoid=".$_GET['sid']; }else{ $query_product = "select * from info where infoid=".$uid; } //echo $query_product; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { // // if (($mnum%2)==0){ $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_btitle" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_btitle.title" , nl2br($row_product["title"]) ); // s_num $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block //} $tp_index-> assign ( "tp_p2_list_01_001.title" , nl2br($row_product["title"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imaster" , nl2br($row_product["imaster"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.content" , ($row_product["content"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imonitor" , nl2br($row_product["imonitor"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.idesign" , nl2br($row_product["idesign"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itotaldate" , nl2br($row_product["itotaldate"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.irange" , nl2br($row_product["irange"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itype" , nl2br($row_product["itype"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.inote" , nl2br($row_product["inote"]) ); // s_num /////////////////////////////////////////////////////////////////////////// // $photolist=""; $photo_dir = "data/engineer/" . $row_product["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $stdwidth=171; $stdheight=129; if($filelist) { foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; $tp_index-> newBlock ("tp_p2_list_01"); $tp_index-> assign ("tp_p2_list_01.imgpath" , $link1 ); // s_num $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_product["infoid"] , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); $tp_index-> assign ("tp_p2_list_01.imgtext" , $imgnote ); // s_num list($width, $height, $value, $params) = GetImageSize($link1); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ("tp_p2_list_01.height" , $height ); // s_num $tp_index-> assign ("tp_p2_list_01.width" , $width ); // s_num } } } $mnum++; return; } function u_p7_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; global $f_que; global $f_page; global $mpd01; global $mtable_company_k; global $mbgpdc_path; global $link; require_once 'examitemindex.php'; //if ($_GET['mmenu']=="7-1") $infoid=3091; //if ($_GET['mmenu']=="7-2") $infoid=3066; //if ($_GET['mmenu']=="7-3") $infoid=3424; $query_product = "select * from info where infoid=".$_GET['sid']; $query_product = "select * from info where infoid=$infoid"; // echo $query_product."
"; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { // // if (($mnum%2)==0){ $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block //} $tp_index-> assign ( "tp_p2_list_01_001.title" , nl2br($row_product["title"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imaster" , nl2br($row_product["imaster"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imonitor" , nl2br($row_product["imonitor"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.idesign" , nl2br($row_product["idesign"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itotaldate" , nl2br($row_product["itotaldate"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.irange" , $row_product["irange"] ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itype" , nl2br($row_product["itype"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.inote" , nl2br($row_product["inote"]) ); // s_num /////////////////////////////////////////////////////////////////////////// // $photolist=""; $photo_dir = "data/engineer/" . $row_product["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $stdwidth=171; $stdheight=129; if($filelist) { foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; if ($coi<6){ $tmpp="tp_p2_list_01"; }else{ $tmpp="tp_p2_list_01add"; } $coi++; $tp_index-> newBlock ("$tmpp"); $tp_index-> assign ("$tmpp.imgpath" , $link1 ); // s_num $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_product["infoid"] , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); $tp_index-> assign ("$tmpp.imgtext" , $imgnote ); // s_num list($width, $height, $value, $params) = GetImageSize($link1); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ("$tmpp.height" , $height ); // s_num $tp_index-> assign ("$tmpp.width" , $width ); // s_num } } } $mnum++; return; } function u_p4_4() { global $tp_index; global $link; $query_product = "select id,cateid,catename from engname order by cateid"; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { if ($row_product["cateid"]<>37){ $tp_index-> newBlock ( "tp_4_4_1" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product["catename"] ); // s_num $query_product1 = "select infoid,title from info where infocate=17 and scate=".$row_product["cateid"]." order by infoid"; $result_product1 = mysql_query($query_product1); while ($row_product1 = mysql_fetch_array($result_product1)) { $tp_index-> newBlock ( "tp_4_4_2" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product1["title"] ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product1["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") $filelist[] .= $file; } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } }else{ $query_product2 = "select infoid,title from info where infocate=17 and scate=".$row_product["cateid"]." order by infoid"; $result_product2 = mysql_query($query_product1); while ($row_product2 = mysql_fetch_array($result_product2)) { $tp_index-> newBlock ( "tp_4_4_3" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product2["title"] ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product2["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") $filelist[] .= $file; } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } } } } function u_p4_61() { //SAME AS 13_1 global $tp_index; global $link; if (!($_GET['kind']=='')){ $mwhere=" where cateid=26"; } $query_product = "select id,cateid,catename from engname_dl WHERE cateid=26 order by cateid"; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { if ($row_product["cateid"]<>350){ $tp_index-> newBlock ( "tp_4_4_1_b" ); // 瀏覽 blo $tp_index-> assign ( "title" , $row_product["catename"] ); // s_num $tp_index-> assign ( "id" , $row_product["cateid"] ); // s_num $tp_index-> newBlock ( "tp_4_4_1" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product["catename"] ); // s_num $tp_index-> assign ( "id" , $row_product["cateid"] ); // s_num $query_product1 = "select infoid,title from info where infocate=77 and scate=26 order by infoid"; $result_product1 = mysql_query($query_product1); while ($row_product1 = mysql_fetch_array($result_product1)) { $tp_index-> newBlock ( "tp_4_4_2" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product1["title"] ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product1["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") $filelist[] .= $file; } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } }else{ $query_product2 = "select infoid,title from info where infocate=77 and scate=26 order by infoid"; $result_product2 = mysql_query($query_product1); while ($row_product2 = mysql_fetch_array($result_product2)) { $tp_index-> newBlock ( "tp_4_4_3" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product2["title"] ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product2["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") $filelist[] .= $file; } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } } } } function u_p13_1() { global $tp_index; global $link; if (!($_GET['kind']=='')){ $mwhere=" where cateid=".$_GET['kind']; } $query_product = "select id,cateid,catename from engname_dl $mwhere where cateid<>26 order by cateid"; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { if ($row_product["cateid"]<>350){ $tp_index-> newBlock ( "tp_4_4_1_b" ); // 瀏覽 blo $tp_index-> assign ( "title" , $row_product["catename"] ); // s_num $tp_index-> assign ( "id" , $row_product["cateid"] ); // s_num $tp_index-> newBlock ( "tp_4_4_1" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product["catename"] ); // s_num $tp_index-> assign ( "id" , $row_product["cateid"] ); // s_num $query_product1 = "select infoid,title from info where infocate=77 and scate=".$row_product["cateid"]." order by infoid"; $result_product1 = mysql_query($query_product1); while ($row_product1 = mysql_fetch_array($result_product1)) { $tp_index-> newBlock ( "tp_4_4_2" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product1["title"] ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product1["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") $filelist[] .= $file; } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } }else{ $query_product2 = "select infoid,title from info where infocate=77 and scate=".$row_product["cateid"]." order by infoid"; $result_product2 = mysql_query($query_product1); while ($row_product2 = mysql_fetch_array($result_product2)) { $tp_index-> newBlock ( "tp_4_4_3" ); // 瀏覽 bloc $tp_index-> assign ( "title" , $row_product2["title"] ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product2["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") $filelist[] .= $file; } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } } } } function u_homequick() { $tim['tab_up_color'] = 'FFFF00'; $tim['tab_down_color'] = '000000'; $tim['project_border_color'] = 'B3B3F4'; $tim['project_title_highlight_color'] = 'EAEAFF'; $tim['project_subject_highlight_color'] = 'F9F9FF'; $tim['project_light_color'] = 'EAEAFF'; $tim['project_middle_color'] = 'CCCCFF'; $tim['project_down_color'] = '007300'; global $tp_index; global $link; $query_product = "select * from confirm_cate where isvender<>1"; // $confirmbig=infocate_list_confirmbig(); //$tp_index-> newBlock ( "tp_4_7_1_searchform" ); // 瀏覽 bloc //$tp_index-> assign ( "cateid" , $_REQUEST['cateid'] ); // s_num $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $photolist=""; $tp_index-> newBlock ( "tp_qekind" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "fcateno" , ($row_product["fcateno"]) ); // s_num $query_qakind = "select * from infocateb_qa where catename like '".$row_product["catename"]."'"; $result_qakind = mysql_query($query_qakind); $row_qakind = mysql_fetch_array($result_qakind); $tp_index-> assign ( "qakind" , $row_qakind["cateid"] ); // s_num $query_qakind = "select * from engname_dl where catename like '".$row_product["catename"]."'"; $result_qakind = mysql_query($query_qakind); $row_qakind = mysql_fetch_array($result_qakind); $tp_index-> assign ( "qakinddl" , $row_qakind["cateid"] ); // s_num if (($iii%2)==0){ // $tp_index-> assign ( "bgc" , "#e8e8e8" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"ffffff\"'"; }else{ // $tp_index-> assign ( "bgc" , "#ffffff" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"ffffff\"'"; } $tp_index-> assign ( "tr_mouse" , $tr_mouse ); // s_num } $mnum++; } function u_p2_7() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=196800 and infoid=2679"; $result_product = mysql_query($query_product); $row_product = mysql_fetch_array($result_product); $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $query_product = "select * from info_k_i where infocate=".$companycateid; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , $row_product["content"] ); // 產品解說 } } function u_p4_6() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=1968 and infoid=2678"; $result_product = mysql_query($query_product); $row_product = mysql_fetch_array($result_product); $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $query_product = "select * from info_k_i where infocate=".$companycateid; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , $row_product["content"] ); // 產品解說 } } function u_p4_7_1() { global $tp_index; global $link; $query_product = "select * from confirm_cate where isvender<>1"; $confirmbig=infocate_list_confirmbig(); if ($_REQUEST['cateid']==4){ $tp_index-> newBlock ( "tp_4_7_1_sks" ); } $tp_index-> newBlock ( "tp_4_7_1_searchform" ); // 瀏覽 bloc $tp_index-> assign ( "cateid" , $_REQUEST['cateid'] ); // s_num $actnamebigstr=" and (actnamebig=".$_GET['cateid'].") "; if ($_GET['cateid']==1){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=5) "; } if ($_GET['cateid']==2){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=6) "; } $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num //echo $query_product; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $photolist=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "cateid2" , ($_GET['cateid']) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "link" , "indexmain.php?mmenu=4-7-1-1&fcateno=".$row_product["fcateno"]."&cateid=".$_GET['cateid']); ///////////////// 計算認可筆數 $totalcount=0; $totalcount=0; $query_productx="select count(*) as ccount,actnameyear from confirm_info where fcateno=".$row_product["fcateno"]." $actnamebigstr and online=1 group by actnameyear"; $result_productx = mysql_query($query_productx); while ($row_productx = mysql_fetch_array($result_productx)){ $totalcount =$totalcount + $row_productx["ccount"]; $tp_index-> assign ( "count".$row_productx["actnameyear"] , "(".$row_productx["ccount"].")" ); } $tp_index-> assign ( "count1" ,$totalcount ); $tp_index-> newBlock ( "tp_4_7_1_sk" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "fcateno" , ($row_product["fcateno"]) ); // s_num } $mnum++; for ($ii=1;$ii<5;$ii++){ if (!($_GET['cateid']==$ii)) { $tp_index-> newBlock ( "tp_4_7_1_imglist" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num $tp_index-> newBlock ( "tp_4_7_1_imglist3" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num } } return; } function u_p4_7_1_m() { global $tp_index; global $link; $query_product = "select * from confirm_cate where (fcateno=26 or fcateno=27) and isvender<>1"; $confirmbig=infocate_list_confirmbig(); if ($_REQUEST['cateid']==4){ $tp_index-> newBlock ( "tp_4_7_1_sks" ); } $tp_index-> newBlock ( "tp_4_7_1_searchform" ); // 瀏覽 bloc $tp_index-> assign ( "cateid" , "4" ); // s_num $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num //echo $query_product; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $photolist=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "link" , "indexmain.php?mmenu=4-7-1-1_m&fcateno=".$row_product["fcateno"]."&cateid=4"); $tp_index-> assign ( "fcateno" , ($row_product["fcateno"]) ); // s_num $tp_index-> assign ( "fcateno1" , ($row_product["fcateno"]) ); // s_num ///////////////// 計算認可筆數 $totalcount=0; $totalcount=0; $query_productx="select count(*) as ccount,actnameyear from confirm_info where fcateno=".$row_product["fcateno"]." and venderno='".$_SESSION["muser_id"]."' and actnamebig=".$_GET['cateid']." group by actnameyear"; $result_productx = mysql_query($query_productx); while ($row_productx = mysql_fetch_array($result_productx)){ $totalcount =$totalcount + $row_productx["ccount"]; $tp_index-> assign ( "count".$row_productx["actnameyear"] , "(".$row_productx["ccount"].")" ); } $tp_index-> assign ( "count1" ,$totalcount ); $tp_index-> newBlock ( "tp_4_7_1_sk" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "fcateno" , ($row_product["fcateno"]) ); // s_num } $mnum++; for ($ii=1;$ii<7;$ii++){ if (!($_GET['cateid']==$ii)) { $tp_index-> newBlock ( "tp_4_7_1_imglist" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num $tp_index-> newBlock ( "tp_4_7_1_imglist3" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num } } return; } function u_p4_7_1_1_m() { $tim['tab_up_color'] = 'FFFF00'; $tim['tab_down_color'] = '000000'; $tim['project_border_color'] = 'B3B3F4'; $tim['project_title_highlight_color'] = 'EAEAFF'; $tim['project_subject_highlight_color'] = 'F9F9FF'; $tim['project_light_color'] = 'EAEAFF'; $tim['project_middle_color'] = 'CCCCFF'; $tim['project_down_color'] = '007300'; global $tp_index; global $link; global $form; $cateinfo=infocate_list_confirm(); $confirmbig=infocate_list_confirmbig(); $tp_index-> newBlock ( "tp_4_7_1_1_corder" ); // 瀏覽 block $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> newBlock ( "tp_4_7_1_1_corder2" ); // 瀏覽 block $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num if (!($_REQUEST['corder'])=='') { $corder=" order by ".$_REQUEST['corder']." $desc"; $corders="&corder=".$_REQUEST['corder']; }else{ $corder=" order by styleno1 $desc"; $corders="&corder=styleno1"; } $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num $tp_index-> assign ( "bigkind" , $cateinfo[$_REQUEST['fcateno']] ); // s_num $limit = ($_POST["limit"]) ? $_POST["limit"] : $_GET["limit"]; $offset = ($_POST["offset"])? $_POST["offset"] : $_GET["offset"]; $limit = ($limit) ? $limit : 40; $offset = (!$offset) ? 0 : $offset; If($_SERVER["REQUEST_METHOD"]=='POST') $offset=0; If (!$_GET['action']) $add_query_string="limit $offset,$limit"; if (!($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)){ $query_product2 ="select * from confirm_cate where fcateno='".$_REQUEST['fcateno']."'"; $result_product2 = mysql_query($query_product2); $mmax_qty4 = mysql_num_rows($result_product2); while ($row_product2 = mysql_fetch_array($result_product2)) { for ($xx=1;$xx<15;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product2["f".$xx]) ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+70; } } for ($xx=30;$xx<36;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product2["f".$xx]) ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+70; } } } }elseif($_REQUEST['fcateno']==27){ //////////////////////////// $linetitlearray[15]='心數(C)'; $linetitlearray[16]='導體標稱截面積(mm²)'; $linetitlearray[17]='導體構成(股數/mm)'; $linetitlearray[18]='導體外徑(mm)(約)'; $linetitlearray[19]='耐燃層厚度(mm)(約)'; $linetitlearray[20]='絕緣厚度(mm)'; $linetitlearray[21]='被覆厚度(mm)'; $linetitlearray[22]='完成外徑(mm)(約)'; $linetitlearray[23]='20℃導體電阻(Ω/㎞)'; $linetitlearray[24]='試驗電壓(kV/1min)'; $linetitlearray[25]='20℃絕緣電阻(MΩ-㎞)'; $linetitlearray[26]='備考'; for ($xx=15;$xx<27;$xx++){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , $linetitlearray[$xx] ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+100; } }else{ $linetitlearray[15]='標稱導體截面積(mm²)導體直徑(mm)'; $linetitlearray[16]='芯線數/對數(C/P)'; $linetitlearray[17]='絕緣體厚度(mm)'; $linetitlearray[18]='被覆體厚度(mm)'; $linetitlearray[19]='導體電阻(Ω/km)'; $linetitlearray[20]='耐電壓(V)'; $linetitlearray[21]='成品外徑(mm)'; for ($xx=15;$xx<22;$xx++){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , $linetitlearray[$xx] ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+150; } //////////////////////////////// } $tp_index-> newBlock ( "tp_4_7_1_1_width" ); // 瀏覽 block $tp_index-> assign ( "width" , ($addw+800) ); // s_num $actnamebigstr=" and (actnamebig=".$_GET['cateid'].") "; if ($_GET['cateid']==1){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=5) "; } if ($_GET['cateid']==2){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=6) "; } if ($_GET['y']){ $query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and actnameyear=".$_GET['y']." and venderno='".$_SESSION["muser_id"]."' $actnamebigstr " ; // echo $query_product; }else{ $query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and venderno='".$_SESSION["muser_id"]."' $actnamebigstr "; } //echo $query_product; ///////////////////// 快速查詢區塊 if ($_GET['action']){ if (!($_POST['f2']=='')){ $filter.=" and (".$_POST['f2']." like '%".$_POST['keyword']."%') ";} if (($_POST['f2']=='')){ $filter.=" and ((member_username like '%".$_POST['keyword']."%') or (styleno2 like '%".$_POST['keyword']."%') or (outno like '%".$_POST['keyword']."%') or (styleno1 like '%".$_POST['keyword']."%')) "; } if ($_POST['f2']=="markno"){ $markno=$_POST['keyword']; if (strpos($markno,"-")){ $markarray=explode("-",$markno); $fromno=substr($markarray[1],-5); $fromfrom=substr($markno,0,7); //多抓一碼以保險 $filter=" and markno like '%".$fromfrom."%' and ((markfrom<=$fromno and markend>=$fromno) or (mark2from<=$fromno and mark2end>=$fromno)) "; } } if (!($_POST['year']=='')){ $filter.=" and (actnameyear=".$_POST['year'].") ";} $query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_REQUEST['fcateno']." and venderno='".$_SESSION["muser_id"]."' $actnamebigstr $filter"." "; //$aky=base64_encode($_GET['keyword']); $akys="&keyword=".base64_encode($_POST['keyword']); } // echo $query_product; $iii=1; $result_product = mysql_query($query_product); $mmax_qty41 = mysql_num_rows($result_product); // echo $query_product." ".$corder." ".$add_query_string; $result_product = mysql_query($query_product." ".$corder." ".$add_query_string); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $snno=($row_product["snno"]); $tp_index-> newBlock ( "tp_4_7_1_1" ); // 瀏覽 block if (($iii%2)==0){ $tp_index-> assign ( "bgc" , "#e8e8e8" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"e8e8e8\"'"; }else{ $tp_index-> assign ( "bgc" , "#ffffff" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"ffffff\"'"; } $tp_index-> assign ( "snno" , $snno ); // s_num $tp_index-> assign ( "tr_mouse" , $tr_mouse ); // s_num $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num $tp_index-> assign ( "isonline" , (($row_product["online"]==1) ? "已上線" : "未上線") ); // s_num $tp_index-> assign ( "no" , $iii ); // s_num if ($row_product["stype"]==1) $stypetext="非庫存品"; if ($row_product["stype"]==2) $stypetext="新庫存品"; if ($row_product["stype"]==3) $stypetext="原庫存交貨"; $tp_index-> assign ( "stype" , $stypetext ); // s_num $tp_index-> assign ( "styleno1" , $row_product["styleno1"] ); // s_num $tp_index-> assign ( "styleno2" , $row_product["styleno2"] ); // s_num $tp_index-> assign ( "vender" , $row_product["member_username"] ); // s_num $tp_index-> assign ( "venderno" , $row_product["member_userid"] ); // s_num $tp_index-> assign ( "listno" , $row_product["confirm_id"] ); // s_num $tp_index-> assign ( "fcateno" , $row_product["fcateno"] ); // s_num $tp_index-> assign ( "outno" , $row_product["outno"] ); // s_num $tp_index-> assign ( "pamount1" , $row_product["pamount1"] ); // s_num $tp_index-> assign ( "pamount2" , $row_product["pamount2"] ); // s_num ////////////////////////////////////////////////////////////////////// 判斷是否要出現系列 START if (($_REQUEST['cateid']==1) OR ($_REQUEST['cateid']==2)){ $showserial=0; // $innsal="SELECT * FROM ((confirm_info INNER JOIN confirm_cate ON confirm_info.fcateno = confirm_cate.fcateno) INNER JOIN confirm_serial ON confirm_serial.snno = confirm_info.snno ) where confirm_cate.fcateno='".$_REQUEST['fcateno']."'"; $innsal="SELECT * FROM ((confirm_info INNER JOIN confirm_cate ON confirm_info.fcateno = confirm_cate.fcateno) INNER JOIN confirm_serial ON confirm_serial.snno = confirm_info.snno ) where confirm_serial.snno='".$snno."'" ; $result_innsal = mysql_query($innsal); //echo $innsal; while ($row_innsal = mysql_fetch_array($result_innsal)) { for ($xx=15;$xx<30;$xx++){ if ($row_innsal["f".$xx."u"]==1) $showserial=1; } } } ///////////////////////////////////////////////////////////////////// 判斷是否要出現系列END if ($showserial==1) $tp_index-> assign ( "showserial" , "[系列資訊]"); // s_num $tp_index-> assign ( "startdate" , $row_product["startdate"] ); // s_num $tp_index-> assign ( "enddate" , $row_product["enddate"] ); // s_num $tp_index-> assign ( "notes" , $row_product["notes"] ); // s_num $tp_index-> assign ( "changenotes" , $row_product["changenotes"] ); // s_num $markno=explode('@',$row_product["markno"]); $marknob="".$markno[0]."
"; if (!$markno[1]=='') $marknob.="".$markno[1]."

"; if (!$markno[2]=='') $marknob.="".$markno[2].""; $tp_index-> assign ( "markno" , $marknob ); // s_num $tp_index-> assign ( "authno" , $row_product["authno"] ); // s_num $tp_index-> assign ( "pdate1" , $row_product["pdate1"] ); // s_num $tp_index-> assign ( "pdate2" , $row_product["pdate2"] ); // s_num $tp_index-> assign ( "applydate" , $row_product["applydate"] ); // s_num $iii++; //echo "vvvvvvvvvvvvvvvvvvvvvvvvvv"; ///////////////////// 非電攬內容開始 if (!($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)){ $query_product2 ="select * from confirm_cate where fcateno='".$_REQUEST['fcateno']."'"; $result_product2 = mysql_query($query_product2); $mmax_qty = mysql_num_rows($result_product2); while ($row_product2 = mysql_fetch_array($result_product2)) { for ($xx=1;$xx<15;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } } for ($xx=30;$xx<36;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } } } ///////////////////// 非電攬結束 ///////////////////// 電攬內容開始 }elseif($_REQUEST['fcateno']==27){ // $query_product2 ="select n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26 from confirm_lineserial where snno='".$row_product["snno"]."'"; //$result_product2 = mysql_query($query_product2); //list($n15,$n16,$n17,$n18,$n19,$n20,$n21,$n22,$n23,$n24,$n25,$n26) = mysql_fetch_array($result_product2); for ($xx=15;$xx<27;$xx++){ //eval("\$nv=\$n".$xx.";"); eval("\$nv=\$f".$xx."n;"); $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } }else{ for ($xx=15;$xx<22;$xx++){ //eval("\$nv=\$n".$xx.";"); eval("\$nv=\$f".$xx."n;"); $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } } /////////////////////電攬結束 } $mnum++; $tp_index-> newBlock ( "tp_4_7_1_1_top" ); // 瀏覽 block $tp_index-> assign ( "count" , $mmax_qty41 ); // s_num $tp_index-> newBlock ( "tp_4_7_1_search" ); // 瀏覽 block $tp_index-> assign ( "bigkind" , $cateinfo[$_REQUEST['fcateno']] ); // s_num if ($_REQUEST['f2']) { $f2array=array("styleno1"=>"受理編號","member_username"=>"廠商","styleno2"=>"型號","authno"=>"認可證書","markno"=>"標示號碼"); $tp_index-> assign ( "catetitle" , " + ".$f2array[$_REQUEST['f2']] ); // s_num } $year1='列出全部年度!!'; if ($_REQUEST['y']) $year=$_REQUEST['y']; $tp_index-> assign ( "year" , (($_REQUEST['y']=='') ? $year : $year1) ); // s_num $keyword='列出全部資料!!'; if ($_REQUEST['keyword']) $keyword=$_REQUEST['keyword']; $tp_index-> assign ( "keyword" , $keyword ); // s_num if (!$_GET['action']){ $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,0,"&mmenu=4-7-1-1_m&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); $tp_index-> newBlock ( "tp_1_1_page_top" ); // 瀏覽 block $tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,0,"&mmenu=4-7-1-1_m&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); } for ($ii=1;$ii<7;$ii++){ if (!($_GET['cateid']==$ii)) { $tp_index-> newBlock ( "tp_4_7_1_imglist" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num } } return; } function u_p4_7_1_1_ex() { $tim['tab_up_color'] = 'FFFF00'; $tim['tab_down_color'] = '000000'; $tim['project_border_color'] = 'B3B3F4'; $tim['project_title_highlight_color'] = 'EAEAFF'; $tim['project_subject_highlight_color'] = 'F9F9FF'; $tim['project_light_color'] = 'EAEAFF'; $tim['project_middle_color'] = 'CCCCFF'; $tim['project_down_color'] = '007300'; global $tp_index; global $link; global $form; $cateinfo=infocate_list_confirm(); $confirmbig=infocate_list_confirmbig(); $tp_index-> newBlock ( "tp_4_7_1_1_corder" ); // 瀏覽 block $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> newBlock ( "tp_4_7_1_1_corder2" ); // 瀏覽 block $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num if (!($_REQUEST['corder'])=='') { $corder=" order by ".$_REQUEST['corder']." $desc"; $corders="&corder=".$_REQUEST['corder']; }else{ $corder=" order by styleno1 $desc"; $corders="&corder=styleno1"; } $actnamebigstr=" and (actnamebig=".$_GET['cateid'].") "; if ($_GET['cateid']==1){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=5) "; } if ($_GET['cateid']==2){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=6) "; } $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num $tp_index-> assign ( "bigkind" , $cateinfo[$_REQUEST['fcateno']] ); // s_num $limit = ($_POST["limit"]) ? $_POST["limit"] : $_GET["limit"]; $offset = ($_POST["offset"])? $_POST["offset"] : $_GET["offset"]; $limit = ($limit) ? $limit : 40; $offset = (!$offset) ? 0 : $offset; If($_SERVER["REQUEST_METHOD"]=='POST') $offset=0; If (!$_GET['action']) $add_query_string="limit $offset,$limit"; $tp_index-> newBlock ( "tp_4_7_1_1_width" ); // 瀏覽 block $tp_index-> assign ( "width" , ($addw+1800) ); // s_num if ($_GET['y']){ //$query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and actnameyear=".$_GET['y']." $actnamebigstr and online=1" ; /// $query_product ="select count(*) as pcount,authno,member_username,member_userid,startdate,outno from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and actnameyear=".$_GET['y']." $actnamebigstr and online=1 group by authno,member_username,startdate,outno" ; //echo $query_product ; //$query_product_excount ="select distinct authno,member_username,startdate,outno from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and actnameyear=".$_GET['y']." $actnamebigstr and online=1" ; $query_product ="select count(*) as pcount,member_username,member_userid,outno from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and actnameyear=".$_GET['y']." $actnamebigstr and online=1 group by outno,member_username" ; }else{ $query_product ="select count(*)as pcount,member_username,member_userid,outno from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." $actnamebigstr and online=1 group by outno,member_username"; $query_product_excount ="select distinct member_username,outno from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." $actnamebigstr and online=1"; } ///////////////////// 快速查詢區塊 if ($_GET['action']){ if (!($_POST['f2']=='')){ $filter.=" and (".$_POST['f2']." like '%".$_POST['keyword']."%') ";} if (($_POST['f2']=='')){ $filter.=" and ((member_username like '%".$_POST['keyword']."%') or (authno like '%".$_POST['keyword']."%') or (styleno2 like '%".$_POST['keyword']."%') or (outno like '%".$_POST['keyword']."%') or (styleno1 like '%".$_POST['keyword']."%')) "; } if ($_POST['f2']=="markno"){ $markno=$_POST['keyword']; if (strpos($markno,"-")){ $markarray=explode("-",$markno); $fromno=substr($markarray[1],-5); $fromfrom=substr($markno,0,7); $filter=" and markno like '%".$fromfrom."%' and ((markfrom<=$fromno and markend>=$fromno) or (mark2from<=$fromno and mark2end>=$fromno)) "; } } if (!($_POST['year']=='')){ $filter.=" and (actnameyear=".$_POST['year'].") ";} $query_product ="select distinct member_username,member_userid,outno from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_REQUEST['fcateno']." $actnamebigstr $filter"." and online=1"; $akys="&keyword=".base64_encode($_POST['keyword']); } // echo $query_product; $iii=1; $result_product = mysql_query($query_product); $mmax_qty41 = mysql_num_rows($result_product); // echo $query_product." ".$corder." ".$add_query_string; $result_product = mysql_query($query_product." ".$corder." ".$add_query_string); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $snno=($row_product["snno"]); $tp_index-> newBlock ( "tp_4_7_1_1" ); // 瀏覽 block if (($iii%2)==0){ $tp_index-> assign ( "bgc" , "#e8e8e8" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"e8e8e8\"'"; }else{ $tp_index-> assign ( "bgc" , "#ffffff" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"ffffff\"'"; } $tp_index-> assign ( "snno" , $snno ); // s_num $tp_index-> assign ( "tr_mouse" , $tr_mouse ); // s_num $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num $tp_index-> assign ( "no" , $iii ); // s_num $tp_index-> assign ( "actnamebigv" , $confirmbig[$row_product["actnamebig"]] ); // s_num $tp_index-> assign ( "styleno1" , $row_product["styleno1"] ); // s_num $tp_index-> assign ( "styleno2" , $row_product["styleno2"] ); // s_num $tp_index-> assign ( "vender" , $row_product["member_username"] ); // s_num $tp_index-> assign ( "venderno" , $row_product["member_userid"] ); // s_num $tp_index-> assign ( "listno" , $row_product["confirm_id"] ); // s_num $tp_index-> assign ( "fcateno" , $row_product["fcateno"] ); // s_num $tp_index-> assign ( "outno" , $row_product["outno"] ); // s_num $tp_index-> assign ( "excount" , $row_product["pcount"] ); // s_num $psnno=$row_product["psnno"]; //echo $psnno; ////////////////////////////////////////////////////////////////////// 判斷是否要出現系列 START ///////////////////////////////////////////////////////////////////// 判斷是否要出現系列END if ($showserial==1) $tp_index-> assign ( "showserial" , "[系列資訊]"); // s_num $tp_index-> assign ( "startdate" , $row_product["startdate"] ); // s_num $tp_index-> assign ( "enddate" , $row_product["enddate"] ); // s_num $tp_index-> assign ( "notes" , $row_product["notes"] ); // s_num $tp_index-> assign ( "changenotes" , $row_product["changenotes"] ); // s_num $markno=explode('@',$row_product["markno"]); $marknob="".$markno[0]."
"; //if (!$markno[1]=='') $marknob.="".$markno[1]."
"; //if (!$markno[2]=='') $marknob.="".$markno[2].""; if (!$markno[1]=='') $marknob.="".$markno[1]."
"; if (!$markno[2]=='') $marknob.="".$markno[2]."
"; if (!$markno[3]=='') $marknob.="".$markno[3]."
"; if (!$markno[4]=='') $marknob.="".$markno[4]."
"; if (!$markno[5]=='') $marknob.="".$markno[5]."
"; if (!$markno[6]=='') $marknob.="".$markno[6]."
"; $tp_index-> assign ( "markno" , $marknob ); // s_num $tp_index-> assign ( "authno" , $row_product["authno"] ); // s_num $tp_index-> assign ( "pdate1" , $row_product["pdate1"] ); // s_num $tp_index-> assign ( "pdate2" , $row_product["pdate2"] ); // s_num $tp_index-> assign ( "applydate" , $row_product["applydate"] ); // s_num $iii++; } $mnum++; $tp_index-> newBlock ( "tp_4_7_1_1_top" ); // 瀏覽 block $tp_index-> assign ( "count" , $mmax_qty41 ); // s_num $tp_index-> newBlock ( "tp_4_7_1_search" ); // 瀏覽 block $tp_index-> assign ( "bigkind" , $cateinfo[$_REQUEST['fcateno']] ); // s_num if ($_REQUEST['f2']) { $f2array=array("styleno1"=>"受理編號","member_username"=>"廠商","styleno2"=>"型號","authno"=>"認可證書","markno"=>"標示號碼"); $tp_index-> assign ( "catetitle" , " + ".$f2array[$_REQUEST['f2']] ); // s_num } $year1='列出全部年度!!'; if (($_REQUEST['y']=='') and ($_REQUEST['year']=='')) { $year=$year1;} if (($_REQUEST['y']=='') and (!$_REQUEST['year']=='')) { $year=$_REQUEST['year'];} if ((!$_REQUEST['y']=='') and ($_REQUEST['year']=='')) { $year=$_REQUEST['y'];} $tp_index-> assign ( "year" , $year ); // s_num $keyword='列出全部資料!!'; if ($_REQUEST['keyword']) $keyword=$_REQUEST['keyword']; $tp_index-> assign ( "keyword" , $keyword ); // s_num if (!$_GET['action']){ $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,$_GET["nextpage"],"&mmenu=4-7-1-1&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); $tp_index-> newBlock ( "tp_1_1_page_top" ); // 瀏覽 block $tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,$_GET["nextpage"],"&mmenu=4-7-1-1&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); } for ($ii=1;$ii<5;$ii++){ if (!($_GET['cateid']==$ii)) { $tp_index-> newBlock ( "tp_4_7_1_imglist" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num } } return; } function u_p4_7_1_1() { $tim['tab_up_color'] = 'FFFF00'; $tim['tab_down_color'] = '000000'; $tim['project_border_color'] = 'B3B3F4'; $tim['project_title_highlight_color'] = 'EAEAFF'; $tim['project_subject_highlight_color'] = 'F9F9FF'; $tim['project_light_color'] = 'EAEAFF'; $tim['project_middle_color'] = 'CCCCFF'; $tim['project_down_color'] = '007300'; global $tp_index; global $link; global $form; $cateinfo=infocate_list_confirm(); $confirmbig=infocate_list_confirmbig(); $tp_index-> newBlock ( "tp_4_7_1_1_corder" ); // 瀏覽 block $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> newBlock ( "tp_4_7_1_1_corder2" ); // 瀏覽 block $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num if (!($_REQUEST['corder'])=='') { $corder=" order by ".$_REQUEST['corder']." $desc"; $corders="&corder=".$_REQUEST['corder']; }else{ $corder=" order by styleno1 $desc"; $corders="&corder=styleno1"; } $actnamebigstr=" and (actnamebig=".$_GET['cateid'].") "; if ($_GET['cateid']==1){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=5) "; } if ($_GET['cateid']==2){ $actnamebigstr=" and (actnamebig=".$_GET['cateid']." or actnamebig=6) "; } $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num $tp_index-> assign ( "bigkind" , $cateinfo[$_REQUEST['fcateno']] ); // s_num $limit = ($_POST["limit"]) ? $_POST["limit"] : $_GET["limit"]; $offset = ($_POST["offset"])? $_POST["offset"] : $_GET["offset"]; $limit = ($limit) ? $limit : 40; $offset = (!$offset) ? 0 : $offset; If($_SERVER["REQUEST_METHOD"]=='POST') $offset=0; If (!$_GET['action']) $add_query_string="limit $offset,$limit"; // select * from confirm_info inner join confirm_cate on (confirm_cate.fcateno=confirm_info.fcateno) where confirm_id=11639 // if ((!($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)) and (!($_REQUEST['cateid']==4))){ if ((!($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)) or ((($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)) and ($_GET['cateid']==1 or $_GET['cateid']==5))) { $query_product2 ="select * from confirm_cate where fcateno='".$_REQUEST['fcateno']."'"; $result_product2 = mysql_query($query_product2); $mmax_qty4 = mysql_num_rows($result_product2); while ($row_product2 = mysql_fetch_array($result_product2)) { for ($xx=1;$xx<15;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product2["f".$xx]) ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+40; } } for ($xx=30;$xx<36;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product2["f".$xx]) ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+40; } } } }elseif($_REQUEST['fcateno']==27){ //////////////////////////// $linetitlearray[15]='心數(C)'; $linetitlearray[16]='導體標稱截面積(mm²)'; $linetitlearray[17]='導體構成(股數/mm)'; $linetitlearray[18]='導體外徑(mm)(約)'; $linetitlearray[19]='耐燃層厚度(mm)(約)'; $linetitlearray[20]='絕緣厚度(mm)'; $linetitlearray[21]='被覆厚度(mm)'; $linetitlearray[22]='完成外徑(mm)(約)'; $linetitlearray[23]='20℃導體電阻(Ω/㎞)'; $linetitlearray[24]='試驗電壓(kV/1min)'; $linetitlearray[25]='20℃絕緣電阻(MΩ-㎞)'; $linetitlearray[26]='備考'; for ($xx=15;$xx<27;$xx++){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , $linetitlearray[$xx] ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+70; } }else{ $linetitlearray[15]='標稱導體截面積(mm²)導體直徑(mm)'; $linetitlearray[16]='芯線數/對數(C/P)'; $linetitlearray[17]='絕緣體厚度(mm)'; $linetitlearray[18]='被覆體厚度(mm)'; $linetitlearray[19]='導體電阻(Ω/km)'; $linetitlearray[20]='耐電壓(V)'; $linetitlearray[21]='成品外徑(mm)'; for ($xx=15;$xx<22;$xx++){ $tp_index-> newBlock ( "tp_4_7_1_1_ctb" ); // 瀏覽 block $tp_index-> assign ( "title" , $linetitlearray[$xx] ); // s_num $tp_index-> assign ( "corder" , "indexmain.php?".$_SERVER['QUERY_STRING'] ); // s_num $tp_index-> assign ( "fno" , "f".$xx."n" ); // s_num $addw=$addw+60; } //////////////////////////////// } $tp_index-> newBlock ( "tp_4_7_1_1_width" ); // 瀏覽 block $tp_index-> assign ( "width" , ($addw+1800) ); // s_num if ($_GET['y']){ $query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." and actnameyear=".$_GET['y']." $actnamebigstr and online=1" ; }else{ $query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_GET['fcateno']." $actnamebigstr and online=1"; } //echo $query_product; ///////////////////// 快速查詢區塊 if ($_GET['action']){ if (!($_POST['f2']=='')){ $filter.=" and (".$_POST['f2']." like '%".$_POST['keyword']."%') ";} if (($_POST['f2']=='')){ $filter.=" and ((member_username like '%".$_POST['keyword']."%') or (authno like '%".$_POST['keyword']."%') or (styleno2 like '%".$_POST['keyword']."%') or (outno like '%".$_POST['keyword']."%') or (styleno1 like '%".$_POST['keyword']."%')) "; } if ($_POST['f2']=="markno"){ $markno=$_POST['keyword']; if (strpos($markno,"-")){ $markarray=explode("-",$markno); $fromno=substr($markarray[1],-5); $fromfrom=substr($markno,0,7); $filter=" and markno like '%".$fromfrom."%' and ((markfrom<=$fromno and markend>=$fromno) or (mark2from<=$fromno and mark2end>=$fromno)) "; } } if (!($_POST['year']=='')){ $filter.=" and (actnameyear=".$_POST['year'].") ";} $query_product ="select * from confirm_info INNER JOIN member ON confirm_info.venderno = member.member_userid where fcateno=".$_REQUEST['fcateno']." $actnamebigstr $filter"." and online=1"; //$aky=base64_encode($_GET['keyword']); $akys="&keyword=".base64_encode($_POST['keyword']); } // echo $query_product; $iii=1; $result_product = mysql_query($query_product); $mmax_qty41 = mysql_num_rows($result_product); // echo $query_product." ".$corder." ".$add_query_string; $result_product = mysql_query($query_product." ".$corder." ".$add_query_string); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $snno=($row_product["snno"]); $tp_index-> newBlock ( "tp_4_7_1_1" ); // 瀏覽 block $linecatestype=''; if ($row_product["stype"]=='1') $linecatestype='非庫存品'; if ($row_product["stype"]=='2') $linecatestype='新庫存品'; if ($row_product["stype"]=='3') $linecatestype='庫存品交貨'; $tp_index-> assign ( "stype" , $linecatestype ); // s_num if (($iii%2)==0){ $tp_index-> assign ( "bgc" , "#e8e8e8" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"e8e8e8\"'"; }else{ $tp_index-> assign ( "bgc" , "#ffffff" ); // s_num $tr_mouse = "onMouseOver='this.style.backgroundColor=\"".$tim['project_light_color']."\"' onMouseOut='this.style.backgroundColor=\"ffffff\"'"; } $tp_index-> assign ( "snno" , $snno ); // s_num $tp_index-> assign ( "tr_mouse" , $tr_mouse ); // s_num $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num $tp_index-> assign ( "no" , $iii ); // s_num $tp_index-> assign ( "actnamebigv" , $confirmbig[$row_product["actnamebig"]] ); // s_num ///// check if change style exist $query_product_change="select confirm_id,fcateno,authno from confirm_info where actnamebig=3 and authno='".$row_product["authno"]."' and online=1"; $result_product_change = mysql_query($query_product_change); $row_product_change = mysql_fetch_array($result_product_change); if (is_numeric($row_product_change['confirm_id'])) $tp_index-> assign ( "actnamebigv_change" , "
[輕微變更內容]
" ); // s_num //// $tp_index-> assign ( "styleno1" , $row_product["styleno1"] ); // s_num $tp_index-> assign ( "styleno2" , $row_product["styleno2"] ); // s_num $tp_index-> assign ( "vender" , $row_product["member_username"] ); // s_num $tp_index-> assign ( "venderno" , $row_product["member_userid"] ); // s_num $tp_index-> assign ( "listno" , $row_product["confirm_id"] ); // s_num $tp_index-> assign ( "fcateno" , $row_product["fcateno"] ); // s_num $tp_index-> assign ( "outno" , $row_product["outno"] ); // s_num $psnno=$row_product["psnno"]; //echo $psnno; ////////////////////////////////////////////////////////////////////// 判斷是否要出現系列 START if ($row_product["actnamebig"]==5) $snno=$row_product["psnno"] ; if (($_REQUEST['cateid']==1) OR ($_REQUEST['cateid']==2)){ $showserial=0; // $innsal="SELECT * FROM ((confirm_info INNER JOIN confirm_cate ON confirm_info.fcateno = confirm_cate.fcateno) INNER JOIN confirm_serial ON confirm_serial.snno = confirm_info.snno ) where confirm_cate.fcateno='".$_REQUEST['fcateno']."'"; $innsal="SELECT * FROM ((confirm_info INNER JOIN confirm_cate ON confirm_info.fcateno = confirm_cate.fcateno) INNER JOIN confirm_serial ON confirm_serial.snno = confirm_info.snno ) where confirm_serial.snno='".$snno."'"; $result_innsal = mysql_query($innsal); //echo $innsal; while ($row_innsal = mysql_fetch_array($result_innsal)) { for ($xx=15;$xx<30;$xx++){ if ($row_innsal["f".$xx."u"]==1) $showserial=1; } } } ///////////////////////////////////////////////////////////////////// 判斷是否要出現系列END if ($showserial==1) $tp_index-> assign ( "showserial" , "[系列資訊]"); // s_num $tp_index-> assign ( "startdate" , $row_product["startdate"] ); // s_num $tp_index-> assign ( "enddate" , $row_product["enddate"] ); // s_num $tp_index-> assign ( "notes" , $row_product["notes"] ); // s_num $tp_index-> assign ( "changenotes" , $row_product["changenotes"] ); // s_num $markno=explode('@',$row_product["markno"]); $marknob="".$markno[0]."
"; //if (!$markno[1]=='') $marknob.="".$markno[1]."
"; //if (!$markno[2]=='') $marknob.="".$markno[2].""; if (!$markno[1]=='') $marknob.="".$markno[1]."
"; if (!$markno[2]=='') $marknob.="".$markno[2]."
"; if (!$markno[3]=='') $marknob.="".$markno[3]."
"; if (!$markno[4]=='') $marknob.="".$markno[4]."
"; if (!$markno[5]=='') $marknob.="".$markno[5]."
"; if (!$markno[6]=='') $marknob.="".$markno[6]."
"; $tp_index-> assign ( "markno" , $marknob ); // s_num $tp_index-> assign ( "authno" , $row_product["authno"] ); // s_num $tp_index-> assign ( "pdate1" , $row_product["pdate1"] ); // s_num $tp_index-> assign ( "pdate2" , $row_product["pdate2"] ); // s_num $tp_index-> assign ( "applydate" , $row_product["applydate"] ); // s_num $iii++; //echo "vvvvvvvvvvvvvvvvvvvvvvvvvv"; ///////////////////// 非電攬內容開始 1011001 修改 //if (!($_REQUEST['fcateno']==216 or $_REQUEST['fcateno']==217)){ if ((!($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)) or ((($_REQUEST['fcateno']==26 or $_REQUEST['fcateno']==27)) and ($_GET['cateid']==1 or $_GET['cateid']==5))) { $query_product2 ="select * from confirm_cate where fcateno='".$_REQUEST['fcateno']."'"; $result_product2 = mysql_query($query_product2); $mmax_qty = mysql_num_rows($result_product2); while ($row_product2 = mysql_fetch_array($result_product2)) { for ($xx=1;$xx<15;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } } for ($xx=30;$xx<36;$xx++){ if (($row_product2["f".$xx."u"])==1){ $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } } } ///////////////////// 非電攬結束 ///////////////////// 電攬內容開始 }elseif($_REQUEST['fcateno']==27){ // $query_product2 ="select n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26 from confirm_lineserial where snno='".$row_product["snno"]."'"; //$result_product2 = mysql_query($query_product2); //list($n15,$n16,$n17,$n18,$n19,$n20,$n21,$n22,$n23,$n24,$n25,$n26) = mysql_fetch_array($result_product2); for ($xx=15;$xx<27;$xx++){ //eval("\$nv=\$n".$xx.";"); eval("\$nv=\$f".$xx."n;"); $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } }else{ for ($xx=15;$xx<22;$xx++){ //eval("\$nv=\$n".$xx.";"); eval("\$nv=\$f".$xx."n;"); $tp_index-> newBlock ( "tp_4_7_1_1_ctbv" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["f".$xx."n"]) ); // s_num } } /////////////////////電攬結束 } $mnum++; $tp_index-> newBlock ( "tp_4_7_1_1_top" ); // 瀏覽 block $tp_index-> assign ( "count" , $mmax_qty41 ); // s_num $tp_index-> newBlock ( "tp_4_7_1_search" ); // 瀏覽 block $tp_index-> assign ( "bigkind" , $cateinfo[$_REQUEST['fcateno']] ); // s_num if ($_REQUEST['f2']) { $f2array=array("styleno1"=>"受理編號","member_username"=>"廠商","styleno2"=>"型號","authno"=>"認可證書","markno"=>"標示號碼"); $tp_index-> assign ( "catetitle" , " + ".$f2array[$_REQUEST['f2']] ); // s_num } // $year='列出全部年度!!'; // if ($_REQUEST['y']) $year=$_REQUEST['y']; //$tp_index-> assign ( "year" , $year ); // s_num $year1='列出全部年度!!'; if (($_REQUEST['y']=='') and ($_REQUEST['year']=='')) { $year=$year1;} if (($_REQUEST['y']=='') and (!$_REQUEST['year']=='')) { $year=$_REQUEST['year'];} if ((!$_REQUEST['y']=='') and ($_REQUEST['year']=='')) { $year=$_REQUEST['y'];} $tp_index-> assign ( "year" , $year ); // s_num $keyword='列出全部資料!!'; if ($_REQUEST['keyword']) $keyword=$_REQUEST['keyword']; $tp_index-> assign ( "keyword" , $keyword ); // s_num if (!$_GET['action']){ $tp_index-> newBlock ( "tp_1_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,$_GET["nextpage"],"&mmenu=4-7-1-1&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); $tp_index-> newBlock ( "tp_1_1_page_top" ); // 瀏覽 block $tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,$_GET["nextpage"],"&mmenu=4-7-1-1&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); } for ($ii=1;$ii<5;$ii++){ if (!($_GET['cateid']==$ii)) { $tp_index-> newBlock ( "tp_4_7_1_imglist" ); // 瀏覽 block $tp_index-> assign ( "cateidno" , $ii ); // s_num $tp_index-> assign ( "cateimg" , "pic001".($ii-1).".jpg" ); // s_num } } return; } function u_p15_1() { //echo days_in_month(2008, 11); global $tp_index; global $link; if ($_GET['month']){ $m=($_GET['month']); }else{ $m=date("m"); } if ($_GET['year']){ $y=($_GET['year']); }else{ $y="20".date("y"); } $pm=$m-1; $nm=$m+1; $ny=$y; $py=$y; if ($m==12) { $pm=11; $py=$y; } if ($m==12) { $nm=1; $ny=$y+1; } if ($m==1) { $pm=12; $py=$y-1; } if ($m==1) { $nm=2; $ny=$y; } $m=((strlen($m)<2)? ("0".$m) : $m ); $y=((strlen($y)<2)? ("0".$y) : $y ); $tp_index-> newBlock ( "tp_4_7_1_date" ); // 瀏覽 block $tp_index-> assign ( "month" , $m ); // s_num $tp_index-> assign ( "year" , $y ); // s_num $tp_index-> assign ( "nmonth" , $nm ); // s_num $tp_index-> assign ( "nyear" , $ny ); // s_num $tp_index-> assign ( "pmonth" , $pm ); // s_num $tp_index-> assign ( "pyear" , $py ); // s_num $tp_index-> assign ( "nsnno" , $_GET['snno'] ); // s_nu $fcateno= (($_GET['fcateno']=='') ? 4 : $_GET['fcateno'] ); $query_product2 ="select * from confirm_cate where fcateno=$fcateno"; $result_product2 = mysql_query($query_product2); $row_product2 = mysql_fetch_array($result_product2); $maxq=$row_product2["examday"]; $tp_index-> newBlock ( "tp_4_7_1a" ); // 瀏覽 block $tp_index-> assign ( "maxq" , $maxq ); // s_num for ($iii=1;($iii<(days_in_month($y, $m)+1));$iii++){ $snno=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "date" , ((strlen($iii)<2)? ("0".$iii) : $iii ) ); // s_num $d=((strlen($iii)<2)? ("0".$iii) : $iii ); $cmdate=$y."-".$m."-".$d; $query_product2 ="select * from confirm_info where eventdata='$cmdate' and fcateno=".$fcateno; $result_product2 = mysql_query($query_product2); $nowrecord = mysql_num_rows($result_product2); //echo $mmax_qty; $query_product2 ="select * from confirm_info where eventdata='$cmdate'"; $result_product2 = mysql_query($query_product2); $mmax_qty = mysql_num_rows($result_product2); while ($row_product2 = mysql_fetch_array($result_product2)) { $snno .= $row_product2["snno"]."  ".","; } if ($nowrecord<$maxq){ $tp_index-> newBlock ( "tp_4_7_1_nofull" ); // 瀏覽 block $tp_index-> assign ( "tp_4_7_1.snno" , $snno ); // s_num $tp_index-> assign ( "tp_4_7_1_nofull.ndate" , $cmdate ); // s_num $tp_index-> assign ( "tp_4_7_1_nofull.nsnno" , $_GET['snno'] ); // s_nu }else{ $tp_index-> newBlock ( "tp_4_7_1_full" ); // 瀏覽 block $tp_index-> assign ( "tp_4_7_1.snno" , $snno ); // s_num } } return; } function u_p3_1_10() { //echo days_in_month(2008, 11); global $tp_index; global $link; if ($_GET['month']){ $m=($_GET['month']); }else{ $m=date("m"); } if ($_GET['year']){ $y=($_GET['year']); }else{ $y="20".date("y"); } $pm=$m-1; $nm=$m+1; $ny=$y; $py=$y; if ($m==12) { $pm=11; $py=$y; } if ($m==12) { $nm=1; $ny=$y+1; } if ($m==1) { $pm=12; $py=$y-1; } if ($m==1) { $nm=2; $ny=$y; } $m=((strlen($m)<2)? ("0".$m) : $m ); $y=((strlen($y)<2)? ("0".$y) : $y ); $tp_index-> newBlock ( "tp_4_7_1_date" ); // 瀏覽 block $tp_index-> assign ( "month" , $m ); // s_num $tp_index-> assign ( "year" , $y ); // s_num $tp_index-> assign ( "nmonth" , $nm ); // s_num $tp_index-> assign ( "nyear" , $ny ); // s_num $tp_index-> assign ( "pmonth" , $pm ); // s_num $tp_index-> assign ( "pyear" , $py ); // s_num $tp_index-> assign ( "nsnno" , $_GET['snno'] ); // s_nu $ssfcateno= (($_GET['ssfcateno']=='') ? 4 : $_GET['ssfcateno'] ); $tp_index-> newBlock ( "tp_4_7_1_cate1" ); // 瀏覽 block $tp_index-> assign ( "tp_4_7_1_cate1.m" , $m ); // s_num $tp_index-> assign ( "tp_4_7_1_cate1.y" , $y ); // s_num $query_product21 ="select * from confirm_cate where fcateno=".$ssfcateno; $result_product21 = mysql_query($query_product21); $row_product21 = mysql_fetch_array($result_product21); $tp_index-> assign ( "tp_4_7_1_cate1.maxq" , $row_product21['examday'] ); // s_num $query_product21 ="select * from confirm_cate where isvender<>1 order by fcateno"; $result_product21 = mysql_query($query_product21); while ($row_product21 = mysql_fetch_array($result_product21)) { $tp_index-> newBlock ( "tp_4_7_1_cate" ); // 瀏覽 block $tp_index-> assign ( "fcateno" , $row_product21['fcateno'] ); // s_num $tp_index-> assign ( "fcatename" , $row_product21['catename'] ); // s_num if ($ssfcateno==$row_product21['fcateno']) $tp_index-> assign ( "fcatenoselected" , "selected" ); // s_num } for ($iii=1;($iii<(days_in_month($y, $m)+1));$iii++){ $snno=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "date" , ((strlen($iii)<2)? ("0".$iii) : $iii ) ); // s_num $d=((strlen($iii)<2)? ("0".$iii) : $iii ); $cmdate=$y."-".$m."-".$d; $query_product2 ="select * from confirm_info where eventdata='$cmdate' and fcateno=$ssfcateno"; $result_product2 = mysql_query($query_product2); $mmax_qty = mysql_num_rows($result_product2); while ($row_product2 = mysql_fetch_array($result_product2)) { $snno .= $row_product2["snno"]." "; } $tp_index-> assign ( "snno" , $snno ); // s_num $tp_index-> assign ( "ndate" , $cmdate ); // s_num $tp_index-> assign ( "nsnno" , $_GET['snno'] ); // s_nu } return; } function u_p2_4_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; global $f_que; global $f_page; global $mpd01; global $mtable_company_k; global $mbgpdc_path; global $link; global $form; $query_product = "select * from info where infoid=".$_GET['sid']; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { // // if (($mnum%2)==0){ $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block //} $tp_index-> assign ( "tp_p2_list_01_001.title" , $row_product["title"] ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imaster" , $row_product["imaster"] ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.imonitor" , $row_product["imonitor"] ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.idesign" , $row_product["idesign"] ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itotaldate" , $row_product["itotaldate"] ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.irange" , nl2br($row_product["irange"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.itype" , nl2br($row_product["itype"]) ); // s_num $tp_index-> assign ( "tp_p2_list_01_001.inote" , nl2br($row_product["inote"]) ); // s_num /////////////////////////////////////////////////////////////////////////// // $photolist=""; $photo_dir = "data/engineer/" . $row_product["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db" && !is_dir($photo_dir."/".$file) ) { $filelist[] .= $file; } } $stdwidth=176; $stdheight=254; $photornd=0; if($filelist) { foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; $link1m = $photo_dir . "/org/" . $val; //$tp_index-> newBlock ("tp_p2_list_01"); //$tp_index-> assign ("tp_p2_list_01.imgpath" , $link1 ); // s_num //echo "dd"; $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_product["infoid"] , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); //$tp_index-> assign ("tp_p2_list_01.imgtext" , $imgnote ); // s_num list($width, $height, $value, $params) = GetImageSize($link1); //list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); // list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); // $tp_index-> assign ("tp_p2_list_01.height" , $height ); // s_num // $tp_index-> assign ("tp_p2_list_01.width" , $width ); // s_num if ((strpos($link1m, "jpg")) != false){ $photoshow[$photornd]="
".$imgnote.""; }else{ $photoshow[$photornd]="".$link1m1."
".$imgnote."
"; } // $photoshow[$photornd]="
".$imgnote.""; // $photoshow[$photornd]="
".$imgnote.""; $photornd=$photornd+1; } } } //print_r($photoshow); $tp_index-> newBlock ("tp_photo_table"); $tp_index-> assign ( "tp_photo_table" , $form->tablegrid($photoshow, 3, "95%", 10, "ffffff", "center $tr_mouse", "align=center valign=top cellpadding=7'", "bottom style='border: 496eb5 1px dotted;'") ); // 訂單日期 $tp_index-> newBlock ( "tp_p4_02" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=7771&cateid=".$_GET['cateid']."&cateid_k=".$_GET['cateid_k'],count($filelist),'','',$msnum,0,'',33) ); $mnum++; return; } function u_p2_4(){ global $tp_index; global $form; $query_photo = "select * from sys_template where funcid=".$_GET['cateid']." and tpl_name='ptpl_talbe_title' order by tplid desc"; $query_photo = "select * from infocate where cateid=".$_GET['cateid']; //echo $query_photo; $result_photo = mysql_query($query_photo); $row_photo = mysql_fetch_array($result_photo); $tp_index-> newBlock ("tp_ptpl_home_item"); $tp_index-> assign ("home_item",$row_photo["catename"]); ///////////////////////////////////////////////////// $tp_index-> newBlock ( "tp_pagetitle" ); // 瀏覽 block //$tp_index-> assign ( "tp_tour1_title.tp_title" , $row_product_kind_chk["title"] ); // $tp_index-> assign ( "tp_pagetitle.title" , "-".$row_photo["catename"]."-圖片列表" ); // $bigkind=$row_photo["catename"]; $query_photo = "select * from infocate_k where cateid=".$_GET['cateid']." order by up_date desc"; $result_photo = mysql_query($query_photo); $cateid=$_GET['cateid']; $cateid_k=$_GET['cateid_k']; if(empty($_GET['cateid_k'])) { $query_product_kind_chk = "select * from infocate_k where cateid=".$_GET['cateid']." order by up_date desc"; $result_product_kind_chk = mysql_query($query_product_kind_chk); $row_product_kind_chk = mysql_fetch_array($result_product_kind_chk); $cateid_k = $row_product_kind_chk["cateid_k"]; } while ($row_photo = mysql_fetch_array($result_photo)) { $tp_index-> newBlock ("tp_photo_kind_list"); $tp_index-> assign ( "nn1" , "nn1" ); // if ($row_photo["cateid_k"]==$cateid_k){ $tp_index-> assign ( "tp_strong" , "" ); // $tp_index-> assign ( "tp_un_strong" , "" ); // $tp_index-> assign ( "nn1" , "nn118" ); // $nowkind=$row_photo['catename']; } $tp_index-> assign ( "photo_kind_name" , $row_photo['catename'] ); // 訂單日期 $tp_index-> assign ( "photo_kind_link" , "indexmain.php?mmenu=2-4&cateid=".$row_photo['cateid']."&cateid_k=".$row_photo['cateid_k'] ); // 訂單日期 } $query_photo2 = "SELECT * FROM info where infocate=$cateid and scate=$cateid_k and cshow=2 order by importseq"; $result_photo2 = mysql_query($query_photo2); $photornd=0; //找出工程實績列表 while($row_photo2 = mysql_fetch_array($result_photo2)) { $isget=0; $photo_dir = "data/engineer/" . $row_photo2["infoid"]."/" ; //echo $photo_dir; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db" && !is_dir($photo_dir."/".$file) ) { $filelist[$photornd]['filen'] .= $photo_dir.$file; $filelist[$photornd]['title'] .= $row_photo2["title"]; $filelist[$photornd]['rown'] .= $row_photo2["infoid"]; $filelist[$photornd]['idn'] .= $photornd; $photornd++; $isget=1; if ($isget==1){ break;} } } } //找出工程實績列表結束 if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $photornd=0; if($filelist) { foreach($filelist as $key=>$val) { if (($val['idn']>=$msnum) and ($val['idn']<=($msnum+11))){ $link = $val['filen']; list($width, $height, $value, $params) = GetImageSize($link); $stdwidth=176; $stdheight=254; list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $orgvaltitle=$val["title"]; if (mb_strlen($val["title"], 'UTF-8')>255){ $val["title"]=mb_substr(($val["title"]),0,255,"UTF-8").".."; } //if ($_GET['cateid']==5) $photoshow[$photornd] = "
".$val["title"]."
"; //991221 // $photoshow[$photornd] = "
TFTF-".$bigkind."-".$nowkind."-". $photornd=$photornd+1; } } } $tp_index-> newBlock ("tp_photo_table"); $tp_index-> assign ( "tp_photo_table" , $form->tablegrid($photoshow, 3, "97%", 30, "ffffff", "center $tr_mouse", " align=center cellpadding=3'", "top style='border: 496eb5 1px dotted;'") ); // 訂單日期 $tp_index-> newBlock ( "tp_p4_02" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=7771&cateid=".$_GET['cateid']."&cateid_k=".$_GET['cateid_k'],count($filelist),'','',$msnum,0,'',9) ); } function u_p2_4_old() { global $tp_index; global $link; $query_product = "select * from info where infocate=15"; //echo $query_product; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $photolist=""; $tp_index-> newBlock ( "tp_2_4" ); // 瀏覽 block $tp_index-> assign ( "title" , ($row_product["title"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_num unset($filelist); $photo_dir = "data/infofile/" . $row_product["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $tp_index-> assign ( "file" , $photo_dir."/".$filelist[0] ); // s_num } $mnum++; return; } function u_p3_1_2() { global $tp_index; global $link; $linknew=db_connectnew(); if ($_SESSION["muser_id"]==''){ ?> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num // $result_product = mysql_query($query_product); $mnum = 0; while (list($fcateno,$snno,$styleno2,$applydate,$actnamebig,$title,$infocate,$confirm_id)=db_fetch_row($querycopy)){ $photolist=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "ckind" , $confirmbig[($actnamebig)] ); // s_num $tp_index-> assign ( "ekind" , $cateinfo[($fcateno)] ); // s_num $tp_index-> assign ( "snno" , ($snno) ); // s_n $tp_index-> assign ( "applydate" , $applydate ); // s_n $tp_index-> assign ( "styleno2" , $styleno2 ); // s_n $query_productn = "select title from info_k_i where infoid='".$row_product["progress2"]."'"; $result_productn = mysql_query($query_productn); $row_productn = mysql_fetch_array($result_productn); //if (($row_product["actnamebig"])==4){ $tp_index-> assign ( "imagelink" , "" ); $tp_index-> assign ( "progress" , $title ); // s_n $tp_index-> assign ( "confirm_id" , $confirm_id ); // s_n //} $tp_index-> assign ( "progressbig" ,$infocate ); // s_n // $tp_index-> assign ( "link" , "indexmain.php?mmenu=3-1-1-1&fcateno=".$row_product["fcateno"]."&cateid=".$row_product["fcateno"] ); // s_num } $mnum++; return; } function u_p3_1_1a() { global $tp_index; global $link; if ($_SESSION["muser_id"]==''){ ?> 1"; $confirmbig=infocate_list_confirmbig(); $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num //echo $query_product; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $photolist=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "link" , "newblue/newline.php?mmenu=3-1-1-1&fcateno=".$row_product["fcateno"]."&cateid=".$row_product["fcateno"] ); // s_num } $mnum++; return; } function u_p3_1_1() { global $tp_index; global $link; if ($_SESSION["muser_id"]==''){ ?> 1"; $confirmbig=infocate_list_confirmbig(); $tp_index-> newBlock ( "tp_4_7_1_bigcate" ); // 瀏覽 bloc $tp_index-> assign ( "bigcate" , $confirmbig[$_GET['cateid']] ); // s_num //echo $query_product; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { $photolist=""; $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "catename" , ($row_product["catename"]) ); // s_num $tp_index-> assign ( "up_date" , ($row_product["up_date"]) ); // s_n $tp_index-> assign ( "link" , "newblue/newline.php?gfcateno=".$row_product["fcateno"]."&cateid=".$row_product["fcateno"]."&rndcode=".rand(1,800000) ); // s_num } $mnum++; return; } function randstr() { mt_srand((double)microtime()*10000); for($i=0;$i<5;$i++) { $x = mt_rand(1,9); $newpic_name .= ($x%2==0) ? chr(mt_rand(48,57)) : chr(mt_rand(97,122)); } return $newpic_name; } function getSNno($autono){ //echo $autono; global $link; //有 bug //$authnolen=strlen($autono); // $actauthono=($autono."B".date("Y")); // $innsalz="select count(*) as pcount from confirm_info where left(styleno1,".($authnolen+5).") like '".$actauthono."'"; // $querylz = db_query($innsalz,$link); //list($pcount) = db_fetch_row($querylz); $authnolen=strlen($autono); // $actauthono=($autono."B".date("Y")); $actauthono=($autono.(date("Y")-1911)); $innsalz="select max(right(styleno1,4)) as pcount from confirm_info where left(styleno1,".($authnolen+3).") like '".$actauthono."' and stype<>3"; // echo "select max(right(styleno1,4)) as pcount from confirm_info where left(styleno1,".($authnolen+3).") like '".$actauthono."'"; //exit; $querylz = db_query($innsalz,$link); list($pcount) = db_fetch_row($querylz); // return ($autono."B".date("Y").sprintf("%04d",$pcount+1)); return ($autono.(date("Y")-1911).sprintf("%04d",$pcount+1)); } function getSNno3($autono){ // 全找 global $link; $innsalz="select styleno1 from confirm_info where snno like '".$autono."'"; $querylz = db_query($innsalz,$link); list($styleno1) = db_fetch_row($querylz); $authnolen=strlen($styleno1); // $innsalz="select max(right(styleno1,1)) as pcount from confirm_info where left(styleno1,".($authnolen+1).") like '".$styleno1."-'"; $innsalz="select count(right(styleno1,IF(length(styleno1)=".($authnolen+3).",2,1))) as pcount from confirm_info where left(styleno1,".($authnolen+1).") like '".$styleno1."-'"; //echo $innsalz; //exit; $querylz = db_query($innsalz,$link); list($pcount) = db_fetch_row($querylz); //修正 // return ($styleno1."-".sprintf("%02d",$pcount+1)); return ($styleno1."-".($pcount+1)); } function u_p3_1_1_1_sa() { global $tp_index; global $link; $pdate1array=$_POST['pdate1']; $pdate2array=$_POST['pdate2']; $pamount1array=$_POST['pamount1']; $pamount2array=$_POST['pamount2']; $paddarray=$_POST['padd']; if ($_POST['sftype']==2){ // 現有庫存就是申請庫存, 在 MODE=2 時 paomunt2 就是現有庫存, amount1 就是申請庫存量 $pamount2array=$_POST['pamount1']; } $pcompanyarray=$_POST['pcompany']; $psidarray=$_POST['apsid']; $snno=$_POST['snno']; $pauthnoarray=$_POST['pauthno']; $innsalz="select fcateno, venderno, actnameyear, actnamebig ,progress,authno,styleno2 from confirm_info where snno='".$snno."'" ; $querylz = db_query($innsalz,$link); list( $fcateno, $venderno, $actnameyear, $actnamebig ,$progress,$authno,$styleno2) = db_fetch_row($querylz); $innsalz="select member_username from member where member_userid='".$venderno."'" ; $querylz = db_query($innsalz,$link); list( $vendername)=db_fetch_row($querylz); $actnameyear=date("Y"); for ($i=0;($i '' and actnamebig=1 and (fcateno=26 or fcateno=27) ) order by styleno1"; $result_product = mysql_query($query_data); while ($row_product = mysql_fetch_array($result_product)){ if ($row_product["fcateno"]=='26') $prename="(HR)"; if ($row_product["fcateno"]=='27') $prename="(FR)"; $tp_index-> newBlock ( "tp_stylenolist" ); // 瀏覽 block $tp_index-> assign ( "tp_stylenolist.snno" , $row_product["snno"] ); // 產品解說 $tp_index-> assign ( "tp_stylenolist.authno" , $prename." ".$row_product["authno"] ); // 產品解說 } $tp_index-> newBlock ( "tp_stylenolisttoday" ); // 瀏覽 block $tp_index-> assign ( "today" , date("Y-m-d") ); // 產品解說 } function u_p3_1_1_1() { global $form; if ($_SESSION["muser_id"]==''){ ?> '' and actnamebig=1 ) order by styleno1"; $query_data="select actnamebig,fcateno,authno,snno from confirm_info where ( (fcateno=".$_REQUEST["fcateno"].") and venderno='".$_SESSION["muser_id"]."' and authno<>'' and actnamebig=1 ) order by styleno1"; $result_product = mysql_query($query_data); while ($row_product = mysql_fetch_array($result_product)){ $tp_index-> newBlock ( "tp_stylenolist" ); // 瀏覽 block $tp_index-> assign ( "tp_stylenolist.snno" , $row_product["snno"] ); // 產品解說 $tp_index-> assign ( "tp_stylenolist.authno" , $row_product["authno"] ); // 產品解說 } //echo $row_product["fcateno"]; // $query_data1="select member_username from member where member_userid='".$_SESSION["muser_id"]."' "; //echo $query_data1; // $result_product1 = mysql_query($query_data1); // $row_product1 = mysql_fetch_array($result_product1); $tp_index-> newBlock ( "tp_infolist" ); // 瀏覽 block $tp_index-> assign ( "tp_infolist.venderno" , $infocate_list_vender[$_SESSION["muser_id"]] ); // 產品解說 $tp_index-> assign ( "tp_infolist.catename" , $cateinfo[$_REQUEST["fcateno"]] ); // 產品解說 $tp_index-> assign ( "tp_infolist.totalquota1" , $totalquota1 ); // 產品解說 //$_SESSION["totalquota1"]=(is_numeric($_SESSION["totalquota1"]) ? $totalquota1 : 0 ); $_SESSION["totalquota1"]= $totalquota1; if ($_REQUEST["fcateno"]=="26"){ $_SESSION["xtype"]=1; } if ($_REQUEST["fcateno"]=="27"){ $_SESSION["xtype"]=2; } $tp_index-> newBlock ( "tp_infolistx" ); // 瀏覽 block $tp_index-> assign ( "xtype" , $_SESSION["xtype"] ); // 產品解說 $tp_index-> assign ( "totalquota1" , $_SESSION["totalquota1"] ); // 產品解說 $query_data="select ad1,ad2,ad3 from member where member_userid='".$_SESSION["muser_id"]."' "; $result_product = mysql_query($query_data); $row_product = mysql_fetch_array($result_product); if ($row_product['ad1']<>'') $addressarray[$row_product['ad1']]=$row_product['ad1']; if ($row_product['ad2']<>'') $addressarray[$row_product['ad2']]=$row_product['ad2']; if ($row_product['ad3']<>'') $addressarray[$row_product['ad3']]=$row_product['ad3']; $tp_index-> newBlock ( "tp_addresslist0" ); // 瀏覽 block $tp_index-> assign ( "address" , $form->select("padd[]","",$addressarray," id='padd[]'") ); // 產品解說 $tp_index-> newBlock ( "tp_addresslist1" ); // 瀏覽 block $tp_index-> assign ( "address" , $form->select("padd[]","",$addressarray," id='padd[]'") ); // 產品解說 $tp_index-> newBlock ( "tp_addresslist2" ); // 瀏覽 block $tp_index-> assign ( "address" , $form->select("padd[]","",$addressarray," id='padd[]'") ); // 產品解說 return; } function u_p3_1_1_1BAK() { if ($_SESSION["muser_id"]==''){ ?> newBlock ( "tp_p3_1_9" ); // 瀏覽 block // $tp_index-> assign ( "companyname" , ($row_data["member_username"]) ); // s_num // $tp_index-> assign ( "cno" , ($row_data["member_userid"]) ); // s_num // $tp_index-> assign ( "phone" , ($row_data["phone"]) ); // s_num // $tp_index-> assign ( "address" , ($row_data["address"]) ); // s_num // $tp_index-> assign ( "email" , ($row_data["email"]) ); // s_num // $tp_index-> assign ( "man" , ($row_data["personal"]) ); // s_num // $xml= str_replace( '{companyname}' , ($row_data["phone"]) , $xml); $xml= str_replace( '{snno}' , $rndstr , $xml); $xml= str_replace( '{company}' , ($row_data["member_username"]) , $xml); $xml= str_replace( '{phone}' , ($row_data["phone"]) , $xml); $xml= str_replace( '{address}' , ($row_data["address"]) , $xml); $xml= str_replace( '{fax}' , ($row_data["fax"]) , $xml); $xml= str_replace( '{email}' , ($row_data["email"]) , $xml); $xml= str_replace( '{man}' , ($row_data["personal"]) , $xml); } //////////////////////////////// $filena= $rndstr .".doc"; $filernd="tempdoc/".$filena; $file1 = fopen($filernd,"w"); fwrite($file1, $xml); $tp_index-> newBlock ( "tp_4_7_1" ); // 瀏覽 block $tp_index-> assign ( "docfile" , $filernd ); // s_num $tp_index-> assign ( "sn" , $rndstr ); // s_num $query_data="insert into confirm_info(snno,venderno,fcateno,actnamebig,actnameyear,online,applydate,sip) values('".$rndstr."','".$_SESSION["muser_id"]."','".$_GET['fcateno']."','".$_GET['tempid']."',2009,2,'".date("Y-m-d")."','".$_SERVER["REMOTE_ADDR"]."')" ; // echo $query_data; $result_data = mysql_query($query_data); // $mmax_qty = mysql_num_rows($result_data); // $row_data = mysql_fetch_array($result_data); return; } function u_p2_3() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=1 and infoid=2662"; $result_product = mysql_query($query_product); $row_product = mysql_fetch_array($result_product); $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $query_product = "select * from info_k_i where infocate=".$companycateid; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { //$tp_index-> newBlock ("tp_p2_list_01"); unset($filelist); $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block //$tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , str_replace("\r\n","
",$row_product["content"]) ); // 產品解說 // $tp_index-> assign ( "tp_p2_list_01_001.tp_pd04" , str_replace("\r\n","
",$row_product["title"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , $row_product["content"] ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd04" , $row_product["title"] ); // 產品解說 /////////////////////////////////////////////////////////////////////////// 取出圖片列表 $photo_dir = "data/info_i/" . $row_product["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $photolist = ""; if($filelist) { foreach($filelist as $key=>$val) { $link = $photo_dir . "/" . $val; $photolist .= "

"; } } /////////////////////////////////////////////////////////////////////////// $tp_index-> assign ( "tp_p2_list_01_001.photolist" , $photolist ); // 產品圖檔(小) } return; } function u_p2_5() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=8 and infoid=2665"; $result_product = mysql_query($query_product); $row_product = mysql_fetch_array($result_product); $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $query_product = "select * from info_k_i where infocate=".$companycateid; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { //$tp_index-> newBlock ("tp_p2_list_01"); unset($filelist); $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block // $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , str_replace("\r\n","
",$row_product["content"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" ,$row_product["content"] ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd04" , str_replace("\r\n","
",$row_product["title"]) ); // 產品解說 /////////////////////////////////////////////////////////////////////////// 取出圖片列表 $photo_dir = "data/info_i/" . $row_product["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $photolist = ""; $stdwidth=400; $stdheight=400; if($filelist) { foreach($filelist as $key=>$val) { $link = $photo_dir . "/" . $val; list($width, $height, $value, $params) = GetImageSize($link); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $photolist .= "

"; } } /////////////////////////////////////////////////////////////////////////// $tp_index-> assign ( "tp_p2_list_01_001.photolist" , $photolist ); // 產品圖檔(小) } return; } function u_istem() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=330"; $result_product = mysql_query($query_product); while ($row_product = mysql_fetch_array($result_product)){; $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $tp_index-> newBlock ("tp_p2_list_01x"); $tp_index-> assign ( "tp_p2_list_01x.tp_pd04" , str_replace("\r\n","
",$row_product["title"]) ); // 產品解說 $query_product1 = "select * from info_k_i where infocate=".$companycateid; $result_product1 = mysql_query($query_product1); $mnum = 0; while ($row_product1 = mysql_fetch_array($result_product1)) { $tp_index-> newBlock ( "tp_p2_list_01_001x" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_001x.tp_pd09" , str_replace("\r\n","
",$row_product1["content"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001x.tp_pd04" , str_replace("\r\n","
",$row_product1["title"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001x.tp_address" , str_replace("\r\n","
",$row_product1["address"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001x.tp_phone" , str_replace("\r\n","
",$row_product1["phone"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001x.tp_fax" , str_replace("\r\n","
",$row_product1["fax"]) ); // 產品解說 } } return; } function u_p9_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=332"; $result_product = mysql_query($query_product); while ($row_product = mysql_fetch_array($result_product)){; $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $tp_index-> newBlock ("tp_p2_list_01"); $tp_index-> assign ( "tp_p2_list_01.tp_pd04" , str_replace("\r\n","
",$row_product["title"]) ); // 產品解說 $query_product1 = "select * from info_k_i where infocate=".$companycateid; $result_product1 = mysql_query($query_product1); $mnum = 0; while ($row_product1 = mysql_fetch_array($result_product1)) { $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , str_replace("\r\n","
",$row_product1["content"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd04" , str_replace("\r\n","
",$row_product1["title"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_address" , str_replace("\r\n","
",$row_product1["address"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_phone" , str_replace("\r\n","
",$row_product1["phone"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_fax" , str_replace("\r\n","
",$row_product1["fax"]) ); // 產品解說 } } return; } function u_p2_2() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; $query_product = "select * from info_i where infocate=1 and infoid=2666"; $result_product = mysql_query($query_product); $row_product = mysql_fetch_array($result_product); $companytitle=$row_product["title"]; $companycateid=$row_product["infoid"]; $query_product = "select * from info_k_i where infocate=".$companycateid; $result_product = mysql_query($query_product); $mnum = 0; while ($row_product = mysql_fetch_array($result_product)) { //$tp_index-> newBlock ("tp_p2_list_01"); unset($filelist); $photolist=""; $tp_index-> newBlock ( "tp_p2_list_01_001" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01_001.tp_pd09" , str_replace("\r\n","
",$row_product["content"]) ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01_001.tp_pd04" , str_replace("\r\n","
",$row_product["title"]) ); // 產品解說 /////////////////////////////////////////////////////////////////////////// 取出圖片列表 $photo_dir = "data/info_i/" . $row_product["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $photolist = ""; if($filelist) { foreach($filelist as $key=>$val) { $link = $photo_dir . "/" . $val; $photolist .= "

"; } } /////////////////////////////////////////////////////////////////////////// $tp_index-> assign ( "tp_p2_list_01_001.photolist" , $photolist ); // 產品圖檔(小) } return; } function u_p4_1(){ global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p4_1 = "select * from info where infocate=20 order by infoid desc"; $result_u_p4_1 = mysql_query($query_u_p4_1); $mmax_qty = mysql_num_rows($result_u_p4_1); $query_u_p4_1 = "select * from info where infocate=20 order by infoid desc limit $msnum,10"; $result_u_p4_1 = mysql_query($query_u_p4_1); while ($row_u_p4_1 = mysql_fetch_array($result_u_p4_1)) { $tp_index-> newBlock ( "tp_4_1" ); // 瀏覽 block $tp_index-> assign ( "title" , mb_substr(($row_u_p4_1["title"]),0,30,"UTF-8") ); // 內容 $tp_index-> assign ( "up_date" , substr($row_u_p4_1["up_date"],0,10) ); // 內容 $tp_index-> assign ( "link" , "indexmain.php?mmenu=4-1-1&sum=".$row_u_p4_1["infoid"] ); // 內容 $tp_index-> assign ( "id" , $row_u_p4_1["infoid"] ); // 內容 $tp_index-> assign ( "content" ,($row_u_p4_1["content"]) ); // 內容 if (!($row_u_p4_1["ititlelink"]=='')) $tp_index-> assign ( "link" , $row_u_p4_1["ititlelink"] ); // 內容 } $tp_index-> newBlock ( "tp_4_1_page" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=4-1&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function u_p4_1_com(){ global $tp_index; global $link; global $form; $linknew=db_connectnew(); if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } //////////////////////////////公司訊息 $copystr="select sum(money) from coin where venderno='".$_SESSION["muser_id"]."'" ; $querycopy=db_query($copystr,$linknew); list($totalmoney)=db_fetch_row($querycopy); //$query = db_query("select sum(money) as totalmoney from usermesg where snno='".$_SESSION["muser_id"]."' and type=0", $link); //list($totalmoney) = db_fetch_row($query); /// $query_productmb = "select sum(money) as totalmoney from usermesg where snno='".$_SESSION["muser_id"]."' and type=0"; // $result_productmb = mysql_query($query_productmb); // list($totalmoney) = mysql_fetch_row($result_productmb); $query_productm = "select count(*) from coin where venderno='".$_SESSION["muser_id"]."' and money>0 order by coin_date desc" ; $querycopy=db_query($query_productm,$linknew); list($mnum)=db_fetch_row($querycopy); //$query_product = "select * from usermesg // where snno='".$_SESSION["muser_id"]."' and isread=0 order by mesgid desc"; $tp_index-> newBlock ( "tp_4_1_com_num" ); // 瀏覽 block $tp_index-> assign ( "mnum" , $mnum ); // s_num $tp_index-> assign ("totalmoney",(is_numeric($totalmoney) ? $totalmoney : 0) ); $query_product = "select venderno, money,coin_date ,meg from coin where venderno='".$_SESSION["muser_id"]."' and type=1 order by coin_date desc" ; $querycopy=db_query($query_product,$linknew); $mailicon=array("1"=>"mail02.gif","0"=>"mail01.gif"); while (list($venderno, $money,$coin_date ,$meg)=db_fetch_row($querycopy)){ $tp_index-> newBlock ( "tp_4_1_msg" ); // 瀏覽 block $tp_index-> assign ( "title" , $meg ); // s_num $tp_index-> assign ( "money" , $money ); // s_num $tp_index-> assign ( "cdate" , $coin_date ); // s_num // $tp_index-> assign ( "mesgid" , $row_product['mesgid'] ); // s_num // $tp_index-> assign ( "mailicon" , $mailicon[$row_product['isread']] ); // s_num if ($row_product['isread']==0) $tp_index-> assign ( "readstatus" , "未讀閱" ); // s_num if ($row_product['isread']==1) $tp_index-> assign ( "readstatus" , "已讀閱" ); // s_num $query_product33 = "select * from usermesg where remesgid='".$row_product['mesgid']."' and type=1 order by mesgid desc"; $result_product33 = mysql_query($query_product33); while ($row_product33 = mysql_fetch_array($result_product33)) { $tp_index-> newBlock ( "tp_4_1_msg" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_product33['title'] ); // s_num $tp_index-> assign ( "cdate" , $row_product33['cdate'] ); // s_num $tp_index-> assign ( "mesgid" , $row_product33['mesgid'] ); // s_num $tp_index-> assign ( "mailicon" , $mailicon[$row_product33['isread']] ); // s_num if ($row_product33['isread']==0) $tp_index-> assign ( "readstatus" , "未讀閱" ); // s_num if ($row_product33['isread']==1) $tp_index-> assign ( "readstatus" , "已讀閱" ); // s_num } } $tp_index-> newBlock ( "tp_msgapplylink" ); // 瀏覽 block if ($totalmoney<=0){ $tp_index-> assign ( "msgapplylink" , "'javascript:showmoneymsg();'"); }else{ $tp_index-> assign ( "msgapplylink" , "indexmain.php?mmenu=3-1-1"); } $tp_index-> newBlock ( "tp_4_1_page_com" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=3-1",$mmax_qty,'','',$msnum,0,'',7) ); //$tp_index-> assign ( "spage" , $form->html_page("indexmain.php",$mmax_qty41,'','',$offset,0,"&mmenu=4-7-1-1&fcateno=".$_REQUEST['fcateno']."&cateid=".$_GET['cateid']."&y=".$_GET['y']."&search_info=".$search_info2.$corders.$akys,$limit) ); } function u_p1_1_1(){ global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p4_1_1 = "select * from info where infoid=".$_GET['sum']; $result_u_p4_1_1 = mysql_query($query_u_p4_1_1); while ($row_u_p4_1_1 = mysql_fetch_array($result_u_p4_1_1)) { $tp_index-> newBlock ( "tp_1_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p4_1_1["title"] ); // 內容 $tp_index-> assign ( "up_date" , $row_u_p4_1_1["up_date"] ); // 內容 $tp_index-> assign ( "content" , $row_u_p4_1_1["content"] ); // 內容 /////////////////////////////////////////////////////////////////////////// 取出圖片列表 $photo_dir = "data/infohot/" . $row_u_p4_1_1["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $photolist = ""; if($filelist) { foreach($filelist as $key=>$val) { $linkv = $photo_dir . "/" . $val; $photolist .= "

"; } } /////////////////////////////////////////////////////////////////////////// $tp_index-> assign ( "photolist" , $photolist ); // 產品圖檔(小) unset($filelist); $photo_dir = "data/engineerupfile/" . $row_u_p4_1_1["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $stdwidth=176; $stdheight=129; if($filelist) { foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; $tp_index-> newBlock ("tp_p2_list_01"); $tp_index-> assign ("tp_p2_list_01.imgpath" , $link1 ); // s_num $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_u_p4_1_1["infoid"] , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); $tp_index-> assign ("tp_p2_list_01.imgpath1" , end(explode("/",$link1)) ); // s_num // list($width, $height, $value, $params) = GetImageSize($link1); // list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); // list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ("tp_p2_list_01.height" , $height ); // s_num $tp_index-> assign ("tp_p2_list_01.width" , $width ); // s_num } } } } function u_p4_1_1(){ global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p4_1_1 = "select * from info where infoid=".$_GET['sum']; $result_u_p4_1_1 = mysql_query($query_u_p4_1_1); while ($row_u_p4_1_1 = mysql_fetch_array($result_u_p4_1_1)) { $tp_index-> newBlock ( "tp_4_1_1" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p4_1_1["title"] ); // 內容 $tp_index-> assign ( "up_date" , $row_u_p4_1_1["up_date"] ); // 內容 $tp_index-> assign ( "content" , $row_u_p4_1_1["content"] ); // 內容 /////////////////////////////////////////////////////////////////////////// 取出圖片列表 $photo_dir = "data/infohot/" . $row_u_p4_1_1["infoid"] ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $photolist = ""; if($filelist) { foreach($filelist as $key=>$val) { $linkv = $photo_dir . "/" . $val; $photolist .= "

"; } } /////////////////////////////////////////////////////////////////////////// $tp_index-> assign ( "photolist" , $photolist ); // 產品圖檔(小) unset($filelist); $photo_dir = "data/engineerupfile/" . $row_u_p4_1_1["infoid"] ; // echo $photo_dir ; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[] .= $file; } } $stdwidth=171; $stdheight=129; if($filelist) { foreach($filelist as $key=>$val) { $link1 = $photo_dir . "/" . $val; $tp_index-> newBlock ("tp_p2_list_01"); $tp_index-> assign ("tp_p2_list_01.imgpath" , $link1 ); // s_num $queryimgtext=db_query("select infoimgtextid,imgname,imgnote from infoimgtext where imgname='".$val."' and infoid=".$row_u_p4_1_1["infoid"] , $link); list($infoimgtextid,$imgname ,$imgnote) = db_fetch_row($queryimgtext); $tp_index-> assign ("tp_p2_list_01.imgtext" , $imgnote ); // s_num // list($width, $height, $value, $params) = GetImageSize($link1); // list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); // list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ("tp_p2_list_01.height" , $height ); // s_num $tp_index-> assign ("tp_p2_list_01.width" , $width ); // s_num } } } } function u_p4_8(){ global $tp_index; global $link; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_u_p4_8 = "select * from infocateb_qa where cateid<>24 order by cateid"; $result_u_p4_8 = mysql_query($query_u_p4_8); $mmax_qty = mysql_num_rows($result_u_p4_8); while ($row_u_p4_8 = mysql_fetch_array($result_u_p4_8)) { $tp_index-> newBlock ( "tp_4_8_kind" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p4_8["catename"] ); // 內容 $tp_index-> assign ( "id" , $row_u_p4_8["cateid"] ); // 內容 if ($_GET['kind']==$row_u_p4_8["cateid"]) $tp_index-> assign ( "idselect" , "selected" ); // 內容 } if (!($_REQUEST['kind']=='')){ $kind=$_REQUEST['kind'];} else{ $kind=1;} $num=1; $query_u_p4_q = "select * from infoqa where infocate=$kind order by infoid"; //echo $query_u_p4_q; $result_u_p4_q = mysql_query($query_u_p4_q); $mmax_qty = mysql_num_rows($result_u_p4_q); while ($row_u_p4_q = mysql_fetch_array($result_u_p4_q)) { $style=""; if ($num%2==0) $style="bgcolor=#669966"; $tp_index-> newBlock ( "tp_4_8_q" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p4_q["title"] ); // 內容 $tp_index-> assign ( "id" , $row_u_p4_q["id"] ); // 內容 $tp_index-> assign ( "style" , $style ); // 內容 $tp_index-> assign ( "no" , $num ); // 內容 $tp_index-> newBlock ( "tp_4_8_a" ); // 瀏覽 block $tp_index-> assign ( "title" , $row_u_p4_q["title"] ); // 內容 $tp_index-> assign ( "id" , $row_u_p4_q["id"] ); // 內容 $tp_index-> assign ( "content" , $row_u_p4_q["content"] ); // 內容 $tp_index-> assign ( "style" , $style ); // 內容 $tp_index-> assign ( "no" , $num ); // 內容 $num++; } } function u_p12_1() { global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; global $f_que; global $f_page; global $mpd01; // 沒有傳值,抓第一筆 if(empty($mpd01)) { $query_product_kind_chk = "select * from products_cate order by cid "; $result_product_kind_chk = mysql_query($query_product_kind_chk); $row_product_kind_chk = mysql_fetch_array($result_product_kind_chk); $mpd01 = $row_product_kind_chk["cid"]; } $query_product_kind = "select * from products_cate order by cid "; $result_product_kind = mysql_query($query_product_kind); while($row_product_kind = mysql_fetch_array($result_product_kind)) { $tp_index-> newBlock ( "tp_p2_kind2" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_kind.tp_pk02" , $row_product_kind["pk02"] ); // $tp_index-> assign ( "tp_p2_kind.tp_link" , u_showproc().".php?mmenu=2&mpd01=".$row_product_kind["pk01"]."&disb=".$row_product_kind["pk11"] ); // } $query_product_kind = "select * from products_cate where cid='$mpd01'"; $result_product_kind = mysql_query($query_product_kind); $row_product_kind = mysql_fetch_array($result_product_kind); $mmaxline = 10; if ((!($_GET['f_que']=='')) and (!($_GET['linkact']=='1'))) { $f_que=base64_decode($_GET['f_que']); } //echo $f_que; list($msnum,$mmax_qty)=u_pd_pg_product2(); // 計算頁次 list($msnum,$mmax_qty)=u_pd_pg_product(); // 計算頁次 //echo $msnum.'----'; if(empty($mpd01)) { $mwhere = " where available='Y' "; } else { if(empty($f_que)) { $mwhere = " where class_id='$mpd01' and available='Y' "; } else { $mwhere = " where (provider_id like '%$f_que%' or proname like '%$f_que%' or prodesc like '%$f_que%' or procode like '%$f_que%' or unit like '%$f_que%' or sellingprice like '%$f_que%' or prophotos like '%$f_que%' or mat like '%$f_que%' or color like '%$f_que%' ) and available='Y' "; } } if (!($f_que)){ $tp_index-> newBlock ( "tp_p2_thiskind" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_thiskind.thiskind" , $row_product_kind["class_name"] ); // 產品代號 }else{ $tp_index-> newBlock ( "tp_p2_thiskind" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_thiskind.thiskind" , "搜尋: ".$f_que." 結果" ); // 產品代號 } $query_product = "select * from products $mwhere order by procode limit $msnum,$mmaxline "; //echo $query_product."
"; $result_product = mysql_query($query_product); $totalrecnum = mysql_num_rows($result_product); // 目前總筆數 if ($totalrecnum==0){ $tp_index-> newBlock ( "tp_p2_list_01_nopro" ); // 瀏覽 block } $mnum = 0; $tp_index-> newBlock ( "tp_p2_list" ); // 瀏覽 block while ($row_product = mysql_fetch_array($result_product)) { $tp_index-> newBlock ( "tp_p2_list_01" ); // 瀏覽 block $tp_index-> assign ( "tp_p2_list_01.tp_s_num" , $row_product["s_num"] ); // s_num $tp_index-> assign ( "tp_p2_list_01.tp_pd01" , $row_product["pd01"] ); // 類別代號 $tp_index-> assign ( "tp_p2_list_01.tp_pd02" , $row_product["procode"] ); // 產品代號 $tp_index-> assign ( "tp_p2_list_01.mpd01" , $mpd01 ); // 產品代號 $tp_index-> assign ( "tp_p2_list_01.f_page" , $f_page ); // 產品代號 $tp_index-> assign ( "tp_p2_list_01.tp_pcount" , ($row_product["pageviews"]) ); // 產品代號 $tp_index-> assign ( "tp_p2_list_01.tp_pd03" , $row_product["pd03"] ); // 品牌 $tp_index-> assign ( "tp_p2_list_01.tp_pd04" , StripSlashes($row_product["proname"]) ); // 品名 $tp_index-> assign ( "tp_p2_list_01.tp_pd05" , $row_product["unit"] ); // 規格 $tp_index-> assign ( "tp_p2_list_01.tp_pd06" , $row_product["unit"] ); // 單位 if ($_REQUEST['disb']==''){ $tp_index-> newBlock ( "tp_p2_list_01_01" ); // 瀏覽 block } if ($_REQUEST['disb']=='0'){ $tp_index-> newBlock ( "tp_p2_list_01_01" ); // 瀏覽 block } if ((u_checkal($row_product["pd02"])=='0') and ($row_product["pk11"])==0) { $tp_index-> newBlock ( "tp_p2_list_01_01" ); // 瀏覽 block } if ($_SESSION["muser_vip"]=='Y'){ $tp_index-> assign ( "tp_p2_list_01.tp_pd07" , number_format($row_product["pd07"]*$row_product["pd24"]*0.1)); // 建議售價 if (!($row_product["pd24"]==10)){ $tp_index-> assign ( "tp_vip" , "" ); // 單位 } }else{ $tp_index-> assign ( "tp_p2_list_01.tp_pd07" , number_format($row_product["unit"]) ); // 建議售價 } $tp_index-> assign ( "tp_p2_list_01.tp_pd07_car" , $row_product["pd07"] ); // 建議售價-購物車用 $tp_index-> assign ( "tp_p2_list_01.tp_mat" , $row_product["mat"] ); // 使用方法 $tp_index-> assign ( "tp_p2_list_01.tp_color" , $row_product["color"] ); // 使用方法 $tp_index-> assign ( "tp_p2_list_01.tp_alink" , $row_product["alink"] ); // 使用方法 $tp_index-> assign ( "tp_p2_list_01.tp_unit" , nl2br($row_product["unit"]) ); // 使用方法 $tp_index-> assign ( "tp_p2_list_01.tp_pd08" , $row_product["sellingprice"] ); // 使用方法 $tp_index-> assign ( "tp_p2_list_01.tp_pd09" , $row_product["prodesc"] ); // 產品解說 $tp_index-> assign ( "tp_p2_list_01.tp_pd10" , $row_product["prophotob"] ); // 產品圖檔(小) if (file_exists($row_product["prophotob"])){ list($width, $height, $value, $params) = GetImageSize(($row_product["prophotob"])); $stdwidth=150; $stdheight=800; list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $tp_index-> assign ( "tp_p2_list_01.x" , $width ); // 品名 $tp_index-> assign ( "tp_p2_list_01.y" , $height ); // 品名 } $tp_index-> assign ( "tp_p2_list_01.tp_pd10_big" , "bigimg.php?snum=".$row_product["pid"]."&img=".$row_product["prophotob"] ); // 產品圖檔(大) $tp_index-> assign ( "tp_p2_list_01.tp_pd11" , $row_product["pd11"] ); // 產品圖檔(大) $tp_index-> assign ( "tp_p2_list_01.tp_pd21" , number_format($row_product["pd21"]) ); // 購買紅利 $tp_index-> assign ( "tp_p2_list_01.tp_pd21_car" , $row_product["pd21"] ); // 購買紅利-購物車用 $tp_index-> assign ( "tp_p2_list_01.tp_pd22" , number_format($row_product["pd22"]) ); // 兌換紅利 $tp_index-> assign ( "tp_p2_list_01.tp_pd23" , $row_product["pd23"] ); // 是否上架 $tp_index-> assign ( "tp_p2_list_01.tp_mpd01" , $mpd01 ); // $tp_index-> assign ( "tp_p2_list_01.tp_f_page" , $f_page ); // ////////////////////////////////// 首頁隨機產品 $mnum++; } return; } function u_p7771(){ global $tp_index; global $form; $query_photo = "select * from sys_template where funcid=".$_GET['cateid']." and tpl_name='ptpl_talbe_title' order by tplid desc"; $query_photo = "select * from infocate where cateid=".$_GET['cateid']; //echo $query_photo; $result_photo = mysql_query($query_photo); $row_photo = mysql_fetch_array($result_photo); $tp_index-> newBlock ("tp_ptpl_home_item"); $tp_index-> assign ("home_item",$row_photo["catename"]); ///////////////////////////////////////////////////// $tp_index-> newBlock ( "tp_pagetitle" ); // 瀏覽 block //$tp_index-> assign ( "tp_tour1_title.tp_title" , $row_product_kind_chk["title"] ); // $tp_index-> assign ( "tp_pagetitle.title" , "-".$row_photo["catename"]."-圖片列表" ); // $bigkind=$row_photo["catename"]; ////////////////////////////////////////////////////// $query_photo = "select * from infocate_k where cateid=".$_GET['cateid']." order by up_date desc"; $result_photo = mysql_query($query_photo); $cateid=$_GET['cateid']; $cateid_k=$_GET['cateid_k']; if(empty($_GET['cateid_k'])) { $query_product_kind_chk = "select * from infocate_k where cateid=".$_GET['cateid']." order by up_date desc"; $result_product_kind_chk = mysql_query($query_product_kind_chk); $row_product_kind_chk = mysql_fetch_array($result_product_kind_chk); $cateid_k = $row_product_kind_chk["cateid_k"]; } while ($row_photo = mysql_fetch_array($result_photo)) { $tp_index-> newBlock ("tp_photo_kind_list"); $tp_index-> assign ( "nn1" , "nn1" ); // if ($row_photo["cateid_k"]==$cateid_k){ $tp_index-> assign ( "tp_strong" , "" ); // $tp_index-> assign ( "tp_un_strong" , "" ); // $tp_index-> assign ( "nn1" , "nn118" ); // $nowkind=$row_photo['catename']; } $tp_index-> assign ( "photo_kind_name" , $row_photo['catename'] ); // 訂單日期 $tp_index-> assign ( "photo_kind_link" , "indexmain.php?mmenu=7771&cateid=".$row_photo['cateid']."&cateid_k=".$row_photo['cateid_k'] ); // 訂單日期 } ////////////////////////////////////////////////////////////////////////// // $query_photo2 = "SELECT info.infoid as minfoid,info.infocate, info_k.title,info_k.infoid, info_k.infocatek FROM info INNER JOIN info_k ON info.infoid = info_k.infocate where info.infocate=$cateid and info_k.infocatek=$cateid_k"; $query_photo2 = "SELECT * FROM info where infocate=$cateid and scate=$cateid_k and cshow=2"; $result_photo2 = mysql_query($query_photo2); $photornd=0; //找出工程實績列表 while($row_photo2 = mysql_fetch_array($result_photo2)) { // echo "ff"; // $query_photo22 = "SELECT * FROM info_k where infocate=".$row_photo2['infoid']; // $result_photo22 = mysql_query($query_photo22); $isget=0; // while($row_photo22 = mysql_fetch_array($result_photo22)){ $photo_dir = "data/engineer/" . $row_photo2["infoid"]."/" ; //echo $photo_dir; $current_dir = @opendir($photo_dir); while ($file = @readdir($current_dir)) { if ($file != ".." && $file != "." && $file != "Thumbs.db") { $filelist[$photornd]['filen'] .= $photo_dir.$file; $filelist[$photornd]['title'] .= $row_photo2["title"]; $filelist[$photornd]['rown'] .= $row_photo2["infoid"]; $filelist[$photornd]['idn'] .= $photornd; $photornd++; $isget=1; if ($isget==1){ break;} } } } //找出工程實績列表結束 //print_r($filelist); //exit; if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $photornd=0; if($filelist) { foreach($filelist as $key=>$val) { if (($val['idn']>=$msnum) and ($val['idn']<=($msnum+11))){ $link = $val['filen']; list($width, $height, $value, $params) = GetImageSize($link); //////////////////////////////////// $stdwidth=200; $stdheight=150; //echo $width; list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); // list($width,$height)= htmlresize($width,$height,$stdwidth,$stdheight); $orgvaltitle=$val["title"]; if (mb_strlen($val["title"], 'UTF-8')>255){ $val["title"]=mb_substr(($val["title"]),0,255,"UTF-8").".."; } // width=160 height=120 // $photoshow[$photornd] = "
".$val["title"]."
"; // $photoshow[$photornd] = "
".$row_photo2['title']; // $photornd=$photornd+1; // width=160 height=120 $photoshow[$photornd] = "
TFTF-".$bigkind."-".$nowkind."-".
".$val["title"]."
"; // $photoshow[$photornd] = "
".$row_photo2['title']; $photornd=$photornd+1; } } } $tp_index-> newBlock ("tp_photo_table"); $tp_index-> assign ( "tp_photo_table" , $form->tablegrid($photoshow, 3, "97%", 210, "ffffff", "center $tr_mouse", " align=center cellpadding=3'", "top style='border: 496eb5 1px dotted;'") ); // 訂單日期 $tp_index-> newBlock ( "tp_p4_02" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=7771&cateid=".$_GET['cateid']."&cateid_k=".$_GET['cateid_k'],count($filelist),'','',$msnum,0,'',9) ); } function u_p777(){ global $tp_index; $tablename=$_GET['sname']; $s1='title'; $s2='infoid'; $s3='up_date'; $s4=$_GET['infono']; //$search_info=$_REQUEST['search_info']; if ((($_POST['search_info']))) { $search_info1=($_POST['search_info']); $search_info2=base64_encode($_POST['search_info']); }else{ $search_info1=base64_decode($_GET['search_info']); $search_info2=($_GET['search_info']); } if (($_POST['search_info']=='') and ($_GET['search_info']=='')){ $mwhere=' where infocate='."10".' and cshow=2 '; }else{ $mwhere=" where infocate=10 and cshow=2 and ((title like '%".$search_info1."%') or (contentnohtml like '%".$search_info1."%')) "; } //$mwhere=' where import=1 '; // $query_photo = "select * from sys_template where funcid=".$s4." and tpl_name='ptpl_talbe_title' order by tplid desc"; // echo $query_photo; // $result_photo = mysql_query($query_photo); // $row_photo = mysql_fetch_array($result_photo); $tp_index-> newBlock ("tp_ptpl_talbe_title"); $tp_index-> assign ("talbe_title",$row_photo["tpl_value"]); if ($tablename=='photo_group'){ $s1='group_name'; $s2='photo_group_id'; $s3='up_date'; $mwhere=''; } if ($_GET['offset']==''){ $msnum=0; }else{ $msnum=$_GET['offset']; } $query_photo = "select * from $tablename $mwhere order by up_date desc"; $result_photo = mysql_query($query_photo); $mmax_qty = mysql_num_rows($result_photo); $query_photo = "select * from $tablename $mwhere order by up_date desc limit $msnum,10"; $result_photo = mysql_query($query_photo); while ($row_photo = mysql_fetch_array($result_photo)) { $mmax_qty--; $tp_index-> newBlock ("tp_photo_group_list"); $tp_index-> assign ( "photo_group_name" , $row_photo[$s1] ); // 訂單日期 $tp_index-> assign ( "photo_group_no" , $row_photo["importseq"] ); // 訂單日期 $tp_index-> assign ( "photo_group_date" , substr($row_photo[$s3],0,10) ); // 訂單日期 $tp_index-> assign ( "photo_group_link" , "indexmain.php?mmenu=18000&sid=".$row_photo["infoid"]."&cateid=".$row_photo["infocate"]."&imp=1" ); // 連結 } //if (($_POST['search_info'])) //$search_info=base64_encode($_POST['search_info']); $tp_index-> newBlock ( "tp_p4_02" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=777&sname=".$_GET['sname']."&infono=".$_GET['infono']."&search_info=".$search_info2,$mmax_qty,'','',$msnum,0,'',10) ); } function u_p888(){ global $tp_index; $query_photo = "select * from photo_group order by up_date desc limit 0,10"; $result_photo = mysql_query($query_photo); while ($row_photo = mysql_fetch_array($result_photo)) { $tp_index-> newBlock ("tp_photo_group_list"); $tp_index-> assign ( "photo_group_name" , $row_photo["group_name"] ); // 訂單日期 $tp_index-> assign ( "photo_group_no" , $row_photo["photo_group_id"] ); // 訂單日期 $tp_index-> assign ( "photo_group_date" , substr($row_photo["up_date"],0,9) ); // 訂單日期 } } function u_p7979() { global $mtable_photo; global $mph_path; global $tp_index; global $mtable_product; global $mtable_product_kind; global $mpd_path; global $tp_index; global $f_que; global $f_page; global $mpd01; global $pid; // list($msnum,$mmax_qty)=u_pd_pg_photo(); // 計算頁次 // list($msnum,$mmax_qty)=u_pd_pg_product(); // 計算頁次 // echo $mmax_qty.'----'; $mwhere = "pd02='".$_GET['pid']."' and d_date='0000-00-00 00:00:00'"; if ($_GET['pid']=="") { $tp_index-> newBlock ( "tp_p3_list" ); $tp_index-> newBlock ( "tp_p3_list_01" ); // 瀏覽 block $tp_index-> assign ( "uname" , $_SESSION["muser_name"] ); // 訂單日期 $tp_index-> assign ( "telno" , $_SESSION["muser_phone"] ); // 訂單日期 $tp_index-> assign ( "email" , $_SESSION["muser_email"] ); // 訂單日期 } $mmaxline=9; $query_photo = "select * from $mtable_product where $mwhere order by pd02 "; // $query_photo = "select * from $mtable_photo // where d_date='0000-00-00 00:00:00' // order by s_num desc // limit $msnum,8 // "; //echo $query_photo."
"; $result_photo = mysql_query($query_photo); $mnum = 0; $tp_index-> newBlock ( "tp_p3_list" ); // 瀏覽 block while ($row_photo = mysql_fetch_array($result_photo)) { // $tp_index-> newBlock ( "tp_p3_list_01" ); // 瀏覽 block // $tp_index-> assign ( "tp_p3_list_01.tp_s_num" , $row_photo["s_num"] ); // 產品代號 // $tp_index-> assign ( "tp_p3_list_01.tp_ph01" , $row_photo["ph01"] ); // 產品代號 // $tp_index-> assign ( "tp_p3_list_01.tp_ph02" , $row_photo["ph02"] ); // 產品名稱 // $tp_index-> assign ( "tp_p3_list_01.tp_ph03" , $row_photo["ph03"] ); // 圖片說明 // $tp_index-> assign ( "tp_p3_list_01.tp_ph04" , $row_photo["ph04"] ); // 照片檔 // $tp_index-> assign ( "tp_p3_list_01.tp_ph04_link" , $mph_path.$row_photo["ph04"] ); // 檔案名稱連結 // $tp_index-> assign ( "tp_p3_list_01.tp_link" , u_showproc().".php?mmenu=31&ms_num=".$row_photo[s_num] ); // 連結資料 $tp_index-> newBlock ( "tp_p3_list_01" ); // 瀏覽 block $tp_index-> assign ( "uname" , $_SESSION["muser_name"] ); // 訂單日期 $tp_index-> assign ( "telno" , $_SESSION["muser_phone"] ); // 訂單日期 $tp_index-> assign ( "email" , $_SESSION["muser_email"] ); // 訂單日期 $tp_index-> assign ( "tp_p3_list_01.tp_s_num" , $row_photo["s_num"] ); // s_num $tp_index-> assign ( "tp_p3_list_01.tp_pd01" , $row_photo["pd01"] ); // 類別代號 $tp_index-> assign ( "tp_p3_list_01.tp_pd02" , $row_photo["pd02"] ); // 產品代號 $tp_index-> assign ( "tp_p3_list_01.tp_pcount" , ($row_photo["pd25"]) ); // 產品代號 $tp_index-> assign ( "tp_p3_list_01.mpd01" , ($_GET["mpd01"]) ); // 產品代號 $tp_index-> assign ( "tp_p3_list_01.tp_pd03" , $$row_photo["pd03"] ); // 品牌 $tp_index-> assign ( "tp_p3_list_01.tp_pd04" , StripSlashes($row_photo["pd04"]) ); // 品名 $tp_index-> assign ( "tp_p3_list_01.tp_pd05" , $row_photo["pd05"] ); // 規格 $tp_index-> assign ( "tp_p3_list_01.tp_pd06" , $row_photo["pd06"] ); // 單位 $tp_index-> assign ( "tp_p3_list_01.tp_pd07" , $row_photo["pd07"] ); // 單位 $tp_index-> assign ( "tp_p3_list_01.tp_pd07_car" , $row_photo["pd07"] ); $tp_index-> assign ( "tp_p3_list_01.tp_pd08" , StripSlashes($row_photo["pd08"]) ); // 使用方法 $tp_index-> assign ( "tp_p3_list_01.tp_pd09" , StripSlashes($row_photo["pd09"]) ); // 產品解說 //$tp_index-> assign ( "tp_p22_list_01.tp_pb10" , $row_product_bonus["pb10"] ); // 產品圖檔(小) $tp_index-> assign ( "tp_p3_list_01.tp_pd10" , $mpb_path.'s-'.$row_photo["pd10"] ); // 產品圖檔(小) $tp_index-> assign ( "tp_p3_list_01.tp_pd10_big" , $mpb_path.$row_photo["pd10"] ); // 檔案名稱連結 $tp_index-> assign ( "tp_p3_list_01.tp_pd10_link" , $mpb_path.$row_photo["pd10"] ); // 檔案名稱連結 $tp_index-> assign ( "tp_p3_list_01.tp_pd11" , $row_photo["pd11"] ); // 產品圖檔(大) $tp_index-> assign ( "tp_p3_list_01.tp_pd11_link" , $mpb_path.$row_photo["pd11"] ); // 檔案名稱連結 $tp_index-> assign ( "tp_p3_list_01.tp_pd21" , $row_photo["pd21"] ); // 購買紅利 $tp_index-> assign ( "tp_p3_list_01.tp_pd22" , number_format($row_photo["pd22"]) ); // 兌換紅利 $tp_index-> assign ( "tp_p3_list_01.tp_pd22_car" , $row_photo["pd22"] ); // 兌換紅利-購物車用 $tp_index-> assign ( "tp_p3_list_01.tp_pd23" , $row_photo["pd23"] ); // 是否上架 $tp_index-> assign ( "tp_p3_list_01.tp_bonus" , $f_bonus ); // 依紅利點查詢紅利獎品 $mnum++; if($mnum%3==0) { // 換下一行 $tp_index-> newBlock ( "tp_p3_list" ); // 瀏覽 block } } //ECHO ($mnum)."G"; //ECHO ($mnum%3); for($i=1;$i<(4-($mnum%3));$i++){ $tp_index-> newBlock ( "tp_p3_list_02" ); // 瀏覽 block } ; return; } ////////////////////// ////////////////////////// function u_p922() { global $tp_index; $tp_index-> newBlock ( "tp_p6_in_01" ); // 瀏覽 block return; } ////////////////////////////////////////////////////// function function_result($query) { $sql_table = "twcityor_macrocosm"; //echo $sql_table; //mysql_connect("localhost","twcityor_macro","18143260"); mysql_connect("localhost","hengyi","H18143260i"); //mysql_connect("localhost","root",""); mysql_select_db($sql_table); $result = mysql_query($query); $row_nums = @mysql_num_rows($result); $field_nums = @mysql_num_fields($result); if($row_nums==0) { return $result; } else { return $result; } } function u_p101() { if ($_SESSION["muser_id"]=="" ) { ?> newBlock ( "tp_out_01_01" ); // 輸出瀏覽畫面 $tp_index-> assign ( "tp_om01" ,$row[foid] ); // 首筆 $tp_index-> assign ( "tp_om02" , $row[up_date] ); // 首筆 if ($row['orderstatus']==1) { $orderstatus="新訂單";} if ($row['orderstatus']==2) { $orderstatus="訂單接受";} if ($row['orderstatus']==3) { $orderstatus="訂單完成";} if ($row['orderstatus']==4) { $orderstatus="訂單取消";} if ($row['orderstatus']=='') { $orderstatus="訂單錯誤";} $tp_index-> assign ( "tp_om09" , $orderstatus ); // 首筆 $tp_index-> assign ( "tp_om08" , $row[amount] ); // 首筆 $tp_index-> assign ( "tp_om06" , $row[freight] ); // 首筆 $array_proid = explode(",",$row[pro_id]); $array_pice = explode(",",$row[price]); $array_nums = explode(",",$row[qty]); $array_unit = explode(",",$row[unit]); $i = 1; $sub_total= 0; for($j=0; $j newBlock ("tp_out_01_01_01"); // 輸出瀏覽畫面 // $tp_index-> assign ("tp_class" , $mclass); // class $query_proname="select proname from products where procode='$array_proid[$j]' "; list($proname) = mysql_fetch_row(function_result($query_proname)); $tp_index-> assign ("tp_od02" , $array_proid[$j]); // class $tp_index-> assign ("tp_od04" , $proname); // class $tp_index-> assign ("tp_od05" , $array_pice[$j]); // class $tp_index-> assign ("tp_od06" , $array_nums[$j]); // class $tp_index-> assign ("tp_od07" , $array_unit[$j]); // class $tp_index-> assign ("tp_od09" , ($array_pice[$j] * $array_nums[$j])); // class $i++; } } // exit; $tp_index-> newBlock ( "tp_p4_02" ); // 瀏覽 block $tp_index-> assign ( "spage" , html_page("indexmain.php?mmenu=101",$mmax_qty,'','',$msnum,0,'',8) ); } ///////////////////////////////////////////////// ///////////////////////////////////////////////////// function u_p10111111() { if ($_SESSION["muser_id"]=="" ) { ?> "; $result_order_main = mysql_query($query_order_main); $row_order_main = mysql_fetch_array($result_order_main); if($vsel=='4'||$vsel=='51') { // 瀏覽 or 查詢 } else { $tp_index-> newBlock ( "tp_in_01" ); // 輸入畫面-確定按鈕 } if ($row_order_main["om11"]==1){ $mmb111 = "郵政劃撥"; // 付款法 $sel1="selected"; } if ($row_order_main["om11"]==2){ $mmb111 = "電匯"; // 付款法 $sel2="selected"; } if ($row_order_main["om11"]==3){ $mmb111= "貨到付款"; // 付款法 $sel3="selected"; } $tp_index-> assign ( "tp_in_01.tp_width1" , "15%" ); // $tp_index-> assign ( "tp_in_01.tp_width2" , "85%" ); // $tp_index-> assign ( "tp_in_01.tp_action" , u_showproc().".php?msel=".$vsel."1" ); // form action $tp_index-> assign ( "tp_in_01.tp_date" , date("Ymd") ); // 公佈欄日期 $tp_index-> assign ( "tp_in_01.tp_s_num" , $row_order_main["s_num"] ); // 流水號 $tp_index-> assign ( "tp_in_01.tp_om01" , $row_order_main["om01"] ); // 訂單編號 $tp_index-> assign ( "tp_in_01.tp_om02" , $row_order_main["om02"] ); // 訂單日期 $tp_index-> assign ( "tp_in_01.tp_om03" , $row_order_main["om03"] ); // 會員帳號 $tp_index-> assign ( "tp_in_01.tp_om04" , $row_order_main["om04"] ); // 會員姓名 $tp_index-> assign ( "tp_in_01.tp_om05" , $row_order_main["om05"] ); // 總數量 $tp_index-> assign ( "tp_in_01.tp_om06" , $row_order_main["om06"] ); // 運費 $tp_index-> assign ( "tp_in_01.tp_om07" , $row_order_main["om07"] ); // 折扣 $tp_index-> assign ( "tp_in_01.tp_om08" , $row_order_main["om08"] ); // 總金額 $tp_index-> assign ( "tp_in_01.tp_om09" , $row_order_main["om09"] ); // 狀態 $tp_index-> assign ( "tp_in_01.tp_oom09" , $row_order_main["om09"] ); // 狀態-紀錄修改前的資料 $tp_index-> assign ( "tp_in_01.tp_om10" , $row_order_main["om10"] ); // 備註 $tp_index-> assign ( "sel1" , $sel1 ); // 付款法 $tp_index-> assign ( "sel2" , $sel2 ); // 付款法 $tp_index-> assign ( "sel3" , $sel3 ); // 付款法 if($vsel==1||$vsel==2||$vsel==3) { // 1=新增、2=修改、3=刪除 $tp_index-> newBlock ( "tp_in_01_01" ); // 輸入畫面-確定按鈕 $tp_index-> assign ( "tp_btn_str" , $vbtn_str ); // 確定 botton 的文字 } if($vsel=='4'||$vsel=='51') { // 瀏覽 or 查詢 if($vque==NULL) { $mwhere = "d_date='0000-00-00 00:00:00'"; } else { $mwhere = "(om01 like '%$vque%' or om02 like '%$vque%' or om03 like '%$vque%' or om04 like '%$vque%') and d_date='0000-00-00 00:00:00' "; } if(!empty($f_om09)) { $mwhere .= "and om09='$f_om09' and d_date='0000-00-00 00:00:00'"; } if($vque1=='1') { $mwhere .= " and om09='1' and d_date='0000-00-00 00:00:00'"; } $mwhere.=" and om03='".$_SESSION["muser_id"]."' "; $query_order_main1 = "select * from $mtable_order_main where $mwhere order by om01 desc "; // echo $query_order_main1.'
'; $result_order_main = mysql_query($query_order_main1); $mstock_qty = mysql_num_rows($result_order_main); // 目前總筆數 $msnum = ($f_page*$mmaxline)-$mmaxline; // 起始比數 $mpagetot = floor(((($mmaxline-1)+$mstock_qty)/$mmaxline)); // 求整數,最大頁次 if($f_page==1) { // 首頁,不可再往上 $mup_page = $f_page; } else { $mup_page = $f_page-1; } if($f_page==$mpagetot) { // 末頁,不可再往上 $mdn_page = $f_page; } else { $mdn_page = $f_page+1; } $query_order_main1 = "select * from $mtable_order_main where $mwhere order by om01 desc limit $msnum,$mmaxline "; //echo $query_order_main1."
"; $result_order_main1 = mysql_query($query_order_main1); $mnum = 1; $tp_index-> newBlock ( "tp_out_01" ); // 輸出瀏覽畫面 $tp_index-> assign ( "tp_top_page" , u_showproc().".php?msel=".$vsel."&f_page=1&f_que=".$vque ); // 首筆 $tp_index-> assign ( "tp_up_page" , u_showproc().".php?msel=".$vsel."&f_page=".$mup_page."&f_que=".$vque ); // 上頁 $tp_index-> assign ( "tp_dn_page" , u_showproc().".php?msel=".$vsel."&f_page=".$mdn_page."&f_que=".$vque ); // 下頁 $tp_index-> assign ( "tp_bot_page" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_que=".$vque ); // 末筆 $tp_index-> assign ( "tp_page" , number_format($f_page) ); // 目前頁次 $tp_index-> assign ( "tp_maxpage" , number_format($mpagetot) ); // 總頁次 $tp_index-> assign ( "tp_reccount" , number_format($mstock_qty) ); // 資料筆數 $tp_index-> assign ( "tp_link_om09_0" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_om09=&f_que=".$vque ); // 0.全部 $tp_index-> assign ( "tp_link_om09_1" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_om09=1&f_que=".$vque ); // 1.處理中 $tp_index-> assign ( "tp_link_om09_2" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_om09=2&f_que=".$vque ); // 2.送貨中 $tp_index-> assign ( "tp_link_om09_3" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_om09=3&f_que=".$vque ); // 3.已完成 $tp_index-> assign ( "tp_link_om09_4" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_om09=4&f_que=".$vque ); // 4.已退貨 $tp_index-> assign ( "tp_link_om09_5" , u_showproc().".php?msel=".$vsel."&f_page=".$mpagetot."&f_om09=5&f_que=".$vque ); // 5.已作廢 $mdetail_cnt = 0; // 單身筆數 if (mysql_num_rows($result_order_main1)==0) { $tp_index-> newBlock ( "tp_out_01_019" ); // 輸出瀏覽畫面 } while ($row_order_main1 = mysql_fetch_array($result_order_main1)) { $tp_index-> newBlock ( "tp_out_01_01" ); // 輸出瀏覽畫面 // Mark by Tony 主檔用一種顏色 //if($mnum%2==0) { // $mclass = "value_color"; //} //else { // $mclass = ""; //} $mclass = "value_color"; $tp_index-> assign ( "tp_class" , $mclass ); // class $tp_index-> assign ( "tp_om01" , $row_order_main1["om01"] ); // 訂單編號 //$tp_index-> assign ( "tp_om02" , $row_order_main1["om02"] ); // 訂單日期 $tp_index-> assign ( "tp_userid" , $_SESSION["muser_id"] ); // 訂單日期 $tp_index-> assign ( "tp_om02" , substr($row_order_main1["om02"],5,5) ); // 訂單日期 $tp_index-> assign ( "tp_om03" , $row_order_main1["om03"] ); // 會員帳號 $tp_index-> assign ( "tp_om04" , $row_order_main1["om04"] ); // 會員姓名 $tp_index-> assign ( "tp_om05" , number_format($row_order_main1["om05"]) ); // 總數量 $tp_index-> assign ( "tp_om06" , number_format($row_order_main1["om06"]) ); // 運費 $tp_index-> assign ( "tp_om07" , number_format($row_order_main1["om07"]) ); // 折扣 $tp_index-> assign ( "tp_om08" , number_format($row_order_main1["om08"]) ); // 總金額 $tp_index-> assign ( "tp_om09" , u_od_statu($row_order_main1["om09"]) ); // 狀態 $tp_index-> assign ( "tp_om10" , $row_order_main1["om10"] ); // 備註 $tp_index-> assign ( "tp_link" , u_showproc().".php?msel=41&ms_num=".$row_order_main1["s_num"]."&f_page=".$f_page."&f_que=".$vque ); // 連結修改資料 $tp_index-> assign ( "tp_link_upd" , u_showproc().".php?msel=2&ms_num=".$row_order_main1["s_num"]."&f_page=".$f_page."&f_que=".$vque ); // 連結修改資料 if("1"==$row_order_main1["om09"]) { // 1.處理中,才可以刪除資料 $tp_index-> assign ( "tp_link_del" , u_showproc().".php?msel=3&ms_num=".$row_order_main1["s_num"]."&f_page=".$f_page."&f_que=".$vque ); // 連結修改資料 } else { $tp_index-> assign ( "tp_link_del" , "javascript:alert('狀態不是【1.處理中】,不可以刪除。');" ); // 連結刪除資料 } $mnum++; $query_order_detail = "select * from $mtable_order_detail where od01='$row_order_main1[om01]' and d_date='0000-00-00 00:00:00' order by od01 "; //echo $query_order_detail."
"; $result_order_detail = mysql_query($query_order_detail); $mclass = "value_color"; $mdetail_num = 1; // 單身筆數 while ($row_order_detail = mysql_fetch_array($result_order_detail)) { $tp_index-> newBlock ( "tp_out_01_01_01" ); // 輸出瀏覽畫面 $tp_index-> assign ( "tp_class" , $mclass ); // class $tp_index-> assign ( "tp_num" , $mdetail_num ); // 序 $tp_index-> assign ( "tp_od01" , $row_order_detail["od01"] ); // 訂單編號 $tp_index-> assign ( "tp_od02" , $row_order_detail["od02"] ); // 產品代號 $tp_index-> assign ( "tp_od03" , $row_order_detail["od03"] ); // 品牌 $tp_index-> assign ( "tp_od04" , $row_order_detail["od04"] ); // 品名 $tp_index-> assign ( "tp_od05" , number_format($row_order_detail["od05"]) ); // 單價 $tp_index-> assign ( "tp_od06" , number_format($row_order_detail["od06"]) ); // 數量 $tp_index-> assign ( "tp_od07" , $row_order_detail["od07"] ); // 規格 $tp_index-> assign ( "tp_od08" , $row_order_detail["od08"] ); // 單位 $tp_index-> assign ( "tp_od09" , number_format($row_order_detail["od09"]) ); // 小計 $tp_index-> assign ( "tp_od10" , number_format($row_order_detail["od10"]) ); // 紅利 $tp_index-> assign ( "tp_od11" , $row_order_detail["od11"] ); // 備註 $tp_index-> assign ( "tp_link" , "order_detail.php?msel=41&ms_num=".$row_order_detail["s_num"]."&f_page=".$f_page."&f_que=".$vque ); // 連結修改資料 $tp_index-> assign ( "tp_link_upd" , "order_detail.php?msel=2&ms_num=".$row_order_detail["s_num"]."&f_page=".$f_page."&f_que=".$vque ); // 連結修改資料 //echo $row_order_main1["om09"].'---'; if("1"==$row_order_main1["om09"]) { // 1.處理中,才可以刪除資料 $tp_index-> assign ( "tp_link_del" , "order_detail.php?msel=3&ms_num=".$row_order_detail["s_num"]."&f_page=".$f_page."&f_que=".$vque ); // 連結修改資料 } else { $tp_index-> assign ( "tp_link_del" , "javascript:alert('狀態不是【1.處理中】,不可以刪除。');" ); // 連結刪除資料 } $mdetail_num++; $mdetail_cnt++; } } $tp_index-> assign ( "tp_out_01.tp_detail_cnt", number_format($mdetail_cnt) ); // 明細資料筆數 } return; } ///////////////////////////////////////////////// function u_checkal($pid) { $query_company="SELECT product.*, product_kind.* FROM product_kind INNER JOIN product ON product_kind.pk01 = product.pd01 where pd02='$pid' "; //echo $query_company; $result_company = mysql_query($query_company); $row_company = mysql_fetch_array($result_company); return($row_company["pk11"]); } function logout() { // session_cache_limiter("nocache"); // session_start(); $mbase_path = 'indexmain.php'; include_once($mbase_path.'zi_init.php'); // 共用自訂函數與變數設定 setcookie("member_userid", ""); session_destroy(); // 移除所有 session] echo ""; } ///////////////////////////////// function loginprocess(){ global $link; $msel = $_REQUEST["msel"]; $login_id = $_POST["login_id"]; $login_pw = $_POST["login_pw"]; $query= db_query("select member_userid,member_nickname,mkind from member where member_userid='$login_id' and password='".$login_pw."'", $link); list ($member_userid, $member_nickname,$mkind) = db_fetch_row($query); if ($member_userid) { setcookie("member_userid", $member_userid); setcookie("member_nickname", $member_nickname); if ($_SERVER["QUERY_STRING"]) { $query_string = array (); foreach ($_GET as $k => $v) { $query_string[] = "$k=$v"; } $QUERY_STRING = implode("&", $query_string); $QUERY_STRING = ($QUERY_STRING) ? "./?$QUERY_STRING" : "./"; } echo ""; exit; } else { $mgo_url = "../indexmain.php"; $mmsg = '登入失敗!!!請重新登入!!!'; $mmsg_ng_num = '289503'; ?> newBlock ( "tp_p1_bmusic" ); // 瀏覽 block $tp_index-> assign ( "bmusic" , "images/".$row_company["cp11"] ); // } ////////////////////////////////////////////// function u_p6609() { global $mservermail; $mservermail="tftf@tftf.com.tw"; $msubject = '意見詢問'; // 標題 $msubject = "=?UTF-8?B?" . base64_encode($msubject) . "?="; $mexdata = "Content-Type:text/html;charset=utf-8\n"; $mexdata .= "From:".$mservermail."\nReply-To:".$mservermail; $mbody = '
';
               $mbody .= '謝謝您的詢問,您的詢問單明細如下..'."\n\n";
             //  $mbody .= '詢問單編號:'.$mom01."\n";
               $mbody .= '公司:'.StripSlashes($_POST["f_mb05222"])."\n"; 
               $mbody .= '職稱:'.StripSlashes($_POST["f_mb052"])."\n"; 
			   $mbody .= '您的稱呼:'.StripSlashes($_POST["f_mb02"])."\n"; 
			   $mbody .= '電話:'.StripSlashes($_POST["f_mb05"])."\n"; 
 			   $mbody .= '電子郵件:'.StripSlashes($_POST["f_email"])."\n"; 
			   $mbody .= '意見:'.StripSlashes($_POST["f_mb17"])."\n";
			   //$mto       = 'loung-yeen@umail.hinet.net';
		      //$mto       = 'loung-yeen@loungyeen.com.tw;loung-yeen@umail.hinet.net;tftf@tftf.com.tw;ang1l@mail2000.com.tw';
			       $mto       = 'tftf@tftf.com.tw';  
				  
			 $mcar_msg = '謝謝您! 您的意見已送出,請敬待我們回覆!!';
                  $mgo_url = "indexmain.php"; 	 
				  
				  
      if(!mail( $mto , $msubject , $mbody , "$mexdata")) {
	  
	   $mcar_msg = '詢問單送出失敗...請聯絡網管人員!!';
                  $mgo_url = "indexmain.php"; 
	  
	  }
?>			   

			    newBlock (  "tp_randhome1"  ); // 瀏覽 block
		 $tp_index-> assign   (  "randhome1_link"       , u_showproc().".php?mmenu=2&mpd01=".$mpd01."&f_page=1&f_que=".$row_company["pd02"]."&linkact=1"               ); //
		 $tp_index-> assign   (  "randhome1_name"       , $row_company["pd04"]             ); //
		 $tp_index-> assign   (  "randhome1_pic"       , $mpb_path.'pd/s-'.$row_company["pd10"]             ); //
		      $tp_index-> assign   (  "randhome_alt"       , $row_company["pd04"]             ); //


	 $row_company = mysql_fetch_array($result_company);
	 
	     $tp_index-> newBlock (  "tp_randhome2"  ); // 瀏覽 block
		 $tp_index-> assign   (  "randhome1_link"       , u_showproc().".php?mmenu=2&mpd01=".$mpd01."&f_page=1&f_que=".$row_company["pd02"]."&linkact=1"                ); //
		 $tp_index-> assign   (  "randhome1_name"       , $row_company["pd04"]             ); //
		 $tp_index-> assign   (  "randhome1_pic"       , $mpb_path.'pd/s-'.$row_company["pd10"]             ); //
              $tp_index-> assign   (  "randhome_alt"       , $row_company["pd04"]             ); //

		 
		 
    $row_company = mysql_fetch_array($result_company);
	 
	     $tp_index-> newBlock (  "tp_randhome3"  ); // 瀏覽 block
		 $tp_index-> assign   (  "randhome1_link"       , u_showproc().".php?mmenu=2&mpd01=".$mpd01."&f_page=1&f_que=".$row_company["pd02"]."&linkact=1"                ); //
		 $tp_index-> assign   (  "randhome1_name"       , $row_company["pd04"]             ); //
		 $tp_index-> assign   (  "randhome1_pic"       , $mpb_path.'pd/s-'.$row_company["pd10"]             ); //
	     $tp_index-> assign   (  "randhome_alt"       , $row_company["pd04"]             ); //

	 
	 
	 


}

////////////////////////////////////////////////////////////////////////////////////


function u_p7724() {
  //echo "ggg";
     global $mtable_company;
     global $mimg_path;
     global $tp_index;
    global $mtable_product;
	global $mpd_path;
	 

     $query_company  = "select * from $mtable_product where d_date='0000-00-00 00:00:00' order by pd25 desc";

     //echo $query_company.'--------------';

     $result_company = mysql_query($query_company);

     $row_company = mysql_fetch_array($result_company);
	 
	     $tp_index-> newBlock (  "tp_randhome4"  ); // 瀏覽 block
		 $tp_index-> assign   (  "randhome1_link"       , u_showproc().".php?mmenu=2&mpd01=".$mpd01."&f_page=1&f_que=".$row_company["pd02"]."&linkact=1"              ); //
		 $tp_index-> assign   (  "randhome1_name"       , $row_company["pd04"]             ); //
		 $tp_index-> assign   (  "randhome1_pic"       , $mpb_path.'pd/s-'.$row_company["pd10"]             ); //
         $tp_index-> assign   (  "randhome_alt"       , $row_company["pd04"]             ); //

		 
	 $row_company = mysql_fetch_array($result_company);
	 
	     $tp_index-> newBlock (  "tp_randhome5"  ); // 瀏覽 block
		 $tp_index-> assign   (  "randhome1_link"       , u_showproc().".php?mmenu=2&mpd01=".$mpd01."&f_page=1&f_que=".$row_company["pd02"]."&linkact=1"                ); //
		 $tp_index-> assign   (  "randhome1_name"       , $row_company["pd04"]             ); //
		 $tp_index-> assign   (  "randhome1_pic"       , $mpb_path.'pd/s-'.$row_company["pd10"]             ); //
         $tp_index-> assign   (  "randhome_alt"       , $row_company["pd04"]             ); //

	 


}




function u_p12_2_2() {

     global $tp_index;
     global $link; 

  $query_product = "select * from info
                                 where infocate=46";

//echo $query_product;
     $result_product = mysql_query($query_product);
     $mnum = 0;
      while ($row_product = mysql_fetch_array($result_product)) {

	        $photolist="";
            $tp_index-> newBlock (  "tp_2_4"  ); // 瀏覽 block
			$tp_index-> assign   (  "title"     , ($row_product["title"])                    ); // s_num
			$tp_index-> assign   (  "progressday1"     , ($row_product["progressday1"])                    ); // s_num
			$tp_index-> assign   (  "recdep"     , ($row_product["recdep"])                    ); // s_num
			$tp_index-> assign   (  "recdate"     , ($row_product["recdate"])                    ); // s_num
			$tp_index-> assign   (  "addtext1"     , ($row_product["addtext1"])                    ); // s_num
            $tp_index-> assign   (  "up_date"     , ($row_product["up_date"])                    ); // s_num

	   
			unset($filelist);
	   	$photo_dir = "data/infofile/" . $row_product["infoid"] ;
			$current_dir = @opendir($photo_dir);
			while ($file = @readdir($current_dir)) {
			   if ($file != ".." && $file != "." && $file != "Thumbs.db") {
				   $filelist[] .= $file;
				
			   }
			}
		
			
           $tp_index-> assign   (  "file"     , $photo_dir."/".$filelist[0]                   ); // s_num
			
			
	}
	$mnum++;
     return;
  }
  


function u_p12_2_1() {

     global $tp_index;
     global $link; 

  $query_product = "select * from info
                                 where infocate=45";

//echo $query_product;
     $result_product = mysql_query($query_product);
     $mnum = 0;
      while ($row_product = mysql_fetch_array($result_product)) {

	        $photolist="";
            $tp_index-> newBlock (  "tp_2_4_1"  ); // 瀏覽 block
			$tp_index-> assign   (  "title"     , ($row_product["title"])                    ); // s_num
			$tp_index-> assign   (  "progressday1"     , ($row_product["progressday1"])                    ); // s_num
			$tp_index-> assign   (  "recdep"     , ($row_product["recdep"])                    ); // s_num
			$tp_index-> assign   (  "recdate"     , ($row_product["recdate"])                    ); // s_num
			$tp_index-> assign   (  "addtext1"     , ($row_product["addtext1"])                    ); // s_num
            $tp_index-> assign   (  "up_date"     , ($row_product["up_date"])                    ); // s_num

	   
			unset($filelist);
	   	$photo_dir = "data/infofile/" . $row_product["infoid"] ;
			$current_dir = @opendir($photo_dir);
			while ($file = @readdir($current_dir)) {
			   if ($file != ".." && $file != "." && $file != "Thumbs.db") {
				   $filelist[] .= $file;
				
			   }
			}
		
			
           $tp_index-> assign   (  "file"     , $photo_dir."/".$filelist[0]                   ); // s_num
			
			
	}
	$mnum++;
     return;
  }
  




///////////////////////////////////////////////////////////////////////////////////



  // **************************************************************************
  //  函數名稱: u_p1()
  //  函數功能: 關於忠山茗硯藝坊
  //  使用方式: u_p1()
  //  程式設計: Tony
  //  設計日期: 2004.11.07
  // **************************************************************************


  function u_p_counter() {
     global $mtable_company;
     global $mimg_path;
     global $tp_index;

     $query_company  = "select * from counter
                        ";



     $result_company = mysql_query($query_company);
 $row_company = mysql_fetch_array($result_company);
    
     $tp_index-> newBlock (  "tp_counter"  ); // 瀏覽 block
     $tp_index-> assign   (  "count"       ,$row_company["count"]           ); //
    




     return;
  }

  













  function u_p1() {
     global $mtable_company;
     global $mimg_path;
     global $tp_index;

     $query_company  = "select * from $mtable_company
                                 where s_num = '1' 
                                 order by s_num
                        ";

     //echo $query_company.'--------------';

     $result_company = mysql_query($query_company);

     $row_company = mysql_fetch_array($result_company);
     $mcp01 = str_replace("\r\n","
",$row_company["cp01"]); $mcp02 = str_replace("\r\n","
",$row_company["cp02"]); $mcp03 = str_replace("\r\n","
",$row_company["cp03"]); $mcp04 = str_replace("\r\n","
",$row_company["cp04"]); //echo $row_company["cp02"]; $tp_index-> newBlock ( "tp_p1_list" ); // 瀏覽 block $tp_index-> assign ( "tp_cp01" , StripSlashes($row_company["cp01"]) ); // $tp_index-> assign ( "tp_cp02" , StripSlashes($mcp02) ); // $tp_index-> assign ( "tp_cp03" , StripSlashes($mcp03) ); // $tp_index-> assign ( "tp_cp04" , StripSlashes($mcp04) ); // $tp_index-> assign ( "tp_cp10" , $mimg_path."s-".$row_company["cp10"] ); // 照片1連結 return; } function u_fulltext(){ global $tp_index; $infoarray=array("15"=>"財務報表","10"=>"最新消息","15"=>"認可基準","37"=>"認可規定","8"=>"業務內容","8"=>"訓練講習","20"=>"設備公告欄","3"=>"訓練講習","4"=>"消防設計監造檢修","77"=>"表格與檔案下載","17"=>"認可基準","332"=>"相關網站","1"=>"組織架構"); $infolinkarray=array("15"=>"財務報表","10"=>"1-1-1","15"=>"認可基準","37"=>"認可規定","8"=>"業務內容","8"=>"訓練講習","20"=>"設備公告欄","3"=>"5-4-1","4"=>"6-1","77"=>"13-1","17"=>"4-4","332"=>"9-1","1"=>"2-1"); //print_r($infoarray); $keyword= $_POST['keyword']; $ii=1; if (mb_strlen($keyword,'UTF-8')<1){ echo " "; $tp_index-> newBlock ( "tp_fulltext_count" ); // 瀏覽 block $tp_index-> assign ( "tp_count" , 0 ); // s_num return; } $keyword=mb_str_replace(" "," ",$keyword,"UTF-8"); $keyword=mb_str_replace(" "," ",$keyword,"UTF-8"); $keyword=mb_str_replace(" "," ",$keyword,"UTF-8"); $keyword=mb_str_replace(" "," ",$keyword,"UTF-8"); $keyword=mb_str_replace(" "," ",$keyword,"UTF-8"); $keyword=mb_str_replace(" "," ",$keyword,"UTF-8"); $keywordarray=explode(" ",$keyword); // for ($mx=0;$mx".$row_product_kindc['infocate1'].$infoarray[$row_product_kindc['infocate']]."=>".mb_substr($row_product_kindc['title'],0,20,"UTF-8")."=>".mb_substr($row_product_kindc['contentnohtml'],$minpos,38,"UTF-8")); $fullrow[$ii][1]=mb_str_replace($keyword,"".$keyword."",$fullrow[$ii][1],"UTF-8"); $fullrow[$ii][2]="indexmain.php?mmenu=".$infolinkarray[$row_product_kindc['infocate']]."&sum=".$row_product_kindc["infoid"]; $fullrow[$ii][3]=$row_product_kindc['infocate']; $ii++; $spos=$inpos+2; } ////////////////////////////////////////////////////// $qstr="(info.contentnohtml like '%".$keywordarray[0]."%' or info.title like '%".$keywordarray[0]."%')"; //} $query_product_kind_chkc = "select * from info where $qstr order by infocate"; $result_product_kind_chkc = mysql_query($query_product_kind_chkc); while($row_product_kindc = mysql_fetch_array($result_product_kind_chkc)) { $spos=0; $inpos=mb_strpos($row_product_kindc["contentnohtml"],$keyword,$spos,"UTF-8"); $inpos=mb_strpos($row_product_kindc["contentnohtml"],$keyword,$spos,"UTF-8"); if ($inpos<15){ $minpos=0;} else { $minpos=$inpos-15; } $fullrow[$ii][1]=($ii.".".$row_product_kindc['infocate1'].$infoarray[$row_product_kindc['infocate']]."=>".mb_substr($row_product_kindc['title'],0,10,"UTF-8")."=>".mb_substr($row_product_kindc['contentnohtml'],$minpos,38,"UTF-8")); $fullrow[$ii][1]=mb_str_replace($keyword,"".$keyword."",$fullrow[$ii][1],"UTF-8"); $fullrow[$ii][2]="indexmain.php?mmenu=1-1-1&sum=".$row_product_kindc["infoid"]; $fullrow[$ii][3]=$row_product_kindc['infocate']; $ii++; $spos=$inpos+2; } ////////////////////////////////////////////////////// for ($mx=0;$mx".$row_product_kindc["infocate1"].$infoarray[$row_product_kindc["infocate"]]."=>".mb_substr($row_product_kindc[16],0,10,"UTF-8")."=>".mb_substr($row_product_kindc[10],$minpos,20,"UTF-8")); $fullrow[$ii][1]=mb_str_replace($keyword,"".$keyword."",$fullrow[$ii][1],"UTF-8"); //if ($row_product_kindc["infocate"]==1) //$fullrow[$ii][2]="indexmain.php?mmenu=1009"; //if ($row_product_kindc["infocate"]==2) $fullrow[$ii][2]="indexmain.php?mmenu=".$infolinkarray[$row_product_kindc["infocate"]]."&sid=".$row_product_kindc["infoid"]."&cateid=".$row_product_kindc["infocate"]; //if ($row_product_kindc["infocate"]==3) // $fullrow[$ii][2]="indexmain.php?mmenu=1819&sid=".$row_product_kindc["infoid"]."&cateid=".$row_product_kindc["infocate"]; $ii++; $spos=$inpos+2; // } } ///////////////////////////////////////////////////// $tp_index-> newBlock ( "tp_fulltext_count" ); // 瀏覽 block $tp_index-> assign ( "tp_count" , $ii-1 ); // s_num for ($vd=1;$vd<=count($fullrow);$vd++){ $tp_index-> newBlock ( "tp_fulltext_list" ); // 瀏覽 block $tp_index-> assign ( "tp_fulltext" , $fullrow[$vd][1].".." ); // s_num $tp_index-> assign ( "tp_fulltext_link" , $fullrow[$vd][2] ); // s_num } //print_r($fullrow); } function u_addposter() { global $tp_index; $tp_index-> newBlock ( "tp_p6_in_01" ); // 瀏覽 block $tp_index-> assign ( "tp_action" , u_showproc().".php?mmenu=611"); // 連結資料 } ?>