PageRenderTime 69ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/PO/detail_tmp2.php

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