一旦单击“下载”按钮,我们将尝试下载pdf格式的完整订单详细信息。...此处 100452121 是orderid, xpress 是发货名称& 14104918100111 是跟踪ID。...
我们设置了以下条件:如果tracking_id为空,则<xsl:for-each select="/Document/Items/Item[generate-id() = generate-id(key('itemKey',Item_Id)[1])]">
<xsl:sort select="Patent_No" />
<tr>
<td>
<xsl:value-of select="normalize-space(Item_Id)" />
</td>
<td>
<xsl:value-of select="normalize-space(Date)" />
</td>
<td>
<xsl:variable name="count" select="count(key('itemKey',Item_Id)[generate-id() = generate-id(key('itemCodeKey', concat(Item_Id, '|', Code))[1])])"/>
<xsl:for-each select="key('itemKey',Item_Id)[generate-id() = generate-id(key('itemCodeKey', concat(Item_Id, '|', Code))[1])]">
<xsl:sort select="Code" />
<xsl:value-of select="normalize-space(Code)"/>
<xsl:if test="$count != position()">, </xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
应该为{strong}零 [0],即使该订单可用tracking_id。...
Shippinglabel.php Full code in pastebin
echo 0
创世
<td><?php echo $orderrecords[$k]["order_id"]; ?><br/>
<?php
if ($st == 1) {
if ($orderrecords[$k]["tracking_id"] == '') {
?>
<input type="button" name="shipment" id="xpress" value="xpress"
onclick="createshipment('<?php echo $orderrecords[$k]["order_id"];?>')" />
<?php
}
}
?>
<?php
if ($orderrecords[$k]["tracking_id"] != '' && $orderrecords[$k]["shipping_name"] == 'xpress')
{
?>
<a target="_blank"
href="http://sbdev1.kidsdial.com/ecom1/xpress/xpressdownload.php?orderId=<?php
echo $orderrecords[$k]["order_id"];?>"
id="pdfdownload" >
<input type="button" name="shipment" value="DOWNLOAD" /></a>
<?php
}
?>
</td>
xpressshipment.php Full code in pastebin
function createshipment(orderid)
{
var assignee='<?php echo $_SESSION['login_user']?>';
alert(orderid);
$.ajax({
url: "xpressshipment.php",
type: "POST",
data:'orderid='+orderid+'&assignee='+assignee,
success: function(data){
if(data==1)
{
$("#pdfdownload").show();
}
if(data==0){alert("First Enter Tracking Id.");}
window.location ="http://sbdev1.kidsdial.com/ecom1/xpress/xpressdownload.php?orderId="+orderid;
}
});
}
xpressdownload.php Full code in pastebin
<?php
$data =
array (
'AirWayBillNO' => $resultc[0]['awb'],
);
if($res->AddManifestDetails[0]->ReturnMessage=='successful')
{
$sqli="update do_order set tracking_id='".$resultc[0]['awb']."',shipping_name='xpress' where order_id='".$order_id."'";
$resulti=$db_handle->executeUpdate($sqli);
}
?>
var_dump(“ tracking_id”); 结果给出了字符串(11)“ tracking_id” 。...
请让我知道是否需要更多详细信息。...
请帮助我找到解决方法。...
预先感谢。...
答案 0 :(得分:2)
在xpressdownload.php文件中,您错误地定义了$ orderid变量。
if(isset($_GET['orderId']) && $_GET['orderId']!='')
{
$orderid=$_GET['orderId'];
}
else
{
echo 2;
}
$orderid='';
首先,您要检查$ _GET ['orderId']是否存在,如果是,则将$ _GET ['orderId']的值赋予$ orderid。这是对的。 但是在if ... else块之后,您将$ orderid赋予''值。因此,在每种情况下,$ orderid都具有null值,并且您的sql查询不会返回记录。您必须删除$ orderid =''行;或将其移至if语句之前。