PageRenderTime 25ms CodeModel.GetById 5ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/shipping/pages/ship_mgr/pre_process.php

http://phreedom.googlecode.com/
PHP | 61 lines | 37 code | 0 blank | 24 comment | 5 complexity | 758c6c4119a7a9cdf719dcd0c4fc18e6 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0
  1. <?php
  2. // +-----------------------------------------------------------------+
  3. // | PhreeBooks Open Source ERP |
  4. // +-----------------------------------------------------------------+
  5. // | Copyright (c) 2008, 2009, 2010, 2011, 2012 PhreeSoft, LLC |
  6. // | http://www.PhreeSoft.com |
  7. // +-----------------------------------------------------------------+
  8. // | This program is free software: you can redistribute it and/or |
  9. // | modify it under the terms of the GNU General Public License as |
  10. // | published by the Free Software Foundation, either version 3 of |
  11. // | the License, or any later version. |
  12. // | |
  13. // | This program is distributed in the hope that it will be useful, |
  14. // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  15. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  16. // | GNU General Public License for more details. |
  17. // +-----------------------------------------------------------------+
  18. // Path: /modules/shipping/pages/ship_mgr/pre_process.php
  19. //
  20. $security_level = validate_user(SECURITY_ID_SHIPPING_MANAGER);
  21. /************** include page specific files *********************/
  22. require_once(DIR_FS_WORKING . 'defaults.php');
  23. /************** page specific initialization *************************/
  24. $date = $_GET['search_date'] ? gen_db_date($_GET['search_date']) : date('Y-m-d');
  25. $search_text = $_GET['search_text'] == TEXT_SEARCH ? '' : db_input($_GET['search_text']);
  26. $action = isset($_GET['action']) ? $_GET['action'] : $_POST['todo'];
  27. $module_id = isset($_POST['module_id']) ? $_POST['module_id'] : '';
  28. $row_seq = isset($_POST['rowSeq']) ? $_POST['rowSeq'] : '';
  29. // load methods
  30. $installed_modules = load_all_methods('shipping');
  31. /*************** hook for custom actions ***************************/
  32. $custom_path = DIR_FS_WORKING . 'custom/pages/ship_mgr/extra_actions.php';
  33. if (file_exists($custom_path)) { include($custom_path); }
  34. /*************** Act on the action request *************************/
  35. if ($module_id) {
  36. require_once (DIR_FS_WORKING.'methods/'.$module_id.'/'.$module_id.'.php');
  37. $shipping = new $module_id;
  38. switch ($action) {
  39. default:
  40. if (method_exists($shipping, $action)) $shipping->$action();
  41. break;
  42. case 'track': $shipping->trackPackages($date, $row_seq); break;
  43. case 'reconcile': $shipping->reconcileInvoice(); break;
  44. case 'search':
  45. case 'search_reset':
  46. }
  47. }
  48. /***************** prepare to display templates *************************/
  49. $cal_ship = array(
  50. 'name' => 'cal',
  51. 'form' => 'ship_mgr',
  52. 'fieldname' => 'search_date',
  53. 'imagename' => 'btn_date_1',
  54. 'default' => gen_locale_date($date),
  55. 'params' => array('align'=>'left', 'onchange'=>'calendarPage();'),
  56. );
  57. $include_header = true;
  58. $include_footer = true;
  59. $include_template = 'template_main.php';
  60. define('PAGE_TITLE', BOX_SHIPPING_MANAGER);
  61. ?>