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

/_tmp/detail_tmp.php

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