| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- include("session_check.php");
- include("header.php");
- include("menu.php");
- ?>
- <!-- <a href="javascript: history.back();">Zurück</a> -->
- <form name="shoppingcart_set_template" action="shoppingcart_set_template.php" method="POST">
- <input type="hidden" value="set_template" name="action">
- <input type="submit" value="" class="invisible_submit">
- </form>
- <form name="shoppingcart_load_template" action="shoppingcart.php" method="POST">
- <input type="hidden" value="load_template" name="action">
- <input type="submit" value="" class="invisible_submit">
- </form>
- <div width="100%" align="center">
- <big> Warenkorb </big>
- <table border="0" width="80%">
- <tr class="table_header">
- <td width="80px" align="center">ProduktNr.</td>
- <td align="center">Bezeichnung</td>
- <td align="center">Zusatz</td>
- <td width="30px" align="center">Menge</td>
- <td align="center">Anmerkung</td>
- <td width="40px" align="center">Preis(EUR)</td>
- <td colspan="2" width="200px"> </td>
- </tr>
- <tr>
- <td colspan="6"> </td>
- </tr>
- <?php
- /* load or initialize the ShoppingCart */
- if(!isset($shopping_cart))
- {
- if(isset($_SESSION["cart_product_id_array"]))
- $shopping_cart = new ShoppingCart($_SESSION["username"], $_SESSION["cart_product_id_array"], $_SESSION["cart_product_amount_array"]);
- else
- $shopping_cart = new ShoppingCart($_SESSION["username"]);
- }
- $list = $shopping_cart->getItems();
- /* if there were any actions, set the focus to the next item */
- $prev_edit_product_id = "";
- $set_focus_next = false;
- if (var_get_post("action", "") == "edit_product_amount") {
- $prev_edit_product_id = var_get_post("product_id", "");
- }
- for($i = 0; $i < count($list); $i++)
- {
- echo "\t<tr class=\"list_normal\" onmouseover=\"javascript: this.className='list_hover';\" onmouseout=\"javascript: this.className='list_normal';\">\n";
- echo "\t<form name=\"edit_product_amount_".$list[$i][0]."\" action=\"shoppingcart.php\" method=\"POST\">\n";
- echo "\t<input type=\"hidden\" name=\"action\" value=\"edit_product_amount\">\n";
- echo "\t<input type=\"hidden\" name=\"product_id\" value=\"".$list[$i][0]."\">\n";
- echo "\t<input type=\"submit\" value=\"\" class=\"invisible_submit\">\n";
- echo "\t\t<td onclick=\"javascript: window.location.href = 'product_details.php?product_id=".$list[$i][0]."';\">".$list[$i][0]."</td>\n";
- echo "\t\t<td onclick=\"javascript: window.location.href = 'product_details.php?product_id=".$list[$i][0]."';\">".$list[$i][1]."</td>\n";
- echo "\t\t<td onclick=\"javascript: window.location.href = 'product_details.php?product_id=".$list[$i][0]."';\">".$list[$i][4]."</td>\n";
- echo "\t\t<td width=\"30px\"><input type=\"text\" name=\"product_amount\" id=\"product_amount_".$list[$i][0]."\" class=\"list_cell\" value=\"".$list[$i][2]."\"></td>\n";
- echo "\t\t<td width=\"100px\"><input type=\"text\" name=\"product_hint\" class=\"list_cell\" value=\"".$list[$i][5]."\"></td>\n";
- echo "\t\t<td align=\"right\" onclick=\"javascript: window.location.href = 'product_details.php?product_id=".$list[$i][0]."';\">".number_format($list[$i][3] * $list[$i][2], 2)."</td>\n";
- echo "\t\t<td width=\"100px\" align=\"center\"><a href=\"javascript: document.forms['edit_product_amount_".$list[$i][0]."'].submit();\">speichern</a></td>\n";
- echo "\t\t<td width=\"100px\" align=\"center\"><a href=\"javascript: window.location.href= ' shoppingcart.php?action=remove_product_from_cart&product_id=".$list[$i][0]."';\">entfernen</a></td>\n";
- echo "\t</form>\n\t</tr></a>\n";
- if ($set_focus_next == true) {
- echo "<script type=\"text/javascript\">\n";
- echo "document.getElementById('product_amount_".$list[$i][0]."').scrollIntoView(\"true\")\n";
- echo "document.getElementById('product_amount_".$list[$i][0]."').focus();\n";
- echo "document.getElementById('product_amount_".$list[$i][0]."').select();\n";
-
- echo "</script>\n";
- $set_focus_next = false;
- }
- /* check if the edited product id is the current */
- if ($prev_edit_product_id == $list[$i][0]) {
- $set_focus_next = true;
- }
- }
- ?>
- <tr>
- <td colspan="7"> </td>
- </tr>
- <tr>
- <td colspan="7"><a href="javascript: document.forms['shoppingcart_load_template'].submit();">Artikel aus dem Standard Warenkorb hinzufügen</a></td>
- </tr>
- <tr class="table_header">
- <td colspan="5"> </td>
- <td colspan="2" align="center" width="200px"><big><a href="shoppingcart_submit.php">weiter</a></big></td>
- </tr>
- <tr>
- <td colspan="7"> </td>
- </tr>
- <tr>
- <td colspan="7" align="right"><a href="javascript: document.forms['shoppingcart_set_template'].submit();">diesen Warenkorb als Standard speichern</a></td>
- </tr>
- </table>
- </div>
- <?php
- include("footer.php");
- ?>
|