<?php
/****************************************/
/*                                      */
/*  百信卡盟平台联系QQ:84945491         */
/*  淘宝店 http://shop70674652.taobao.com  */
/*  百信卡盟 http://www.caipiaobus.com  */
/*                                      */
/****************************************/

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"/>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo $vd['sc'];
echo "css/main.css\">\r\n";
echo "<s";
echo "tyle type=\"text/css\">\r\ntd{height:30px}\r\n</style>\r\n</head>\r\n<body>\r\n<table border=\"1\" width=\"100%\" style=\"border-collapse: collapse;\" bordercolor=\"#cccccc\">\r\n  <tr>\r\n    <td class=\"listhead\" colspan=\"2\" style=\"border-right:1px #ccc solid\">静态页面生成程序</td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"25%\" align=\"center\">文章系统相关页面</td>\r\n    <td width=\"75%\" align=\"left\" style=\"border-right:1px #ccc solid\"><input t";
echo "ype=\"button\" onclick=\"setdata(1, 'article', 'article')\" value=\"文章静态页\" class=\"button\"/></td>\r\n  </tr>\r\n  ";
if ( UB_B2C )
{
				echo "  <tr>\r\n    <td width=\"25%\" align=\"center\">零售平台相关页面</td>\r\n    <td width=\"75%\" align=\"left\" style=\"border-right:1px #ccc solid;\">\r\n      <input type=\"button\" onclick=\"setdata(1, 'index', 'b2c')\" value=\"首页静态页\" class=\"button\"/>\r\n      <input type=\"button\" onclick=\"setdata(1, 'cat', 'b2c')\" value=\"商品总类静态页\" class=\"button\"/>\r\n      <input type=\"button\" onclick=\"setdata(1, 'plist', 'b2c')\" v";
				echo "alue=\"商品列表静态页\" class=\"button\"/>\r\n      <input type=\"button\" onclick=\"setdata(1, 'product', 'b2c')\" value=\"商品静态页\" class=\"button\"/>\r\n    </td>\r\n  </tr>\r\n  ";
}
echo "  ";
if ( UB_B2B )
{
				echo "  <tr>\r\n    <td width=\"25%\" align=\"center\">批发平台相关页面</td>\r\n    <td width=\"75%\" align=\"left\" style=\"border-right:1px #ccc solid;\">\r\n      <input type=\"button\" onclick=\"setdata(1, 'index', 'b2b')\" value=\"首页静态页\" class=\"button\"/>\r\n    </td>\r\n  </tr>\r\n  ";
}
echo "  ";
if ( UB_YKT )
{
				echo "  <tr>\r\n    <td width=\"25%\" align=\"center\">一卡通平台相关页面</td>\r\n    <td width=\"75%\" align=\"left\" style=\"border-right:1px #ccc solid\">\r\n      <input type=\"button\" onclick=\"setdata(1, 'index', 'ykt')\" value=\"首页静态页\" class=\"button\"/>\r\n      <input type=\"button\" onclick=\"setdata(1, 'product', 'ykt')\" value=\"商品静态页\" class=\"button\"/>\r\n    </td>\r\n  </tr>\r\n  ";
}
echo "  <tr>\r\n    <td width=\"25%\" align=\"center\" style=\"border-bottom:1px #ccc solid\">引导页相关页面</td>\r\n    <td width=\"75%\" align=\"left\" style=\"border-bottom:1px #ccc solid;border-right:1px #ccc solid\">\r\n      <input type=\"button\" onclick=\"setdata(1, 'index', 'index')\" value=\"首页静态页\" class=\"button\"/>\r\n    </td>\r\n  </tr>\r\n</table>\r\n<br/>\r\n<table border=\"1\" width=\"100%\" style=\"border-collapse: collapse\" bord";
echo "ercolor=\"#cccccc\">\r\n  <tr>\r\n    <td style=\"border:1px #ccc solid;\"><div id=\"result\" style=\"font-size:15px;color:#ff0000;font-weight:bold\"></div><div id=\"tmp\"></div></td>\r\n  </tr>\r\n</table>\r\n</body>\r\n</html>\r\n";
echo "<s";
echo "cript type=\"text/javascript\">\r\n  var cat = new Array();\r\n  var pid = new Array();\r\n  var art = new Array();\r\n  ";
$i = 0;
echo "  ";
foreach ( $vd['cat'] as $cat )
{
				echo "    cat[";
				echo $i;
				echo "] = ";
				echo $cat['id'];
				echo ";\r\n  ";
				++$i;
}
echo "  catcount = ";
echo $i;
echo ";\r\n  \r\n  ";
$i = 0;
echo "  ";
foreach ( $vd['article'] as $art )
{
				echo "    art[";
				echo $i;
				echo "] = ";
				echo $art['id'];
				echo ";\r\n  ";
				++$i;
}
echo "  artcount = ";
echo $i;
echo " + 1;\r\n  \r\n  ";
$i = 0;
echo "  ";
foreach ( $vd['pid'] as $pid )
{
				echo "    pid[";
				echo $i;
				echo "] = ";
				echo $pid['pid'];
				echo ";\r\n  ";
				++$i;
}
echo "  pidcount = ";
echo $i;
echo ";\r\n  \r\n  pinyin = Array(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"AZ\",\"09\");\r\n  \r\n  pycount  = 28;\r\n  var thismod = \"b2c\"\r\n  var m  = \"mod_b2b\";\r\n  var c  = \"html\";\r\n  var a  = 'index';\r\n  var id = 0;\r\n  var modname = \"零售系统\";\r\n  var moddir  = \"b2c\";\r\n  \r\n  var thisid = 0;\r\n  \r\n  var single = 1; // 如果单项则为1\r\n  var thiscount = 0";
echo ";\r\n  \r\n  var other = \"\";\r\n  \r\n  // 顺序 首页->类目->商品->列表->文章\r\n  \r\n  function loadXMLDoc()\r\n  {\r\n    xmlhttp=null;\r\n    var url=null;\r\n    \r\n    if(a == \"pinyin\")\r\n    {\r\n      keywords = thisid;\r\n      if(thisid == \"AZ\")\r\n      {\r\n        keywords = \"\";\r\n      }\r\n      \r\n      url = \"m=\" + m + \"&c=\" + c + \"&a=\" + a + \"&id=\" + thisid + \"&thismod=\" + thismod + \"&keywords=\" + keywords + \"&sty";
echo "pe=pinyin\";\r\n    }\r\n    else\r\n    {\r\n      url = \"m=\" + m + \"&c=\" + c + \"&a=\" + a + \"&id=\" + thisid + \"&thismod=\" + thismod;\r\n    }\r\n\r\n    // 针对 Mozilla等浏览器的代码：\r\n    if (window.XMLHttpRequest)\r\n    {\r\n      xmlhttp=new XMLHttpRequest();\r\n    }\r\n    // 针对 IE 的代码：\r\n    else if (window.ActiveXObject)\r\n    {\r\n      xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n    }\r\n    \r\n    if (x";
echo "mlhttp!=null)\r\n    {\r\n      xmlhttp.onreadystatechange=state_Change;\r\n      xmlhttp.open(\"post\", \"index.php\", true);\r\n      xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');\r\n      xmlhttp.send(url);\r\n    }\r\n    else\r\n    {\r\n      alert(\"您的浏览器不支持XMLHTTP\")\r\n    }\r\n  }\r\n  \r\n  function state_Change()\r\n  {\r\n    var result = document.getElementById(\"result\");\r\n    //";
echo " 如果 xmlhttp 显示为 \"loaded\"\r\n    if (xmlhttp.readyState==4)\r\n    {\r\n      // 如果为 \"OK\"\r\n      if (xmlhttp.status==200)\r\n      {\r\n        if(a == \"index\")\r\n        {\r\n          result.innerHTML = modname + \"首页生成完毕  => index.html\";\r\n          if(single == 1)\r\n          {\r\n            return;\r\n          }\r\n          \r\n          a = \"cat\";\r\n          loadXMLDoc();\r\n          return;\r\n       ";
echo " }\r\n        \r\n        if(a == \"cat\")\r\n        {\r\n          result.innerHTML = modname + \"类目生成完毕  => cat.html\";\r\n          if(single == 1)\r\n          {\r\n            return;\r\n          }\r\n          \r\n          a = \"product\";\r\n          thisid = pid[0];\r\n          thiscount = 1;\r\n          loadXMLDoc();\r\n          return;\r\n        }\r\n        \r\n        if(a == \"product\")\r\n        {\r\n          re";
echo "sult.innerHTML = modname + \"编号为\" + thisid + \"商品生成完毕  => \" + thismod + \"/p\" + thisid + \".html\";\r\n          \r\n          if((single == 1) &&(thiscount == pidcount))\r\n          {\r\n            result.innerHTML = modname + \"所有商品静态页面生成完毕\";\r\n            return;\r\n          }\r\n\r\n          if(thiscount == pidcount)\r\n          {\r\n            a = \"plist\";\r\n            thisid = cat[0];\r\n   ";
echo "         thiscount = 1;\r\n            result.innerHTML = modname + \"所有商品静态页面生成完毕\";\r\n            if(single == 1)\r\n            {\r\n              return;\r\n            }\r\n          }\r\n          thisid = pid[thiscount];\r\n          thiscount++;\r\n          loadXMLDoc();\r\n          return;\r\n        }\r\n        \r\n        if(a == \"plist\")\r\n        {\r\n          result.innerHTML = modname + \"编号为\" ";
echo "+ thisid + \"的商品分类生成完毕  => \" + thismod + \"/list-\" + thisid + \".html\";\r\n          \r\n          if((single == 1) &&(thiscount == catcount))\r\n          {\r\n            result.innerHTML = modname + \"所有商品分类静态页面生成完毕\";\r\n            return;\r\n          }\r\n\r\n          if(thiscount == catcount)\r\n          {\r\n            a = \"article\";\r\n            thisid = art[0];\r\n            thiscount =";
echo " 1;\r\n            result.innerHTML = modname + \"所有商品分类静态页面生成完毕\";\r\n            if(single == 1)\r\n            {\r\n              return;\r\n            }\r\n          }\r\n          thisid = cat[thiscount];\r\n          thiscount++;\r\n          loadXMLDoc();\r\n          return;\r\n        }\r\n        \r\n        if(a == \"article\")\r\n        {\r\n          result.innerHTML = modname + \"编号为\" + thisid + \"的";
echo "文章生成完毕  => article/\" + thisid + \".html\";\r\n          \r\n          if((single == 1) &&(thiscount == artcount))\r\n          {\r\n            result.innerHTML = modname + \"所有文章静态页面生成完毕\";\r\n            return;\r\n          }\r\n          \r\n          if(thiscount == artcount)\r\n          {\r\n            result.innerHTML = modname + \"所有文章静态页面生成完毕\";\r\n            if(single == 1)\r\n       ";
echo "     {\r\n              return;\r\n            }\r\n          }\r\n          thisid = art[thiscount];\r\n          thiscount++;\r\n          loadXMLDoc();\r\n          return;\r\n        }\r\n        \r\n        if(a == \"pinyin\")\r\n        {\r\n          result.innerHTML = modname + \"拼音为\" + thisid + \"的商品列表生成完毕  => \" + thismod + \"/list-\" + thisid + \".html\";\r\n          if((single == 1) &&(thiscount == pycount)";
echo ")\r\n          {\r\n            result.innerHTML = modname + \"所有拼音商品列表静态页面生成完毕\";\r\n            return;\r\n          }\r\n          \r\n          if(thiscount == pycount)\r\n          {\r\n            result.innerHTML = modname + \"所有拼音商品列表静态页面生成完毕\";\r\n            if(single == 1)\r\n            {\r\n              return;\r\n            }\r\n          }\r\n          \r\n          thisid = pinyin[";
echo "thiscount];\r\n          thiscount++;\r\n          loadXMLDoc();\r\n          return;\r\n        }\r\n      }\r\n      else\r\n      {\r\n        result.innerHTML = modname + \"首页生成失败\";\r\n      }\r\n    }\r\n  }\r\n  \r\n  function setdata(sgl, act, mod)\r\n  {\r\n    if(act == \"product\")\r\n    {\r\n      thisid = pid[0];\r\n      \r\n    }\r\n    if(act == \"cat\")\r\n    {\r\n      thisid = cat[0];\r\n      \r\n    }\r\n    if(act == \"arti";
echo "cle\")\r\n    {\r\n      thisid = art[0];\r\n      \r\n    }\r\n    \r\n    thismod = mod;\r\n    \r\n    switch(mod)\r\n    {\r\n      case \"b2b\":\r\n        modname = \"批发\";\r\n        break;\r\n      case \"ykt\":\r\n        modname = \"一卡通\";\r\n        break;\r\n      case \"b2c\":\r\n        modname = \"零售\";\r\n        break;\r\n      case \"article\":\r\n        modname = \"文章\";\r\n        break;\r\n      case \"index\":\r\n        modname ";
echo "= \"引导页\";\r\n        break;\r\n    }\r\n    \r\n    thiscount = 0;\r\n    a = act;\r\n    single = sgl;\r\n    loadXMLDoc();\r\n  }\r\n</script>\r\n";
?>
