PageRenderTime 67ms CodeModel.GetById 19ms RepoModel.GetById 1ms 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

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. /**
  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;<

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