PageRenderTime 64ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/_tmp/detail_working.php

https://github.com/tlezotte/ePOS
PHP | 1744 lines | 1487 code | 83 blank | 174 comment | 190 complexity | 8d8320af4f046800a1b83823213fa23d MD5 | raw file
  1. <?php
  2. /**
  3. * Request System
  4. *
  5. * detail.php displays detailed information on PO.
  6. *
  7. * @version 1.5
  8. * @link http://www.yourdomain.com/go/Request/
  9. * @author Thomas LeZotte (tom@lezotte.net)
  10. *
  11. * @package PO
  12. * @filesource
  13. *
  14. * PHP Debug
  15. * @link http://phpdebug.sourceforge.net/
  16. * PDF Toolkit
  17. * @link http://www.accesspdf.com/
  18. */
  19. /**
  20. * - Forward BlackBerry users to BlackBerry version
  21. */
  22. require_once('../include/BlackBerry.php');
  23. /**
  24. * - Start Page Loading Timer
  25. */
  26. include_once('../include/Timer.php');
  27. $starttime = StartLoadTimer();
  28. /**
  29. * - Set debug mode
  30. */
  31. $debug_page = false;
  32. include_once('debug/header.php');
  33. /**
  34. * - Database Connection
  35. */
  36. require_once('../Connections/connDB.php');
  37. /**
  38. * - Config Information
  39. */
  40. require_once('../include/config.php');
  41. /**
  42. * - Check User Access
  43. */
  44. require_once('../security/check_user.php');
  45. /**
  46. * - Form Validation
  47. */
  48. //include('vdaemon/vdaemon.php');
  49. /* -------------------------------------------------------------
  50. * ---------- START DENIAL PROCESSING --------------------------
  51. * -------------------------------------------------------------
  52. */
  53. if (substr($_POST['auth'],0,3) == 'app' OR $_POST['auth'] == 'controller') {
  54. if (array_key_exists('yes_x', $_POST)) { $yn = "yes"; } // Set approval button pressed
  55. if (array_key_exists('no_x', $_POST)) { $yn = "no"; } // Set approval button pressed
  56. /* ---------------- Check to see if a Comment was provided ---------------- */
  57. if (empty($_POST['Com']) AND $yn == 'no') {
  58. $_SESSION['error'] = "A denied Requisition requires you to enter a Comment.";
  59. $_SESSION['redirect'] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  60. header("location: ../error.php");
  61. exit();
  62. }
  63. /* ---------------- Change status for non approved request ---------------- */
  64. if ($yn == 'no') {
  65. setRequestStatus($_POST['type_id'], 'X'); // Update PO status
  66. }
  67. /* ---------------- Update the approvals for the PO ---------------- */
  68. $dbh->query("UPDATE Authorization
  69. SET ".$_POST['auth']."yn='" . $yn . "',
  70. ".$_POST['auth']."Date=NOW(),
  71. ".$_POST['auth']."Com='" . htmlentities($_POST['Com'], ENT_QUOTES, 'UTF-8') . "'
  72. WHERE id = ".$_POST['auth_id']);
  73. if ($_POST['auth'] == 'controller') {
  74. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=app0"; // Forward to Approver 1
  75. } else {
  76. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=" . $_POST['auth'] . "&yn=" . $yn; // Record Controllers Approval
  77. }
  78. header("Location: ".$forward);
  79. exit();
  80. }
  81. /* -------------------------------------------------------------
  82. * ---------- END DENIAL PROCESSING ----------------------------
  83. * -------------------------------------------------------------
  84. */
  85. /* -------------------------------------------------------------
  86. * ------------- START FINANCE PROCESSING -------------------
  87. * -------------------------------------------------------------
  88. */
  89. if ($_POST['action'] == 'finance_update') {
  90. /* ----- Controller changes Plant ----- */
  91. if ($_POST['currentPlant'] != $_POST['plant']) {
  92. $sql = "UPDATE PO SET plant='" . $_POST['plant'] . "' WHERE id=" . $_POST['type_id']; // Update Bill to Plant
  93. $dbh->query($sql);
  94. if ($default['debug_capture'] == 'on') {
  95. debug_capture($_SESSION['eid'], $_POST['id'], 'debug', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
  96. }
  97. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=controller&plant=" . $_POST['plant'] . "&department=" . $_POST['department']; // Check Controler
  98. /* ----- Controller changes Department ----- */
  99. } elseif ($_POST['currentDepartment'] != $_POST['department']) {
  100. $sql = "UPDATE PO SET department='" . $_POST['department'] . "' WHERE id=" . $_POST['type_id']; // Update Department
  101. $dbh->query($sql);
  102. if ($default['debug_capture'] == 'on') {
  103. debug_capture($_SESSION['eid'], $_POST['id'], 'debug', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
  104. }
  105. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=controller&plant=" . $_POST['plant'] . "&department=" . $_POST['department']; // Check Controler
  106. }
  107. /* ----- Cycle through items ----- */
  108. for ($x=1; $x <= $_POST['items_count']; $x++) {
  109. $item = "item" . $x; // Item ID
  110. $item_COA = $item . "_newCOA"; // COA value
  111. $item_COAid = $item_COA . "id"; // COA value ID
  112. if (strlen($_POST[$item_COAid]) > 0) {
  113. $sql = "UPDATE Items SET cat='" . $_POST[$item_COAid] . "' WHERE id=" . $_POST[$item];
  114. $dbh->query($sql);
  115. }
  116. if ($default['debug_capture'] == 'on') {
  117. debug_capture($_SESSION['eid'], $_POST['id'], 'debug', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
  118. }
  119. }
  120. /* ----- Update CER numbers and Credit Card ----- */
  121. $dbh->query("UPDATE PO SET cer='" . $_POST['cer'] . "',
  122. creditcard='" . $_POST['creditcard'] . "'
  123. WHERE id=" . $_POST['type_id']);
  124. }
  125. /* -------------------------------------------------------------
  126. * ------------- END FINANCE PROCESSING -------------------
  127. * -------------------------------------------------------------
  128. */
  129. /* -------------------------------------------------------------
  130. * ------------- START UPDATE PROCESSING -----------------------
  131. * -------------------------------------------------------------
  132. */
  133. if ($_POST['stage'] == "update") {
  134. /* -------------------------------------------------------------
  135. * ---------- START REQUESTER PROCESSING -----------------------
  136. * -------------------------------------------------------------
  137. */
  138. if ($_POST['auth'] == "req") {
  139. /* ---------------- START CANCEL PURCHASE ORDER -------------- */
  140. if ($_POST['cancel'] == 'yes') {
  141. setRequestStatus($_POST['type_id'], 'C'); // Update PO status
  142. header("location: list.php?action=my&access=0");
  143. exit();
  144. }
  145. /* --------- END CANCEL PURCHASE ORDER ----------------------- */
  146. /* ---------------- START COPY PURCHASE ORDER ---------------- */
  147. // if (array_key_exists('copyrequest_x',$_POST)) {
  148. // /* Getting PO information */
  149. // $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
  150. // FROM PO
  151. // WHERE id = ?",array($_POST['type_id']));
  152. //
  153. // /* -- Read $PO into $_SESSION -- */
  154. // foreach ($PO as $key => $value) {
  155. // $_SESSION[$key] = $value;
  156. // }
  157. //
  158. // header("location: information.php");
  159. // exit();
  160. // }
  161. /* --------- END COPY PURCHASE ORDER ----------------------- */
  162. /* ---------------- START RESEND PURCHASE ORDER ---------------- */
  163. if (array_key_exists('restorerequest_x',$_POST)) {
  164. setRequestStatus($_POST['type_id'], 'N'); // Update PO status
  165. header("location: router.php?type_id=" . $_POST['type_id'] . "&approval=app0"); // Forward to router as new Request
  166. exit();
  167. }
  168. /* --------- END RESEND PURCHASE ORDER ----------------------- */
  169. }
  170. /* -------------------------------------------------------------
  171. * ---------- END REQUESTER PROCESSING -----------------------
  172. * -------------------------------------------------------------
  173. */
  174. }
  175. /* -------------------------------------------------------------
  176. * ------------- END UPDATE PROCESSING -----------------------
  177. * -------------------------------------------------------------
  178. */
  179. /* -------------------------------------------------------------
  180. * ------------- START PURCHASING PROCESSING -------------------
  181. * -------------------------------------------------------------
  182. */
  183. if ($_POST['action'] == 'purchasing_update') {
  184. /* ------------- Adding supplier contact information ------------- */
  185. if (array_key_exists('addContact_x',$_POST)) {
  186. $sql = "INSERT INTO Contacts VALUES (NULL,
  187. '" . $_POST['id'] . "',
  188. '" . $_SESSION['eid'] . "',
  189. NOW(),
  190. '" . $_POST['cc_name'] . "',
  191. '" . $_POST['cc_phone'] . "',
  192. '" . $_POST['cc_ext'] . "',
  193. '" . $_POST['cc_email'] . "'
  194. )";
  195. $dbh->query($sql);
  196. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  197. exit();
  198. }
  199. /* ------------- Adding payment information ------------- */
  200. if (array_key_exists('addPayment_x',$_POST)) {
  201. $sql = "INSERT INTO Payments VALUES (NULL,
  202. '" . $_POST['id'] . "',
  203. '" . $_SESSION['eid'] . "',
  204. NOW(),
  205. '" . mysql_real_escape_string($_POST['pay_amount']) . "',
  206. '" . mysql_real_escape_string($_POST['paymentDate']) . "',
  207. '0')";
  208. $dbh->query($sql);
  209. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  210. exit();
  211. }
  212. /* ------------- Update payment information ------------- */
  213. if (array_key_exists('updatePayments_x',$_POST)) {
  214. for ($i=1; $i <= $_POST['payments_count']; $i++) {
  215. $pay_id = "pay_id" . $i;
  216. $pay_amount = "pay_amount" . $i;
  217. $pay_date = "pay_date" . $i;
  218. $pay_remove = "pay_remove" . $i;
  219. $pay_status = ($_POST[$pay_remove] == 'yes') ? 1 : 0;
  220. $sql = "UPDATE Payments SET pay_eid = '" . $_SESSION['eid'] . "',
  221. pay_recorded = NOW(),
  222. pay_amount = '" . mysql_real_escape_string($_POST[$pay_amount]) . "',
  223. pay_date = '" . mysql_real_escape_string($_POST[$pay_date]) . "',
  224. pay_status = '" . $pay_status . "'
  225. WHERE pay_id = " . $_POST[$pay_id];
  226. $dbh->query($sql);
  227. }
  228. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  229. exit();
  230. }
  231. /* ------------- Purchaser marks Request as Complete ------------- */
  232. if (array_key_exists('completed_x',$_POST)) {
  233. /* Record Purchasing agent */
  234. $auth_sql = "UPDATE Authorization SET issuer='" . $_SESSION['eid'] . "',
  235. issuerDate=NOW(),
  236. level='O'
  237. WHERE id = " . $_POST['auth_id'];
  238. $dbh->query($auth_sql);
  239. /* Update Request Status */
  240. $po_sql = "UPDATE PO SET po='" . $_POST['po'] . "',
  241. status='O'
  242. WHERE id = " . $_POST['id'];
  243. $dbh->query($po_sql);
  244. sendCompleted($_POST['req'],$_POST['id'],htmlspecialchars($_POST['purpose']),$_POST['po'], $_SESSION['eid']); // Send email to Requester
  245. //sendVendor($_POST['id']);
  246. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  247. exit();
  248. }
  249. /* ------------- Add Vendor and change Terms when Purchasing changes Vendor ------------- */
  250. if (strlen($_POST['vendSearch']) > 0) {
  251. $supplier2 = "sup2='" . $_POST['supplierNew'] . "',";
  252. $supplier2 .= "terms='" . $_POST['supplierNewTerms'] . "',";
  253. } else {
  254. $supplier2 = "terms='".$_POST['terms']."',";
  255. }
  256. /* ------------- Creating update fields ------------- */
  257. $PO = "fob='".$_POST['fob']."',
  258. via='".$_POST['via']."',
  259. purchaseUpdate=NOW(),
  260. reqType='".$_POST['reqtype']."',
  261. $supplier2
  262. private='".$_POST['private']."',
  263. hot='".$_POST['hot']."'
  264. ";
  265. $sql = "UPDATE PO SET $PO WHERE id = ".$_POST['id'];
  266. $dbh->query($sql);
  267. History($_SESSION['eid'], 'update', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
  268. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  269. exit();
  270. }
  271. /* -------------------------------------------------------------
  272. * ------------- END PURCHASING PROCESSING -------------------
  273. * -------------------------------------------------------------
  274. */
  275. /* -------------------------------------------------------------
  276. * ------------- START DATABASE CONNECTIONS -------------------
  277. * -------------------------------------------------------------
  278. */
  279. /* ------------- Getting PO information ------------- */
  280. $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
  281. FROM PO
  282. WHERE id = ?",array($_GET['id']));
  283. /* ------------- Getting Authoriztions for above PO ------------- */
  284. $AUTH = $dbh->getRow("SELECT * FROM Authorization WHERE type_id = ? and type = 'PO'",array($PO['id']));
  285. /* ------------- Get Employee names from Standards database ------------- */
  286. $EMPLOYEES = $dbh->getAssoc("SELECT eid, CONCAT(fst,' ',lst) AS name
  287. FROM Standards.Employees");
  288. /* ------------- Getting Vendor information from Standards ------------- */
  289. $VENDOR = $dbh->getAssoc("SELECT BTVEND, BTNAME FROM Standards.Vendor");
  290. /* ------------- Getting Company information from Standards ------------- */
  291. //$COMPANY = $dbh->getAssoc("SELECT id, name FROM Standards.Companies");
  292. /* ------------- Getting Plant information from Standards ------------- */
  293. $plant_sql = "SELECT id, name FROM Standards.Plants WHERE status = '0'";
  294. $PLANTS = $dbh->getAssoc($plant_sql);
  295. $plant_query = $dbh->prepare($plant_sql);
  296. $PLANT = $dbh->getRow("SELECT * FROM Standards.Plants WHERE id=" . $PO['plant']);
  297. /* ------------- Getting Department information from Standards ------------- */
  298. $dept_sql = "SELECT id, CONCAT('(',id,') ',name) AS fullname FROM Standards.Department WHERE status='0' ORDER BY name";
  299. $DEPARTMENT = $dbh->getAssoc($dept_sql);
  300. $dept_query = $dbh->prepare($dept_sql);
  301. /* ------------- Getting Category information from Standards ------------- */
  302. $COA = $dbh->getAssoc("SELECT CONCAT(coa_account,'-',coa_suffix) AS id, coa_description AS name
  303. FROM Standards.COA
  304. WHERE coa_plant=" . $PLANT['conbr']);
  305. /* ------------- Getting CER numbers from CER ------------- */
  306. $cer_sql = "SELECT id, cer FROM CER WHERE cer IS NOT NULL ORDER BY cer+0";
  307. $CER = $dbh->getAssoc($cer_sql);
  308. $cer_query = $dbh->prepare($cer_sql);
  309. /* ------------- Getting Vendor terms from Standards ------------- */
  310. $terms_sql = "SELECT terms_id AS id, terms_name AS name FROM Standards.VendorTerms ORDER BY name";
  311. $TERMS = $dbh->getAssoc($terms_sql);
  312. $terms_query = $dbh->prepare($terms_sql);
  313. /* ------------- Get items related to this Request -------------*/
  314. $items_sql = "SELECT * FROM Items WHERE type_id = ".$PO['id'];
  315. $items_query = $dbh->prepare($items_sql);
  316. $items_sth = $dbh->execute($items_query);
  317. $items_count = $items_sth->numRows();
  318. /* ------------- Get Purchase Request users ------------- */
  319. $purchaser_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
  320. FROM Users U
  321. INNER JOIN Standards.Employees E ON U.eid = E.eid
  322. WHERE U.role = 'purchasing'
  323. AND E.status = '0'
  324. AND U.eid <> '08745'
  325. ORDER BY E.lst ASC");
  326. /* ------------- Get Purchase Request users ------------- */
  327. $financer_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
  328. FROM Users U
  329. INNER JOIN Standards.Employees E ON U.eid = E.eid
  330. WHERE U.role = 'financing'
  331. AND E.status = '0'
  332. AND U.eid <> '08745'
  333. ORDER BY E.lst ASC");
  334. /* ------------- Get Vendor Payments ------------- */
  335. $payments = $dbh->query("SELECT * FROM Payments WHERE request_id=" . $PO['id'] . " AND pay_status='0' ORDER BY pay_date ASC");
  336. $payments_count = $payments->numRows();
  337. /* ------------- Get Contact Information ------------- */
  338. $contacts = $dbh->query("SELECT * FROM Contacts WHERE request_id=" . $PO['id'] . " ORDER BY id DESC");
  339. $contacts_count = $contacts->numRows();
  340. /* ------------- Getting Comments Information ------------- */
  341. $post_sql = "SELECT * FROM Postings
  342. WHERE request_id = ".$_GET['id']."
  343. AND type = 'global'
  344. ORDER BY posted DESC";
  345. $LAST_POST = $dbh->getRow($post_sql); // Get the last posted comment
  346. $post_query = $dbh->prepare($post_sql);
  347. $post_sth = $dbh->execute($post_query);
  348. $post_count = $post_sth->numRows();
  349. /* -------------------------------------------------------------
  350. * ------------- END DATABASE CONNECTIONS -------------------
  351. * -------------------------------------------------------------
  352. */
  353. /* -------------------------------------------------------------
  354. * ------------- START VARIABLES -------------------------------
  355. * -------------------------------------------------------------
  356. */
  357. /* ------------- Check current level and current user ------------- */
  358. if (array_key_exists('approval', $_GET)) {
  359. if ($PO['status'] != 'N') {
  360. switch ($PO['status']) {
  361. case 'C': $message="This Requisition has been marked Canceled."; break;
  362. case 'X': $message="This Requisition has been marked Not Approved."; break;
  363. case 'A': $message="This Requisition has been already Approved."; break;
  364. case 'O': $message="This Requisition has been Kicked off to the Vendor."; break;
  365. }
  366. unset($_GET['approval']);
  367. } elseif ($_GET['approval'] != $AUTH['level']) {
  368. $message="This Requisition is currently not at your approval level.";
  369. unset($_GET['approval']);
  370. } elseif ($_GET['approval'] == $AUTH['level'] AND $AUTH[$_GET['approval']] == $_SESSION['eid']) {
  371. $_GET['approval'] = $_GET['approval'];
  372. }
  373. }
  374. /* ------------- Set message for Message Center ------------- */
  375. switch ($_GET['approval']) {
  376. // case 'controller': $message="Finance can edit the Finance area and fields highlighted in <span style=\"color:#009900;\">GREEN</span>."; break;
  377. }
  378. $highlight='class="highlight"'; // Highlighted style sheet class
  379. /* ------------- Set items display mode ------------- */
  380. if ($_GET['approval'] == 'controller') {
  381. $displayItem = "display"; // Display Items detail
  382. } else {
  383. $displayItem = "none"; // Don't display Items detail
  384. }
  385. /* -------------------------------------------------------------
  386. * ------------- END VARIABLES -------------------------------
  387. * -------------------------------------------------------------
  388. */
  389. /**
  390. * - Display attachments from V3
  391. */
  392. include_once('attachment.php');
  393. /* ------------- Setup onLoad javascript program ------------- */
  394. if ($default['pageloading'] == 'on') {
  395. $ONLOAD_OPTIONS="pageloading();";
  396. }
  397. $ONLOAD_OPTIONS.="function() {
  398. new Effect.Pulsate('hotMessage', {delay:2, duration:5});
  399. new Effect.Pulsate('messageCenter', {delay:2, duration:5});
  400. }";
  401. if (isset($ONLOAD_OPTIONS)) { $ONLOAD="onLoad=\"$ONLOAD_OPTIONS\""; }
  402. ?>
  403. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  404. <html><!-- InstanceBegin template="/Templates/vnmain.dwt.php" codeOutsideHTMLIsLocked="false" -->
  405. <head>
  406. <!-- InstanceBeginEditable name="doctitle" -->
  407. <title><?= $default['title1']; ?></title>
  408. <!-- InstanceEndEditable -->
  409. <meta http-equiv="imagetoolbar" content="no">
  410. <meta name="copyright" content="2004 Your Company" />
  411. <meta name="author" content="Thomas LeZotte" />
  412. <link type="text/css" href="/Common/Print.css" rel="stylesheet" media="print">
  413. <link type="text/css" href="../default.css" charset="UTF-8" rel="stylesheet">
  414. <?php if ($default['rss'] == 'on') { ?>
  415. <link rel="alternate" type="application/rss+xml" title="Purchase Requisition Announcements" href="<?= $default['URL_HOME']; ?>/PO/<?= $default['rss_file']; ?>">
  416. <link rel="alternate" type="application/rss+xml" title="Capital Acquisition Announcements" href="<?= $default['URL_HOME']; ?>/CER/<?= $default['rss_file']; ?>">
  417. <?php } ?>
  418. <script type="text/javascript" src="/Common/js/overlibmws.js"></script>
  419. <!-- InstanceBeginEditable name="head" -->
  420. <script type="text/javascript" src="/Common/js/yahoo/yahoo/yahoo.js"></script>
  421. <script type="text/javascript" src="/Common/js/yahoo/event/event.js" ></script>
  422. <script type="text/javascript" src="/Common/js/yahoo/dom/dom.js" ></script>
  423. <script type="text/javascript" src="/Common/js/yahoo/animation/animation.js" ></script>
  424. <script type="text/javascript" src="/Common/js/yahoo/connection/connection.js" ></script>
  425. <script type="text/javascript" src="/Common/js/yahoo/container/container.js"></script>
  426. <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/container/assets/container.css">
  427. <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/overlibmws_exclusive.js"></SCRIPT>
  428. <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/overlibmws_draggable.js"></SCRIPT>
  429. <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/calendarmws.js"></SCRIPT>
  430. <script type="text/javascript" src="/Common/js/scriptaculous/prototype.js"></script>
  431. <script type="text/javascript" src="/Common/js/scriptaculous/scriptaculous.js?load=effects"></script>
  432. <script type="text/javascript" src="/Common/js/ps/treasure.js"></script>
  433. <script type="text/javascript" src="/Common/js/autoassist/autoassist.js"></script>
  434. <link href="/Common/js/autoassist/autoassist.css" rel="stylesheet" type="text/css">
  435. <script type="text/javascript" src="/Common/js/greybox5/options1.js"></script>
  436. <script type="text/javascript" src="/Common/js/greybox5/AJS.js"></script>
  437. <script type="text/javascript" src="/Common/js/greybox5/AJS_fx.js"></script>
  438. <script type="text/javascript" src="/Common/js/greybox5/gb_scripts.js"></script>
  439. <link type="text/css" href="/Common/js/greybox5/gb_styles.css" rel="stylesheet" media="all">
  440. <script language="javascript">
  441. function toggleItemDisplay(id) {
  442. $R(1, <?= $items_count+1; ?>, true).each(function(s) {
  443. $('itemDetails' + s).toggle();
  444. });
  445. }
  446. </script>
  447. <script>
  448. YAHOO.namespace("example.container");
  449. function init() {
  450. // Define various event handlers for Dialog
  451. var handleYes = function() {
  452. document.Form.submit();
  453. this.hide();
  454. };
  455. var handleNo = function() {
  456. this.hide();
  457. };
  458. // Instantiate the Dialog
  459. YAHOO.example.container.simpledialog1 = new YAHOO.widget.SimpleDialog("simpledialog1",
  460. { width: "325px",
  461. fixedcenter: true,
  462. visible: false,
  463. draggable: false,
  464. modal: true,
  465. close: true,
  466. text: "Do you want to change, this may change the Financial Controller?",
  467. icon: YAHOO.widget.SimpleDialog.ICON_WARN,
  468. constraintoviewport: true,
  469. buttons: [ { text:"Yes", handler:handleYes },
  470. { text:"No", handler:handleNo, isDefault:true } ]
  471. } );
  472. YAHOO.example.container.simpledialog1.setHeader("Are you sure?");
  473. // Render the Dialog
  474. YAHOO.example.container.simpledialog1.render(document.body);
  475. YAHOO.util.Event.addListener("plant", "change", YAHOO.example.container.simpledialog1.show, YAHOO.example.container.simpledialog1, true);
  476. <?php
  477. /* ----- Only display department change dialog for HQ(9) ----- */
  478. if ($PO['plant'] == '9') {
  479. ?>
  480. YAHOO.util.Event.addListener("department", "change", YAHOO.example.container.simpledialog1.show, YAHOO.example.container.simpledialog1, true);
  481. <?php } ?>
  482. }
  483. YAHOO.util.Event.addListener(window, "load", init);
  484. </script>
  485. <script type="text/javascript" src="../js/dynamicInputItems.js"></script>
  486. <link rel="stylesheet" type="text/css" href="<?= $default['URL_HOME']; ?>/style/dd_tabs.css" />
  487. <style type="text/css">
  488. form.inplaceeditor-form a {
  489. color:#FFFFFF;
  490. }
  491. </style>
  492. <!-- InstanceEndEditable -->
  493. <?php if ($ONLOAD_OPTIONS) { ?>
  494. <script language="javascript">
  495. AJS.AEV(window, "load", <?= $ONLOAD_OPTIONS; ?>);
  496. </script>
  497. <?php } ?>
  498. </head>
  499. <body class="yui-skin-sam">
  500. <img src="/Common/images/CompanyPrint.gif" alt="Your Company" width="437" height="61" id="Print" />
  501. <div id="noPrint">
  502. <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
  503. <tbody>
  504. <tr>
  505. <td valign="top"><a href="../home.php" title="<?= $default['title1']; ?> Home"><img name="Company" src="/Common/images/Company.gif" width="300" height="50" border="0"></a></td>
  506. <td align="right" valign="top">
  507. <!-- InstanceBeginEditable name="topRightMenu" --><!-- #BeginLibraryItem "/Library/help.lbi" --><table cellspacing="0" cellpadding="0" summary="" border="0">
  508. <tr>
  509. <td width="30"><a href="../Common/calculator.php" onClick="window.open(this.href,this.target,'width=281,height=270'); return false;" <?php help('', 'Calculator', 'default'); ?>><img src="../images/xcalc.png" width="16" height="14" border="0"></a></td>
  510. <td><a href="../Help/index.php" rel="gb_page_fs[]"><img src="../images/help.gif" width="18" height="18" border="0" align="absmiddle"></a></td>
  511. <td class="DarkHeaderSubSub">&nbsp;<a href="../Help/index.php" rel="gb_page_fs[]" class="dark">Help</a></td>
  512. </tr>
  513. </table>
  514. <!-- #EndLibraryItem --><!-- InstanceEndEditable --></td>
  515. </tr>
  516. <tr>
  517. <td valign="bottom" align="right" colspan="2"><!-- InstanceBeginEditable name="rightMenu" -->
  518. <?php include('../include/menu/main_right.php'); ?>
  519. <!-- InstanceEndEditable --></td>
  520. <td>
  521. </td>
  522. </tr>
  523. <tr>
  524. <td width="100%" colspan="3"><table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  525. <tbody>
  526. <tr>
  527. <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghtl.gif" width="4"></td>
  528. <td colspan="4"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ght.gif" border="0">
  529. <tbody>
  530. <tr>
  531. <td height="4"></td>
  532. </tr>
  533. </tbody>
  534. </table></td>
  535. <td class="BGColorDark" valign="top" rowspan="2"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ght.gif" border="0">
  536. <tbody>
  537. <tr>
  538. <td height="4"></td>
  539. </tr>
  540. </tbody>
  541. </table></td>
  542. <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghtr.gif" width="4"></td>
  543. </tr>
  544. <tr>
  545. <td class="BGGrayLight" rowspan="3"></td>
  546. <td class="BGGrayMedium" rowspan="3"></td>
  547. <td class="BGGrayDark" rowspan="3"></td>
  548. <td class="BGColorDark" rowspan="3"></td>
  549. <td class="BGColorDark" rowspan="3"><!-- InstanceBeginEditable name="leftMenu" --><?php include('../include/menu/main_left.php'); ?><!-- InstanceEndEditable --></td>
  550. <td class="BGColorDark" rowspan="3"></td>
  551. <td class="BGColorDark" rowspan="2"></td>
  552. <td class="BGColorDark" rowspan="2"></td>
  553. <td class="BGColorDark" rowspan="2"></td>
  554. <td class="BGGrayDark" rowspan="2"></td>
  555. <td class="BGGrayMedium" rowspan="2"></td>
  556. <td class="BGGrayLight" rowspan="2"></td>
  557. </tr>
  558. <tr>
  559. <td class="BGColorDark" width="100%"><?php
  560. if (isset($_SESSION['username'])) {
  561. ?>
  562. <div align="right" class="FieldNumberDisabled">&nbsp;</div>
  563. <?php
  564. } else {
  565. echo "&nbsp;";
  566. }
  567. ?>
  568. </td>
  569. </tr>
  570. <tr>
  571. <td valign="top"><img height="20" alt="" src="../images/c-ghct.gif" width="25"></td>
  572. <td valign="top" colspan="2"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ghb.gif" border="0">
  573. <tbody>
  574. <tr>
  575. <td height="4"></td>
  576. </tr>
  577. </tbody>
  578. </table></td>
  579. <td valign="top" colspan="4"><img height="20" alt="" src="../images/c-ghbr.gif" width="4"></td>
  580. </tr>
  581. <tr>
  582. <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghbl.gif" width="4"></td>
  583. <td><table height="4" cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ghb.gif" border="0">
  584. <tbody>
  585. <tr>
  586. <td></td>
  587. </tr>
  588. </tbody>
  589. </table></td>
  590. <td><img height="4" alt="" src="../images/c-ghcb.gif" width="3"></td>
  591. <td colspan="7"></td>
  592. </tr>
  593. </tbody>
  594. </table></td>
  595. </tr>
  596. </tbody>
  597. </table>
  598. </div>
  599. <!-- InstanceBeginEditable name="main" -->
  600. <?php
  601. if ($_SESSION['request_access'] == '3') {
  602. echo "&nbsp;<img src=\"/Common/images/adminAction.gif\" onClick=\"new Effect.toggle('adminPanel', 'slide')\">";
  603. echo "&nbsp;<img src=\"/Common/images/adminSQLAction.gif\" onClick=\"new Effect.toggle('debugPanel', 'slide')\">";
  604. include('../Administration/include/detail.php');
  605. include('../Administration/include/sql_debug.php');
  606. }
  607. ?>
  608. <table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  609. <tbody>
  610. <tr>
  611. <td height="2"></td>
  612. </tr>
  613. <tr>
  614. <td><table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  615. <tbody>
  616. <tr>
  617. <td align="center">
  618. <div id="hotMessage" style="width: 98%;margin:3px auto;display:<?= ($PO['hot'] == 'yes') ? display : none; ?>">This Requisition has been tagged HOT!!</div>
  619. <div id="messageCenter" style="width: 98%;margin:3px auto;display:<?= (isset($message)) ? display : none; ?>"><?= $message; ?></div>
  620. <form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" name="Form" id="Form" runat="vdaemon">
  621. <table border="0" cellpadding="0" cellspacing="0">
  622. <tr>
  623. <td>
  624. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  625. <tr>
  626. <td></td>
  627. <td height="26" valign="bottom">
  628. <table border="0" align="right" cellpadding="0" cellspacing="0">
  629. <tr>
  630. <?php if ($_SESSION['eid'] == $PO['req'] and ! empty($PO['po'])) { ?>
  631. <td><div id="ddcolortabs">
  632. <ul>
  633. <li id="inactive"><a href="checkInformation.php?id=<?= $PO['id']; ?>" <?php help('', 'Request Purchasing to send Vendor a check.', 'default'); ?> rel="gb_page_center[750, 450]"><span>Check&nbsp;Request</span></a></li>
  634. </ul>
  635. </div></td>
  636. <td>
  637. <div id="ddcolortabs">
  638. <ul>
  639. <li id="inactive"><a href="packingSlip.php?id=<?= $_GET['id']; ?>&po=<?= $PO['po']; ?>&req=<?= $PO['req']; ?>&issuer=<?= $AUTH['issuer']; ?>" <?php help('', 'Send electronic packing slip to Puchasing', 'default'); ?> rel="gb_page_center[500, 300]"><span>Packing&nbsp;Slip</span></a></li>
  640. </ul>
  641. </div></td>
  642. <?php } ?>
  643. <td><div id="ddcolortabs">
  644. <ul>
  645. <li id="inactive"><a href="javascript: window.print();" <?php help('', 'Click here to print this Request', 'default'); ?>><span>Print&nbsp;Requisition</span></a></li>
  646. </ul>
  647. </div></td>
  648. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  649. </tr>
  650. </table></td>
  651. </tr>
  652. <tr class="BGAccentVeryDark">
  653. <td width="50%" height="30" nowrap class="DarkHeaderSubSub">&nbsp;&nbsp;Purchase Order Requisition...</td>
  654. <td width="50%"></td>
  655. </tr>
  656. </table>
  657. </td>
  658. </tr>
  659. <tr>
  660. <td class="BGAccentVeryDarkBorder"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  661. <tr>
  662. <td valign="top" class="BGAccentDarkBorder"><table width="100%" border="0">
  663. <tr>
  664. <td height="25" colspan="4" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  665. <tr>
  666. <td><img src="../images/info.png" width="16" height="16" align="texttop"><strong>&nbsp;Information</strong></td>
  667. <td><div align="right" class="mainsection">Status: <strong><?= reqStatus($PO['status']); ?></strong>
  668. <input type="hidden" name="status" value="<?= $PO['status']; ?>">
  669. &nbsp;&nbsp;</div></td>
  670. </tr>
  671. </table></td>
  672. </tr>
  673. <tr>
  674. <td nowrap>Requisition Number:</td>
  675. <td class="label"><?= $_GET['id']; ?></td>
  676. <td nowrap>&nbsp;</td>
  677. <td>&nbsp;</td>
  678. </tr>
  679. <tr>
  680. <td width="12%" nowrap>Purchase Order Number:</td>
  681. <td width="45%" class="label"><?= ($PO['creditcard'] == 'yes') ? "Credit Card" : $PO['po']; ?></td>
  682. <td width="13%" nowrap><table width="100%" border="0" cellspacing="0" cellpadding="0">
  683. <tr>
  684. <td nowrap>CER Number:</td>
  685. <td width="35" align="right"><a href="cer_list.php" rel="gb_page_center[700, 600]" <?php help('', 'Click here to get a list of approved Capital Acquisition Requests', 'default'); ?>><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a></td>
  686. </tr>
  687. </table></td>
  688. <td width="26%"><table border="0" cellspacing="0" cellpadding="0">
  689. <tr>
  690. <td class="label"><a href="../CER/detail.php?id=<?= $PO['cer']; ?>" class="dark" rel="gb_page_fs[]"><?= $CER[$PO['cer']]; ?></a></td>
  691. <td><?php if (!empty($PO['cer'])) { ?>
  692. <a href="<?= $default['URL_HOME']; ?>/CER/print.php?id=<?= $PO['cer']; ?>" <?php help('', 'Click here to print this Capital Acquisition Request', 'default'); ?>><img src="../images/printer.gif" border="0" align="absmiddle"></a>
  693. <?php } ?></td>
  694. </tr>
  695. </table></td>
  696. </tr>
  697. <tr>
  698. <td>Requisitioner:</td>
  699. <td class="label"><?= caps($EMPLOYEES[$PO['req']]); ?></td>
  700. <td nowrap>Requisition Date:</td>
  701. <td class="label"><?= $PO['_reqDate']; ?></td>
  702. </tr>
  703. <?php if (!empty($PO['incareof']) AND $PO['req'] != $PO['incareof']) { ?>
  704. <tr>
  705. <td><img src="/Common/images/menupointer2.gif" width="4" height="7" align="absmiddle"> In Care Of:</td>
  706. <td class="label"><?= caps($EMPLOYEES[$PO['incareof']]); ?></td>
  707. <td>&nbsp;</td>
  708. <td>&nbsp;</td>
  709. </tr>
  710. <?php } ?>
  711. <tr>
  712. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
  713. </tr>
  714. <?php if (strlen($PO['sup2']) == 6) { ?>
  715. <tr>
  716. <td nowrap>Final Vendor: </td>
  717. <td nowrap class="label"><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?><?php
  718. /* Getting suppliers from Suppliers */
  719. $SUPPLIER = $dbh->getRow("SELECT BTVEND AS id, BTNAME AS name, BTADR1 AS address, BTADR3 AS city, BTPRCD AS state, BTPOST AS zip5, BTWPAG AS web
  720. FROM Standards.Vendor
  721. WHERE BTVEND = '".$PO['sup2']."'");
  722. ?><span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&name=<?= caps($SUPPLIER['name']); ?>&address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle"></a><?php if (!empty($SUPPLIER['web'])) { ?>&nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle"></a>
  723. <?php } ?><a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&company=<?= $PO['company']; ?>" title="Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle"></a></span></td>
  724. <td>Kickoff Date:</td>
  725. <td class="label"><?= ($AUTH['issuerDate'] == '0000-00-00 00:00:00' OR is_null($AUTH['issuerDate'])) ? $blank : date("F j, Y", strtotime($AUTH['issuerDate'])); ?></td>
  726. </tr>
  727. <?php } ?>
  728. <tr>
  729. <td nowrap><?= (empty($PO['po'])) ? Recommended : Final; ?> Vendor:</td>
  730. <td nowrap class="label"><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?><?php
  731. /* Getting suppliers from Suppliers */
  732. $SUPPLIER = $dbh->getRow("SELECT BTVEND AS id, BTNAME AS name, BTADR1 AS address, BTADR3 AS city, BTPRCD AS state, BTPOST AS zip5, BTWPAG AS web
  733. FROM Standards.Vendor
  734. WHERE BTVEND = '".$PO['sup']."'");
  735. ?><span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&name=<?= caps($SUPPLIER['name']); ?>&address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle"></a><?php if (!empty($SUPPLIER['web'])) { ?>&nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle"></a>
  736. <?php } ?><a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&company=<?= $PO['company']; ?>" title="Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle"></a></span></td>
  737. <?php if (strlen($PO['sup2']) != 6 AND !empty($PO['po'])) { ?>
  738. <td>Kickoff Date:</td>
  739. <td class="label"><?= ($AUTH['issuerDate'] == '0000-00-00 00:00:00' OR is_null($AUTH['issuerDate'])) ? $blank : date("F j, Y", strtotime($AUTH['issuerDate'])); ?></td>
  740. <?php } else { ?>
  741. <td>&nbsp;</td>
  742. <td>&nbsp;</td>
  743. <?php } ?>
  744. </tr>
  745. <!-- <tr>
  746. <td>Company:</td>
  747. <td class="label"><?= caps($COMPANY[$PO[company]]); ?></td>
  748. <td nowrap>&nbsp;</td>
  749. <td>&nbsp;</td>
  750. </tr>-->
  751. <tr>
  752. <td>Bill to Plant: </td>
  753. <td class="label"><?= caps($PLANTS[$PO['plant']]); ?><input type="hidden" name="currentPlant" id="currentPlant" value="<?= $PO['plant']; ?>"></td>
  754. <td>Deliver to Plant: </td>
  755. <td class="label"><?= caps($PLANTS[$PO['ship']]); ?></td>
  756. </tr>
  757. <tr>
  758. <td>Department:</td>
  759. <td class="label"><?= caps($DEPARTMENT[$PO['department']]); ?><input type="hidden" name="currentDepartment" id="currentDepartment" value="<?= $PO['department']; ?>"></td>
  760. <td>Job Number: </td>
  761. <td class="label"><?= $PO['job']; ?></td>
  762. </tr>
  763. <tr>
  764. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
  765. </tr>
  766. <tr>
  767. <td valign="top" nowrap>Purpose / Usage:</td>
  768. <td colspan="3" class="label"><?= caps(stripslashes($PO['purpose'])); ?></td>
  769. </tr>
  770. </table></td>
  771. </tr>
  772. <!--
  773. <tr>
  774. <td>&nbsp;</td>
  775. </tr>
  776. <tr>
  777. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  778. <tr>
  779. <td width="100%" height="25" colspan="6" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  780. <tr>
  781. <td>&nbsp;<a href="javascript:switchTracking();" class="black" <?php help('', 'Show or Hide the Track Shipments', 'default'); ?>><strong><img src="../images/package.gif" width="16" height="16" border="0" align="texttop">&nbsp;Track Shipments </strong></a></td>
  782. <td width="120">&nbsp;</td>
  783. </tr>
  784. </table></td>
  785. </tr>
  786. <td>&nbsp;</td>
  787. </table>
  788. </td>
  789. </tr>
  790. -->
  791. <tr>
  792. <td>&nbsp;</td>
  793. </tr>
  794. <tr><td class="BGAccentDarkBorder"><table width="100%" border="0">
  795. <tr>
  796. <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  797. <tr>
  798. <td>&nbsp;<a href="javascript:void(0);" onClick="new Effect.toggle('itemsContainer','blind')" class="black" <?php help('', 'Show or Hide the Item Information', 'default'); ?>><strong><img src="../images/text.gif" width="16" height="16" border="0" align="texttop">&nbsp;Item Information</strong></a></td>
  799. <td width="120"><a href="javascript:toggleItemDisplay('itemsContainer');" class="viewcomments">View All Details </a></td>
  800. </tr>
  801. </table></td>
  802. </tr>
  803. <tr>
  804. <td>
  805. <div id="itemsContainer">
  806. <table width="100%" border="0">
  807. <tr>
  808. <td width="35" class="HeaderAccentDark">&nbsp;</td>
  809. <td width="35" class="HeaderAccentDark">Unit</td>
  810. <td width="80" nowrap class="HeaderAccentDark">Company#&nbsp;</td>
  811. <td width="60" nowrap class="HeaderAccentDark">Manuf#&nbsp;</td>
  812. <td class="HeaderAccentDark">Item Description</td>
  813. <td width="80" nowrap class="HeaderAccentDark">Price</td>
  814. </tr>
  815. <?php
  816. while($items_sth->fetchInto($ITEMS)) {
  817. $count_items++;
  818. $row_color = ($count_items % 2) ? FFFFFF : DFDFBF;
  819. ?>
  820. <!-- Start of Item<?= $count_items; ?> -->
  821. <tr <?php pointer($row_color); ?>>
  822. <td width="50" bgcolor="#<?= $row_color; ?>" class="label"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  823. <tr>
  824. <td><a href="javascript:switchItems('itemDetails<?= $count_items; ?>', 'collapsed');" id="itemDetails<?= $count_items; ?>A" <?php help('', 'View more details on this item', 'default'); ?>><img src="../images/1rightarrow.gif" name="itemDetails<?= $count_items; ?>I" width="16" height="16" border="0" id="itemDetails<?= $count_items; ?>I">
  825. <input name="item<?= $count_items; ?>" type="hidden" id="item<?= $count_items; ?>" value="<?= $ITEMS['id']; ?>">
  826. </a></td>
  827. <td><strong><?= $ITEMS['qty']; ?></strong></td>
  828. </tr>
  829. </table></td>
  830. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper($ITEMS['unit']); ?></td>
  831. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['part'])); ?></td>
  832. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['manuf'])); ?></td>
  833. <td nowrap bgcolor="#<?= $row_color; ?>" class="label">
  834. <?php
  835. if (strlen($ITEMS['descr']) > 50) {
  836. echo caps(substr(stripslashes($ITEMS['descr']), 0, 50));
  837. echo "...<a href=\"javascript:void(0);\" class=black onmouseover=\"return overlib('" . caps(stripslashes($ITEMS['descr'])) . "', TEXTPADDING, 10, WIDTH, 300, WRAPMAX, 300, AUTOSTATUS, BGCOLOR, '#000000', CGCOLOR, '#E68B2C', FGCOLOR, '#B0D585');\" onmouseout=\"nd();\"><img src=\"../images/bubble.gif\" width=14 height=17 border=0 align=absmiddle></a>";
  838. } else {
  839. echo caps(stripslashes($ITEMS['descr']));
  840. }
  841. ?></td>
  842. <td bgcolor="#<?= $row_color; ?>" class="label"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  843. <tr>
  844. <td><strong>$</strong></td>
  845. <td align="right"><strong><?php $d=(substr($ITEMS['price'], -2, 2) == '00') ? 2 : 4; echo number_format($ITEMS['price'],$d); ?><?= ($d == 2) ? "<img src=\"/Common/images/spacer.gif\" width=\"18\" height=\"5\">" : ''; ?></strong></td>
  846. </tr>
  847. </table></td>
  848. </tr>
  849. <tr <?php pointer($row_color); ?> id="itemDetails<?= $count_items; ?>" style="display:<?= $displayItem; ?>">
  850. <td colspan="6" bgcolor="#<?= $row_color; ?>" class="label"><table border="0">
  851. <tr>
  852. <td width="20">&nbsp;</td>
  853. <td width="200">&nbsp;</td>
  854. <td width="24">&nbsp;</td>
  855. <td width="100" class="gHeader">GL Code </td>
  856. <td width="250" class="gHeader">Name</td>
  857. </tr>
  858. <tr>
  859. <td>&nbsp;</td>
  860. <td><?= ($_GET['approval'] == 'controller') ? Recommended : Item; ?> Category: </td>
  861. <td class="label"><?= checkCategory($count_items, $PLANT['conbr'], $PO['department'], $ITEMS['cat']); ?></td>
  862. <td class="label"><?= $PLANT['conbr'] . "-" . $PO['department'] . "-" . $ITEMS['cat']; ?></td>
  863. <td class="label"><?= caps($COA[$ITEMS['cat']]); ?></td>
  864. </tr>
  865. <?php if ($_GET['approval'] == 'controllerOFF') { ?>
  866. <tr>
  867. <td>&nbsp;</td>
  868. <td>Change Category: </td>
  869. <td class="label">&nbsp;</td>
  870. <td class="label"><div id="item<?= $count_items; ?>_newGLnumber"></div></td>
  871. <td class="label"><input id="item<?= $count_items; ?>_newCOA" name="item<?= $count_items; ?>_newCOA" type="text" size="50" class="editContent" />
  872. <script type="text/javascript">
  873. Event.observe(window, "load", function() {
  874. var aa = new AutoAssist("item<?= $count_items; ?>_newCOA", function() {
  875. return "../Common/COA.php?p=<?= $PLANT['conbr']; ?>&d=<?= $PO['department']; ?>&i=<?= $count_items; ?>&q=" + this.txtBox.value;
  876. });
  877. });
  878. </script>
  879. <input name="item<?= $count_items; ?>_newCOAid" type="hidden" id="item<?= $count_items; ?>_newCOAid"></td>
  880. </tr>
  881. <?php } ?>
  882. <?php if ($_GET['approval'] == 'controller') { ?>
  883. <tr>
  884. <td>&nbsp;</td>
  885. <td>Change Category: </td>
  886. <td class="label">&nbsp;</td>
  887. <td nowrap class="label"><?= $PLANT['conbr']; ?>-<?= $PO['department']; ?>-<input name="item<?= $count_items; ?>_newCOAid" type="text" class="BGAccentDarkBlueBorder" id="item<?= $count_items; ?>_newCOAid" size="7" maxlength="7" /></td>
  888. <td><img src="/Common/images/left-collapsed.gif" width="10" height="10" align="absmiddle"> Enter GL-Number here (XXXX-XX)</td>
  889. </tr>
  890. <?php } ?>
  891. <tr>
  892. <td>&nbsp;</td>
  893. <td>Company Tool Number: </td>
  894. <td class="label">&nbsp;</td>
  895. <td class="label"><?= $ITEMS['vt']; ?></td>
  896. <td>&nbsp;</td>
  897. </tr>
  898. </table></td></tr>
  899. <!-- End of Item<?= $count_items; ?> -->
  900. <?php } ?>
  901. <tr><td colspan="5" align="right" class="xpHeaderBottomActive"><input name="items_count" type="hidden" id="items_count" value="<?= $count_items; ?>">
  902. Total: </td>
  903. <td class="xpHeaderBottomActive"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  904. <tr>
  905. <td style="font-weight:bold">$</td>
  906. <td style="font-weight:bold" align="right"><?= number_format($PO['total'],2); ?><img src="/Common/images/spacer.gif" width="18" height="5"></td>
  907. </tr>
  908. </table></td>
  909. </tr>
  910. </table>
  911. </div></td>
  912. </tr>
  913. </table></td></tr>
  914. <tr>
  915. <td>&nbsp;</td>
  916. </tr>
  917. <tr>
  918. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  919. <tr>
  920. <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  921. <tr>
  922. <td>&nbsp;<a href="javascript:void(0);" onClick="new Effect.toggle('attachments','blind')" class="black" <?php help('', 'Show or Hide the Attachments', 'default'); ?>><strong><img src="../images/paperclip.gif" width="17" height="17" border="0" align="texttop">&nbsp;Attachments</strong></a></td>
  923. <td width="160"><!--<a href="../Uploads/index.php?request_id=<?= $_GET['id']; ?>&type_id=PO#upload" target="attachments" class="viewcomments">Upload File</a>--></td>
  924. </tr>
  925. </table></td>
  926. </tr>
  927. <tr>
  928. <td>
  929. <div id="attachments">
  930. <!--<iframe id="attachments" name="attachments" frameborder="0" width="100%" height="150" src="../Uploads/index.php?request_id=<?= $_GET['id']; ?>&type_id=PO"></iframe>-->
  931. <table width="100%" border="0">
  932. <tr>
  933. <td width="12%">Quote:</td>
  934. <td nowrap><?= $Attachment; ?></td>
  935. <?php if ($_SESSION['eid'] == $PO['req'] AND $_SESSION['eid'] != $AUTH['issuer']) { ?>
  936. <td width="50%">&nbsp;
  937. <?= $CHANGE; ?>
  938. &nbsp;
  939. <input name="file" type="file" id="file" size="50"></td>
  940. <?php } ?>
  941. </tr>
  942. <tr>
  943. <td nowrap>File Cabinet:</td>
  944. <td nowrap><?= $Attachment2; ?></td>
  945. <?php if ($_SESSION['eid'] == $PO['req']) { ?>
  946. <td>&nbsp;
  947. <?= $ADDITION; ?>
  948. &nbsp;
  949. <input name="file2" type="file" id="file2" size="50"></td>
  950. <?php } ?>
  951. </tr>
  952. </table>
  953. </div></td>
  954. </tr>
  955. </table></td>
  956. </tr>
  957. <tr>
  958. <td>&nbsp;</td>
  959. </tr>
  960. <tr>
  961. <td class="<?= (array_key_exists('approval', $_GET)) ? BGAccentDarkBlueBorder : BGAccentDarkBorder; ?>"><table width="100%" border="0">
  962. <tr>
  963. <td width="100%" height="25" colspan="6" class="<?= (array_key_exists('approval', $_GET)) ? BGAccentDarkBlue : BGAccentDark; ?>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  964. <tr>
  965. <td>&nbsp;<a href="javascript:switchComments();" class="<?= (array_key_exists('approval', $_GET)) ? white : black; ?>" <?php help('', 'Show or Hide the Comments', 'default'); ?>><strong><img src="../images/comments.gif" width="19" height="16" border="0" align="texttop">&nbsp;Comments</strong></a></td>
  966. <td width="120"><a href="comments.php?request_id=<?= $_GET['id']; ?>&eid=<?= $_SESSION['eid']; ?>" title="Post a new comment" rel="gb_page_center[675,325]" class="<?= (array_key_exists('approval', $_GET)) ? addWhite : addBlack; ?>">NEW COMMENT</a></td>
  967. </tr>
  968. </table></td>
  969. </tr>
  970. <td>
  971. <?php if ($post_count > 0) { ?>
  972. <div id="commentsHeader" onClick="switchComments();">There <?= ($post_count > 1) ? are : is; ?> currently <strong><?= $post_count; ?></strong> comment<?= ($post_count > 1) ? s : ''; ?>. The last comment was posted on <strong><?= date('F d, Y \a\t H:i A', strtotime($LAST_POST['posted'])); ?></strong>.<br>
  973. <br><div class="clickToView">Click to view all Comments.</div></div>
  974. <?php } else { ?>
  975. <div id="commentsHeader">There are currently <strong>NO</strong> comments.</div>
  976. <?php } ?>
  977. <div width="95%" border="0" align="center" id="commentsArea" style="display:none" onClick="switchComments();">
  978. <br>
  979. <?php
  980. $count=0;
  981. while($post_sth->fetchInto($POST)) {
  982. $count++;
  983. ?>
  984. <div class="comment">
  985. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  986. <tr>
  987. <td width="55" rowspan="3" valign="top" class="comment_datenum"><div class="comment_month">
  988. <?= date("M", strtotime($POST['posted'])); ?>
  989. </div>
  990. <div class="comment_day">
  991. <?= date("d", strtotime($POST['posted'])); ?>
  992. </div>
  993. <div class="comment_year">
  994. <?= date("y", strtotime($POST['posted'])); ?>
  995. </div></td>
  996. <td class="comment_wrote"><?= ucwords(strtolower($EMPLOYEES[$POST[eid]])); ?>
  997. wrote... </td>
  998. </tr>
  999. <tr>
  1000. <td class="commentbody"><?= caps(stripslashes($POST['comment'])); ?></td>
  1001. </tr>
  1002. <tr>
  1003. <td class="comment_date"><?= date("h:i A", strtotime($POST['posted'])); ?></td>
  1004. </tr>
  1005. </table>
  1006. </div>
  1007. <br>
  1008. <?php } ?></div></td>
  1009. </table></td>
  1010. </tr>
  1011. <tr>
  1012. <td>&nbsp;</td>
  1013. </tr>
  1014. <?php if ($_SESSION['request_role'] == 'controller' OR $_SESSION['request_role'] == 'executive') { ?>
  1015. <tr>
  1016. <td class="BGAccentDarkBlueBorder"><table width="100%" border="0">
  1017. <tr>
  1018. <td height="25" class="BGAccentDarkBlue"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  1019. <tr>
  1020. <td><img src="../images/team.gif" width="16" height="18" align="texttop"> <a href="javascript:void(0);" class="white"><strong>Finance Department</strong></a></td>
  1021. <td align="right"><a href="javascript:void(0);" <?php help('Last Updated', date('\D\a\y\: F d, Y \<\b\r\>\T\i\m\e\: H:i:s', strtotime($PO['update_status'])), 'default'); ?> class="LightHeaderSubSub"></a></td>
  1022. </tr>
  1023. </table></td>
  1024. </tr>
  1025. <tr>
  1026. <td><fieldset class="collapsible" id="financeInfoF">
  1027. <legend><a href="javascript:switchFieldset('financeInfo', 'collapsible');" id="financeInfoA">Billing</a></legend>
  1028. <table width="100%" border="0" cellspacing="2" cellpadding="0" id="financeInfo">
  1029. <tr>
  1030. <td width="194" nowrap>CER Number:</td>
  1031. <td width="150" class="label"><a href="../CER/detail.php?id=<?= $PO['cer']; ?>" class="dark" rel="gb_page_fs[]"><?= $CER[$PO['cer']]; ?></a></td>
  1032. <td nowrap><!--Credit Card Purchase:--></td>
  1033. <td width="187"><!--<select name="creditcard" id="creditcard" >
  1034. <option value="no" <?= ($PO['creditcard'] == 'no') ? selected : $blank; ?>>No</option>
  1035. <option value="yes" <?= ($PO['creditcard'] == 'yes') ? selected : $blank; ?>>Yes</option>
  1036. </select>--></td>
  1037. </tr>
  1038. <tr>
  1039. <td nowrap><table width="100%" border="0" cellspacing="0" cellpadding="0">
  1040. <tr>
  1041. <td nowrap>Change CER Number:</td>
  1042. <td width="35" align="right"><a href="cer_list.php" rel="gb_page_center[700, 600]" <?php help('', 'Click here to get a list of approved Capital Acquisition Requests', 'default'); ?>><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a></td>
  1043. </tr>
  1044. </table></td>
  1045. <td><select name="cer" id="cer">
  1046. <option value="0">Select One</option>
  1047. <?php
  1048. $cer_sth = $dbh->execute($cer_query);
  1049. while($cer_sth->fetchInto($DATA)) {
  1050. echo " <option value=\"".$DATA['id']."\">".caps($DATA['cer'])."</option>\n";
  1051. }
  1052. ?>
  1053. </select></td>
  1054. <td nowrap><!--In Budget:--></td>
  1055. <td><!--<select name="inBudget" id="inBudget">
  1056. <option value="no" <?= ($PO['inBudget'] == 'no') ? selected : $blank; ?>>No</option>
  1057. <option value="yes" <?= ($PO['inBudget'] == 'yes') ? selected : $blank; ?>>Yes</option>
  1058. </select>--></td>
  1059. </tr>
  1060. <tr>
  1061. <td height="5" colspan="4" nowrap><img src="../images/spacer.gif" width="5" height="5"></td>
  1062. </tr>
  1063. <tr>
  1064. <td nowrap>Bill to Plant: </td>
  1065. <td class="label"><?= caps($PLANTS[$PO['plant']]); ?></td>
  1066. <td nowrap>Department:</td>
  1067. <td class="label"><?= caps($DEPARTMENT[$PO['department']]); ?></td>
  1068. </tr>
  1069. <tr>
  1070. <td nowrap>Change Bill to Plant: </td>
  1071. <td><select name="plant" id="plant">
  1072. <option value="0">Select One</option>
  1073. <?php
  1074. $plant_sth = $dbh->execute($plant_query);
  1075. while($plant_sth->fetchInto($DATA)) {
  1076. $selected = ($PO['plant'] == $DATA['id']) ? selected : $blank;
  1077. echo " <option value=\"".$DATA['id']."\" ".$selected.">".caps($DATA['name'])."</option>\n";
  1078. }
  1079. ?>
  1080. </select></td>
  1081. <td nowrap>Change Department:</td>
  1082. <td><select name="department" id="department">
  1083. <option value="0">Select One</option>
  1084. <?php
  1085. $dept_sth = $dbh->execute($dept_query);
  1086. while($dept_sth->fetchInto($DEPT)) {
  1087. $selected = ($PO['department'] == $DEPT['id']) ? selected : $blank;
  1088. echo " <option value=\"".$DEPT['id']."\" ".$selected.">".caps($DEPT['fullname'])."</option>\n";
  1089. }
  1090. ?>
  1091. </select></td>
  1092. </tr>
  1093. <tr>
  1094. <td height="5" colspan="4" nowrap><img src="../images/spacer.gif" width="5" height="5"></td>
  1095. </tr>
  1096. <tr>
  1097. <td>&nbsp;</td>
  1098. <td>&nbsp;</td>
  1099. <td>&nbsp;</td>
  1100. <td><!--<input name="updaterequest" type="image" src="../images/button.php?i=w130.png&l=Update Request" alt="Update Request" border="0">-->
  1101. <input name="action" type="hidden" id="action" value="finance_update">
  1102. &nbsp;</td>
  1103. </tr>
  1104. </table>
  1105. </fieldset></td>
  1106. </tr>
  1107. </table></td>
  1108. </tr>
  1109. <tr><td>&nbsp;</td></tr>
  1110. <?php } ?>
  1111. <tr>
  1112. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  1113. <tr>
  1114. <td width="405" height="25" colspan="6" class="BGAccentDark"><strong><a name="approvals"></a><img src="../images/checkmark.gif" width="16" height="16" align="texttop"></strong>&nbsp;Approvals</td>
  1115. </tr>
  1116. <!-- START REQUESTER -->
  1117. <tr>
  1118. <td height="25" colspan="6"><table border="0">
  1119. <tr class="BGAccentDark">
  1120. <td height="25" nowrap>&nbsp;</td>
  1121. <td width="30" nowrap>&nbsp;</td>
  1122. <td nowrap class="HeaderAccentDark">&nbsp;</td>
  1123. <td nowrap class="HeaderAccentDark">Date</td>
  1124. <td width="20" align="center" nowrap class="HeaderAccentDark"><a href="javascript:void(0);" <?php help('', 'Days between Approvals', 'default'); ?>><img src="/Common/images/clock.gif" width="16" height="16" border="0"></a></td>
  1125. <td width="30" align="center" nowrap class="HeaderAccentDark"><a href="javascript:void(0);" <?php help('', 'Number of comments submitted by each Approver', 'default'); ?>><img src="../images/comments.gif" width="19" height="16" border="0"></a></td>
  1126. <td width="400" nowrap class="HeaderAccentDark">Comments</td>
  1127. <td nowrap class="HeaderAccentDark"><?= (array_key_exists('approval', $_GET)) ? 'Approval' : $blank; ?></td>
  1128. </tr>
  1129. <tr>
  1130. <td nowrap>Requester:</td>
  1131. <td align="center" nowrap><?= showCommentIcon($PO['req'], ucwords(strtolower($EMPLOYEES[$PO['req']])), $PO['id']); ?></td>
  1132. <td nowrap class="label"><?= ucwords(strtolower($EMPLOYEES[$PO['req']])); ?></td>
  1133. <td nowrap class="label"><?= $PO['_reqDate']; ?></td>
  1134. <td nowrap class="TrainActive">-</td>
  1135. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black"><?= checkComments($_GET['id'], $PO['req']); ?></a></td>
  1136. <td nowrap>&nbsp;</td>
  1137. <td nowrap>&nbsp;</td>
  1138. </tr>
  1139. <!-- END REQUESTER -->
  1140. <?php if (strlen($AUTH['controller']) == 5) { ?>
  1141. <!-- START CONTROLLER -->
  1142. <tr <?= ($_GET['approval'] == 'controller') ? $highlight : $blank; ?>>
  1143. <td nowrap>Controller:</td>
  1144. <td align="center" nowrap><?php
  1145. if (is_null($AUTH['controllerDate'])) {
  1146. echo showMailIcon('controller', $AUTH['controller'], caps($EMPLOYEES[$AUTH['controller']]), $PO['id']);
  1147. } else {
  1148. echo showCommentIcon($AUTH['controller'], caps($EMPLOYEES[$AUTH['controller']]), $PO['id']);
  1149. }
  1150. ?></td>
  1151. <td nowrap class="label"><?= caps($EMPLOYEES[$AUTH['controller']]); ?></td>
  1152. <td nowrap class="label"><?php if (isset($AUTH['controllerDate'])) { echo date("F d, Y", strtotime($AUTH['controllerDate'])); } ?></td>
  1153. <td nowrap class="TrainActive">&nbsp;</td>
  1154. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black">
  1155. <?= checkComments($_GET['id'], $AUTH['controller']); ?>
  1156. </a></td>
  1157. <td nowrap class="label"><?= displayAppComment('controller', $_GET['approval'], $AUTH['controller'], $AUTH['controllerCom'], $AUTH['controllerDate']); ?></td>
  1158. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'controller', $AUTH['controller'], $AUTH['controllerDate']); ?></td>
  1159. </tr>
  1160. <?php } ?>
  1161. <!-- END CONTROLLER -->
  1162. <!-- START APPROVER 1 -->
  1163. <tr <?= ($_GET['approval'] == 'app1') ? $highlight : $blank; ?>>
  1164. <td nowrap><?= $language['label']['app1']; ?>:</td>
  1165. <td align="center" nowrap><?php
  1166. if (is_null($AUTH['app1Date'])) {
  1167. echo showMailIcon('app1', $AUTH['app1'], caps($EMPLOYEES[$AUTH['app1']]), $PO['id']);
  1168. } else {
  1169. echo showCommentIcon($AUTH['app1'], caps($EMPLOYEES[$AUTH['app1']]), $PO['id']);
  1170. }
  1171. ?></td>
  1172. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  1173. <td nowrap class="label"><?php if (isset($AUTH['app1Date'])) { echo date("F d, Y", strtotime($AUTH['app1Date'])); } ?></td>
  1174. <td nowrap class="TrainActive"><?php if (isset($AUTH['app1Date'])) { echo abs(ceil((strtotime($PO['reqDate']) - strtotime($AUTH['app1Date'])) / (60 * 60 * 24))); } ?></td>
  1175. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black"><?= checkComments($_GET['id'], $AUTH['app1']); ?></a></td>
  1176. <td nowrap class="label"><?= displayAppComment('app1', $_GET['approval'], $AUTH['app1'], $AUTH['app1Com'], $AUTH['app1Date']); ?></td>
  1177. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  1178. </tr>
  1179. <!-- END APPROVER 1 -->
  1180. <?php if (strlen($AUTH['app2']) == 5 OR $PO['status'] == 'N') { ?>
  1181. <!-- START APPROVER 2 -->
  1182. <tr <?= ($_GET['approval'] == 'app2') ? $highlight : $blank; ?>>
  1183. <td nowrap><?= $language['label']['app2']; ?>:</td>
  1184. <td align="center" nowrap><?php if (is_null($AUTH['app2Date']) AND !is_null($AUTH['app1Date']) AND $AUTH['app2'] != '0') {
  1185. echo showMailIcon('app2', $AUTH['app2'], caps($EMPLOYEES[$AUTH['app2']]), $PO['id']);
  1186. } else if (!is_null($AUTH['app2Date'])) {
  1187. echo showCommentIcon($AUTH['app2'], caps($EMPLOYEES[$AUTH['app2']]), $PO['id']);
  1188. }
  1189. ?></td>
  1190. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  1191. <td nowrap class="label"><?php if (isset($AUTH['app2Date'])) { echo date("F d, Y", strtotime($AUTH['app2Date'])); } ?></td>
  1192. <td nowrap class="TrainActive"><?php if (isset($AUTH['app2Date'])) { echo abs(ceil((strtotime($AUTH['app1Date']) - strtotime($AUTH['app2Date'])) / (60 * 60 * 24))); } ?></td>
  1193. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black">
  1194. <?= checkComments($_GET['id'], $AUTH['app2']); ?>
  1195. </a></td>
  1196. <td nowrap class="label"><?= displayAppComment('app2', $_GET['approval'], $AUTH['app2'], $AUTH['app2Com'], $AUTH['app2Date']); ?></td>
  1197. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  1198. </tr>
  1199. <!-- END APPROVER 2 -->
  1200. <?php } ?>
  1201. <?php if (strlen($AUTH['app3']) == 5 OR $PO['status'] == 'N') { ?>
  1202. <!-- END APPROVER 3 -->
  1203. <tr <?= ($_GET['approval'] == 'app3') ? $highlight : $blank; ?>>
  1204. <td nowrap><?= $language['label']['app3']; ?>:</td>
  1205. <td align="center" nowrap><?php if (is_null($AUTH['app3Date']) AND !is_null($AUTH['app2Date']) AND $AUTH['app3'] != '0') {
  1206. echo showMailIcon('app3', $AUTH['app3'], caps($EMPLOYEES[$AUTH['app3']]), $PO['id']);
  1207. } else if (!is_null($AUTH['app3Date'])) {
  1208. echo showCommentIcon($AUTH['app3'], caps($EMPLOYEES[$AUTH['app3']]), $PO['id']);
  1209. }
  1210. ?></td>
  1211. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  1212. <td nowrap class="label"><?php if (isset($AUTH['app3Date'])) { echo date("F d, Y", strtotime($AUTH['app3Date'])); } ?></td>
  1213. <td nowrap class="TrainActive"><?php if (isset($AUTH['app3Date'])) { echo abs(ceil((strtotime($AUTH['app2Date']) - strtotime($AUTH['app3Date'])) / (60 * 60 * 24))); } ?></td>
  1214. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black">
  1215. <?= checkComments($_GET['id'], $AUTH['app3']); ?>
  1216. </a></td>
  1217. <td nowrap class="label"><?= displayAppComment('app3', $_GET['approval'], $AUTH['app3'], $AUTH['app3Com'], $AUTH['app3Date']); ?></td>
  1218. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  1219. </tr>
  1220. <!-- END APPROVER 3 -->
  1221. <?php } ?>
  1222. <?php if (strlen($AUTH['app4']) == 5 OR $PO['status'] == 'N') { ?>
  1223. <!-- START APPROVER 4 -->
  1224. <tr <?= ($_GET['approval'] == 'app4') ? $highlight : $blank; ?>>
  1225. <td nowrap><?= $language['label']['app4']; ?>:</td>
  1226. <td align="center" nowrap><?php if (is_null($AUTH['app4Date']) AND !is_null($AUTH['app2Date']) AND $AUTH['app4'] != '0') {
  1227. echo showMailIcon('app4', $AUTH['app4'], caps($EMPLOYEES[$AUTH['app4']]), $PO['id']);
  1228. } else if (!is_null($AUTH['app4Date'])) {
  1229. echo showCommentIcon($AUTH['app4'], caps($EMPLOYEES[$AUTH['app4']]), $PO['id']);
  1230. }
  1231. ?></td>
  1232. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  1233. <td nowrap class="label"><?php if (isset($AUTH['app4Date'])) { echo date("F d, Y", strtotime($AUTH['app4Date'])); } ?></td>
  1234. <td nowrap class="TrainActive"><?php if (isset($AUTH['app4Date'])) { echo abs(ceil((strtotime($AUTH['app3Date']) - strtotime($AUTH['app4Date'])) / (60 * 60 * 24))); } ?></td>
  1235. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black">
  1236. <?= checkComments($_GET['id'], $AUTH['app4']); ?>
  1237. </a></td>
  1238. <td nowrap class="label"><?= displayAppComment('app4', $_GET['approval'], $AUTH['app4'], $AUTH['app4Com'], $AUTH['app4Date']); ?></td>
  1239. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  1240. </tr>
  1241. <!-- END APPROVER 4 -->
  1242. <?php } ?>
  1243. <?php if (!is_null($PO['po'])) { ?>
  1244. <!-- START PURCHASER -->
  1245. <tr <?= ($_GET['approval'] == 'purchaser') ? $highlight : $blank; ?>>
  1246. <td nowrap>Purchaser: </td>
  1247. <td align="center" nowrap><?= showCommentIcon($AUTH['issuer'], caps($EMPLOYEES[$AUTH['issuer']]), $PO['id']); ?></td>
  1248. <td nowrap class="label"><?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  1249. <td nowrap class="label"><?= date("F j, Y", strtotime($AUTH['issuerDate'])); ?></td>
  1250. <td nowrap class="TrainActive"><?php if (isset($AUTH['issuerDate'])) { echo abs(ceil((strtotime($AUTH['issuerDate']) - strtotime($AUTH['issuerDate'])) / (60 * 60 * 24))); } ?></td>
  1251. <td nowrap class="TrainActive"><a href="javascript:void(0);" onClick="switchComments();" class="black">
  1252. <?= checkComments($_GET['id'], $AUTH['issuer']); ?>
  1253. </a></td>
  1254. <td nowrap>&nbsp;</td>
  1255. <td nowrap>&nbsp;</td>
  1256. </tr>
  1257. <!-- END PURCHASER -->
  1258. <?php } ?>
  1259. <!-- START TOTAL -->
  1260. <tr class="xpHeaderTotal">
  1261. <td height="25" nowrap>Totals:</td>
  1262. <td nowrap>&nbsp;</td>
  1263. <td nowrap>&nbsp;</td>
  1264. <td nowrap>&nbsp;</td>
  1265. <td nowrap class="TrainActive"><?= abs(ceil((strtotime($REQUEST['reqDate']) - strtotime($AUTH['issuerDate'])) / (60 * 60 * 24))); ?></td>
  1266. <td nowrap class="TrainActive">&nbsp;</td>
  1267. <td nowrap class="TipLabel">Days</td>
  1268. <td nowrap>&nbsp;</td>
  1269. </tr>
  1270. <!-- END TOTAL -->
  1271. </table></td>
  1272. </tr>
  1273. </table></td>
  1274. </tr>
  1275. <?php if ($_SESSION['request_role'] == 'purchasing' OR $_SESSION['request_role'] == 'executive') { ?>
  1276. <tr><td>&nbsp;</td></tr>
  1277. <tr>
  1278. <td valign="top" class="BGAccentDarkBlueBorder"><table width="100%" border="0">
  1279. <tr>
  1280. <td height="25" class="BGAccentDarkBlue"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  1281. <tr>
  1282. <td style="color:#FFFFFF; font-weight:bold;"><img src="../images/team.gif" width="16" height="18" align="texttop"> Purchasing Department</td>
  1283. <td align="right"><a href="javascript:void(0);" <?php help('Last Updated', date('\D\a\y\: F d, Y \<\b\r\>\T\i\m\e\: H:i:s', strtotime($PO['update_status'])), 'default'); ?> class="LightHeaderSubSub"><?php if (!empty($PO['purchaseUpdate'])) { ?>Last Updated: <?= date('F d, Y', strtotime($PO['purchaseUpdate'])); ?></a><?php } ?></td>
  1284. </tr>
  1285. </table></td>
  1286. </tr>
  1287. <tr>
  1288. <td><table width="100%" border="0" cellspacing="2" cellpadding="0">
  1289. <?php if (is_null($PO['po'])) { ?>
  1290. <tr>
  1291. <td colspan="4" class="blankNoteArea"><table border="0" align="center" cellspacing="5">
  1292. <tr>
  1293. <td>Purchaser scheduled to Complete Requisition:</td>
  1294. <td><select name="purchaserHold" id="purchaserHold" onChange="this.form.submit();">
  1295. <option value="0">Select One</option>
  1296. <?php
  1297. $purchaser_sth = $dbh->execute($purchaser_sql);
  1298. while($purchaser_sth->fetchInto($PURCHASER)) {
  1299. $selected = ($AUTH['issuer'] == $PURCHASER['eid']) ? selected : $blank;
  1300. print "<option value=\"".$PURCHASER['eid']."\" ".$selected.">".caps($PURCHASER['lst'].", ".$PURCHASER['fst'])."</option>";
  1301. }
  1302. ?>
  1303. </select></td>
  1304. </tr>
  1305. <?php if ($PO['status'] == 'A') { ?>
  1306. <tr>
  1307. <td>Time elapsed since Requisition approval: </td>
  1308. <td><strong><?= elapsedApprovalTime($_GET['id']); ?> hours</strong></td>
  1309. </tr>
  1310. <?php } ?>
  1311. </table></td>
  1312. </tr>
  1313. <?php } else { ?>
  1314. <tr>
  1315. <td width="100">Purchaser:</td>
  1316. <td class="label"><?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  1317. <td width="125">Vendor Kickoff:</td>
  1318. <td nowrap class="label"><?= ($AUTH['issuerDate'] == '0000-00-00 00:00:00' OR is_null($AUTH['issuerDate'])) ? $blank : date("F j, Y h:iA", strtotime($AUTH['issuerDate'])); ?></td>
  1319. </tr>
  1320. <?php } ?>
  1321. <tr>
  1322. <td height="5" colspan="4"><fieldset class="collapsible" id="purchasingInfoF">
  1323. <legend><a href="javascript:switchFieldset('purchasingInfo', 'collapsible');" id="purchasingInfoA">Information</a></legend>
  1324. <table width="100%" border="0" cellspacing="2" cellpadding="0" id="purchasingInfo">
  1325. <tr>
  1326. <td nowrap>Private Requisition:</td>
  1327. <td><select name="private" id="private" disabled="disabled">
  1328. <option value="no" <?= ($PO['private'] == 'no') ? selected : $blank; ?>>No</option>
  1329. <option value="yes" <?= ($PO['private'] == 'yes') ? selected : $blank; ?>>Yes</option>
  1330. </select></td>
  1331. <td nowrap>HOT Requisition:</td>
  1332. <td><select name="hot" id="hot">
  1333. <option value="no" <?= ($PO['hot'] == 'no') ? selected : $blank; ?>>No</option>
  1334. <option value="yes" <?= ($PO['hot'] == 'yes') ? selected : $blank; ?>>Yes</option>
  1335. </select></td>
  1336. </tr>
  1337. <tr>
  1338. <td colspan="4">&nbsp;</td>
  1339. </tr>
  1340. <tr>
  1341. <td width="194" nowrap>FOB:</td>
  1342. <td width="150"><input name="fob" type="text" id="fob" value="<?= $PO['fob']; ?>" size="15" maxlength="15"></td>
  1343. <td width="142" nowrap>Requisition Type: </td>
  1344. <td width="187"><select name="reqType" id="reqType">
  1345. <option value="0">Select One</option>
  1346. <option value="blanket" <?= ($PO['reqType'] == 'blanket') ? selected : $blank; ?>>Blanket Order</option>
  1347. <option value="capex" <?= ($PO['reqType'] == 'capex') ? selected : $blank; ?>>Capital Expense</option>
  1348. <option value="mro" <?= ($PO['reqType'] == 'mro') ? selected : $blank; ?>>MRO</option>
  1349. <option value="tooling" <?= ($PO['reqType'] == 'tooling') ? selected : $blank; ?>>Tooling</option>
  1350. </select></td>
  1351. </tr>
  1352. <tr>
  1353. <td>Ship Via:</td>
  1354. <td><input name="via" type="text" id="via" value="<?= $PO['via']; ?>" size="15" maxlength="15"></td>
  1355. <td width="142">Final Terms:</td>
  1356. <td><select name="terms" id="terms">
  1357. <option value="0">Select One</option>
  1358. <?php
  1359. $terms_sth = $dbh->execute($terms_query);
  1360. while($terms_sth->fetchInto($TERMS2)) {
  1361. $selected = ($PO['terms'] == $TERMS2['id']) ? selected : $blank;
  1362. print "<option value=\"".$TERMS2['id']."\" ".$selected.">".$TERMS2['name']."</option>";
  1363. }
  1364. ?>
  1365. </select></td>
  1366. </tr>
  1367. <tr>
  1368. <td colspan="4">&nbsp;</td>
  1369. <tr>
  1370. <td>&nbsp;</td>
  1371. <td colspan="2" class="dHeader">Name</td>
  1372. <td class="dHeader">Terms</td>
  1373. </tr>
  1374. <tr>
  1375. <td>Recommended Vendor:</td>
  1376. <td colspan="2" nowrap><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?>
  1377. <?php
  1378. /* Getting suppliers from Suppliers */
  1379. $SUPPLIER = $dbh->getRow("SELECT BTVEND AS id, BTNAME AS name, BTADR1 AS address, BTADR3 AS city, BTPRCD AS state, BTPOST AS zip5, BTWPAG AS web, BTTRMC AS terms
  1380. FROM Standards.Vendor
  1381. WHERE BTVEND = '" . $PO['sup'] . "'");
  1382. ?><span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&name=<?= caps($SUPPLIER['name']); ?>&address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle"></a><?php if (!empty($SUPPLIER['web'])) { ?>&nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle"></a><?php } ?><a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&company=<?= $PO['company']; ?>" title="Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle">&nbsp;&nbsp;</a></span></td>
  1383. <td><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  1384. </tr>
  1385. <?php if (strlen($PO['sup2'])== 6) { ?>
  1386. <tr>
  1387. <td>Final Vendor:</td>
  1388. <td colspan="2" nowrap><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?>
  1389. <?php
  1390. /* Getting suppliers from Suppliers */
  1391. $SUPPLIER = $dbh->getRow("SELECT BTVEND AS id, BTNAME AS name, BTADR1 AS address, BTADR3 AS city, BTPRCD AS state, BTPOST AS zip5, BTWPAG AS web, BTTRMC AS terms
  1392. FROM Standards.Vendor
  1393. WHERE BTVEND = '" . $PO['sup2'] . "'");
  1394. ?><span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&name=<?= caps($SUPPLIER['name']); ?>&address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle"></a><?php if (!empty($SUPPLIER['web'])) { ?>&nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle"></a><?php } ?><a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&company=<?= $PO['company']; ?>" title="Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle">&nbsp;&nbsp;</a></span></td>
  1395. <td><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  1396. </tr>
  1397. <?php } ?>
  1398. <tr>
  1399. <td>Change Vendor:</td>
  1400. <td colspan="3"><input id="vendSearch" name="vendSearch" type="text" size="50" />
  1401. <script type="text/javascript">
  1402. Event.observe(window, "load", function() {
  1403. var aa = new AutoAssist("vendSearch", function() {
  1404. return "../Common/vendor.php?q=" + this.txtBox.value;
  1405. });
  1406. });
  1407. </script>
  1408. <input name="supplierNew" type="hidden" id="supplierNew"><input name="supplierNewTerms" type="hidden" id="supplierNewTerms"></td>
  1409. </tr>
  1410. <tr>
  1411. <td>&nbsp;</td>
  1412. <td>&nbsp;</td>
  1413. <td>&nbsp;</td>
  1414. <td><input name="updaterequest" type="image" src="../images/button.php?i=w130.png&l=Update Request" alt="Update Request" border="0">
  1415. <input name="action" type="hidden" id="action" value="purchasing_update">
  1416. &nbsp;</td>
  1417. </tr>
  1418. </table>
  1419. </fieldset>
  1420. <fieldset class="collapsed" id="vendorPaymentsF">
  1421. <legend><a href="javascript:switchFieldset('vendorPayments', 'collapsed');" id="vendorPaymentsA">Vendor Payments (<?= $payments_count; ?>)</a></legend>
  1422. <table border="0" align="center" cellpadding="0" cellspacing="5" id="vendorPayments" style="display:none">
  1423. <tr>
  1424. <td valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  1425. <tr>
  1426. <td class="blueNoteAreaBorder"><table border="0">
  1427. <tr class="blueNoteArea">
  1428. <td class="label">Amount</td>
  1429. <td class="label">Date</td>
  1430. <td class="label">&nbsp;</td>
  1431. </tr>
  1432. <tr>
  1433. <td class="label">$<input name="pay_amount" type="text" class="BGAccentDarkBlueBorder" id="pay_amount" size="15"></td>
  1434. <td class="label"><input name="paymentDate" type="text" id="paymentDate" size="10" maxlength="10" class="BGAccentDarkBlueBorder" value="<?= $PAYMENTS['0']['pay_date']; ?>" readonly>
  1435. <a href="javascript:show_calendar('Form.paymentDate')" <?php help('', 'Click here to choose a date', 'default'); ?>><img src="../images/calendar.gif" width="17" height="18" border="0" align="absmiddle"></a></td>
  1436. <td class="label"><input name="addPayment" type="image" id="addPayment" src="../images/add.gif"></td>
  1437. </tr>
  1438. </table></td>
  1439. </tr>
  1440. </table></td>
  1441. <td rowspan="2" align="right" valign="top"><img src="../images/spacer.gif" width="50" height="10"></td>
  1442. <td align="right" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  1443. <tr>
  1444. <td class="blueNoteAreaBorder">
  1445. <?php if ($payments_count > 0) { ?>
  1446. <table border="0">
  1447. <tr class="blueNoteArea">
  1448. <td class="label">&nbsp;</td>
  1449. <td class="label">Amount</td>
  1450. <td class="label">Date</td>
  1451. <td class="label">Delete</td>
  1452. </tr>
  1453. <?php
  1454. $count=0;
  1455. $total=$PO['total'];
  1456. while ($payments->fetchInto($PAYMENTS)) {
  1457. $count++;
  1458. $total -= $PAYMENTS['pay_amount'];
  1459. ?>
  1460. <tr>
  1461. <td class="label"><?= $count; ?><input type="hidden" name="pay_id<?= $count; ?>" id="pay_id<?= $count; ?>" value="<?= $PAYMENTS['pay_id']; ?>"></td>
  1462. <td class="label">$<input name="pay_amount<?= $count; ?>" type="text" class="BGAccentDarkBlueBorder" id="pay_amount<?= $count; ?>" value="<?= $PAYMENTS['pay_amount']; ?>" size="15"></td>
  1463. <td class="label"><input name="pay_date<?= $count; ?>" type="text" id="pay_date<?= $count; ?>" size="10" maxlength="10" class="BGAccentDarkBlueBorder" value="<?= $PAYMENTS['pay_date']; ?>" readonly>
  1464. <a href="javascript:show_calendar('Form.pay_date<?= $count; ?>')" <?php help('', 'Click here to choose a date', 'default'); ?>><img src="../images/calendar.gif" width="17" height="18" border="0" align="absmiddle"></a></td>
  1465. <td align="center" class="label"><input type="checkbox" name="pay_remove<?= $count; ?>" id="pay_remove<?= $count; ?>" value="yes"></td>
  1466. </tr>
  1467. <?php } ?>
  1468. </table>
  1469. <input name="payments_count" id="payments_count" type="hidden" value="<?= $payments_count; ?>">
  1470. <?php } ?></td>
  1471. </tr>
  1472. </table></td>
  1473. </tr>
  1474. <tr>
  1475. <td>&nbsp;</td>
  1476. <td>
  1477. <?php if ($payments_count > 0) { ?>
  1478. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  1479. <tr>
  1480. <td class="label">Outstanding: $<?= number_format($total,2); ?></td>
  1481. <td align="right"><input name="updatePayments" id="updatePayments" type="image" src="../images/button.php?i=w70.png&l=Update" alt="Update Payments" border="0">&nbsp;</td>
  1482. </tr>
  1483. </table>
  1484. <?php } ?> </td>
  1485. </tr>
  1486. </table>
  1487. </fieldset>
  1488. <fieldset class="collapsed" id="currentContactsF">
  1489. <legend><a href="javascript:switchFieldset('currentContacts', 'collapsed');" id="currentContactsA">Contact Information (<?= $contacts_count; ?>)</a></legend>
  1490. <table border="0" align="center" cellpadding="0" cellspacing="0" id="currentContacts" style="display:none">
  1491. <tr>
  1492. <td class="blueNoteAreaBorder"><table border="0">
  1493. <tr class="blueNoteArea">
  1494. <td class="label">Name</td>
  1495. <td class="label">Phone</td>
  1496. <td class="label">Ext</td>
  1497. <td class="label">Email</td>
  1498. </tr>
  1499. <tr>
  1500. <td class="label"><input name="cc_name" type="text" id="cc_name" size="30" maxlength="30" class="BGAccentDarkBlueBorder"></td>
  1501. <td class="label"><input name="cc_phone" type="text" id="cc_phone" size="15" maxlength="15" class="BGAccentDarkBlueBorder"></td>
  1502. <td class="label"><input name="cc_ext" type="text" id="cc_ext" size="10" maxlength="10" class="BGAccentDarkBlueBorder"></td>
  1503. <td class="label"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  1504. <tr>
  1505. <td><input name="cc_email" type="text" id="cc_email" size="50" maxlength="50" class="BGAccentDarkBlueBorder"></td>
  1506. <td width="35" align="center"><input name="addContact" type="image" id="addContact" src="../images/add.gif"></td>
  1507. </tr>
  1508. </table></td>
  1509. </tr>
  1510. <?php
  1511. while($contacts->fetchInto($CONTACTS)) {
  1512. ?>
  1513. <tr>
  1514. <td class="label"><?= $CONTACTS['name']; ?></td>
  1515. <td class="label"><?= $CONTACTS['phone']; ?></td>
  1516. <td class="label"><?= $CONTACTS['ext']; ?></td>
  1517. <td class="label"><a href="mailto:<?= $CONTACTS['email']; ?>" class="emailLink"><?= $CONTACTS['email']; ?></a></td>
  1518. </tr>
  1519. <?php } ?>
  1520. </table></td>
  1521. </tr>
  1522. </table>
  1523. </fieldset></td>
  1524. </tr>
  1525. <?php if ($PO['status'] != 'N') { ?>
  1526. <tr>
  1527. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="10"></td>
  1528. </tr>
  1529. <tr>
  1530. <td colspan="4" class="blueNoteArea">
  1531. <?php if (empty($PO['po'])) { ?>
  1532. <table border="0" align="center" cellpadding="0" cellspacing="0">
  1533. <tr>
  1534. <td style="color:#FFFFFF; font-weight:bold">Purchase Order Number:</td>
  1535. <td width="85" align="center"><input name="po" type="text" id="po" size="15"></td>
  1536. <td><input name="completed" type="image" src="../images/button.php?i=w130.png&l=Vendor Kickoff" alt="Supplier Kickoff" border="0">
  1537. <!--<a href="vendorKickoff.php?id=<?= $_GET['id']; ?>" rel="gb_page_center[550,275]"><img src="../images/button.php?i=w130.png&l=Vendor Kickoff" alt="Supplier Kickoff" border="0"></a>--></td>
  1538. </tr>
  1539. </table>
  1540. <?php } else { ?>
  1541. <span class="editable">Purchase Order Number: <span id="poNumber"><?= $PO['po']; ?></span></span>
  1542. <script type="text/javascript">new Ajax.InPlaceEditor('poNumber', '../Common/detail_updates.php?a=po&id=$PO[id]', {highlightcolor:"#D8D8EB", highlightendcolor:"#014B94"});</script>
  1543. <?php } ?></td>
  1544. </tr>
  1545. <?php } ?>
  1546. </table></td>
  1547. </tr>
  1548. </table></td>
  1549. </tr>
  1550. <?php } ?>
  1551. </table></td>
  1552. </tr>
  1553. <tr>
  1554. <td height="5" valign="bottom"><img src="../images/spacer.gif" width="5" height="5"></td>
  1555. </tr>
  1556. <tr>
  1557. <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  1558. <tr>
  1559. <td width="50%"><?php if ($_SESSION['eid'] == $PO['req'] AND $PO['status'] != 'X' AND $PO['status'] != 'C' AND empty($_GET['approval'])) { ?>
  1560. <table border="0" cellspacing="0" cellpadding="0">
  1561. <tr>
  1562. <td width="20" valign="middle"><input name="cancel" type="checkbox" id="cancel" value="yes"></td>
  1563. <td><input name="cancelrequest" type="image" src="../images/button.php?i=w130.png&l=Cancel Request" alt="Cancel Request" border="0"></td>
  1564. <!--<td>&nbsp;</td>
  1565. <td><input name="copyrequest" type="image" src="../images/button.php?i=w130.png&l=Copy Request" alt="Copy Request" border="0"></td>-->
  1566. </tr>
  1567. </table>
  1568. <?php } ?>
  1569. <?php if ($_SESSION['eid'] == $PO['req'] AND ($PO['status'] == 'X' OR $PO['status'] == 'C')) { ?>
  1570. <table border="0" cellspacing="0" cellpadding="0">
  1571. <tr>
  1572. <td width="20" valign="middle"><input name="restore" type="checkbox" id="restore" value="yes"></td>
  1573. <td><input name="restorerequest" type="image" src="../images/button.php?i=w130.png&l=Restore Request" alt="Restore Request"></td>
  1574. </tr>
  1575. </table>
  1576. <?php } ?>&nbsp;</td>
  1577. <td width="50%" align="right">
  1578. <input name="id" type="hidden" id="id" value="<?= $PO['id']; ?>">
  1579. <input name="type_id" type="hidden" id="type_id" value="<?= $PO['id']; ?>">
  1580. <input name="req" type="hidden" id="req" value="<?= $PO['req']; ?>">
  1581. <input name="purpose" type="hidden" id="purpose" value="<?= $PO['purpose']; ?>">
  1582. <input name="auth_id" type="hidden" id="auth_id" value="<?= $AUTH['id']; ?>">
  1583. <?php
  1584. if (($_SESSION['eid'] == $AUTH[$_GET['approval']] OR
  1585. $_SESSION['eid'] == $PO['req'] OR
  1586. $_SESSION['eid'] == $AUTH['issuer'])) { ?>
  1587. <?php
  1588. if (isset($_GET['approval'])) {
  1589. /* Set auth level to GET[approval] */
  1590. $auth_value = $_GET['approval'];
  1591. } elseif ($_SESSION['eid'] == $PO['req']) {
  1592. /* Allow update if GET[approval] was sent and Requester is viewing */
  1593. $auth_value = "req";
  1594. } elseif ($_SESSION['eid'] == $AUTH['issuer']) {
  1595. /* Allow update if GET[approval] was sent and Requester is viewing */
  1596. $auth_value = "issuer";
  1597. }
  1598. /* Set type of update before or after PO was issued */
  1599. $update_stage = (empty($PO[po])) ? "update" : "post_update";
  1600. ?>
  1601. <input name="auth" type="hidden" id="auth" value="<?= $auth_value; ?>">
  1602. <input name="stage" type="hidden" id="stage" value="<?= $update_stage ?>">
  1603. <!--<input name="imageField" type="image" src="../images/button.php?i=b150.png&l=Update Request" alt="Update Request">-->
  1604. <?php } ?></td>
  1605. </tr>
  1606. </table></td>
  1607. </tr>
  1608. </table>
  1609. </form>
  1610. </td>
  1611. </tr>
  1612. </tbody>
  1613. </table></td>
  1614. </tr>
  1615. </tbody>
  1616. </table>
  1617. <!-- InstanceEndEditable --><br>
  1618. <br>
  1619. <table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  1620. <tbody>
  1621. <tr>
  1622. <td>&nbsp;</td>
  1623. </tr>
  1624. <tr>
  1625. <td>&nbsp;</td>
  1626. </tr>
  1627. <tr>
  1628. <td width="100%" height="20" class="BGAccentDark">
  1629. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  1630. <tr>
  1631. <td width="50%"><span class="Copyright"><!-- InstanceBeginEditable name="copyright" --><?php include('../include/copyright.php'); ?><!-- InstanceEndEditable --></span></td>
  1632. <td width="50%"><div id="noPrint" align="right"><!-- InstanceBeginEditable name="version" --><?php include('../include/version.php'); ?><!-- InstanceEndEditable --></div></td>
  1633. </tr>
  1634. </table></td>
  1635. </tr>
  1636. <tr>
  1637. <td>
  1638. <div align="center"><!-- InstanceBeginEditable name="footer" --><!-- InstanceEndEditable --></div>
  1639. <div class="TrainVisited" id="noPrint"><?= onlineCount(); ?></div>
  1640. </td>
  1641. </tr>
  1642. </tbody>
  1643. </table>
  1644. <br>
  1645. </body>
  1646. <script>var request_id='<?= $_GET['id']; ?>';</script>
  1647. <script type="text/javascript" src="/Common/js/scriptaculous/prototype-min.js"></script>
  1648. <script type="text/javascript" src="/Common/js/scriptaculous/scriptaculous.js?load=builder,effects"></script>
  1649. <script type="text/javascript" src="/Common/js/ps/tooltips.js"></script>
  1650. <!-- InstanceBeginEditable name="js" --><!-- InstanceEndEditable -->
  1651. <!-- InstanceEnd --></html>
  1652. <?php
  1653. /**
  1654. * - Display Debug Information
  1655. */
  1656. include_once('debug/footer.php');
  1657. /**
  1658. * - Disconnect from database
  1659. */
  1660. $dbh->disconnect();
  1661. ?>