PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/osCommerce/OM/Core/Site/Admin/Application/modules_order_total/pages/edit.php

http://github.com/osCommerce/oscommerce
PHP | 65 lines | 37 code | 16 blank | 12 comment | 3 complexity | 7b3ce49b0733c61cf2fe4db1a6075f9f MD5 | raw file
  1. <?php
  2. /*
  3. $Id: $
  4. osCommerce, Open Source E-Commerce Solutions
  5. http://www.oscommerce.com
  6. Copyright (c) 2007 osCommerce
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License v2 (1991)
  9. as published by the Free Software Foundation.
  10. */
  11. include('includes/modules/order_total/' . $_GET['module'] . '.php');
  12. $osC_Language->injectDefinitions('modules/order_total/' . $_GET['module'] . '.xml');
  13. $module = 'osC_OrderTotal_' . $_GET['module'];
  14. $module = new $module();
  15. ?>
  16. <h1><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1>
  17. <?php
  18. if ( $osC_MessageStack->size($osC_Template->getModule()) > 0 ) {
  19. echo $osC_MessageStack->get($osC_Template->getModule());
  20. }
  21. ?>
  22. <div class="infoBoxHeading"><?php echo osc_icon('edit.png') . ' ' . $module->getTitle(); ?></div>
  23. <div class="infoBoxContent">
  24. <form name="mEdit" action="<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&module=' . $module->getCode() . '&action=save'); ?>" method="post">
  25. <p><?php echo $osC_Language->get('introduction_edit_order_total_module'); ?></p>
  26. <?php
  27. $keys = '';
  28. foreach ( $module->getKeys() as $key ) {
  29. $Qkey = $osC_Database->query('select configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
  30. $Qkey->bindTable(':table_configuration', TABLE_CONFIGURATION);
  31. $Qkey->bindValue(':configuration_key', $key);
  32. $Qkey->execute();
  33. $keys .= '<b>' . $Qkey->value('configuration_title') . '</b><br />' . $Qkey->value('configuration_description') . '<br />';
  34. if ( !osc_empty($Qkey->value('set_function')) ) {
  35. $keys .= osc_call_user_func($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
  36. } else {
  37. $keys .= osc_draw_input_field('configuration[' . $key . ']', $Qkey->value('configuration_value'));
  38. }
  39. $keys .= '<br /><br />';
  40. }
  41. $keys = substr($keys, 0, strrpos($keys, '<br /><br />'));
  42. ?>
  43. <p><?php echo $keys; ?></p>
  44. <p align="center"><?php echo osc_draw_hidden_field('subaction', 'confirm') . '<input type="submit" value="' . $osC_Language->get('button_save') . '" class="operationButton" /> <input type="button" value="' . $osC_Language->get('button_cancel') . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()) . '\';" class="operationButton" />'; ?></p>
  45. </form>
  46. </div>