$pix2 = $width / $detail_count; $progress2 = 0; echo "<script language=\"JavaScript\">\nfunction updateProgress2(sMsg, iWidth)\n{ \ndocument.getElementById(\"status2\").innerHTML = sMsg;\ndocument.getElementById(\"progress2\").style.width = iWidth + \"px\";\ndocument.getElementById(\"percent2\").innerHTML = parseInt(iWidth / " . $width . " * 100) + \"%\";\nif(sMsg == \"操作完成!\"){\ndocument.getElementById(\"detailcontent\").style.display =\"none\";\n}\n}\n</script>"; echo "<div id=\"detailcontent\" style=\"width:527px;padding-left:365px;\">\n\t<div style=\"margin: 4px; padding: 8px; border: 1px solid gray; background: #EAEAEA; width: " . $width8 . "px\" align=\"left\">\n\t<div align=\"center\">宝贝列表导入进度条:</div>\n\t<div style=\"padding: 0; background-color: white; border: 1px solid navy; width: " . $width . "px\" >\n\t<div id=\"progress2\" style=\"padding: 0; background-color: #FFCC66; border: 0; width: 0px; text-align: center; height: 16px\"></div>\n\t</div>\n\t<div id=\"status2\"> </div>\n\t<div id=\"percent2\" style=\"position: relative; top: -30px; text-align: center; font-weight: bold; font-size: 8pt\">0%</div>\n\t</div>\n</div>"; $success_product = 0; $fail_product = 0; $jump_product = 0; foreach ($rows2 as $key => $val) { if ($key > 0) { foreach ($val as $k => $v) { $title = trim($titlearr[$k]); if (in_array($title, $profiedlkeysarr)) { $focus_imppro->column_fields[$profiedlarr[$title]] = preg_replace('/\'/', '', $v); } } $return3 = $focus_imppro->save("Products"); if ($return3 == '1') { $success_product++; } elseif ($return3 == '2') { $fail_product++; } elseif ($return3 == '3') { $jump_product++; } } else { $titlearr = $val; } $key1 = $key + 1; echo "<script language=\"JavaScript\">\n\tupdateProgress2(\"当前进度:第'" . $key1 . "'条\", " . min($width, intval($progress2)) . ");\n\t</script>"; flush(); $progress2 += $pix2; }
$titlearr = array(); $focus_imppro->ClearColumnFields(); $pix2 = $width / $detail_count; $progress2 = 0; echo "<script language=\"JavaScript\">\nfunction updateProgress2(sMsg, iWidth)\n{ \ndocument.getElementById(\"status2\").innerHTML = sMsg;\ndocument.getElementById(\"progress2\").style.width = iWidth + \"px\";\ndocument.getElementById(\"percent2\").innerHTML = parseInt(iWidth / " . $width . " * 100) + \"%\";\nif(sMsg == \"操作完成!\"){\ndocument.getElementById(\"detailcontent\").style.display =\"none\";\n}\n}\n</script>"; echo "<div id=\"detailcontent\" style=\"width:527px;padding-left:365px;\">\n\t<div style=\"margin: 4px; padding: 8px; border: 1px solid gray; background: #EAEAEA; width: " . $width8 . "px\" align=\"left\">\n\t<div align=\"center\">宝贝列表导入进度条:</div>\n\t<div style=\"padding: 0; background-color: white; border: 1px solid navy; width: " . $width . "px\" >\n\t<div id=\"progress2\" style=\"padding: 0; background-color: #FFCC66; border: 0; width: 0px; text-align: center; height: 16px\"></div>\n\t</div>\n\t<div id=\"status2\"> </div>\n\t<div id=\"percent2\" style=\"position: relative; top: -30px; text-align: center; font-weight: bold; font-size: 8pt\">0%</div>\n\t</div>\n</div>"; $success_product = 0; foreach ($rows2 as $key => $val) { if ($key > 0) { foreach ($val as $k => $v) { $title = trim($titlearr[$k]); if (in_array($title, $profiedlkeysarr)) { $focus_imppro->column_fields[$profiedlarr[$title]] = $v; } } $eof3 = $focus_imppro->save("Products"); if ($eof3) { $success_product += 1; } } else { $titlearr = $val; } $key1 = $key + 1; echo "<script language=\"JavaScript\">\n\tupdateProgress2(\"当前进度:第'" . $key1 . "'条\", " . min($width, intval($progress2)) . ");\n\t</script>"; flush(); $progress2 += $pix2; } echo "<script language=\"JavaScript\">\nupdateProgress2(\"操作完成!\", " . $width . ");\n</script>"; flush(); $smarty->assign("success_product", $success_product); $inventprofiedlarr = array("订单编号" => 'oid', "标题" => 'productname', "价格" => 'listprice', "购买数量" => 'quantity', "商品属性" => 'comment', "备注" => 'comment2');