PageRenderTime 55ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/PO/detail_preview.php

https://github.com/tlezotte/ePOS
PHP | 817 lines | 728 code | 26 blank | 63 comment | 68 complexity | 4bcf46c475b4f027b98f906a408db02f MD5 | raw file

Large files files are truncated, but you can click here to view the full 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. /* ------------------ START DATABASE CONNECTIONS ----------------------- */
  46. /* Getting PO information */
  47. $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
  48. FROM PO
  49. WHERE id = ?",array($_GET['id']));
  50. /* Getting Authoriztions for above PO */
  51. $AUTH = $dbh->getRow("SELECT * FROM Authorization WHERE type_id = ? and type = 'PO'",array($PO['id']));
  52. /* Get Employee names from Standards database */
  53. $EMPLOYEES = $dbh->getAssoc("SELECT eid, CONCAT(fst,' ',lst) AS name
  54. FROM Standards.Employees");
  55. /* Getting Vendor information from Standards */
  56. $VENDOR = $dbh->getAssoc("SELECT BTVEND, BTNAME FROM Standards.Vendor");
  57. /* Getting Company information from Standards */
  58. //$COMPANY = $dbh->getAssoc("SELECT id, name FROM Standards.Companies");
  59. /* Getting Department information from Standards */
  60. $DEPARTMENT = $dbh->getAssoc("SELECT id, name FROM Standards.Department");
  61. /* Getting Category information from Standards */
  62. //$COA = $dbh->getAssoc("SELECT coa_id AS id, coa_description AS name FROM Standards.COA WHERE coa_plant='" . $PO['plant'] . "'");
  63. /* Getting CER numbers from CER */
  64. $CER = $dbh->getAssoc("SELECT id, cer FROM CER WHERE cer IS NOT NULL ORDER BY cer");
  65. /* Getting Category information from Standards */
  66. $CAT = $dbh->getAssoc("SELECT id, name FROM Standards.Category WHERE status = '0'");
  67. /* Getting Plant information from Standards */
  68. $PLANT = $dbh->getAssoc("SELECT id, name FROM Standards.Plants WHERE status = '0'");
  69. /* Getting Vendor terms from Standards */
  70. $terms_sql = "SELECT terms_id AS id, terms_name AS name FROM Standards.VendorTerms ORDER BY name";
  71. $TERMS = $dbh->getAssoc($terms_sql);
  72. $terms_query = $dbh->prepare($terms_sql);
  73. /* Get items related to this Request */
  74. $items_sql = $dbh->query("SELECT * FROM Items WHERE type_id = ".$PO['id']."");
  75. /* Get Purchase Request users */
  76. $purchaser_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
  77. FROM Users U
  78. INNER JOIN Standards.Employees E ON U.eid = E.eid
  79. WHERE U.group = 'purchasing'
  80. AND E.status = '0'
  81. AND U.eid <> '08745'
  82. ORDER BY E.lst ASC");
  83. /* Get Vendor Payments */
  84. $payments = $dbh->query("SELECT * FROM Payments WHERE request_id=" . $PO['id'] . " AND pay_status='0' ORDER BY pay_date ASC");
  85. $payments_count = $payments->numRows();
  86. /* Get Contact Information */
  87. $contacts = $dbh->query("SELECT * FROM Contacts WHERE request_id=" . $PO['id'] . " ORDER BY id DESC");
  88. $contacts_count = $contacts->numRows();
  89. /* Getting Comments Information */
  90. $post_sql = "SELECT * FROM Postings
  91. WHERE request_id = ".$_GET['id']."
  92. AND type = 'global'
  93. ORDER BY posted DESC";
  94. $LAST_POST = $dbh->getRow($post_sql); // Get the last posted comment
  95. $post_query = $dbh->prepare($post_sql);
  96. $post_sth = $dbh->execute($post_query);
  97. $post_count = $post_sth->numRows();
  98. /* ------------------ END DATABASE CONNECTIONS ----------------------- */
  99. $highlight='class="highlight"'; // Highlighted style sheet class
  100. /* Setup onLoad javascript program */
  101. if ($default['pageloading'] == 'on') {
  102. $ONLOAD_OPTIONS="pageloading();";
  103. }
  104. //$ONLOAD_OPTIONS.="prepareForm();";
  105. if (isset($ONLOAD_OPTIONS)) { $ONLOAD="onLoad=\"$ONLOAD_OPTIONS\""; }
  106. ?>
  107. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  108. <html>
  109. <head>
  110. <title><?= $default['title1']; ?>
  111. </title>
  112. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  113. <meta http-equiv="imagetoolbar" content="no">
  114. <meta name="copyright" content="2004 Your Company" />
  115. <meta name="author" content="Thomas LeZotte" />
  116. <link type="text/css" href="/Common/noPrint.css" rel="stylesheet">
  117. <link type="text/css" href="/Common/Print.css" rel="stylesheet" media="print">
  118. <link type="text/css" href="/Common/newCompany.css" rel="stylesheet" media="screen">
  119. <link type="text/css" href="../epos.css" charset="UTF-8" rel="stylesheet">
  120. <script type="text/javascript" src="/Common/js/overlibmws.js"></script>
  121. <script type="text/javascript" src="/Common/js/overlibmws/overlibmws_iframe.js"></script>
  122. <script type="text/javascript" src="/Common/js/pointers.js"></script>
  123. <script type="text/javascript" src="/Common/js/prototype/prototype.js"></script>
  124. <script type="text/javascript" src="/Common/js/scriptaculous/scriptaculous.js?load=effects"></script>
  125. <script language="javascript">
  126. AJS.AEV(window, "load", function() {
  127. new Effect.Pulsate('hotMessage', {delay:2, duration:5});
  128. new Effect.Shake('messageCenter', {delay:8});
  129. });
  130. </script>
  131. </head>
  132. <body <?= $ONLOAD; ?>>
  133. <table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
  134. <tbody>
  135. <tr>
  136. <td><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>
  137. <div id="messageCenter" align="center" style="width: 700px;display:<?= ($PO['message'] == 'yes') ? display : none; ?>">
  138. <?= $message; ?>
  139. </div>
  140. <br>
  141. <form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" name="Form" id="Form" runat="vdaemon">
  142. <table border="0" align="center" cellpadding="0" cellspacing="0">
  143. <tr>
  144. <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  145. <tr class="BGAccentVeryDark">
  146. <td width="50%" height="30" nowrap class="DarkHeaderSubSub">&nbsp;&nbsp;Purchase Order Requisition...</td>
  147. <td width="50%"></td>
  148. </tr>
  149. </table></td>
  150. </tr>
  151. <tr>
  152. <td class="BGAccentVeryDarkBorder"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  153. <tr>
  154. <td valign="top" class="BGAccentDarkBorder"><table width="100%" border="0">
  155. <tr>
  156. <td height="25" colspan="4" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  157. <tr>
  158. <td><img src="../images/info.png" width="16" height="16" align="texttop"><strong>&nbsp;Information</strong></td>
  159. <td><div align="right" class="mainsection">Status:
  160. <?= reqStatus($PO['status']); ?>
  161. <input type="hidden" name="status" value="<?= $PO['status']; ?>">
  162. &nbsp;&nbsp;</div></td>
  163. </tr>
  164. </table></td>
  165. </tr>
  166. <tr>
  167. <td nowrap>Requisition Number:</td>
  168. <td class="label"><?= $_GET['id']; ?></td>
  169. <td nowrap>&nbsp;</td>
  170. <td>&nbsp;</td>
  171. </tr>
  172. <tr>
  173. <td width="12%" nowrap>Purchase Order Number:</td>
  174. <td width="45%" class="label"><?= $PO['po']; ?></td>
  175. <td width="13%" nowrap>CER Number:</td>
  176. <td width="26%"><span class="label">
  177. <?= $CER[$PO['cer']]; ?>
  178. </span></td>
  179. </tr>
  180. <tr>
  181. <td>Requisitioner:</td>
  182. <td class="label"><?= caps($EMPLOYEES[$PO['req']]); ?></td>
  183. <td nowrap>Requisition Date:</td>
  184. <td class="label"><?= $PO['_reqDate']; ?></td>
  185. </tr>
  186. <?php if (!empty($PO['incareof']) AND $PO['req'] != $PO['incareof']) { ?>
  187. <tr>
  188. <td><img src="/Common/images/menupointer2.gif" width="4" height="7" align="absmiddle"> In Care Of:</td>
  189. <td class="label"><?= caps($EMPLOYEES[$PO['incareof']]); ?></td>
  190. <td>&nbsp;</td>
  191. <td>&nbsp;</td>
  192. </tr>
  193. <?php } ?>
  194. <tr>
  195. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
  196. </tr>
  197. <?php if (!is_null($PO['sup2'])) { ?>
  198. <tr>
  199. <td nowrap>Final Vendor: </td>
  200. <td class="label"><?= caps($VENDOR[$PO[sup2]]); ?></td>
  201. <td>Kickoff Date:</td>
  202. <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>
  203. </tr>
  204. <?php } ?>
  205. <tr>
  206. <td nowrap><?= (is_null($PO['sup2']) AND empty($PO['po'])) ? Recommended : Final; ?>
  207. Vendor:</td>
  208. <td class="label"><?= caps($VENDOR[$PO[sup]]); ?></td>
  209. <?php if (is_null($PO['sup2']) AND !empty($PO['po'])) { ?>
  210. <td>Kickoff Date:</td>
  211. <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>
  212. <?php } else { ?>
  213. <td>&nbsp;</td>
  214. <td>&nbsp;</td>
  215. <?php } ?>
  216. </tr>
  217. <!-- <tr>
  218. <td>Company:</td>
  219. <td class="label"><?= caps($COMPANY[$PO[company]]); ?></td>
  220. <td nowrap>&nbsp;</td>
  221. <td>&nbsp;</td>
  222. </tr>-->
  223. <tr>
  224. <td>Bill to Plant: </td>
  225. <td class="label"><?= caps($PLANT[$PO['plant']]); ?></td>
  226. <td>Deliver to Plant: </td>
  227. <td class="label"><?= caps($PLANT[$PO['ship']]); ?></td>
  228. </tr>
  229. <tr>
  230. <td>Department:</td>
  231. <td class="label"><?= '(' . $PO['department'] . ') ' . caps($DEPARTMENT[$PO['department']]); ?></td>
  232. <td>Job Number: </td>
  233. <td><span class="label">
  234. <?= $PO['job']; ?>
  235. </span></td>
  236. </tr>
  237. <tr>
  238. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
  239. </tr>
  240. <tr>
  241. <td valign="top" nowrap>Purpose / Usage:</td>
  242. <td colspan="3" class="label"><?= caps(stripslashes($PO['purpose'])); ?></td>
  243. </tr>
  244. </table></td>
  245. </tr>
  246. <!--
  247. <tr>
  248. <td>&nbsp;</td>
  249. </tr>
  250. <tr>
  251. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  252. <tr>
  253. <td width="100%" height="25" colspan="6" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  254. <tr>
  255. <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>
  256. <td width="120">&nbsp;</td>
  257. </tr>
  258. </table></td>
  259. </tr>
  260. <td>&nbsp;</td>
  261. </table>
  262. </td>
  263. </tr>
  264. -->
  265. <tr>
  266. <td>&nbsp;</td>
  267. </tr>
  268. <tr>
  269. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  270. <tr>
  271. <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  272. <tr>
  273. <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>
  274. <td width="160"><!--<a href="javascript:void(0);" class="viewcomments">View All Details </a>--></td>
  275. </tr>
  276. </table></td>
  277. </tr>
  278. <tr>
  279. <td><div id="items">
  280. <table width="100%" border="0">
  281. <tr>
  282. <td width="35" class="HeaderAccentDark">&nbsp;</td>
  283. <td width="35" class="HeaderAccentDark">Unit</td>
  284. <td width="80" nowrap class="HeaderAccentDark">Company#&nbsp;</td>
  285. <td width="60" nowrap class="HeaderAccentDark">Manuf#&nbsp;</td>
  286. <td class="HeaderAccentDark">Item Description</td>
  287. <td width="50" nowrap class="HeaderAccentDark">Price</td>
  288. </tr>
  289. <?php
  290. while($items_sql->fetchInto($ITEMS)) {
  291. $count_items++;
  292. $row_color = ($count_items % 2) ? FFFFFF : DFDFBF;
  293. ?>
  294. <!-- Start of Item<?= $count_items; ?> -->
  295. <tr <?php pointer($row_color); ?>>
  296. <td class="label" bgcolor="#<?= $row_color; ?>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  297. <tr>
  298. <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">
  299. <input name="item<?= $count_items; ?>" type="hidden" id="item<?= $count_items; ?>" value="<?= $ITEMS['id']; ?>">
  300. </a></td>
  301. <td><strong>
  302. <?= $ITEMS['qty']; ?>
  303. </strong></td>
  304. </tr>
  305. </table></td>
  306. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper($ITEMS['unit']); ?></td>
  307. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['part'])); ?></td>
  308. <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['manuf'])); ?></td>
  309. <td nowrap bgcolor="#<?= $row_color; ?>" class="label"><?php
  310. if (strlen($ITEMS['descr']) > 50) {
  311. echo caps(substr(htmlspecialchars(stripslashes($ITEMS['descr'])), 0, 50));
  312. 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>";
  313. } else {
  314. echo caps(stripslashes($ITEMS['descr']));
  315. }
  316. ?></td>
  317. <td class="label" bgcolor="#<?= $row_color; ?>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  318. <tr>
  319. <td><strong>$</strong></td>
  320. <td align="right"><strong>
  321. <?= number_format($ITEMS['price'],2); ?>
  322. </strong></td>
  323. </tr>
  324. </table></td>
  325. </tr>
  326. <tr <?php pointer($row_color); ?> id="itemDetails<?= $count_items; ?>" style="display:none">
  327. <td colspan="6" bgcolor="#<?= $row_color; ?>" class="label"><table width="100%" border="0">
  328. <!--
  329. <tr>
  330. <td width="200">Supplier Delevery Date: </td>
  331. <td>&nbsp;</td>
  332. <td width="200">&nbsp;</td>
  333. <td>&nbsp;</td>
  334. </tr>
  335. <tr>
  336. <td>&nbsp;</td>
  337. <td>&nbsp;</td>
  338. <td>&nbsp;</td>
  339. <td>&nbsp;</td>
  340. </tr>
  341. -->
  342. <tr>
  343. <td width="200">Category Name: </td>
  344. <td class="label"><?= caps($CAT[$ITEMS['cat']]); ?></td>
  345. <td width="200">Category Number: </td>
  346. <td class="label"><?= $ITEMS['cat']; ?></td>
  347. </tr>
  348. <tr>
  349. <td>Company Tool Number: </td>
  350. <td class="label"><?= $ITEMS['vt']; ?></td>
  351. <td>&nbsp;</td>
  352. <td>&nbsp;</td>
  353. </tr>
  354. </table></td>
  355. </tr>
  356. <!-- End of Item<?= $count_items; ?> -->
  357. <?php } ?>
  358. <tr>
  359. <td colspan="5" align="right" class="xpHeaderBottomActive">Total: </td>
  360. <td class="xpHeaderBottomActive"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  361. <tr>
  362. <td style="font-weight:bold">$</td>
  363. <td style="font-weight:bold" align="right"><?= number_format($PO['total'],2); ?></td>
  364. </tr>
  365. </table></td>
  366. </tr>
  367. </table>
  368. </div></td>
  369. </tr>
  370. </table></td>
  371. </tr>
  372. <tr>
  373. <td>&nbsp;</td>
  374. </tr>
  375. <tr>
  376. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  377. <tr>
  378. <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  379. <tr>
  380. <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>
  381. <td width="160"><!--<a href="../Uploads/index.php?request_id=<?= $_GET['id']; ?>&type_id=PO#upload" target="attachments" class="viewcomments">Upload File</a>--></td>
  382. </tr>
  383. </table></td>
  384. </tr>
  385. <tr>
  386. <td><div id="attachments">
  387. <!--<iframe id="attachments" name="attachments" frameborder="0" width="100%" height="150" src="../Uploads/index.php?request_id=<?= $_GET['id']; ?>&type_id=PO"></iframe>-->
  388. <table width="100%" border="0">
  389. <tr>
  390. <td width="12%">Quote:</td>
  391. <td nowrap><?= $Attachment; ?></td>
  392. <?php if ($_SESSION['eid'] == $PO['req'] AND $_SESSION['eid'] != $AUTH['issuer']) { ?>
  393. <?php } ?>
  394. </tr>
  395. <tr>
  396. <td nowrap>File Cabinet:</td>
  397. <td nowrap><?= $Attachment2; ?></td>
  398. <?php if ($_SESSION['eid'] == $PO['req']) { ?>
  399. <?php } ?>
  400. </tr>
  401. </table>
  402. </div></td>
  403. </tr>
  404. </table></td>
  405. </tr>
  406. <tr>
  407. <td>&nbsp;</td>
  408. </tr>
  409. <tr>
  410. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  411. <tr>
  412. <td width="100%" height="25" colspan="6" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  413. <tr>
  414. <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>
  415. <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>
  416. </tr>
  417. </table></td>
  418. </tr>
  419. <td><?php if ($post_count > 0) { ?>
  420. <div id="commentsHeader" onClick="switchComments();">There are currently <strong>
  421. <?= $post_count; ?>
  422. </strong> comments. The last comment was posted on <strong>
  423. <?= date('F d, Y \a\t H:i A', strtotime($LAST_POST['posted'])); ?>
  424. </strong>.<br>
  425. <br>
  426. <div class="clickToView">Click to view all Comments.</div>
  427. </div>
  428. <?php } else { ?>
  429. <div id="commentsHeader">There are currently <strong>NO</strong> comments.</div>
  430. <?php } ?>
  431. <div width="95%" border="0" align="center" id="comments_area" style="display:none" onClick="switchComments();"> <br>
  432. <?php
  433. $count=0;
  434. while($post_sth->fetchInto($POST)) {
  435. $count++;
  436. ?>
  437. <div class="comment">
  438. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  439. <tr>
  440. <td width="55" rowspan="3" valign="top" class="comment_datenum"><div class="comment_month">
  441. <?= date("M", strtotime($POST['posted'])); ?>
  442. </div>
  443. <div class="comment_day">
  444. <?= date("d", strtotime($POST['posted'])); ?>
  445. </div>
  446. <div class="comment_year">
  447. <?= date("y", strtotime($POST['posted'])); ?>
  448. </div></td>
  449. <td class="comment_wrote"><?= ucwords(strtolower($EMPLOYEES[$POST[eid]])); ?>
  450. wrote... </td>
  451. </tr>
  452. <tr>
  453. <td class="commentbody"><?= $POST['comment']; ?></td>
  454. </tr>
  455. <tr>
  456. <td class="comment_date"><?= date("h:i A", strtotime($POST['posted'])); ?></td>
  457. </tr>
  458. </table>
  459. </div>
  460. <br>
  461. <?php } ?>
  462. </div></td>
  463. </table></td>
  464. </tr>
  465. <tr>
  466. <td>&nbsp;</td>
  467. </tr>
  468. <tr>
  469. <td class="BGAccentDarkBorder"><table width="100%" border="0">
  470. <tr>
  471. <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>
  472. </tr>
  473. <!-- START REQUESTER -->
  474. <tr>
  475. <td height="25" colspan="6"><table border="0">
  476. <tr class="BGAccentDark">
  477. <td height="25" nowrap>&nbsp;</td>
  478. <td width="30" nowrap>&nbsp;</td>
  479. <td nowrap class="HeaderAccentDark">&nbsp;</td>
  480. <td nowrap class="HeaderAccentDark">Date</td>
  481. <td width="20" align="center" nowrap class="HeaderAccentDark"><img src="/Common/images/clock.gif" width="16" height="16"></td>
  482. <td width="400" nowrap class="HeaderAccentDark">Comments</td>
  483. </tr>
  484. <tr>
  485. <td nowrap>Requester:</td>
  486. <td align="center" nowrap><?= showCommentIcon($PO['req'], ucwords(strtolower($EMPLOYEES[$PO['req']])), $PO['id']); ?></td>
  487. <td nowrap class="label"><?= ucwords(strtolower($EMPLOYEES[$PO['req']])); ?></td>
  488. <td nowrap class="label"><?= $PO['_reqDate']; ?></td>
  489. <td nowrap class="TrainActive">-</td>
  490. <td nowrap>&nbsp;</td>
  491. </tr>
  492. <!-- END REQUESTER -->
  493. <!-- START APPROVER 1 -->
  494. <tr <?= ($_GET['approval'] == 'app1') ? $highlight : $blank; ?>>
  495. <td nowrap><?= $language['label']['app1']; ?>:</td>
  496. <td align="center" nowrap><?php
  497. if (is_null($AUTH['app1Date'])) {
  498. echo showMailIcon('app1', $AUTH['app1'], ucwords(strtolower($EMPLOYEES[$AUTH['app1']])), $PO['id']);
  499. } else {
  500. echo showCommentIcon($AUTH['app1'], ucwords(strtolower($EMPLOYEES[$AUTH['app1']])), $PO['id']);
  501. }
  502. ?></td>
  503. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  504. <td nowrap class="label"><?php if (isset($AUTH['app1Date'])) { echo date("F d, Y", strtotime($AUTH['app1Date'])); } ?></td>
  505. <td nowrap class="TrainActive"><?php if (isset($AUTH['app1Date'])) { echo abs(ceil((strtotime($REQUEST['reqDate']) - strtotime($AUTH['app1Date'])) / (60 * 60 * 24))); } ?></td>
  506. <td nowrap class="label"><?= displayAppComment('app1', $_GET['approval'], $AUTH['app1'], $AUTH['app1Com'], $AUTH['app1Date']); ?></td>
  507. </tr>
  508. <!-- END APPROVER 1 -->
  509. <?php if (strlen($AUTH['app2']) == 5 OR $PO['status'] == 'N') { ?>
  510. <!-- START APPROVER 2 -->
  511. <tr <?= ($_GET['approval'] == 'app2') ? $highlight : $blank; ?>>
  512. <td nowrap><?= $language['label']['app2']; ?>:</td>
  513. <td align="center" nowrap><?php if (is_null($AUTH['app2Date']) AND !is_null($AUTH['app1Date']) AND $AUTH['app2'] != '0') {
  514. echo showMailIcon('app2', $AUTH['app2'], ucwords(strtolower($EMPLOYEES[$AUTH['app2']])), $PO['id']);
  515. } else if (!is_null($AUTH['app2Date'])) {
  516. echo showCommentIcon($AUTH['app2'], ucwords(strtolower($EMPLOYEES[$AUTH['app2']])), $PO['id']);
  517. }
  518. ?></td>
  519. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  520. <td nowrap class="label"><?php if (isset($AUTH['app2Date'])) { echo date("F d, Y", strtotime($AUTH['app2Date'])); } ?></td>
  521. <td nowrap class="TrainActive"><?php if (isset($AUTH['app2Date'])) { echo abs(ceil((strtotime($AUTH['app1Date']) - strtotime($AUTH['app2Date'])) / (60 * 60 * 24))); } ?></td>
  522. <td nowrap class="label"><?= displayAppComment('app2', $_GET['approval'], $AUTH['app2'], $AUTH['app2Com'], $AUTH['app2Date']); ?></td>
  523. </tr>
  524. <!-- END APPROVER 2 -->
  525. <?php } ?>
  526. <?php if (strlen($AUTH['app3']) == 5 OR $PO['status'] == 'N') { ?>
  527. <!-- END APPROVER 3 -->
  528. <tr <?= ($_GET['approval'] == 'app3') ? $highlight : $blank; ?>>
  529. <td nowrap><?= $language['label']['app3']; ?>:</td>
  530. <td align="center" nowrap><?php if (is_null($AUTH['app3Date']) AND !is_null($AUTH['app2Date']) AND $AUTH['app3'] != '0') {
  531. echo showMailIcon('app3', $AUTH['app3'], ucwords(strtolower($EMPLOYEES[$AUTH['app3']])), $PO['id']);
  532. } else if (!is_null($AUTH['app3Date'])) {
  533. echo showCommentIcon($AUTH['app3'], ucwords(strtolower($EMPLOYEES[$AUTH['app3']])), $PO['id']);
  534. }
  535. ?></td>
  536. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  537. <td nowrap class="label"><?php if (isset($AUTH['app3Date'])) { echo date("F d, Y", strtotime($AUTH['app3Date'])); } ?></td>
  538. <td nowrap class="TrainActive"><?php if (isset($AUTH['app3Date'])) { echo abs(ceil((strtotime($AUTH['app2Date']) - strtotime($AUTH['app3Date'])) / (60 * 60 * 24))); } ?></td>
  539. <td nowrap class="label"><?= displayAppComment('app3', $_GET['approval'], $AUTH['app3'], $AUTH['app3Com'], $AUTH['app3Date']); ?></td>
  540. </tr>
  541. <!-- END APPROVER 3 -->
  542. <?php } ?>
  543. <?php if (strlen($AUTH['app4']) == 5 OR $PO['status'] == 'N') { ?>
  544. <!-- START APPROVER 4 -->
  545. <tr <?= ($_GET['approval'] == 'app4') ? $highlight : $blank; ?>>
  546. <td nowrap><?= $language['label']['app4']; ?>:</td>
  547. <td align="center" nowrap><?php if (is_null($AUTH['app4Date']) AND !is_null($AUTH['app2Date']) AND $AUTH['app4'] != '0') {
  548. echo showMailIcon('app4', $AUTH['app4'], ucwords(strtolower($EMPLOYEES[$AUTH['app4']])), $PO['id']);
  549. } else if (!is_null($AUTH['app4Date'])) {
  550. echo showCommentIcon($AUTH['app4'], ucwords(strtolower($EMPLOYEES[$AUTH['app4']])), $PO['id']);
  551. }
  552. ?></td>
  553. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  554. <td nowrap class="label"><?php if (isset($AUTH['app4Date'])) { echo date("F d, Y", strtotime($AUTH['app4Date'])); } ?></td>
  555. <td nowrap class="TrainActive"><?php if (isset($AUTH['app4Date'])) { echo abs(ceil((strtotime($AUTH['app3Date']) - strtotime($AUTH['app4Date'])) / (60 * 60 * 24))); } ?></td>
  556. <td nowrap class="label"><?= displayAppComment('app4', $_GET['approval'], $AUTH['app4'], $AUTH['app4Com'], $AUTH['app4Date']); ?></td>
  557. </tr>
  558. <!-- END APPROVER 4 -->
  559. <?php } ?>
  560. <?php if (!is_null($PO['po'])) { ?>
  561. <!-- START PURCHASER -->
  562. <tr <?= ($_GET['approval'] == 'purchaser') ? $highlight : $blank; ?>>
  563. <td nowrap>Purchaser: </td>
  564. <td align="center" nowrap><?= showCommentIcon($AUTH['issuer'], ucwords(strtolower($EMPLOYEES[$AUTH['issuer']])), $PO['id']); ?></td>
  565. <td nowrap class="label"><?= ucwords(strtolower($EMPLOYEES[$AUTH['issuer']])); ?></td>
  566. <td nowrap class="label"><?= date("F j, Y", strtotime($AUTH['issuerDate'])); ?></td>
  567. <td nowrap class="TrainActive"><?php if (isset($AUTH['generatorDate'])) { echo abs(ceil((strtotime($AUTH['coordinatorDate']) - strtotime($AUTH['generatorDate'])) / (60 * 60 * 24))); } ?></td>
  568. <td nowrap>&nbsp;</td>
  569. </tr>
  570. <!-- END PURCHASER -->
  571. <?php } ?>
  572. <!-- START TOTAL -->
  573. <tr class="xpHeaderTotal">
  574. <td height="25" nowrap>Totals:</td>
  575. <td nowrap>&nbsp;</td>
  576. <td nowrap>&nbsp;</td>
  577. <td nowrap>&nbsp;</td>
  578. <td nowrap class="TrainActive"><?= abs(ceil((strtotime($REQUEST['reqDate']) - strtotime($AUTH['generatorDate'])) / (60 * 60 * 24))); ?></td>
  579. <td nowrap class="TipLabel">Days</td>
  580. </tr>
  581. <!-- END TOTAL -->
  582. </table></td>
  583. </tr>
  584. </table></td>
  585. </tr>
  586. <?php if ($_SESSION['request_role'] == 'purchasing') { ?>
  587. <tr>
  588. <td>&nbsp;</td>
  589. </tr>
  590. <tr>
  591. <td valign="top" class="BGAccentDarkBlueBorder"><table width="100%" border="0">
  592. <tr>
  593. <td height="25" class="BGAccentDarkBlue"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  594. <tr>
  595. <td style="color:#FFFFFF; font-weight:bold;"><img src="../images/team.gif" width="16" height="18" align="texttop"> Purchasing Department</td>
  596. <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">
  597. <?php if (!empty($PO['purchaserUpdate'])) { ?>
  598. Last Updated:
  599. <?= date('F d, Y', strtotime($PO['purchaserUpdate'])); ?>
  600. </a>
  601. <?php } ?></td>
  602. </tr>
  603. </table></td>
  604. </tr>
  605. <tr>
  606. <td><table width="100%" border="0" cellspacing="2" cellpadding="0">
  607. <?php if (is_null($PO['po'])) { ?>
  608. <tr>
  609. <td colspan="4" class="blankNoteArea">Purchaser scheduled to Complete Requisition: <?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  610. </tr>
  611. <?php } else { ?>
  612. <tr>
  613. <td width="100">Purchaser:</td>
  614. <td class="label"><?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  615. <td width="125">Supplier Kickoff:</td>
  616. <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>
  617. </tr>
  618. <?php } ?>
  619. <tr>
  620. <td height="5" colspan="4"><fieldset class="collapsible" id="purchasingInfoF">
  621. <legend><a href="javascript:switchFieldset('purchasingInfo', 'collapsible');" id="purchasingInfoA">Information</a></legend>
  622. <table width="100%" border="0" cellspacing="2" cellpadding="0" id="purchasingInfo">
  623. <tr>
  624. <td nowrap>Private Requisition:</td>
  625. <td><?= caps($PO['private']); ?></td>
  626. <td nowrap>HOT Requisition:</td>
  627. <td><?= caps($PO['hot']); ?></td>
  628. </tr>
  629. <tr>
  630. <td colspan="4">&nbsp;</td>
  631. </tr>
  632. <tr>
  633. <td width="194" nowrap>FOB:</td>
  634. <td width="150" class="label"><?= $PO['fob']; ?></td>
  635. <td width="142" nowrap>Requisition Type: </td>
  636. <td width="187" class="label"><select name="reqType" id="reqType">
  637. <option value="0">Select One</option>
  638. <option value="blanket">Blanket Order</option>
  639. <option value="capex">Capital Expense</option>
  640. <option value="mro">MRO</option>
  641. <option value="tooling">Tooling</option>
  642. </select></td>
  643. </tr>
  644. <tr>
  645. <td>Ship Via:</td>
  646. <td class="label"><?= $PO['via']; ?></td>
  647. <td width="142">Final Terms:</td>
  648. <td class="label"><?= $TERMS[$PO['terms']]; ?></td>
  649. </tr>
  650. <tr>
  651. <td colspan="4">&nbsp;</td>
  652. <tr>
  653. <td>&nbsp;</td>
  654. <td colspan="2" class="dHeader">Name</td>
  655. <td class="dHeader">Terms</td>
  656. </tr>
  657. <tr>
  658. <td>Recommended Vendor:</td>
  659. <td colspan="2" nowrap class="label"><?= caps($VENDOR[$PO['sup']]); ?></td>
  660. <td class="label"><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  661. </tr>
  662. <?php if (!is_null($PO['sup2'])) { ?>
  663. <tr>
  664. <td>Final Vendor:</td>
  665. <td colspan="2" nowrap class="label"><?= caps($VENDOR[$PO['sup2']]); ?></td>
  666. <td class="label"><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  667. </tr>
  668. <?php } ?>
  669. <tr>
  670. <td>&nbsp;</td>
  671. <td>&nbsp;</td>
  672. <td>&nbsp;</td>
  673. <td>&nbsp;</td>
  674. </tr>
  675. </table>
  676. </fieldset>
  677. <fieldset class="collapsed" id="vendorPaymentsF">
  678. <legend><a href="javascript:switchFieldset('vendorPayments', 'collapsed');" id="vendorPaymentsA">Vendor Payments (
  679. <?= $payments_count; ?>
  680. )</a></legend>
  681. <table border="0" align="center" cellpadding="0" cellspacing="5" id="vendorPayments" style="display:none">
  682. <tr>
  683. <td align="right" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  684. <tr>
  685. <td class="blueNoteAreaBorder"><?php if ($payments_count > 0) { ?>
  686. <table border="0">
  687. <tr class="blueNoteArea">
  688. <td class="label">&nbsp;</td>
  689. <td class="label">Amount</td>
  690. <td class="label">Date</td>
  691. <td class="label">Delete</td>
  692. </tr>
  693. <?php
  694. $count=0;
  695. $total=$PO['total'];
  696. while ($payments->fetchInto($PAYMENTS)) {
  697. $count++;
  698. $total -= $PAYMENTS['pay_amount'];
  699. ?>
  700. <tr>
  701. <td class="label"><?= $count; ?>
  702. <input type="hidden" name="pay_id<?= $count; ?>" id="pay_id<?= $count; ?>" value="<?= $PAYMENTS['pay_id']; ?>"></td>
  703. <td class="label">$
  704. <input name="pay_amount<?= $count; ?>" type="text" class="BGAccentDarkBlueBorder" id="pay_amount<?= $count; ?>" value="<?= $PAYMENTS['pay_amount']; ?>" size="15"></td>
  705. <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>
  706. <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>
  707. <td align="center" class="label"><input type="checkbox" name="pay_remove<?= $count; ?>" id="pay_remove<?= $count; ?>" value="yes"></td>
  708. </tr>
  709. <?php } ?>
  710. </table>
  711. <input name="payments_count" id="payments_count" type="hidden" value="<?= $payments_count; ?>">
  712. <?php } ?> </td>
  713. </tr>
  714. </table></td>
  715. </tr>
  716. <tr>
  717. <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  718. <tr>
  719. <td class="label">Outstanding: $
  720. <?= number_format($total,2); ?></td>
  721. <td align="right">&nbsp;</td>
  722. </tr>
  723. </table></td>
  724. </tr>

Large files files are truncated, but you can click here to view the full file