<?
   include "config.inc";
   $db = @mysql_connect("localhost", "$databaseuser", "$databasepasswd");
   @mysql_select_db("$databasename",$db);
?>
<html>
<head>
<title><? echo $ashopname ?> - заказ</title>
</head>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#235C87" VLINK="#235C87" ALINK="#F70404">
<table width="75%" border="0" cellspacing="0" cellpadding="2" align="center">
  <tr align="center"> 
    <td><img src="images/logo.gif" width="208" height="70"><br>
      <hr size="0" noshade>
    </td>
  </tr>
  <tr align="center">
    <td><font size="2" face="Arial, Helvetica, sans-serif"><b>Заказ</b></font> 
      <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr> 
          <td width="40%" valign="top"> 
            <p><font size="2" face="Arial, Helvetica, sans-serif">
		    Подтвердите ваш заказ заполнив обязательные 
			поля этой формы. После отсылки  заказа,  Вы  
			получите на указанный вами email инструкции 
			- как произвести платеж.</font></p>
            </td>
          <td width="20%" align="center">&nbsp;</td>
          <td width="40%" valign="top"> 
            <p><font size="2" face="Arial, Helvetica, sans-serif"><a href="main.php">Продолжить
              выбор!</a></font></p>
            <p><font size="2" face="Arial, Helvetica, sans-serif"><a href="basket.php">Изменить ваш заказ</a></font></p>
         </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr align="center"> 
    <td> 
      <table width="100%" border="1" cellspacing="0" cellpadding="2" bordercolor="#000000">
        <tr align="center"> 
          <td> 
            <form action="order/order.php" method=post name="orderform">
              <font size="6"><b><font face="Arial, Helvetica, sans-serif" size="3">Ваш 
              заказ...</font></b></font> <br>
              <p> 

<TABLE BORDER=1 BORDERCOLOR="#9f9f9f" CELLSPACING="0" CELLPADDING="5">
  <TR>
	<TD><b><FONT FACE="Geneva,Arial" SIZE="2">Товар</FONT></b></TD>
	<TD><b><FONT FACE="Geneva,Arial" SIZE="2">Цена</FONT></b></TD>
	<td><b><FONT FACE="Geneva,Arial" SIZE="2">Всего</FONT></b></TD></TR>

<?
  $subtotal = 0;
  $items = explode("&", $basket);
  for ($i = 0; $i < count($items)-1; $i++) {

    // Get the products name and price from the database...
    $sql="SELECT name, price FROM product WHERE productid=$items[$i]";
    $result = @mysql_query("$sql",$db);
    if (@mysql_num_rows($result) == 0) {
      $name = "Error";
      $price = 0;
    } else {
      $name = @mysql_result($result, 0, "name");
      $price = @mysql_result($result, 0, "price");
      $subtotal += $price;
    }  
    $itemnumber = $items[$i];
    echo "
	<tr><td align=middle>
	  <FONT SIZE=\"2\" FACE=\"Geneva,Arial\">$name</FONT></td>
	<td>
	  <FONT SIZE=\"2\" FACE=\"Geneva,Arial\">$price</FONT></td>
	<td align=right><FONT SIZE=\"2\" FACE=\"Geneva,Arial\">$subtotal</FONT></td></tr>
	<INPUT TYPE=HIDDEN NAME=\"item$i\" VALUE=\"$namn, itemnumber: $itemnumber\">";
  }

  echo "
  <tr><td align=right BGCOLOR=\"#B3B3B3\" colspan=2>
  <b><FONT FACE=\"Geneva,Arial\" SIZE=\"2\">Итого</FONT></b></td>
  <td align=right><INPUT TYPE=HIDDEN NAME=\"sum\" VALUE=\"$subtotal\">
  <FONT FACE=\"Geneva,Arial\" SIZE=\"2\">$subtotal</FONT></td></tr></TABLE>";
?>
				
				
				<br>
                <font size="2" face="Arial, Helvetica, sans-serif">* = обязательно заполнить</font><br>
              <table border=0 cellspacing=0 cellpadding=3 bgcolor="#FFFFFF">
                <tr> 
                  <td align="right" width="72"><font size="2"
face="Arial, Helvetica, sans-serif">Имя:</font></td>
                  <td width="212"> 
                    <input type=text name="firstname" size=40>
                  </td>
                  <td width="72"><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td align="right" width="72"><font size="2"
face="Arial, Helvetica, sans-serif">Фамилия:</font></td>
                  <td width="212"> 
                    <input type=text name="lastname" size=40>
                  </td>
                  <td width="72"><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td align="right" width="72"><font size="2" face="Arial, Helvetica, sans-serif">Email:</font></td>
                  <td width="212"> 
                    <input type=text name="email" size=40>
                  </td>
                  <td width="72"><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td width="72" align="right"><font size="2" face="Arial, Helvetica, sans-serif">Адрес:</font></td>
                  <td width="212"> 
                    <input type=text name="address" size=40>
                  </td>
                  <td><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td width="72" align="right"><font size="2" face="Arial, Helvetica, sans-serif">Почтовый индекс:</font></td>
                  <td width="212"> 
                    <input type=text name="zip" size=40>
                  </td>
                  <td><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td width="72" align="right"><font size="2" face="Arial, Helvetica, sans-serif">Город:</font></td>
                  <td width="212"> 
                    <input type=text name="city" size=40>
                  </td>
                  <td><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td width="72" align="right"><font face="Arial, Helvetica, sans-serif" size="2">Телефон (с кодом):</font></td>
                  <td width="212"> 
                    <input type=text name="phone" size=40>
                  </td>
                  <td><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
                <tr> 
                  <td width="72" align="right"><font size="2"
face="Arial, Helvetica, sans-serif">Метод платежа:</font></td>
                  <td width="212"> 
                    <select name="paymentmethod">
                      <option value="Method 1">WebMoney</option>
                      <option value="Method 2">Русский банк</option>
                      <option value="Method 3">Кредитная карта</option>
                      <option value="Method 3">Согласуем по запросу</option>
                    </select>
                  </td>
                  <td><font size="3" face="Arial, Helvetica, sans-serif">*</font></td>
                </tr>
              </table>
              <br>
              <table>
                <tr> 
                  <td colspan=4 align=center> 
                    <p> 
                      <input type="submit" value="Отправить"  name="Submit">
                      <input type="reset" value="Очистить" name="Reset">
                  </td>
                </tr>
              </table>
              </form>
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>


</body>

</html>
