PageRenderTime 72ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/PO/detail.php

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