📄 shipping_radio.ihtml
字号:
<?phpeval(load_class("ISshipping", "ps_intershipper"));$ps_intershipper = new ps_intershipper; $db = new ps_DB; $q = "SELECT * FROM ISshipping "; $q .= "WHERE ship_publish='Y' "; $q .= "AND vendor_id='$ps_vendor_id' "; $q .= "ORDER BY ship_carrier_name ASC"; $db->query($q); if ($db->num_rows() > 0) { if ($db->num_rows() == 1) { $db->next_record(); ?> <INPUT TYPE="hidden" NAME="ship_method_id" VALUE="<?php $db->sp("ship_method_id"); ?>"><?php } else { /* Pass previous forms results to fetch_quote() function. * If previous form identified a ship to address, the function * will return a quote. Otherwise, it will not. */ if (!$prices = $ps_intershipper->fetch_quote($vars)) { /* If we're unable to get a quote, display * a ship method select list without shipping costs. */?> <TABLE BORDER=0 WIDTH=100% CELLPADDING=2 CELLSPACING=0> <TR BGCOLOR="#ffcc33"> <TD> <B>Choose Shipping Method</B> </TD> </TR><?php while ($db->next_record()) { ?> <TR> <TD> <INPUT TYPE=radio NAME=ship_method_id VALUE=<?php $db->sp("ship_method_id"); if ($ship_method_id) echo " CHECKED>" . $db->f("ship_carrier_name") . " " . $db->f("ship_method_name") . "\r\n"; else echo ">" . $db->f("ship_carrier_name") . " " . $db->f("ship_method_name") . "\r\n"; ?> </TD> </TR><?php } ?> </TABLE><?php } else { ?> <TABLE BORDER=0 WIDTH=100% CELLPADDING=4 CELLSPACING=0> <TR BGCOLOR="#FFCC33"> <TD> <B>Choose Shipping Method</B> </TD> <TD> <B>Delivery Date/Time</B> </TD> <TD> <B>Price</B> </TD> </TR> <?php $i = 0; while ($db->next_record()) { reset($prices); while (list($key,$val)=each($prices)) { if (strcmp($key,$db->f("ship_method_id")) == 0) { if ($i % 2 == 0) $bgcolor = SEARCH_COLOR_1; else $bgcolor = SEARCH_COLOR_2; $i++; ?> <TR BGCOLOR=<?php echo $bgcolor; ?>> <TD> <INPUT TYPE=radio NAME=ship_method_id VALUE=<?php echo $key; if ($ship_method_id && (strcmp($ship_method_id,$db->f("ship_method_id")) == 0)) { echo " CHECKED>" . $db->f("ship_carrier_name") . " "; echo $db->f("ship_method_name") . "\r\n"; } else { echo ">" . $db->f("ship_carrier_name") . " "; echo $db->f("ship_method_name") . "\r\n"; } ?> </TD> <TD><?php echo date("m/d/Y H:m", $prices[$key]["ddate"]); ?></TD> <TD ALIGN=RIGHT><?php printf("%8.2f", $prices[$key]["rate"]); ?></TD> </TR><?php } } } ?> </TABLE><?php } } }?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -