p;action=update_shipping\">";
echo "<input name=\"sid\" type=\"hidden\" value=\"".$row[0]."\">";
echo "<tr><td>";
echo $txt['shippingadmin5']."<br />";
echo "<input name=\"description\" type=\"text\" value=\"".$row[1]."\" size=\"30\" maxlength=\"150\"><br /><br />";
echo $txt['shippingadmin6']."<br />";
echo "<input name=\"rate\" type=\"text\" value=\"".$row[2]."\" size=\"5\" maxlength=\"7\"><br /><br />";
echo $txt['shippingadmin7']."<br />";
echo "<input name=\"country\" type=\"checkbox\" "; if ($row[3] == 1) echo "checked"; echo ">";
echo "</td><td>";
echo $txt['shippingadmin13']."<br />";
// for every payment method we add a checkbox
$query_pay="SELECT * FROM `payment`";
$sql_pay = mysql_query($query_pay) or die(mysql_error());
while ($row_pay = mysql_fetch_row($sql_pay)) {
$query_shippay="SELECT * FROM `shipping_payment` WHERE `shippingid`='".$sid."' AND paymentid='".$row_pay[0]."'";
$sql_shippay = mysql_query($query_shippay) or die(mysql_error());
if (mysql_num_rows($sql_shippay) <> 0) {
$checked = "checked"; }
else { $checked = ""; }
echo "<input name=\"".$row_pay[0]."\" type=\"checkbox\" ".$checked."> ".$row_pay[1]."<br />";
}
echo "</td></tr>";
echo "<tr class=\"altrow\"><td colspan=\"2\">";
echo "<h4><input type=\"submit\" value=\"".$txt['shippingadmin8']."\"></h4>";
echo "</td></tr>";
echo "</form>";
echo "</table>";
exit(include("includes/exit.inc.php"));
}
}
echo "<table width=\"100%\" class=\"datatable\">";
echo " <caption>".$txt['shippingadmin4']."</caption>";
echo " <tr><th>".$txt['shippingadmin5']."</th><th>".$txt['shippingadmin6']."</th><th>".$txt['shippingadmin7']."</th><th>".$txt['shippingadmin12']."</th></tr>";
// add a shipping method
echo " <form method=\"POST\" action=\"index.php?page=shippingadmin&action=add_shipping\">";
echo " <tr class=\"altrow\">";
echo " <td><input name=\"description\" type=\"text\" value=\"\" size=\"30\" maxlength=\"150\"></td>";
echo " <td><input name=\"rate\" type=\"text\" value=\"\" size=\"5\" maxlength=\"7\"></td>";
echo " <td><input name=\"country\" type=\"checkbox\"></td>";
echo " <td><input type=\"submit\" value=\"".$txt['shippingadmin10']."\"></td>";
echo " </tr>";
echo " </form>";
$query="SELECT * FROM `shipping`";
$sql = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_row($sql)) {
echo " <tr>";
echo " <td>".$row[1]."</td>";
echo " <td>".$row[2]."</td>";
echo " <td>".$row[3]."</td>";