PageRenderTime 49ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/orders_edit_other.php

https://bitbucket.org/flth/xtcm
PHP | 270 lines | 242 code | 1 blank | 27 comment | 21 complexity | 47d7cf36dfd1f14c4f1852e620fa876b MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /* --------------------------------------------------------------
  3. $Id: orders_edit_other.php 1920 2011-05-09 13:18:51Z web28 $
  4. XT-Commerce - community made shopping
  5. http://www.xt-commerce.com
  6. XTC-Bestellbearbeitung:
  7. http://www.xtc-webservice.de / Matthias Hinsche
  8. info@xtc-webservice.de
  9. Copyright (c) 2003 XT-Commerce
  10. --------------------------------------------------------------
  11. based on:
  12. (c) 2000-2001 The Exchange Project (earlier name of osCommerce)
  13. (c) 2002-2003 osCommerce(orders.php,v 1.27 2003/02/16); www.oscommerce.com
  14. (c) 2003 nextcommerce (orders.php,v 1.7 2003/08/14); www.nextcommerce.org
  15. Released under the GNU General Public License
  16. --------------------------------------------------------------*/
  17. defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );
  18. ?>
  19. <!-- Sprachen Anfang //-->
  20. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  21. <tr class="dataTableHeadingRow">
  22. <td class="dataTableHeadingContent" width="100%" colspan="3"><b><?php echo TEXT_LANGUAGE; ?></b></td>
  23. </tr>
  24. <?php
  25. echo xtc_draw_form('lang_edit', FILENAME_ORDERS_EDIT, 'action=lang_edit', 'post');
  26. $lang_query = xtc_db_query("select languages_id, name, directory from " . TABLE_LANGUAGES . " ");
  27. while($lang = xtc_db_fetch_array($lang_query)){
  28. ?>
  29. <tr class="dataTableRow">
  30. <td class="dataTableContent" align="left" width="30%"><?php echo $lang['name'];?></td>
  31. <td class="dataTableContent" align="left" width="30%">
  32. <?php
  33. if ($lang['directory']==$order->info['language']){
  34. echo xtc_draw_radio_field('lang', $lang['languages_id'], 'checked');
  35. }else{
  36. echo xtc_draw_radio_field('lang', $lang['languages_id']);
  37. }
  38. ?>
  39. </td>
  40. <td class="dataTableContent" align="left">&nbsp;</td>
  41. </tr>
  42. <?php
  43. }
  44. ?>
  45. <tr class="dataTableRow">
  46. <td class="dataTableContent" align="left" colspan="3">
  47. <?php
  48. echo xtc_draw_hidden_field('oID', $_GET['oID']);
  49. echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_SAVE . '"/>';
  50. ?>
  51. </td>
  52. </tr>
  53. </form>
  54. </table>
  55. <!-- Sprachen Ende //-->
  56. <br /><br />
  57. <!-- Währungen Anfang //-->
  58. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  59. <tr class="dataTableHeadingRow">
  60. <td class="dataTableHeadingContent" width="100%" colspan="3"><b><?php echo TEXT_CURRENCIES; ?></b></td>
  61. </tr>
  62. <?php
  63. echo xtc_draw_form('curr_edit', FILENAME_ORDERS_EDIT, 'action=curr_edit', 'post');
  64. $curr_query = xtc_db_query("select currencies_id, title, code, value from " . TABLE_CURRENCIES . " ");
  65. while($curr = xtc_db_fetch_array($curr_query)){
  66. ?>
  67. <tr class="dataTableRow">
  68. <td class="dataTableContent" align="left" width="30%"><?php echo $curr['title'];?></td>
  69. <td class="dataTableContent" align="left" width="30%">
  70. <?php
  71. if ($curr['code']==$order->info['currency']){
  72. echo xtc_draw_radio_field('currencies_id', $curr['currencies_id'], 'checked');
  73. }else{
  74. echo xtc_draw_radio_field('currencies_id', $curr['currencies_id']);
  75. }
  76. ?>
  77. </td>
  78. <td class="dataTableContent" align="left">&nbsp;</td>
  79. </tr>
  80. <?php
  81. }
  82. ?>
  83. <tr class="dataTableRow">
  84. <td class="dataTableContent" align="left" colspan="3">
  85. <?php
  86. echo xtc_draw_hidden_field('old_currency', $order->info['currency']);
  87. echo xtc_draw_hidden_field('oID', $_GET['oID']);
  88. echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_SAVE . '"/>';
  89. ?>
  90. </td>
  91. </tr>
  92. </form>
  93. </table>
  94. <!-- Währungen Ende //-->
  95. <br /><br />
  96. <!-- Zahlung Anfang //-->
  97. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  98. <tr class="dataTableHeadingRow">
  99. <td class="dataTableHeadingContent" width="100%" colspan="4"><b><?php echo TEXT_PAYMENT; ?></b></td>
  100. </tr>
  101. <?php
  102. //BOF - web28 - 2011-06-08 - FIX for no installed payment modules
  103. if (trim(MODULE_PAYMENT_INSTALLED) != '') {
  104. $payments = explode(';', MODULE_PAYMENT_INSTALLED); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
  105. for ($i=0; $i<count($payments); $i++){
  106. if(file_exists(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/checkout/' . $payments[$i])){
  107. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/checkout/' . $payments[$i]);
  108. } else {
  109. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/' . $payments[$i]);
  110. }
  111. $payment_modul = substr($payments[$i], 0, strrpos($payments[$i], '.'));
  112. $payment_text = constant('MODULE_PAYMENT_'.strtoupper($payment_modul).'_TEXT_TITLE');
  113. $payment_array[] = array('id' => $payment_modul,
  114. 'text' => $payment_text);
  115. }
  116. }
  117. $order_payment = $order->info['payment_class'];
  118. if(file_exists(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/' . $order_payment .'.php')){
  119. if(file_exists(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/checkout/' . $order_payment .'.php')){
  120. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/checkout/' . $order_payment .'.php');
  121. } else {
  122. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/' . $order_payment .'.php');
  123. }
  124. $order_payment_text = constant('MODULE_PAYMENT_'.strtoupper($order_payment).'_TEXT_TITLE');
  125. }
  126. //EOF - web28 - 2011-06-08 - FIX for no installed payment modules
  127. echo xtc_draw_form('payment_edit', FILENAME_ORDERS_EDIT, 'action=payment_edit', 'post');
  128. ?>
  129. <tr class="dataTableRow">
  130. <td class="dataTableContent" align="left" width="30%">
  131. <?php
  132. echo TEXT_ACTUAL . $order_payment_text;
  133. ?>
  134. </td>
  135. <td class="dataTableContent" align="left" width="30%">
  136. <?php
  137. echo TEXT_NEW . xtc_draw_pull_down_menu('payment', $payment_array, $order_payment); //web28 - 2011-06-10 add default entry
  138. ?>
  139. </td>
  140. <td class="dataTableContent" align="left">
  141. <?php
  142. echo xtc_draw_hidden_field('oID', $_GET['oID']);
  143. echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_SAVE . '"/>';
  144. ?>
  145. </td>
  146. </tr>
  147. </form>
  148. </table>
  149. <!-- Zahlung Ende //-->
  150. <br /><br />
  151. <!-- Versand Anfang //-->
  152. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  153. <tr class="dataTableHeadingRow">
  154. <td class="dataTableHeadingContent" width="100%" colspan="4"><b><?php echo TEXT_SHIPPING; ?></b></td>
  155. </tr>
  156. <?php
  157. $shippings = explode(';', MODULE_SHIPPING_INSTALLED); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
  158. for ($i=0; $i<count($shippings); $i++){
  159. if (isset($shippings[$i]) && is_file(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $shippings[$i])) {
  160. if (is_file(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/checkout/' . $shippings[$i])) {
  161. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/checkout/' . $shippings[$i]);
  162. } else {
  163. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $shippings[$i]);
  164. }
  165. $shipping_modul = substr($shippings[$i], 0, strrpos($shippings[$i], '.'));
  166. $shipping_text = constant('MODULE_SHIPPING_'.strtoupper($shipping_modul).'_TEXT_TITLE');
  167. $shipping_array[] = array('id' => $shipping_modul,
  168. 'text' => $shipping_text);
  169. }
  170. }
  171. $order_shipping = explode('_', $order->info['shipping_class']); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
  172. $order_shipping = $order_shipping[0];
  173. if (is_file(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $order_shipping .'.php')) {
  174. if (is_file(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/checkout/' . $order_shipping .'.php')) {
  175. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/checkout/' . $order_shipping .'.php');
  176. } else {
  177. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $order_shipping .'.php');
  178. }
  179. $order_shipping_text = constant('MODULE_SHIPPING_'.strtoupper($order_shipping).'_TEXT_TITLE');
  180. }
  181. echo xtc_draw_form('shipping_edit', FILENAME_ORDERS_EDIT, 'action=shipping_edit', 'post');
  182. ?>
  183. <tr class="dataTableRow">
  184. <td class="dataTableContent" align="left" width="30%">
  185. <?php
  186. echo TEXT_ACTUAL . $order_shipping_text;
  187. ?>
  188. </td>
  189. <td class="dataTableContent" align="left" width="30%">
  190. <?php
  191. echo TEXT_NEW . xtc_draw_pull_down_menu('shipping', $shipping_array, $order_shipping); //web28 - 2011-06-10 add default entry
  192. ?>
  193. </td>
  194. <td class="dataTableContent" align="left">
  195. <?php
  196. $order_total_query = xtc_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $_GET['oID'] . "' and class = 'ot_shipping' ");
  197. $order_total = xtc_db_fetch_array($order_total_query);
  198. echo TEXT_PRICE . xtc_draw_input_field('value', $order_total['value']);
  199. ?>
  200. </td>
  201. <td class="dataTableContent" align="left">
  202. <?php
  203. echo xtc_draw_hidden_field('oID', $_GET['oID']);
  204. echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_SAVE . '"/>';
  205. ?>
  206. </td>
  207. </tr>
  208. </form>
  209. </table>
  210. <!-- Versand Ende //-->
  211. <br /><br />
  212. <!-- OT Module Anfang //-->
  213. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  214. <tr class="dataTableHeadingRow">
  215. <td class="dataTableHeadingContent" style="width:200px"><b><?php echo TEXT_ORDER_TOTAL; ?></b></td>
  216. <td class="dataTableHeadingContent" style="width:300px"><b><?php echo TEXT_ORDER_TITLE; ?></b></td>
  217. <td class="dataTableHeadingContent" style="width:200px"><b><?php echo TEXT_ORDER_VALUE; ?></b></td>
  218. <td class="dataTableHeadingContent" width="" colspan="2">&nbsp;</td>
  219. </tr>
  220. <?php
  221. $totals = explode(';', MODULE_ORDER_TOTAL_INSTALLED); // Hetfield - 2009-08-18 - replaced deprecated function split with explode to be ready for PHP >= 5.3
  222. for ($i=0; $i<count($totals); $i++){
  223. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/order_total/' . $totals[$i]);
  224. $total = substr($totals[$i], 0, strrpos($totals[$i], '.'));
  225. $total_name = str_replace('ot_','',$total);
  226. $total_text = constant(MODULE_ORDER_TOTAL_.strtoupper($total_name)._TITLE);
  227. $ototal_query = xtc_db_query("select orders_total_id, title, value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $_GET['oID'] . "' and class = '" . $total . "' ");
  228. $ototal = xtc_db_fetch_array($ototal_query);
  229. //if (($total != 'ot_subtotal')&&($total != 'ot_subtotal_no_tax')&&($total != 'ot_total')&&($total != 'ot_tax')){
  230. //if ($total != 'ot_shipping'){
  231. ?>
  232. <tr class="dataTableRow">
  233. <?php echo xtc_draw_form('ot_edit', FILENAME_ORDERS_EDIT, 'action=ot_edit', 'post'); ?>
  234. <td class="dataTableContent" align="left"><?php echo $total_text; ?></td>
  235. <td class="dataTableContent" align="left"><?php echo xtc_draw_input_field('title', $ototal['title'], 'size=40'); ?></td>
  236. <td class="dataTableContent" align="left" width="20%"><?php echo xtc_draw_input_field('value', $ototal['value']); ?></td>
  237. <td class="dataTableContent" align="left">
  238. <?php
  239. echo xtc_draw_hidden_field('class', $total);
  240. echo xtc_draw_hidden_field('sort_order', constant(MODULE_ORDER_TOTAL_.strtoupper($total_name)._SORT_ORDER));
  241. echo xtc_draw_hidden_field('oID', $_GET['oID']);
  242. echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_SAVE . '"/>';
  243. ?>
  244. </td>
  245. </form>
  246. <td>
  247. <?php
  248. echo xtc_draw_form('ot_delete', FILENAME_ORDERS_EDIT, 'action=ot_delete', 'post');
  249. echo xtc_draw_hidden_field('oID', $_GET['oID']);
  250. echo xtc_draw_hidden_field('otID', $ototal['orders_total_id']);
  251. //BOF - web28 - 2011-06-13 - no display of BUTTON_DELETE by or_total
  252. if ($total != 'ot_total') {
  253. echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_DELETE . '"/>';
  254. }
  255. //EOF - web28 - 2011-06-13 - no display of BUTTON_DELETE by or_total
  256. ?>
  257. </form>
  258. </td>
  259. </tr>
  260. <?php
  261. // }
  262. }
  263. ?>
  264. </table>