PageRenderTime 101ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/_tmp/detail_beta.php

https://github.com/tlezotte/ePOS
PHP | 1318 lines | 1151 code | 59 blank | 108 comment | 114 complexity | 5fe1454f5bb40c5f1167638dfa26edbc 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. /* --------- START PURCHASING AREA ----------------------- */
  50. if ($_POST['action'] == 'purchasing_update') {
  51. /* --- Adding supplier contact information --- */
  52. if (array_key_exists('addContact_x',$_POST)) {
  53. $sql = "INSERT INTO Contacts VALUES (NULL,
  54. '" . $_POST['id'] . "',
  55. '" . $_SESSION['eid'] . "',
  56. NOW(),
  57. '" . $_POST['cc_name'] . "',
  58. '" . $_POST['cc_phone'] . "',
  59. '" . $_POST['cc_ext'] . "',
  60. '" . $_POST['cc_email'] . "'
  61. )";
  62. $dbh->query($sql);
  63. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  64. exit();
  65. }
  66. /* --- Adding payment information --- */
  67. if (array_key_exists('addPayment_x',$_POST)) {
  68. $sql = "INSERT INTO Payments VALUES (NULL,
  69. '" . $_POST['id'] . "',
  70. '" . $_SESSION['eid'] . "',
  71. NOW(),
  72. '" . mysql_real_escape_string($_POST['pay_amount']) . "',
  73. '" . mysql_real_escape_string($_POST['paymentDate']) . "',
  74. '0')";
  75. $dbh->query($sql);
  76. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  77. exit();
  78. }
  79. /* --- Update payment information --- */
  80. if (array_key_exists('updatePayments_x',$_POST)) {
  81. for ($i=1; $i <= $_POST['payments_count']; $i++) {
  82. $pay_id = "pay_id" . $i;
  83. $pay_amount = "pay_amount" . $i;
  84. $pay_date = "pay_date" . $i;
  85. $pay_remove = "pay_remove" . $i;
  86. $pay_status = ($_POST[$pay_remove] == 'yes') ? 1 : 0;
  87. $sql = "UPDATE Payments SET pay_eid = '" . $_SESSION['eid'] . "',
  88. pay_recorded = NOW(),
  89. pay_amount = '" . mysql_real_escape_string($_POST[$pay_amount]) . "',
  90. pay_date = '" . mysql_real_escape_string($_POST[$pay_date]) . "',
  91. pay_status = '" . $pay_status . "'
  92. WHERE pay_id = " . $_POST[$pay_id];
  93. $dbh->query($sql);
  94. }
  95. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  96. exit();
  97. }
  98. /* --- Purchaser marks Request as Complete --- */
  99. if (array_key_exists('completed_x',$_POST)) {
  100. /* Record Purchasing agent */
  101. $auth_sql = "UPDATE Authorization SET issuer='" . $_SESSION['eid'] . "',
  102. issuerDate=NOW()
  103. WHERE id = " . $_POST['auth_id'];
  104. $dbh->query($auth_sql);
  105. /* Update Request Status */
  106. $po_sql = "UPDATE PO SET po='" . $_POST['po'] . "',
  107. status='O'
  108. WHERE id = " . $_POST['id'];
  109. $dbh->query($po_sql);
  110. sendCompleted($_POST['req'],$_POST['id'],htmlspecialchars($_POST['purpose']),$_POST['po'], $_SESSION['eid']); // Send email to Requester
  111. //sendVendor($_POST['id']);
  112. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  113. exit();
  114. }
  115. /* Add Vendor and change Terms when Purchasing changes Vendor */
  116. if (strlen($_POST['vendSearch']) > 0) {
  117. $supplier2 = "sup2='" . $_POST['supplierNew'] . "',";
  118. $supplier2 .= "terms='" . $_POST['supplierNewTerms'] . "',";
  119. } else {
  120. $supplier2 = "terms='".$_POST['terms']."',";
  121. }
  122. /* Creating update fields */
  123. $PO = "fob='".$_POST['fob']."',
  124. via='".$_POST['via']."',
  125. update_status=NOW(),
  126. $supplier2
  127. purchaserUpdate='" . $_POST['purchaserUpdate'] . "'
  128. ";
  129. $sql = "UPDATE PO SET $PO WHERE id = ".$_POST['id'];
  130. $dbh->query($sql);
  131. History($_SESSION['eid'], 'update', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
  132. header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
  133. exit();
  134. }
  135. /* --------- END PURCHASING AREA ----------------------- */
  136. /* ------------- START APPROVAL PROCESSING --------------------- */
  137. if ($_POST['stage'] == "update") {
  138. if ($_POST['auth'] == "req") {
  139. /* -------------------------------------------------------------
  140. * ---------------- START CANCEL PURCHASE ORDER ----------------
  141. * -------------------------------------------------------------
  142. */
  143. if ($_POST['cancel'] == 'yes') {
  144. setRequestStatus($_POST['type_id'], 'C'); // Update PO status
  145. header("location: list.php?action=my&access=0");
  146. exit();
  147. }
  148. /* --------- END CANCEL PURCHASE ORDER ----------------------- */
  149. /* -------------------------------------------------------------
  150. * ---------------- START COPY PURCHASE ORDER ----------------
  151. * -------------------------------------------------------------
  152. */
  153. if (array_key_exists('copyrequest_x',$_POST)) {
  154. /* Getting PO information */
  155. $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
  156. FROM PO
  157. WHERE id = ?",array($_POST['type_id']));
  158. /* -- Read $PO into $_SESSION -- */
  159. foreach ($PO as $key => $value) {
  160. $_SESSION[$key] = $value;
  161. }
  162. header("location: information.php");
  163. exit();
  164. }
  165. /* --------- END COPY PURCHASE ORDER ----------------------- */
  166. }
  167. /* -------------------------------------------------------------
  168. * ---------- START APP1 and APP2 APPROVAL PROCESSING ----------
  169. * -------------------------------------------------------------
  170. */
  171. if (substr($_POST['auth'],0,3) == 'app') {
  172. $yn = (array_key_exists('yes_x', $_POST)) ? yes : no; // Set approval button pressed
  173. /* Check to see if a Comment was provided */
  174. if (empty($_POST['Com']) AND $yn == 'no') {
  175. $_SESSION['error'] = "A denied Requisition requires you to enter a Comment.";
  176. $_SESSION['redirect'] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  177. header("location: ../error.php");
  178. exit();
  179. }
  180. /* Change status for non approved request */
  181. if ($yn == 'no') {
  182. setRequestStatus($_POST['type_id'], 'X'); // Update PO status
  183. }
  184. /* Update the approvals for the PO */
  185. $dbh->query("UPDATE Authorization
  186. SET ".$_POST['auth']."yn='" . $yn . "',
  187. ".$_POST['auth']."Date=NOW(),
  188. ".$_POST['auth']."Com='" . htmlentities($_POST['Com'], ENT_QUOTES, 'UTF-8') . "',
  189. app2='".$_POST['app2']."',
  190. app3='".$_POST['app3']."',
  191. app4='".$_POST['app4']."'
  192. WHERE id = ".$_POST['auth_id']);
  193. header("location: router.php?type_id=" . $_POST['type_id'] . "&approval=" . $_POST['auth'] . "&yn=" . $yn);
  194. exit();
  195. }
  196. /* ------------- END APP1 and APP2 APPROVAL PROCESSING -------------- */
  197. }
  198. /* ------------------ END APPROVAL STAGE ----------------------- */
  199. /* ------------------ START DATABASE CONNECTIONS ----------------------- */
  200. /* Getting PO information */
  201. $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
  202. FROM PO
  203. WHERE id = ?",array($_GET['id']));
  204. /* Getting Authoriztions for above PO */
  205. $AUTH = $dbh->getRow("SELECT * FROM Authorization WHERE type_id = ? and type = 'PO'",array($PO['id']));
  206. /* Get Employee names from Standards database */
  207. $EMPLOYEES = $dbh->getAssoc("SELECT eid, CONCAT(fst,' ',lst) AS name
  208. FROM Standards.Employees");
  209. /* Getting Vendor information from Standards */
  210. $VENDOR = $dbh->getAssoc("SELECT BTVEND, BTNAME FROM Standards.Vendor");
  211. /* Getting Company information from Standards */
  212. //$COMPANY = $dbh->getAssoc("SELECT id, name FROM Standards.Companies");
  213. /* Getting Department information from Standards */
  214. $DEPARTMENT = $dbh->getAssoc("SELECT id, name FROM Standards.Department");
  215. /* Getting Category information from Standards */
  216. //$COA = $dbh->getAssoc("SELECT coa_id AS id, coa_description AS name FROM Standards.COA WHERE coa_plant='" . $PO['plant'] . "'");
  217. /* Getting CER numbers from CER */
  218. $CER = $dbh->getAssoc("SELECT id, cer FROM CER WHERE cer IS NOT NULL ORDER BY cer");
  219. /* Getting Category information from Standards */
  220. $CAT = $dbh->getAssoc("SELECT id, name FROM Standards.Category WHERE status = '0'");
  221. /* Getting Plant information from Standards */
  222. $PLANT = $dbh->getAssoc("SELECT id, name FROM Standards.Plants WHERE status = '0'");
  223. /* Getting Vendor terms from Standards */
  224. $terms_sql = "SELECT terms_id AS id, terms_name AS name FROM Standards.VendorTerms ORDER BY name";
  225. $TERMS = $dbh->getAssoc($terms_sql);
  226. $terms_query = $dbh->prepare($terms_sql);
  227. /* Get items related to this Request */
  228. $items_sql = $dbh->query("SELECT * FROM Items WHERE type_id = ".$PO['id']."");
  229. /* Get Purchase Request users */
  230. $purchaser_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
  231. FROM Users U
  232. INNER JOIN Standards.Employees E ON U.eid = E.eid
  233. WHERE U.group = 'purchasing'
  234. AND E.status = '0'
  235. AND U.eid <> '08745'
  236. ORDER BY E.lst ASC");
  237. /* Get Vendor Payments */
  238. $payments = $dbh->query("SELECT * FROM Payments WHERE request_id=" . $PO['id'] . " AND pay_status='0' ORDER BY pay_date ASC");
  239. $payments_count = $payments->numRows();
  240. /* Get Contact Information */
  241. $contacts = $dbh->query("SELECT * FROM Contacts WHERE request_id=" . $PO['id'] . " ORDER BY id DESC");
  242. $contacts_count = $contacts->numRows();
  243. /* Getting Comments Information */
  244. $post_sql = "SELECT * FROM Postings
  245. WHERE request_id = ".$_GET['id']."
  246. AND type = 'global'
  247. ORDER BY posted DESC";
  248. $LAST_POST = $dbh->getRow($post_sql); // Get the last posted comment
  249. $post_query = $dbh->prepare($post_sql);
  250. $post_sth = $dbh->execute($post_query);
  251. $post_count = $post_sth->numRows();
  252. /* ------------------ END DATABASE CONNECTIONS ----------------------- */
  253. $highlight='class="highlight"'; // Highlighted style sheet class
  254. /* Setup onLoad javascript program */
  255. if ($default['pageloading'] == 'on') {
  256. $ONLOAD_OPTIONS="pageloading();";
  257. }
  258. //$ONLOAD_OPTIONS.="prepareForm();";
  259. if (isset($ONLOAD_OPTIONS)) { $ONLOAD="onLoad=\"$ONLOAD_OPTIONS\""; }
  260. ?>
  261. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  262. <html><!-- InstanceBegin template="/Templates/vnmain.dwt.php" codeOutsideHTMLIsLocked="false" -->
  263. <head>
  264. <!-- InstanceBeginEditable name="doctitle" -->
  265. <title><?= $default['title1']; ?></title>
  266. <!-- InstanceEndEditable -->
  267. <meta http-equiv="imagetoolbar" content="no">
  268. <meta name="copyright" content="2004 Your Company" />
  269. <meta name="author" content="Thomas LeZotte" />
  270. <link type="text/css" href="/Common/Print.css" rel="stylesheet" media="print">
  271. <link type="text/css" href="../default.css" charset="UTF-8" rel="stylesheet">
  272. <?php if ($default['rss'] == 'on') { ?>
  273. <link rel="alternate" type="application/rss+xml" title="Purchase Requisition Announcements" href="<?= $default['URL_HOME']; ?>/PO/<?= $default['rss_file']; ?>">
  274. <link rel="alternate" type="application/rss+xml" title="Capital Acquisition Announcements" href="<?= $default['URL_HOME']; ?>/CER/<?= $default['rss_file']; ?>">
  275. <?php } ?>
  276. <script type="text/javascript" src="/Common/js/overlibmws.js"></script>
  277. <!-- InstanceBeginEditable name="head" -->
  278. <script type="text/javascript" src="/Common/js/pointers.js"></script>
  279. <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/overlibmws_exclusive.js"></SCRIPT>
  280. <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/overlibmws_draggable.js"></SCRIPT>
  281. <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/calendarmws.js"></SCRIPT>
  282. <script type="text/javascript" src="/Common/js/prototype/prototype.js"></script>
  283. <script type="text/javascript" src="/Common/js/scriptaculous/scriptaculous.js?load=effects"></script>
  284. <script type="text/javascript" src="/Common/js/autoassist/autoassist.js"></script>
  285. <link href="/Common/js/autoassist/autoassist.css" rel="stylesheet" type="text/css">
  286. <script type="text/javascript" src="/Common/js/greybox5/options1.js"></script>
  287. <script type="text/javascript" src="/Common/js/greybox5/AJS.js"></script>
  288. <script type="text/javascript" src="/Common/js/greybox5/AJS_fx.js"></script>
  289. <script type="text/javascript" src="/Common/js/greybox5/gb_scripts.js"></script>
  290. <link type="text/css" href="/Common/js/greybox5/gb_styles.css" rel="stylesheet" media="all">
  291. <script language="javascript">
  292. AJS.AEV(window, "load", function() {
  293. new Effect.Pulsate('hotMessage', {delay:2, duration:5});
  294. new Effect.Shake('messageCenter', {delay:8});
  295. });
  296. </script>
  297. <script type="text/javascript" src="../js/dynamicInputItems.js"></script>
  298. <link rel="stylesheet" type="text/css" href="<?= $default['URL_HOME']; ?>/style/dd_tabs.css" />
  299. <style type="text/css">
  300. form.inplaceeditor-form a {
  301. color:#FFFFFF;
  302. }
  303. </style>
  304. <!-- InstanceEndEditable -->
  305. <?php if ($ONLOAD_OPTIONS) { ?>
  306. <script language="javascript">
  307. AJS.AEV(window, "load", <?= $ONLOAD_OPTIONS; ?>);
  308. </script>
  309. <?php } ?>
  310. </head>
  311. <body class="yui-skin-sam">
  312. <img src="/Common/images/CompanyPrint.gif" alt="Your Company" width="437" height="61" id="Print" />
  313. <div id="noPrint">
  314. <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
  315. <tbody>
  316. <tr>
  317. <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>
  318. <td align="right" valign="top">
  319. <!-- InstanceBeginEditable name="topRightMenu" --><!-- #BeginLibraryItem "/Library/help.lbi" --><table cellspacing="0" cellpadding="0" summary="" border="0">
  320. <tr>
  321. <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>
  322. <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>
  323. <td class="DarkHeaderSubSub">&nbsp;<a href="../Help/index.php" rel="gb_page_fs[]" class="dark">Help</a></td>
  324. </tr>
  325. </table>
  326. <!-- #EndLibraryItem --><!-- InstanceEndEditable --></td>
  327. </tr>
  328. <tr>
  329. <td valign="bottom" align="right" colspan="2"><!-- InstanceBeginEditable name="rightMenu" -->
  330. <?php include('../include/menu/main_right.php'); ?>
  331. <!-- InstanceEndEditable --></td>
  332. <td>
  333. </td>
  334. </tr>
  335. <tr>
  336. <td width="100%" colspan="3"><table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  337. <tbody>
  338. <tr>
  339. <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghtl.gif" width="4"></td>
  340. <td colspan="4"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ght.gif" border="0">
  341. <tbody>
  342. <tr>
  343. <td height="4"></td>
  344. </tr>
  345. </tbody>
  346. </table></td>
  347. <td class="BGColorDark" valign="top" rowspan="2"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ght.gif" border="0">
  348. <tbody>
  349. <tr>
  350. <td height="4"></td>
  351. </tr>
  352. </tbody>
  353. </table></td>
  354. <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghtr.gif" width="4"></td>
  355. </tr>
  356. <tr>
  357. <td class="BGGrayLight" rowspan="3"></td>
  358. <td class="BGGrayMedium" rowspan="3"></td>
  359. <td class="BGGrayDark" rowspan="3"></td>
  360. <td class="BGColorDark" rowspan="3"></td>
  361. <td class="BGColorDark" rowspan="3"><!-- InstanceBeginEditable name="leftMenu" --><?php include('../include/menu/main_left.php'); ?><!-- InstanceEndEditable --></td>
  362. <td class="BGColorDark" rowspan="3"></td>
  363. <td class="BGColorDark" rowspan="2"></td>
  364. <td class="BGColorDark" rowspan="2"></td>
  365. <td class="BGColorDark" rowspan="2"></td>
  366. <td class="BGGrayDark" rowspan="2"></td>
  367. <td class="BGGrayMedium" rowspan="2"></td>
  368. <td class="BGGrayLight" rowspan="2"></td>
  369. </tr>
  370. <tr>
  371. <td class="BGColorDark" width="100%"><?php
  372. if (isset($_SESSION['username'])) {
  373. ?>
  374. <div align="right" class="FieldNumberDisabled">&nbsp;</div>
  375. <?php
  376. } else {
  377. echo "&nbsp;";
  378. }
  379. ?>
  380. </td>
  381. </tr>
  382. <tr>
  383. <td valign="top"><img height="20" alt="" src="../images/c-ghct.gif" width="25"></td>
  384. <td valign="top" colspan="2"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ghb.gif" border="0">
  385. <tbody>
  386. <tr>
  387. <td height="4"></td>
  388. </tr>
  389. </tbody>
  390. </table></td>
  391. <td valign="top" colspan="4"><img height="20" alt="" src="../images/c-ghbr.gif" width="4"></td>
  392. </tr>
  393. <tr>
  394. <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghbl.gif" width="4"></td>
  395. <td><table height="4" cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ghb.gif" border="0">
  396. <tbody>
  397. <tr>
  398. <td></td>
  399. </tr>
  400. </tbody>
  401. </table></td>
  402. <td><img height="4" alt="" src="../images/c-ghcb.gif" width="3"></td>
  403. <td colspan="7"></td>
  404. </tr>
  405. </tbody>
  406. </table></td>
  407. </tr>
  408. </tbody>
  409. </table>
  410. </div>
  411. <!-- InstanceBeginEditable name="main" --> <table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  412. <tbody>
  413. <tr>
  414. <td height="2"></td>
  415. </tr>
  416. <tr>
  417. <td><table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  418. <tbody>
  419. <tr>
  420. <td>
  421. <div id="hotMessage" align="center" style="width: 700px;display:<?= ($PO['hot'] == 'yes') ? display : none; ?>" onMouseOver="new Effect.Pulsate(this);">This Requisition has been tagged HOT!!</div>
  422. <div id="messageCenter" align="center" style="width: 700px;display:<?= ($PO['message'] == 'yes') ? display : none; ?>"><?= $message; ?></div>
  423. <br>
  424. <form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" name="Form" id="Form" runat="vdaemon">
  425. <table border="0" align="center" cellpadding="0" cellspacing="0">
  426. <tr>
  427. <td>
  428. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  429. <tr>
  430. <td></td>
  431. <td height="26" valign="bottom">
  432. <table border="0" align="right" cellpadding="0" cellspacing="0">
  433. <tr>
  434. <?php if ($_SESSION['eid'] == $PO['req'] and ! empty($PO['po'])) { ?>
  435. <td><div id="ddcolortabs">
  436. <ul>
  437. <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>
  438. </ul>
  439. </div></td>
  440. <td>
  441. <div id="ddcolortabs">
  442. <ul>
  443. <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>
  444. </ul>
  445. </div>
  446. </td>
  447. <?php } ?>
  448. <td><div id="ddcolortabs">
  449. <ul>
  450. <li id="inactive"><a href="javascript: window.print();" <?php help('', 'Click here to print this Request', 'default'); ?>><span>Print&nbsp;Requisition</span></a></li>
  451. </ul>
  452. </div></td>
  453. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  454. </tr>
  455. </table></td>
  456. </tr>
  457. <tr class="BGAccentVeryDark">
  458. <td width="50%" height="30" nowrap class="DarkHeaderSubSub">&nbsp;&nbsp;Purchase Order Requisition...</td>
  459. <td width="50%"></td>
  460. </tr>
  461. </table>
  462. </td>
  463. </tr>
  464. <tr>
  465. <td class="BGAccentVeryDarkBorder"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  466. <tr>
  467. <td valign="top" class="BGAccentDarkBorder"><table width="100%" border="0">
  468. <tr>
  469. <td height="25" colspan="4" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  470. <tr>
  471. <td><img src="../images/info.png" width="16" height="16" align="texttop"><strong>&nbsp;Information</strong></td>
  472. <td><div align="right" class="mainsection">Status: <?= reqStatus($PO['status']); ?>
  473. <input type="hidden" name="status" value="<?= $PO['status']; ?>">
  474. &nbsp;&nbsp;</div></td>
  475. </tr>
  476. </table></td>
  477. </tr>
  478. <tr>
  479. <td nowrap>Requisition Number:</td>
  480. <td class="label"><?= $_GET['id']; ?></td>
  481. <td nowrap>&nbsp;</td>
  482. <td>&nbsp;</td>
  483. </tr>
  484. <tr>
  485. <td width="12%" nowrap>Purchase Order Number:</td>
  486. <td width="45%" class="label"><?= $PO['po']; ?></td>
  487. <td width="13%" nowrap><table width="100%" border="0" cellspacing="0" cellpadding="0">
  488. <tr>
  489. <td nowrap>CER Number:</td>
  490. <td width="35" align="right"><a href="cer_list.php" title="Capital Acquisition List" rel="gb_page_center[700, 600]" <?php help('', 'Click here to get a list of approved Capital Expenditure Requests', 'default'); ?>><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a></td>
  491. </tr>
  492. </table> </td>
  493. <td width="26%"><table border="0" cellspacing="0" cellpadding="0">
  494. <tr>
  495. <td class="label"><?= $CER[$PO['cer']]; ?></td>
  496. <td><?php if (!empty($PO['cer'])) { ?>
  497. <a href="<?= $default['URL_HOME']; ?>/CER/print.php?id=<?= $PO['cer']; ?>" <?php help('', 'Click here to print this Capital Expenditure Request', 'default'); ?>><img src="../images/printer.gif" border="0" align="absmiddle"></a>
  498. <?php } ?></td>
  499. </tr>
  500. </table></td>
  501. </tr>
  502. <tr>
  503. <td>Requisitioner:</td>
  504. <td class="label"><?= caps($EMPLOYEES[$PO['req']]); ?></td>
  505. <td nowrap>Requisition Date:</td>
  506. <td class="label"><?= $PO['_reqDate']; ?></td>
  507. </tr>
  508. <?php if (!empty($PO['incareof']) AND $PO['req'] != $PO['incareof']) { ?>
  509. <tr>
  510. <td><img src="/Common/images/menupointer2.gif" width="4" height="7" align="absmiddle"> In Care Of:</td>
  511. <td class="label"><?= caps($EMPLOYEES[$PO['incareof']]); ?></td>
  512. <td>&nbsp;</td>
  513. <td>&nbsp;</td>
  514. </tr>
  515. <?php } ?>
  516. <tr>
  517. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
  518. </tr>
  519. <?php if (!is_null($PO['sup2'])) { ?>
  520. <tr>
  521. <td nowrap>Final Vendor: </td>
  522. <td class="label"><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?><?php
  523. /* Getting suppliers from Suppliers */
  524. $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
  525. FROM Standards.Vendor
  526. WHERE BTVEND = '".$PO['sup2']."'");
  527. ?><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 } ?>&nbsp;<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>
  528. <td>Kickoff Date:</td>
  529. <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>
  530. </tr>
  531. <?php } ?>
  532. <tr>
  533. <td nowrap><?= (is_null($PO['sup2']) AND empty($PO['po'])) ? Recommended : Final; ?> Vendor:</td>
  534. <td class="label"><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?><?php
  535. /* Getting suppliers from Suppliers */
  536. $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
  537. FROM Standards.Vendor
  538. WHERE BTVEND = '".$PO['sup']."'");
  539. ?><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 } ?>&nbsp;<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>
  540. <?php if (is_null($PO['sup2']) AND !empty($PO['po'])) { ?>
  541. <td>Kickoff Date:</td>
  542. <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>
  543. <?php } else { ?>
  544. <td>&nbsp;</td>
  545. <td>&nbsp;</td>
  546. <?php } ?>
  547. </tr>
  548. <tr>
  549. <td>Company:</td>
  550. <td class="label"><?= caps($COMPANY[$PO[company]]); ?></td>
  551. <td nowrap>&nbsp;</td>
  552. <td>&nbsp;</td>
  553. </tr>
  554. <tr>
  555. <td>Bill to Plant: </td>
  556. <td class="label"><?= caps($PLANT[$PO['plant']]); ?></td>
  557. <td>Deliver to Plant: </td>
  558. <td class="label"><?= caps($PLANT[$PO['ship']]); ?></td>
  559. </tr>
  560. <tr>
  561. <td>Department:</td>
  562. <td class="label"><?= '(' . $PO['department'] . ') ' . caps($DEPARTMENT[$PO['department']]); ?></td>
  563. <td>Job Number: </td>
  564. <td><span class="label">
  565. <?= $PO['job']; ?>
  566. </span></td>
  567. </tr>
  568. <tr>
  569. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
  570. </tr>
  571. <tr>
  572. <td valign="top" nowrap>Purpose / Usage:</td>
  573. <td colspan="3" class="label"><?= stripslashes($PO['purpose']); ?></td>
  574. </tr>
  575. </table></td>
  576. </tr>
  577. <tr>
  578. <td>&nbsp;</td>
  579. </tr>
  580. <tr>
  581. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  582. <tr>
  583. <td width="100%" height="25" colspan="6" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  584. <tr>
  585. <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>
  586. <td width="120">&nbsp;</td>
  587. </tr>
  588. </table></td>
  589. </tr>
  590. <td>&nbsp;</td>
  591. </table>
  592. </td>
  593. </tr>
  594. <tr>
  595. <td>&nbsp;</td>
  596. </tr>
  597. <tr><td class="BGAccentDarkBorder"><table width="100%" border="0">
  598. <tr>
  599. <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  600. <tr>
  601. <td>&nbsp;<a href="javascript:void(0);" onClick="new Effect.toggle('items','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>
  602. <td width="160"><!--<a href="javascript:void(0);" class="viewcomments">View All Details </a>--></td>
  603. </tr>
  604. </table></td>
  605. </tr>
  606. <tr>
  607. <td>
  608. <div id="items">
  609. <table width="100%" border="0">
  610. <tr>
  611. <td width="35" class="HeaderAccentDark">&nbsp;</td>
  612. <td width="35" class="HeaderAccentDark">Unit</td>
  613. <td width="80" nowrap class="HeaderAccentDark">Company#&nbsp;</td>
  614. <td width="60" nowrap class="HeaderAccentDark">Manuf#&nbsp;</td>
  615. <td class="HeaderAccentDark">Item Description</td>
  616. <td width="50" nowrap class="HeaderAccentDark">Price</td>
  617. </tr>
  618. <?php
  619. while($items_sql->fetchInto($ITEMS)) {
  620. $count_items++;
  621. $row_color = ($count_items % 2) ? FFFFFF : DFDFBF;
  622. ?>
  623. <!-- Start of Item<?= $count_items; ?> -->
  624. <tr <?php pointer($row_color); ?>>
  625. <td class="label" bgcolor="#<?= $row_color; ?>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  626. <tr>
  627. <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">
  628. <input name="item<?= $count_items; ?>" type="hidden" id="item<?= $count_items; ?>" value="<?= $ITEMS['id']; ?>">
  629. </a></td>
  630. <td><strong><?= $ITEMS['qty']; ?></strong></td>
  631. </tr>
  632. </table></td>
  633. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper($ITEMS['unit']); ?></td>
  634. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['part'])); ?></td>
  635. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['manuf'])); ?></td>
  636. <td nowrap bgcolor="#<?= $row_color; ?>" class="label">
  637. <?php
  638. if (strlen($ITEMS['descr']) > 50) {
  639. echo caps(substr(htmlspecialchars(stripslashes($ITEMS['descr'])), 0, 50));
  640. echo "...<a href=\"javascript:void(0);\" class=black onmouseover=\"return overlib('" . caps(htmlspecialchars(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>";
  641. } else {
  642. echo caps(stripslashes($ITEMS['descr']));
  643. }
  644. ?></td>
  645. <td class="label" bgcolor="#<?= $row_color; ?>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  646. <tr>
  647. <td><strong>$</strong></td>
  648. <td align="right"><strong><?= number_format($ITEMS['price'],2); ?></strong></td>
  649. </tr>
  650. </table></td>
  651. </tr>
  652. <tr <?php pointer($row_color); ?> id="itemDetails<?= $count_items; ?>" style="display:none">
  653. <td colspan="6" bgcolor="#<?= $row_color; ?>" class="label"><table width="100%" border="0">
  654. <!--
  655. <tr>
  656. <td width="200">Supplier Delevery Date: </td>
  657. <td>&nbsp;</td>
  658. <td width="200">&nbsp;</td>
  659. <td>&nbsp;</td>
  660. </tr>
  661. <tr>
  662. <td>&nbsp;</td>
  663. <td>&nbsp;</td>
  664. <td>&nbsp;</td>
  665. <td>&nbsp;</td>
  666. </tr>
  667. -->
  668. <tr>
  669. <td width="200">Category Name: </td>
  670. <td class="label"><?= caps($CAT[$ITEMS['cat']]); ?></td>
  671. <td width="200">Category Number: </td>
  672. <td class="label"><?= $ITEMS['cat']; ?></td>
  673. </tr>
  674. <tr>
  675. <td>Company Tool Number: </td>
  676. <td class="label"><?= $ITEMS['vt']; ?></td>
  677. <td>&nbsp;</td>
  678. <td>&nbsp;</td>
  679. </tr>
  680. </table></td>
  681. </tr>
  682. <!-- End of Item<?= $count_items; ?> -->
  683. <?php } ?>
  684. <tr><td colspan="5" align="right" class="xpHeaderBottomActive">Total: </td>
  685. <td class="xpHeaderBottomActive"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  686. <tr>
  687. <td style="font-weight:bold">$</td>
  688. <td style="font-weight:bold" align="right"><?= number_format($PO['total'],2); ?></td>
  689. </tr>
  690. </table></td>
  691. </tr>
  692. </table>
  693. </div> </td>
  694. </tr>
  695. </table></td></tr>
  696. <tr>
  697. <td>&nbsp;</td>
  698. </tr>
  699. <tr>
  700. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  701. <tr>
  702. <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  703. <tr>
  704. <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>
  705. <td width="160"><!--<a href="../Uploads/index.php?request_id=<?= $_GET['id']; ?>&type_id=PO#upload" target="attachments" class="viewcomments">Upload File</a>--></td>
  706. </tr>
  707. </table></td>
  708. </tr>
  709. <tr>
  710. <td>
  711. <div id="attachments">
  712. <iframe id="attachments" name="attachments" frameborder="0" width="100%" height="150" src="../Uploads/index.php?request_id=<?= $_GET['id']; ?>&type_id=PO"></iframe>
  713. </div></td>
  714. </tr>
  715. </table></td>
  716. </tr>
  717. <tr>
  718. <td>&nbsp;</td>
  719. </tr>
  720. <tr>
  721. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  722. <tr>
  723. <td width="100%" height="25" colspan="6" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  724. <tr>
  725. <td>&nbsp;<a href="javascript:switchComments();" class="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>
  726. <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="add">NEW COMMENT</a></td>
  727. </tr>
  728. </table></td>
  729. </tr>
  730. <td>
  731. <?php if ($post_count > 0) { ?>
  732. <div id="commentsHeader" onClick="switchComments();">There are currently <strong><?= $post_count; ?></strong> comments. The last comment was posted on <strong><?= date('F d, Y \a\t H:i A', strtotime($LAST_POST['posted'])); ?></strong>.<br>
  733. <br><div class="clickToView">Click to view all Comments.</div></div>
  734. <?php } else { ?>
  735. <div id="commentsHeader">There are currently <strong>NO</strong> comments.</div>
  736. <?php } ?>
  737. <div width="95%" border="0" align="center" id="comments_area" style="display:none" onClick="switchComments();">
  738. <br>
  739. <?php
  740. $count=0;
  741. while($post_sth->fetchInto($POST)) {
  742. $count++;
  743. ?>
  744. <div class="comment">
  745. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  746. <tr>
  747. <td width="55" rowspan="3" valign="top" class="comment_datenum"><div class="comment_month">
  748. <?= date("M", strtotime($POST['posted'])); ?>
  749. </div>
  750. <div class="comment_day">
  751. <?= date("d", strtotime($POST['posted'])); ?>
  752. </div>
  753. <div class="comment_year">
  754. <?= date("y", strtotime($POST['posted'])); ?>
  755. </div></td>
  756. <td class="comment_wrote"><?= ucwords(strtolower($EMPLOYEES[$POST[eid]])); ?>
  757. wrote... </td>
  758. </tr>
  759. <tr>
  760. <td class="commentbody"><?= $POST['comment']; ?></td>
  761. </tr>
  762. <tr>
  763. <td class="comment_date"><?= date("h:i A", strtotime($POST['posted'])); ?></td>
  764. </tr>
  765. </table>
  766. </div>
  767. <br>
  768. <?php } ?></div></td>
  769. </table></td>
  770. </tr>
  771. <tr>
  772. <td>&nbsp;</td>
  773. </tr>
  774. <tr>
  775. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  776. <tr>
  777. <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>
  778. </tr>
  779. <!-- START REQUESTER -->
  780. <tr>
  781. <td height="25" colspan="6"><table border="0">
  782. <tr class="BGAccentDark">
  783. <td height="25" nowrap>&nbsp;</td>
  784. <td width="30" nowrap>&nbsp;</td>
  785. <td nowrap class="HeaderAccentDark">&nbsp;</td>
  786. <td nowrap class="HeaderAccentDark">Date</td>
  787. <td width="20" align="center" nowrap class="HeaderAccentDark"><img src="/Common/images/clock.gif" width="16" height="16"></td>
  788. <td width="400" nowrap class="HeaderAccentDark">Comments</td>
  789. <td nowrap class="HeaderAccentDark"><?= (array_key_exists('approval', $_GET)) ? 'Approval' : $blank; ?></td>
  790. </tr>
  791. <tr>
  792. <td nowrap>Requester:</td>
  793. <td align="center" nowrap><?= showCommentIcon($PO['req'], ucwords(strtolower($EMPLOYEES[$PO['req']])), $PO['id']); ?></td>
  794. <td nowrap class="label"><?= ucwords(strtolower($EMPLOYEES[$PO['req']])); ?></td>
  795. <td nowrap class="label"><?= $PO['_reqDate']; ?></td>
  796. <td nowrap class="TrainActive">-</td>
  797. <td nowrap>&nbsp;</td>
  798. <td nowrap>&nbsp;</td>
  799. </tr>
  800. <!-- END REQUESTER -->
  801. <!-- START APPROVER 1 -->
  802. <tr <?= ($_GET['approval'] == 'app1') ? $highlight : $blank; ?>>
  803. <td nowrap><?= $language['label']['app1']; ?>:</td>
  804. <td align="center" nowrap><?php
  805. if (is_null($AUTH['app1Date'])) {
  806. echo showMailIcon('app1', $AUTH['app1'], ucwords(strtolower($EMPLOYEES[$AUTH['app1']])), $PO['id']);
  807. } else {
  808. echo showCommentIcon($AUTH['app1'], ucwords(strtolower($EMPLOYEES[$AUTH['app1']])), $PO['id']);
  809. }
  810. ?></td>
  811. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  812. <td nowrap class="label"><?php if (isset($AUTH['app1Date'])) { echo date("F d, Y", strtotime($AUTH['app1Date'])); } ?></td>
  813. <td nowrap class="TrainActive"><?php if (isset($AUTH['app1Date'])) { echo abs(ceil((strtotime($REQUEST['reqDate']) - strtotime($AUTH['app1Date'])) / (60 * 60 * 24))); } ?></td>
  814. <td nowrap class="label"><?= displayAppComment('app1', $_GET['approval'], $AUTH['app1'], $AUTH['app1Com'], $AUTH['app1Date']); ?></td>
  815. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  816. </tr>
  817. <!-- END APPROVER 1 -->
  818. <?php if (strlen($AUTH['app2']) == 5 OR $PO['status'] == 'N') { ?>
  819. <!-- START APPROVER 2 -->
  820. <tr <?= ($_GET['approval'] == 'app2') ? $highlight : $blank; ?>>
  821. <td nowrap><?= $language['label']['app2']; ?>:</td>
  822. <td align="center" nowrap><?php if (is_null($AUTH['app2Date']) AND !is_null($AUTH['app1Date']) AND $AUTH['app2'] != '0') {
  823. echo showMailIcon('app2', $AUTH['app2'], ucwords(strtolower($EMPLOYEES[$AUTH['app2']])), $PO['id']);
  824. } else if (!is_null($AUTH['app2Date'])) {
  825. echo showCommentIcon($AUTH['app2'], ucwords(strtolower($EMPLOYEES[$AUTH['app2']])), $PO['id']);
  826. }
  827. ?></td>
  828. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  829. <td nowrap class="label"><?php if (isset($AUTH['app2Date'])) { echo date("F d, Y", strtotime($AUTH['app2Date'])); } ?></td>
  830. <td nowrap class="TrainActive"><?php if (isset($AUTH['app2Date'])) { echo abs(ceil((strtotime($AUTH['app1Date']) - strtotime($AUTH['app2Date'])) / (60 * 60 * 24))); } ?></td>
  831. <td nowrap class="label"><?= displayAppComment('app2', $_GET['approval'], $AUTH['app2'], $AUTH['app2Com'], $AUTH['app2Date']); ?></td>
  832. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  833. </tr>
  834. <!-- END APPROVER 2 -->
  835. <?php } ?>
  836. <?php if (strlen($AUTH['app3']) == 5 OR $PO['status'] == 'N') { ?>
  837. <!-- END APPROVER 3 -->
  838. <tr <?= ($_GET['approval'] == 'app3') ? $highlight : $blank; ?>>
  839. <td nowrap><?= $language['label']['app3']; ?>:</td>
  840. <td align="center" nowrap><?php if (is_null($AUTH['app3Date']) AND !is_null($AUTH['app2Date']) AND $AUTH['app3'] != '0') {
  841. echo showMailIcon('app3', $AUTH['app3'], ucwords(strtolower($EMPLOYEES[$AUTH['app3']])), $PO['id']);
  842. } else if (!is_null($AUTH['app3Date'])) {
  843. echo showCommentIcon($AUTH['app3'], ucwords(strtolower($EMPLOYEES[$AUTH['app3']])), $PO['id']);
  844. }
  845. ?></td>
  846. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  847. <td nowrap class="label"><?php if (isset($AUTH['app3Date'])) { echo date("F d, Y", strtotime($AUTH['app3Date'])); } ?></td>
  848. <td nowrap class="TrainActive"><?php if (isset($AUTH['app3Date'])) { echo abs(ceil((strtotime($AUTH['app2Date']) - strtotime($AUTH['app3Date'])) / (60 * 60 * 24))); } ?></td>
  849. <td nowrap class="label"><?= displayAppComment('app3', $_GET['approval'], $AUTH['app3'], $AUTH['app3Com'], $AUTH['app3Date']); ?></td>
  850. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  851. </tr>
  852. <!-- END APPROVER 3 -->
  853. <?php } ?>
  854. <?php if (strlen($AUTH['app4']) == 5 OR $PO['status'] == 'N') { ?>
  855. <!-- START APPROVER 4 -->
  856. <tr <?= ($_GET['approval'] == 'app4') ? $highlight : $blank; ?>>
  857. <td nowrap><?= $language['label']['app4']; ?>:</td>
  858. <td align="center" nowrap><?php if (is_null($AUTH['app4Date']) AND !is_null($AUTH['app2Date']) AND $AUTH['app4'] != '0') {
  859. echo showMailIcon('app4', $AUTH['app4'], ucwords(strtolower($EMPLOYEES[$AUTH['app4']])), $PO['id']);
  860. } else if (!is_null($AUTH['app4Date'])) {
  861. echo showCommentIcon($AUTH['app4'], ucwords(strtolower($EMPLOYEES[$AUTH['app4']])), $PO['id']);
  862. }
  863. ?></td>
  864. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  865. <td nowrap class="label"><?php if (isset($AUTH['app4Date'])) { echo date("F d, Y", strtotime($AUTH['app4Date'])); } ?></td>
  866. <td nowrap class="TrainActive"><?php if (isset($AUTH['app4Date'])) { echo abs(ceil((strtotime($AUTH['app3Date']) - strtotime($AUTH['app4Date'])) / (60 * 60 * 24))); } ?></td>
  867. <td nowrap class="label"><?= displayAppComment('app4', $_GET['approval'], $AUTH['app4'], $AUTH['app4Com'], $AUTH['app4Date']); ?></td>
  868. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  869. </tr>
  870. <!-- END APPROVER 4 -->
  871. <?php } ?>
  872. <?php if (!is_null($PO['po'])) { ?>
  873. <!-- START PURCHASER -->
  874. <tr <?= ($_GET['approval'] == 'purchaser') ? $highlight : $blank; ?>>
  875. <td nowrap>Purchaser: </td>
  876. <td align="center" nowrap><?= showCommentIcon($AUTH['issuer'], ucwords(strtolower($EMPLOYEES[$AUTH['issuer']])), $PO['id']); ?></td>
  877. <td nowrap class="label"><?= ucwords(strtolower($EMPLOYEES[$AUTH['issuer']])); ?></td>
  878. <td nowrap class="label"><?= date("F j, Y", strtotime($AUTH['issuerDate'])); ?></td>
  879. <td nowrap class="TrainActive"><?php if (isset($AUTH['generatorDate'])) { echo abs(ceil((strtotime($AUTH['coordinatorDate']) - strtotime($AUTH['generatorDate'])) / (60 * 60 * 24))); } ?></td>
  880. <td nowrap>&nbsp;</td>
  881. <td nowrap>&nbsp;</td>
  882. </tr>
  883. <!-- END PURCHASER -->
  884. <?php } ?>
  885. <!-- START TOTAL -->
  886. <tr class="xpHeaderTotal">
  887. <td height="25" nowrap>Totals:</td>
  888. <td nowrap>&nbsp;</td>
  889. <td nowrap>&nbsp;</td>
  890. <td nowrap>&nbsp;</td>
  891. <td nowrap class="TrainActive"><?= abs(ceil((strtotime($REQUEST['reqDate']) - strtotime($AUTH['generatorDate'])) / (60 * 60 * 24))); ?></td>
  892. <td nowrap class="TipLabel">Days</td>
  893. <td nowrap>&nbsp;</td>
  894. </tr>
  895. <!-- END TOTAL -->
  896. </table></td>
  897. </tr>
  898. </table></td>
  899. </tr>
  900. <?php if ($_SESSION['request_role'] == 'purchasing') { ?>
  901. <tr><td>&nbsp;</td></tr>
  902. <tr>
  903. <td valign="top" class="BGAccentDarkBlueBorder"><table width="100%" border="0">
  904. <tr>
  905. <td height="25" class="BGAccentDarkBlue"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  906. <tr>
  907. <td style="color:#FFFFFF; font-weight:bold;"><img src="../images/team.gif" width="16" height="18" align="texttop"> Purchasing Department</td>
  908. <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['purchaserUpdate'])) { ?>Last Updated: <?= date('F d, Y', strtotime($PO['purchaserUpdate'])); ?></a><?php } ?></td>
  909. </tr>
  910. </table></td>
  911. </tr>
  912. <tr>
  913. <td><table width="100%" border="0" cellspacing="2" cellpadding="0">
  914. <?php if (is_null($PO['po'])) { ?>
  915. <tr>
  916. <td colspan="4" class="blankNoteArea">Purchaser scheduled to Complete Requisition:
  917. <select name="purchaserHold" id="purchaserHold" onchange="this.form.submit();">
  918. <option value="0">Select One</option>
  919. <?php
  920. $purchaser_sth = $dbh->execute($purchaser_sql);
  921. while($purchaser_sth->fetchInto($PURCHASER)) {
  922. $selected = ($AUTH['issuer'] == $PURCHASER['eid']) ? selected : $blank;
  923. print "<option value=\"".$PURCHASER['eid']."\" ".$selected.">".ucwords(strtolower($PURCHASER['lst'].", ".$PURCHASER['fst']))."</option>";
  924. }
  925. ?>
  926. </select></td>
  927. </tr>
  928. <?php } else { ?>
  929. <tr>
  930. <td width="100">Purchaser:</td>
  931. <td class="label"><?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  932. <td width="125">Supplier Kickoff:</td>
  933. <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>
  934. </tr>
  935. <?php } ?>
  936. <tr>
  937. <td height="5" colspan="4"><fieldset class="collapsible" id="purchasingInfoF">
  938. <legend><a href="javascript:switchFieldset('purchasingInfo', 'collapsible');" id="purchasingInfoA">Information</a></legend>
  939. <table width="100%" border="0" cellspacing="2" cellpadding="0" id="purchasingInfo">
  940. <tr>
  941. <td width="194" nowrap>FOB:</td>
  942. <td width="150"><input name="fob" type="text" id="fob" value="<?= $PO['fob']; ?>" size="15" maxlength="15"></td>
  943. <td width="142" nowrap>Requisition Type: </td>
  944. <td width="187"><select name="reqType" id="reqType">
  945. <option value="0">Select One</option>
  946. <option value="blanket">Blanket Order</option>
  947. <option value="capex">Capital Expense</option>
  948. <option value="mro">MRO</option>
  949. <option value="tooling">Tooling</option>
  950. </select></td>
  951. </tr>
  952. <tr>
  953. <td>Ship Via:</td>
  954. <td><input name="via" type="text" id="via" value="<?= $PO['via']; ?>" size="15" maxlength="15"></td>
  955. <td width="142">Final Terms:</td>
  956. <td><select name="terms" id="terms">
  957. <option value="0">Select One</option>
  958. <?php
  959. $terms_sth = $dbh->execute($terms_query);
  960. while($terms_sth->fetchInto($TERMS2)) {
  961. $selected = ($PO['terms'] == $TERMS2['id']) ? selected : $blank;
  962. print "<option value=\"".$TERMS2['id']."\" ".$selected.">".$TERMS2['name']."</option>";
  963. }
  964. ?>
  965. </select></td>
  966. </tr>
  967. <tr>
  968. <td colspan="4">&nbsp;</td>
  969. <tr>
  970. <td>&nbsp;</td>
  971. <td colspan="2" class="dHeader">Name</td>
  972. <td class="dHeader">Terms</td>
  973. </tr>
  974. <tr>
  975. <td>Recommended Vendor:</td>
  976. <td colspan="2" nowrap><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?>
  977. <?php
  978. /* Getting suppliers from Suppliers */
  979. $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
  980. FROM Standards.Vendor
  981. WHERE BTVEND = '" . $PO['sup'] . "'");
  982. ?><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 } ?>&nbsp;<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>
  983. <td><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  984. </tr>
  985. <?php if (!is_null($PO['sup2'])) { ?>
  986. <tr>
  987. <td>Final Vendor:</td>
  988. <td colspan="2" nowrap><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?>
  989. <?php
  990. /* Getting suppliers from Suppliers */
  991. $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
  992. FROM Standards.Vendor
  993. WHERE BTVEND = '" . $PO['sup2'] . "'");
  994. ?><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 } ?>&nbsp;<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>
  995. <td><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  996. </tr>
  997. <?php } ?>
  998. <tr>
  999. <td>Change Vendor:</td>
  1000. <td colspan="3"><input id="vendSearch" name="vendSearch" type="text" size="50" />
  1001. <script type="text/javascript">
  1002. Event.observe(window, "load", function() {
  1003. var aa = new AutoAssist("vendSearch", function() {
  1004. return "../Common/vendor.php?q=" + this.txtBox.value;
  1005. });
  1006. });
  1007. </script>
  1008. <input name="supplierNew" type="hidden" id="supplierNew"><input name="supplierNewTerms" type="hidden" id="supplierNewTerms"></td>
  1009. </tr>
  1010. <tr>
  1011. <td>&nbsp;</td>
  1012. <td>&nbsp;</td>
  1013. <td>&nbsp;</td>
  1014. <td><input name="updaterequest" type="image" src="../images/button.php?i=w130.png&l=Update Request" alt="Update Request" border="0">
  1015. <input name="action" type="hidden" id="action" value="purchasing_update">
  1016. &nbsp;</td>
  1017. </tr>
  1018. </table>
  1019. </fieldset>
  1020. <fieldset class="collapsed" id="vendorPaymentsF">
  1021. <legend><a href="javascript:switchFieldset('vendorPayments', 'collapsed');" id="vendorPaymentsA">Vendor Payments (<?= $payments_count; ?>)</a></legend>
  1022. <table border="0" align="center" cellpadding="0" cellspacing="5" id="vendorPayments" style="display:none">
  1023. <tr>
  1024. <td valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  1025. <tr>
  1026. <td class="blueNoteAreaBorder"><table border="0">
  1027. <tr class="blueNoteArea">
  1028. <td class="label">Amount</td>
  1029. <td class="label">Date</td>
  1030. <td class="label">&nbsp;</td>
  1031. </tr>
  1032. <tr>
  1033. <td class="label">$<input name="pay_amount" type="text" class="BGAccentDarkBlueBorder" id="pay_amount" size="15"></td>
  1034. <td class="label"><input name="paymentDate" type="text" id="paymentDate" size="10" maxlength="10" class="BGAccentDarkBlueBorder" value="<?= $PAYMENTS['0']['pay_date']; ?>" readonly>
  1035. <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>
  1036. <td class="label"><input name="addPayment" type="image" id="addPayment" src="../images/add.gif"></td>
  1037. </tr>
  1038. </table></td>
  1039. </tr>
  1040. </table></td>
  1041. <td rowspan="2" align="right" valign="top"><img src="../images/spacer.gif" width="50" height="10"></td>
  1042. <td align="right" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  1043. <tr>
  1044. <td class="blueNoteAreaBorder">
  1045. <?php if ($payments_count > 0) { ?>
  1046. <table border="0">
  1047. <tr class="blueNoteArea">
  1048. <td class="label">&nbsp;</td>
  1049. <td class="label">Amount</td>
  1050. <td class="label">Date</td>
  1051. <td class="label">Delete</td>
  1052. </tr>
  1053. <?php
  1054. $count=0;
  1055. $total=$PO['total'];
  1056. while ($payments->fetchInto($PAYMENTS)) {
  1057. $count++;
  1058. $total -= $PAYMENTS['pay_amount'];
  1059. ?>
  1060. <tr>
  1061. <td class="label"><?= $count; ?><input type="hidden" name="pay_id<?= $count; ?>" id="pay_id<?= $count; ?>" value="<?= $PAYMENTS['pay_id']; ?>"></td>
  1062. <td class="label">$<input name="pay_amount<?= $count; ?>" type="text" class="BGAccentDarkBlueBorder" id="pay_amount<?= $count; ?>" value="<?= $PAYMENTS['pay_amount']; ?>" size="15"></td>
  1063. <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>
  1064. <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>
  1065. <td align="center" class="label"><input type="checkbox" name="pay_remove<?= $count; ?>" id="pay_remove<?= $count; ?>" value="yes"></td>
  1066. </tr>
  1067. <?php } ?>
  1068. </table>
  1069. <input name="payments_count" id="payments_count" type="hidden" value="<?= $payments_count; ?>">
  1070. <?php } ?></td>
  1071. </tr>
  1072. </table></td>
  1073. </tr>
  1074. <tr>
  1075. <td>&nbsp;</td>
  1076. <td>
  1077. <?php if ($payments_count > 0) { ?>
  1078. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  1079. <tr>
  1080. <td class="label">Outstanding: $<?= number_format($total,2); ?></td>
  1081. <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>
  1082. </tr>
  1083. </table>
  1084. <?php } ?>
  1085. </td>
  1086. </tr>
  1087. </table>
  1088. </fieldset>
  1089. <fieldset class="collapsed" id="currentContactsF">
  1090. <legend><a href="javascript:switchFieldset('currentContacts', 'collapsed');" id="currentContactsA">Contact Information (<?= $contacts_count; ?>)</a></legend>
  1091. <table border="0" align="center" cellpadding="0" cellspacing="0" id="currentContacts" style="display:none">
  1092. <tr>
  1093. <td class="blueNoteAreaBorder"><table border="0">
  1094. <tr class="blueNoteArea">
  1095. <td class="label">Name</td>
  1096. <td class="label">Phone</td>
  1097. <td class="label">Ext</td>
  1098. <td class="label">Email</td>
  1099. </tr>
  1100. <tr>
  1101. <td class="label"><input name="cc_name" type="text" id="cc_name" size="30" maxlength="30" class="BGAccentDarkBlueBorder"></td>
  1102. <td class="label"><input name="cc_phone" type="text" id="cc_phone" size="15" maxlength="15" class="BGAccentDarkBlueBorder"></td>
  1103. <td class="label"><input name="cc_ext" type="text" id="cc_ext" size="10" maxlength="10" class="BGAccentDarkBlueBorder"></td>
  1104. <td class="label"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  1105. <tr>
  1106. <td><input name="cc_email" type="text" id="cc_email" size="50" maxlength="50" class="BGAccentDarkBlueBorder"></td>
  1107. <td width="35" align="center"><input name="addContact" type="image" id="addContact" src="../images/add.gif"></td>
  1108. </tr>
  1109. </table></td>
  1110. </tr>
  1111. <?php
  1112. while($contacts->fetchInto($CONTACTS)) {
  1113. ?>
  1114. <tr>
  1115. <td class="label"><?= $CONTACTS['name']; ?></td>
  1116. <td class="label"><?= $CONTACTS['phone']; ?></td>
  1117. <td class="label"><?= $CONTACTS['ext']; ?></td>
  1118. <td class="label"><a href="mailto:<?= $CONTACTS['email']; ?>" class="emailLink"><?= $CONTACTS['email']; ?></a></td>
  1119. </tr>
  1120. <?php } ?>
  1121. </table></td>
  1122. </tr>
  1123. </table>
  1124. </fieldset></td>
  1125. </tr>
  1126. <tr>
  1127. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="10"></td>
  1128. </tr>
  1129. <tr>
  1130. <td colspan="4" class="blueNoteArea">
  1131. <?php if (empty($PO['po'])) { ?>
  1132. <table border="0" align="center" cellpadding="0" cellspacing="0">
  1133. <tr>
  1134. <td style="color:#FFFFFF; font-weight:bold">Purchase Order Number:</td>
  1135. <td width="85" align="center"><input name="po" type="text" id="po" size="15"></td>
  1136. <td><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>
  1137. </tr>
  1138. </table>
  1139. <?php } else { ?>
  1140. <span class="editable">Purchase Order Number: <span id="poNumber"><?= $PO['po']; ?></span></span>
  1141. <script type="text/javascript">new Ajax.InPlaceEditor('poNumber', '../Common/detail_updates.php?a=po&id=$PO[id]', {highlightcolor:"#D8D8EB", highlightendcolor:"#014B94"});</script>
  1142. <?php } ?></td>
  1143. </tr>
  1144. </table></td>
  1145. </tr>
  1146. </table></td>
  1147. </tr>
  1148. <?php } ?>
  1149. </table></td>
  1150. </tr>
  1151. <tr>
  1152. <td height="5" valign="bottom"><img src="../images/spacer.gif" width="5" height="5"></td>
  1153. </tr>
  1154. <tr>
  1155. <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  1156. <tr>
  1157. <td width="50%"><?php if ($_SESSION['eid'] == $PO['req'] AND $PO['status'] != 'X' AND empty($_GET['approval'])) { ?>
  1158. <table border="0" cellspacing="0" cellpadding="0">
  1159. <tr>
  1160. <td width="20" valign="middle"><input name="cancel" type="checkbox" id="cancel" value="yes"></td>
  1161. <td><input name="cancelrequest" type="image" src="../images/button.php?i=w130.png&l=Cancel Request" alt="Cancel Request" border="0"></td>
  1162. <!--<td>&nbsp;</td>
  1163. <td><input name="copyrequest" type="image" src="../images/button.php?i=w130.png&l=Copy Request" alt="Copy Request" border="0"></td>-->
  1164. </tr>
  1165. </table>
  1166. <?php } ?>
  1167. <?php if ($_SESSION['eid'] == $PO['req'] AND $PO['status'] == 'X') { ?>
  1168. <table border="0" cellspacing="0" cellpadding="0">
  1169. <tr>
  1170. <td width="20" valign="middle"><input name="restore" type="checkbox" id="restore" value="yes"></td>
  1171. <td><input name="restorerequest" type="image" src="../images/button.php?i=w130.png&l=Restore Request" alt="Restore Request"></td>
  1172. </tr>
  1173. </table>
  1174. <?php } ?>&nbsp;</td>
  1175. <td width="50%" align="right">
  1176. <input name="id" type="hidden" id="id" value="<?= $PO['id']; ?>">
  1177. <input name="req" type="hidden" id="req" value="<?= $PO['req']; ?>">
  1178. <input name="purpose" type="hidden" id="purpose" value="<?= $PO['purpose']; ?>">
  1179. <input name="auth_id" type="hidden" id="auth_id" value="<?= $AUTH['id']; ?>">
  1180. <?php
  1181. if (($_SESSION['eid'] == $AUTH[$_GET['approval']] OR
  1182. $_SESSION['eid'] == $PO['req'] OR
  1183. $_SESSION['eid'] == $AUTH['issuer'])) { ?>
  1184. <?php
  1185. if (isset($_GET['approval'])) {
  1186. /* Set auth level to GET[approval] */
  1187. $auth_value = $_GET['approval'];
  1188. } elseif ($_SESSION['eid'] == $PO['req']) {
  1189. /* Allow update if GET[approval] was sent and Requester is viewing */
  1190. $auth_value = "req";
  1191. } elseif ($_SESSION['eid'] == $AUTH['issuer']) {
  1192. /* Allow update if GET[approval] was sent and Requester is viewing */
  1193. $auth_value = "issuer";
  1194. }
  1195. /* Set type of update before or after PO was issued */
  1196. $update_stage = (empty($PO[po])) ? "update" : "post_update";
  1197. ?>
  1198. <input name="auth" type="hidden" id="auth" value="<?= $auth_value; ?>">
  1199. <input name="type_id" type="hidden" id="type_id" value="<?= $_GET['id']; ?>">
  1200. <input name="stage" type="hidden" id="stage" value="<?= $update_stage ?>">
  1201. <!--<input name="imageField" type="image" src="../images/button.php?i=b150.png&l=Update Request" alt="Update Request">-->
  1202. <?php } ?></td>
  1203. </tr>
  1204. </table></td>
  1205. </tr>
  1206. </table>
  1207. </form>
  1208. <br>
  1209. </td></tr>
  1210. </tbody>
  1211. </table></td>
  1212. </tr>
  1213. </tbody>
  1214. </table>
  1215. <!-- InstanceEndEditable --><br>
  1216. <br>
  1217. <table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  1218. <tbody>
  1219. <tr>
  1220. <td>&nbsp;</td>
  1221. </tr>
  1222. <tr>
  1223. <td>&nbsp;</td>
  1224. </tr>
  1225. <tr>
  1226. <td width="100%" height="20" class="BGAccentDark">
  1227. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  1228. <tr>
  1229. <td width="50%"><span class="Copyright"><!-- InstanceBeginEditable name="copyright" --><?php include('../include/copyright.php'); ?><!-- InstanceEndEditable --></span></td>
  1230. <td width="50%"><div id="noPrint" align="right"><!-- InstanceBeginEditable name="version" --><?php include('../include/version.php'); ?><!-- InstanceEndEditable --></div></td>
  1231. </tr>
  1232. </table></td>
  1233. </tr>
  1234. <tr>
  1235. <td>
  1236. <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>
  1237. <div class="TrainVisited" id="noPrint"><?= onlineCount(); ?></div>
  1238. </td>
  1239. </tr>
  1240. </tbody>
  1241. </table>
  1242. <br>
  1243. </body>
  1244. <script>var request_id='<?= $_GET['id']; ?>';</script>
  1245. <script type="text/javascript" src="/Common/js/scriptaculous/prototype-min.js"></script>
  1246. <script type="text/javascript" src="/Common/js/scriptaculous/scriptaculous.js?load=builder,effects"></script>
  1247. <script type="text/javascript" src="/Common/js/ps/tooltips.js"></script>
  1248. <!-- InstanceBeginEditable name="js" --><!-- InstanceEndEditable -->
  1249. <!-- InstanceEnd --></html>
  1250. <?php
  1251. /**
  1252. * - Display Debug Information
  1253. */
  1254. include_once('debug/footer.php');
  1255. /**
  1256. * - Disconnect from database
  1257. */
  1258. $dbh->disconnect();
  1259. ?>