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

/PO/detail_yui2.php

https://github.com/tlezotte/ePOS
PHP | 1308 lines | 1069 code | 81 blank | 158 comment | 153 complexity | 99efd069406de8e9f8312e4f65947246 MD5 | raw file
  1. <?php
  2. /**
  3. * Request System
  4. *
  5. * detail.php displays detailed information on PO.
  6. *
  7. * @version 1.5
  8. * @link http://www.yourdomain.com/go/Request/
  9. * @author Thomas LeZotte (tom@lezotte.net)
  10. *
  11. * @package PO
  12. * @filesource
  13. *
  14. * PHP Debug
  15. * @link http://phpdebug.sourceforge.net/
  16. * PDF Toolkit
  17. * @link http://www.accesspdf.com/
  18. */
  19. /**
  20. * - Forward BlackBerry users to BlackBerry version
  21. */
  22. require_once('../include/BlackBerry.php');
  23. /**
  24. * - Start Page Loading Timer
  25. */
  26. include_once('../include/Timer.php');
  27. $starttime = StartLoadTimer();
  28. /**
  29. * - Set debug mode
  30. */
  31. $debug_page = false;
  32. include_once('debug/header.php');
  33. $Dbg->DatabaseName = "Request";
  34. /**
  35. * - Database Connection
  36. */
  37. require_once('../Connections/connDB.php');
  38. /**
  39. * - Config Information
  40. */
  41. require_once('../include/config2.php');
  42. /**
  43. * - Check User Access
  44. */
  45. require_once('../security/check_user.php');
  46. /**
  47. * - Form Validation
  48. */
  49. //include('vdaemon/vdaemon.php');
  50. /* -------------------------------------------------------------
  51. * ------------- START FINANCE PROCESSING -------------------
  52. * -------------------------------------------------------------
  53. */
  54. if ($_POST['action'] == 'finance_update') {
  55. $changePlant = false;
  56. $changeDepartment = false;
  57. /* ----- Controller changes Plant ----- */
  58. if ($_POST['currentPlant'] != $_POST['plant']) {
  59. $plant_sql = "UPDATE PO SET plant='" . $_POST['plant'] . "' WHERE id=" . $_POST['type_id']; // Update Bill to Plant
  60. $dbh->query($plant_sql);
  61. // Record transaction for history
  62. debug_capture($_SESSION['eid'], $_POST['id'], $default['debug_capture'], $_SERVER['PHP_SELF'], addslashes(htmlentities($plant_sql)));
  63. $changePlant = true;
  64. }
  65. /* ----- Controller changes Department ----- */
  66. if ($_POST['currentDepartment'] != $_POST['department']) {
  67. $dept_sql = "UPDATE PO SET department='" . $_POST['department'] . "' WHERE id=" . $_POST['type_id']; // Update Department
  68. $dbh->query($dept_sql);
  69. // Record transaction for history
  70. debug_capture($_SESSION['eid'], $_POST['id'], $default['debug_capture'], $_SERVER['PHP_SELF'], addslashes(htmlentities($dept_sql)));
  71. $changeDepartment = false; // Turned off because we are not checking for departments now (HQ)
  72. }
  73. /* ----- Forward to new Controller ----- */
  74. if ($changePlant OR $changeDepartment) {
  75. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=controller&plant=" . $_POST['plant'] . "&department=" . $_POST['department']; // Check Controler
  76. header("Location: ".$forward);
  77. exit();
  78. }
  79. /* ----- Cycle through items ----- */
  80. for ($x=1; $x <= $_POST['items_count']; $x++) {
  81. $item = "item" . $x; // Item ID
  82. $item_COA = $item . "_newCOA"; // COA value
  83. $item_COAid = $item_COA . "id"; // COA value ID
  84. if (strlen($_POST[$item_COAid]) > 0) {
  85. $item_sql = "UPDATE Items SET cat='" . $_POST[$item_COAid] . "' WHERE id=" . $_POST[$item];
  86. $dbh->query($item_sql);
  87. // Record transaction for history
  88. debug_capture($_SESSION['eid'], $_POST['id'], $default['debug_capture'], $_SERVER['PHP_SELF'], addslashes(htmlentities($item_sql)));
  89. }
  90. }
  91. /* ----- Update CER numbers and Credit Card ----- */
  92. $po_sql = "UPDATE PO SET cer='" . $_POST['cer'] . "',
  93. creditcard='" . $_POST['creditcard'] . "'
  94. WHERE id=" . $_POST['type_id'];
  95. $dbh->query($po_sql);
  96. // Record transaction for history
  97. debug_capture($_SESSION['eid'], $_POST['id'], $default['debug_capture'], $_SERVER['PHP_SELF'], addslashes(htmlentities($po_sql)));
  98. }
  99. /* -------------------------------------------------------------
  100. * ------------- END FINANCE PROCESSING -------------------
  101. * -------------------------------------------------------------
  102. */
  103. /* -------------------------------------------------------------
  104. * ---------- START DENIAL PROCESSING --------------------------
  105. * -------------------------------------------------------------
  106. */
  107. if (substr($_POST['auth'],0,3) == 'app' OR $_POST['auth'] == 'controller') {
  108. if (array_key_exists('yes_x', $_POST)) { $yn = "yes"; } // Set approval button pressed
  109. if (array_key_exists('no_x', $_POST)) { $yn = "no"; } // Set approval button pressed
  110. /* ---------------- Check to see if a Comment was provided ---------------- */
  111. if (empty($_POST['Com']) AND $yn == 'no') {
  112. $_SESSION['error'] = "A denied Requisition requires you to enter a Comment.";
  113. $_SESSION['redirect'] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  114. header("location: ../error.php");
  115. exit();
  116. }
  117. /* ---------------- Change status for non approved request ---------------- */
  118. if ($yn == 'no') {
  119. setRequestStatus($_POST['type_id'], 'X'); // Update PO status
  120. }
  121. /* ---------------- Update the approvals for the PO ---------------- */
  122. $auth_sql = "UPDATE Authorization
  123. SET ".$_POST['auth']."yn='" . $yn . "',
  124. ".$_POST['auth']."Date=NOW(),
  125. ".$_POST['auth']."Com='" . htmlentities($_POST['Com'], ENT_QUOTES, 'UTF-8') . "'
  126. WHERE id = ".$_POST['auth_id'];
  127. $dbh->query($auth_sql);
  128. // Record transaction for history
  129. debug_capture($_SESSION['eid'], $_POST['id'], $default['debug_capture'], $_SERVER['PHP_SELF'], addslashes(htmlentities($auth_sql)));
  130. if ($_POST['auth'] == 'controller') {
  131. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=app0"; // Forward to Approver 1
  132. } else {
  133. $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=" . $_POST['auth'] . "&yn=" . $yn; // Record Controllers Approval
  134. }
  135. header("Location: ".$forward);
  136. exit();
  137. }
  138. /* -------------------------------------------------------------
  139. * ---------- END DENIAL PROCESSING ----------------------------
  140. * -------------------------------------------------------------
  141. */
  142. /* -------------------------------------------------------------
  143. * ------------- START UPDATE PROCESSING -----------------------
  144. * -------------------------------------------------------------
  145. */
  146. if ($_POST['stage'] == "update") {
  147. /* -------------------------------------------------------------
  148. * ---------- START REQUESTER PROCESSING -----------------------
  149. * -------------------------------------------------------------
  150. */
  151. if ($_POST['auth'] == "req") {
  152. /* ---------------- START CANCEL PURCHASE ORDER -------------- */
  153. if ($_POST['cancel'] == 'yes') {
  154. setRequestStatus($_POST['type_id'], 'C'); // Update PO status
  155. header("location: list.php?action=my&access=0");
  156. exit();
  157. }
  158. /* ---------------- END CANCEL PURCHASE ORDER -------------- */
  159. /* ------------- Adding tracking information ------------- */
  160. if (array_key_exists('addTracking_x',$_POST)) {
  161. $tracking=new Tracking();
  162. $tracking->add();
  163. }
  164. /* ------------- Update tracking information ------------- */
  165. if (array_key_exists('updateTracking_x',$_POST)) {
  166. $tracking=new Tracking();
  167. $tracking->update();
  168. }
  169. /* ---------------- START RESEND PURCHASE ORDER ---------------- */
  170. if (array_key_exists('restorerequest_x',$_POST)) {
  171. setRequestStatus($_POST['type_id'], 'N'); // Update PO status
  172. header("location: router.php?type_id=" . $_POST['type_id'] . "&approval=app0"); // Forward to router as new Request
  173. exit();
  174. }
  175. /* --------- END RESEND PURCHASE ORDER ----------------------- */
  176. }
  177. /* -------------------------------------------------------------
  178. * ---------- END REQUESTER PROCESSING -----------------------
  179. * -------------------------------------------------------------
  180. */
  181. }
  182. /* -------------------------------------------------------------
  183. * ------------- END UPDATE PROCESSING -----------------------
  184. * -------------------------------------------------------------
  185. */
  186. /* -------------------------------------------------------------
  187. * ------------- START PURCHASING PROCESSING -------------------
  188. * -------------------------------------------------------------
  189. */
  190. if ($_POST['action'] == 'purchasing_update') {
  191. /* ------------- Adding supplier contact information ------------- */
  192. if (array_key_exists('sendPO_x',$_POST)) {
  193. print_r($_POST);
  194. exit();
  195. }
  196. /* ------------- Adding supplier contact information ------------- */
  197. if (array_key_exists('addContact_x',$_POST)) {
  198. $purchasing=new Purchasing();
  199. $purchasing->addContact();
  200. }
  201. /* ================== PAYMENTS =========================== */
  202. /* ------------- Adding payment information ------------- */
  203. if (array_key_exists('addPayment_x',$_POST)) {
  204. $payment=new Payment();
  205. $payment->add();
  206. $sql="select";
  207. $mysql=new Mysql();
  208. $mysql->capture($sql);
  209. }
  210. /* ------------- Update payment information ------------- */
  211. if (array_key_exists('updatePayments_x',$_POST)) {
  212. $payment=new Payment();
  213. $payment->update();
  214. }
  215. /* ================== PAYMENTS =========================== */
  216. /* ------------- Purchaser marks Request as Complete ------------- */
  217. if (array_key_exists('completed_x',$_POST)) {
  218. $purchasing=new Purchasing();
  219. $purchasing->vendorKickoff();
  220. }
  221. /* ------------- Add Vendor and change Terms when Purchasing changes Vendor ------------- */
  222. $purchasing=new Purchasing();
  223. if (strlen($_POST['vendSearch']) > 0) {
  224. $purchasing->update(true);
  225. } else {
  226. $purchasing->update();
  227. }
  228. }
  229. /* -------------------------------------------------------------
  230. * ------------- END PURCHASING PROCESSING -------------------
  231. * -------------------------------------------------------------
  232. */
  233. /* -------------------------------------------------------------
  234. * ------------- START DATABASE CONNECTIONS -------------------
  235. * -------------------------------------------------------------
  236. */
  237. /* ------------- Getting PO information ------------- */
  238. $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %d, %Y') AS _reqDate
  239. FROM PO
  240. WHERE id = ?",array($_GET['id']));
  241. /* ------------- Getting Authoriztions for above PO ------------- */
  242. $AUTH = $dbh->getRow("SELECT * FROM Authorization WHERE type_id = ? and type = 'PO'",array($PO['id']));
  243. /* ------------- Get Employee names from Standards database ------------- */
  244. $EMPLOYEES = $dbh->getAssoc("SELECT eid, CONCAT(fst,' ',lst) AS name
  245. FROM Standards.Employees");
  246. /* ------------- Getting Vendor information from Standards ------------- */
  247. $VENDOR = $dbh->getAssoc("SELECT BTVEND, BTNAME FROM Standards.Vendor");
  248. /* ------------- Getting Plant information from Standards ------------- */
  249. $plant_sql = "SELECT id, name FROM Standards.Plants WHERE status = '0'";
  250. $PLANTS = $dbh->getAssoc($plant_sql);
  251. $plant_query = $dbh->prepare($plant_sql);
  252. $PLANT = $dbh->getRow("SELECT * FROM Standards.Plants WHERE id=" . $PO['plant']);
  253. /* ------------- Getting Department information from Standards ------------- */
  254. $dept_sql = "SELECT id, CONCAT('(',id,') ',name) AS fullname FROM Standards.Department WHERE status='0' ORDER BY name";
  255. $DEPARTMENT = $dbh->getAssoc($dept_sql);
  256. $dept_query = $dbh->prepare($dept_sql);
  257. /* ------------- Getting Category information from Standards ------------- */
  258. $COA = $dbh->getAssoc("SELECT CONCAT(coa_account,'-',coa_suffix) AS id, coa_description AS name
  259. FROM Standards.COA
  260. WHERE coa_plant=" . $PLANT['conbr']);
  261. /* ------------- Getting CER numbers from CER ------------- */
  262. $cer_sql = "SELECT id, cer FROM CER WHERE cer IS NOT NULL ORDER BY cer+0";
  263. $CER = $dbh->getAssoc($cer_sql);
  264. $cer_query = $dbh->prepare($cer_sql);
  265. /* ------------- Getting Vendor terms from Standards ------------- */
  266. $terms_sql = "SELECT terms_id AS id, terms_name AS name FROM Standards.VendorTerms ORDER BY name";
  267. $TERMS = $dbh->getAssoc($terms_sql);
  268. $terms_query = $dbh->prepare($terms_sql);
  269. /* ------------- Get Purchase Request users ------------- */
  270. $purchaser_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
  271. FROM Users U
  272. INNER JOIN Standards.Employees E ON U.eid = E.eid
  273. WHERE U.role = 'purchasing'
  274. AND E.status = '0'
  275. AND U.eid <> '08745'
  276. ORDER BY E.lst ASC");
  277. /* ------------- Get Purchase Request users ------------- */
  278. $financer_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
  279. FROM Users U
  280. INNER JOIN Standards.Employees E ON U.eid = E.eid
  281. WHERE U.role = 'financing'
  282. AND E.status = '0'
  283. AND U.eid <> '08745'
  284. ORDER BY E.lst ASC");
  285. /* ------------- Get Vendor Payments ------------- */
  286. $payments = $dbh->query("SELECT * FROM Payments WHERE request_id=" . $PO['id'] . " AND pay_status='0' ORDER BY pay_date ASC");
  287. $payments_count = $payments->numRows();
  288. /* ------------- Get Tracking Information ------------- */
  289. $TRACKING = getTrackingInformation($PO['id']);
  290. /* ------------- Getting Comments Information ------------- */
  291. $post_sql = "SELECT * FROM Postings
  292. WHERE request_id = ".$_GET['id']."
  293. AND type = 'global'
  294. ORDER BY posted DESC";
  295. $LAST_POST = $dbh->getRow($post_sql); // Get the last posted comment
  296. $post_query = $dbh->prepare($post_sql);
  297. $post_sth = $dbh->execute($post_query);
  298. $post_count = $post_sth->numRows();
  299. /* -------------------------------------------------------------
  300. * ------------- END DATABASE CONNECTIONS -------------------
  301. * -------------------------------------------------------------
  302. */
  303. /* -------------------------------------------------------------
  304. * ------------- START VARIABLES -------------------------------
  305. * -------------------------------------------------------------
  306. */
  307. /* ------------- Check current level and current user ------------- */
  308. if (array_key_exists('approval', $_GET)) {
  309. if ($AUTH[$AUTH['level']] != $_SESSION['eid']) {
  310. $message="<img src=\"/Common/images/nochange.gif\" align=\"absmiddle\" /> You are not authorized to approve this requisition.";
  311. unset($_GET['approval']);
  312. } elseif ($_GET['approval'] != $AUTH['level']) {
  313. $message="<img src=\"/Common/images/nochange.gif\" align=\"absmiddle\" /> This Requisition is currently not at your approval level.";
  314. unset($_GET['approval']);
  315. }
  316. } elseif ($PO['status'] == 'N') {
  317. $message="<div class=\"appJump\"<img src=\"/Common/images/action.gif\" align=\"absmiddle\" /> This requisition is waiting for action from " . caps($EMPLOYEES[$AUTH[$AUTH['level']]] . "</div>");
  318. }
  319. /* ------------- Get who denied the Requisition ------------- */
  320. if ($PO['status'] == 'X') {
  321. $who = array_search('no', $AUTH);
  322. $canceled = '#' . substr($who,0,4) . 'Status';
  323. }
  324. $disableSendPO = (!empty($PO['po']) AND $PO['reqType'] == 'blanket') ? '' : ' class="disabled"';
  325. $phone_char=array('(', ')', ' ', '-', '.');
  326. $format_phone="(000)000-0000";
  327. /* -------------------------------------------------------------
  328. * ------------- END VARIABLES -------------------------------
  329. * -------------------------------------------------------------
  330. */
  331. ?>
  332. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  333. <html>
  334. <head>
  335. <title><?= $default['title1']; ?></title>
  336. <meta http-equiv="imagetoolbar" content="no">
  337. <meta name="copyright" content="2004 Your Company" />
  338. <meta name="author" content="Thomas LeZotte" />
  339. <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/reset-fonts-grids/reset-fonts-grids.css" /> <!-- CSS Grid -->
  340. <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/fonts/fonts-min.css" /> <!-- Datatable, TabView -->
  341. <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/assets/skins/sam/datatable.css" /> <!-- Datatable -->
  342. <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/assets/skins/sam/tabview.css" /> <!-- TabView -->
  343. <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/assets/skins/custom/menu.css"> <!-- Menu -->
  344. <link type="text/css" rel="stylesheet" href="/Common/Print.css" media="print" />
  345. <link type="text/css" rel="stylesheet" href="../default_yui.css" />
  346. <link type="text/css" rel="alternate stylesheet" title="seasonal" href="/Common/themes/christmas/default.css" />
  347. <link type="text/css" rel="alternate stylesheet" title="night" href="/Common/themes/night/default.css" />
  348. <?php if ($default['rss'] == 'on') { ?>
  349. <link rel="alternate" type="application/rss+xml" title="<?= $default['title1']; ?> Announcements" href="<?= $default['URL_HOME']; ?>/data/<?= $default['rss_file']; ?>">
  350. <link rel="alternate" type="application/rss+xml" title="Capital Acquisition Announcements" href="<?= $default['URL_HOME']; ?>/data/<?= $default['rss_file']; ?>">
  351. <?php } ?>
  352. <script type="text/javascript" src="/Common/js/styleswitcher.js"></script>
  353. <script type="text/javascript" src="/Common/js/jquery/jquery-min.js"></script>
  354. <script type="text/javascript" src="/Common/js/jquery/ui/ui.datepicker-min.js"></script>
  355. </head>
  356. <body class="yui-skin-sam">
  357. <div id="doc3" class="yui-t7">
  358. <div id="hd">
  359. <div class="yui-gb">
  360. <div class="yui-u first">
  361. <img src="/Common/images/CompanyPrint.gif" name="Print" width="437" height="61" id="Print" />
  362. <a href="../home.php" title="<?= $default['title1']; ?>|Home Page"><img src="/Common/images/Company.gif" width="300" height="50" border="0" id="CompanyLogo"></a>
  363. </div>
  364. <div class="yui-u" id="centerTitle"><!-- Center Title Area -->&nbsp;<?php if ($_SESSION['request_access'] >= 2) { ?><span style="text-align:center"><a href="<?= $default['URL_HOME']; ?>/PO/detail.php?<?= $_SERVER['QUERY_STRING']; ?>" class="DarkHeaderSubSub">Switch to original</a></span><?php } ?></div>
  365. <div class="yui-u">
  366. <div id="applicationTitle" style="font-weight:bold;font-size:115%;text-align:right"><?= $language['label']['title1']; ?>&nbsp;</div>
  367. <div id="loggedInUser" class="loggedInUser" style="text-align:right"><strong><a href="../Administration/user_information.php" class="loggedInUser" title="User Task|Edit your user information"><?= caps($_SESSION['fullname']); ?></a></strong>&nbsp;<a href="../logout.php" class="loggedInUser" title="User Task|Selecting [logout] will Log you out of the <?= $default[title1]; ?> and stop automatic cookie login">[logout]</a>&nbsp;</div>
  368. <div id="styleSwitcher" style="text-align:right">Themes: <span id="defaultStyle" class="style" title="Theme Selector|Default Theme"><a href="#" onclick="setActiveStyleSheet('default'); return false;"><img src="/Common/images/spacer.gif" width="14" height="10" border="0" /></a></span><span id="seasonalStyle" class="style" title="Theme Selector|Seasonal Theme - Christmas Season"><a href="#" onclick="setActiveStyleSheet('seasonal'); return false;"><img src="/Common/images/spacer.gif" width="14" height="10" border="0" /></a></span><span id="nightStyle" class="style" title="Theme Selector|Night Scape Theme"><a href="#" onclick="setActiveStyleSheet('night'); return false;"><img src="/Common/images/spacer.gif" width="14" height="10" border="0" /></a></span>&nbsp;</div>
  369. </div>
  370. </div>
  371. </div>
  372. <div id="bd">
  373. <div class="yui-g" id="mm"><?php include('../include/main_menu.php'); ?></div>
  374. <div class="yui-g">
  375. <form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data" name="Form" id="Form" style="padding-top:10px" runat="vdaemon">
  376. <div id="requestStatusContainer" style="width:800px;margin-left: auto;margin-right:auto;">
  377. <div id="requestStatusTitle">Status Indicator</div>
  378. <div id="requestStatus" title="User Task|Click the Requisition Status window to jump to approvals panel"><?= reqStatus($PO['status']); ?><input type="hidden" name="status" value="<?= $PO['status']; ?>" /></div>
  379. </div>
  380. <div id="minimantle" class="md minimantle" style="width:800px;margin-left: auto;margin-right:auto;">
  381. <div id="maincontent" class="md-sub">
  382. <div class="hd" style="height:25px"><h2>Purchase Order Requisition...</h2></div>
  383. <!-- Start Panel One -->
  384. <div id="information_panel" class="md-sub2">
  385. <p id="information_title">Information</p>
  386. <div id="information_content" style="margin:10px">
  387. <table width="100%" align="center" border="0">
  388. <tr>
  389. <td nowrap="nowrap">Requisition Number:</td>
  390. <td class="label"><?= $_GET['id']; ?></td>
  391. <td nowrap="nowrap"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  392. <tr>
  393. <td nowrap="nowrap">Blanket Order:</td>
  394. <td width="35" align="right"><a href="blanket_list.php" rel="gb_page_center[700, 600]" title="Blanket Order List|Click here to get a list of approved Blanket Orders"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle" /></a></td>
  395. </tr>
  396. </table></td>
  397. <td class="label"><table border="0" cellspacing="0" cellpadding="0">
  398. <tr>
  399. <td class="label"><a href="../CER/detail.php?id=<?= $PO['cer']; ?>" class="dark" rel="gb_page_fs[]">
  400. <?= $CER[$PO['cer']]; ?>
  401. </a></td>
  402. <td><?php if (!empty($PO['cer'])) { ?>
  403. <a href="<?= $default['URL_HOME']; ?>/CER/print.php?id=<?= $PO['cer']; ?>" title="Print Center|Click here to print this Capital Acquisition Request"><img src="../images/printer.gif" border="0" align="absmiddle" /></a>
  404. <?php } ?></td>
  405. </tr>
  406. </table></td>
  407. </tr>
  408. <tr>
  409. <td width="12%" nowrap="nowrap">Purchase Order Number:</td>
  410. <td width="45%" class="label"><?= ($PO['creditcard'] == 'yes') ? "Credit Card" : $PO['po']; ?></td>
  411. <td width="13%" nowrap="nowrap"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  412. <tr>
  413. <td nowrap="nowrap">CER Number:</td>
  414. <td width="35" align="right"><a href="cer_list.php" rel="gb_page_center[700, 600]" title="Capital Acquistion List|Click here to get a list of approved Capital Acquisition Requests"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle" /></a></td>
  415. </tr>
  416. </table></td>
  417. <td width="26%" class="label"><table border="0" cellspacing="0" cellpadding="0">
  418. <tr>
  419. <td class="label"><a href="../CER/detail.php?id=<?= $PO['cer']; ?>" class="dark" rel="gb_page_fs[]">
  420. <?= $CER[$PO['cer']]; ?>
  421. </a></td>
  422. <td><?php if (!empty($PO['cer'])) { ?>
  423. <a href="<?= $default['URL_HOME']; ?>/CER/print.php?id=<?= $PO['cer']; ?>" title="Print Center|Click here to print this Capital Acquisition Request"><img src="../images/printer.gif" border="0" align="absmiddle" /></a>
  424. <?php } ?></td>
  425. </tr>
  426. </table></td>
  427. </tr>
  428. <tr>
  429. <td>Requisitioner:</td>
  430. <td class="label"><?= caps($EMPLOYEES[$PO['req']]); ?></td>
  431. <td nowrap="nowrap">Requisition Date:</td>
  432. <td class="label"><?= $PO['_reqDate']; ?></td>
  433. </tr>
  434. <?php if (!empty($PO['incareof']) AND $PO['req'] != $PO['incareof']) { ?>
  435. <tr>
  436. <td><img src="/Common/images/menupointer2.gif" width="4" height="7" align="absmiddle" /> In Care Of:</td>
  437. <td class="label"><?= caps($EMPLOYEES[$PO['incareof']]); ?></td>
  438. <td>&nbsp;</td>
  439. <td>&nbsp;</td>
  440. </tr>
  441. <?php } ?>
  442. <tr>
  443. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5" /></td>
  444. </tr>
  445. <?php if (strlen($PO['sup2']) == 6) { ?>
  446. <tr>
  447. <td nowrap="nowrap">Final Vendor: </td>
  448. <td nowrap="nowrap" class="label"><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?>
  449. <?php
  450. /* Getting suppliers from Suppliers */
  451. $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
  452. FROM Standards.Vendor
  453. WHERE BTVEND = '".$PO['sup2']."'");
  454. ?> <span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&amp;name=<?= caps($SUPPLIER['name']); ?>&amp;address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle" /></a>
  455. <?php if (!empty($SUPPLIER['web'])) { ?>
  456. &nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle" /></a>
  457. <?php } ?>
  458. <a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle" /></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&amp;company=<?= $PO['company']; ?>" title="Fax Center|Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle" /></a></span></td>
  459. <td>Kickoff Date:</td>
  460. <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>
  461. </tr>
  462. <?php } ?>
  463. <tr>
  464. <td nowrap="nowrap"><?= (empty($PO['po'])) ? Recommended : Final; ?>
  465. Vendor:</td>
  466. <td nowrap="nowrap" class="label"><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?>
  467. <?php
  468. /* Getting suppliers from Suppliers */
  469. $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
  470. FROM Standards.Vendor
  471. WHERE BTVEND = '".$PO['sup']."'");
  472. ?><span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&amp;name=<?= caps($SUPPLIER['name']); ?>&amp;address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle" /></a>
  473. <?php if (!empty($SUPPLIER['web'])) { ?>
  474. &nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle" /></a>
  475. <?php } ?>
  476. <a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle" /></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&amp;company=<?= $PO['company']; ?>" title="Fax Center|Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle" /></a></span></td>
  477. <?php if (strlen($PO['sup2']) != 6 AND !empty($PO['po'])) { ?>
  478. <td>Kickoff Date:</td>
  479. <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>
  480. <?php } else { ?>
  481. <td>&nbsp;</td>
  482. <td>&nbsp;</td>
  483. <?php } ?>
  484. </tr>
  485. <!-- <tr>
  486. <td>Company:</td>
  487. <td class="label"><?= caps($COMPANY[$PO[company]]); ?></td>
  488. <td nowrap>&nbsp;</td>
  489. <td>&nbsp;</td>
  490. </tr>-->
  491. <tr>
  492. <td>Bill to Plant: </td>
  493. <td class="label"><?= caps($PLANTS[$PO['plant']]); ?>
  494. <input type="hidden" name="currentPlant" id="currentPlant" value="<?= $PO['plant']; ?>" /></td>
  495. <td>Deliver to Plant: </td>
  496. <td class="label"><?= caps($PLANTS[$PO['ship']]); ?></td>
  497. </tr>
  498. <tr>
  499. <td>Department:</td>
  500. <td class="label"><?= caps($DEPARTMENT[$PO['department']]); ?>
  501. <input type="hidden" name="currentDepartment" id="currentDepartment" value="<?= $PO['department']; ?>" /></td>
  502. <td>Job Number: </td>
  503. <td class="label"><?= $PO['job']; ?></td>
  504. </tr>
  505. <tr>
  506. <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5" /></td>
  507. </tr>
  508. <tr>
  509. <td valign="top" nowrap="nowrap">Purpose / Usage:</td>
  510. <td colspan="3" class="label"><?= caps(stripslashes($PO['purpose'])); ?></td>
  511. </tr>
  512. </table>
  513. </div>
  514. </div>
  515. <!-- End Panel One -->
  516. <!-- Start Panel Two -->
  517. <div id="itemInformation" class="md-sub2">
  518. <p id="itemInformation_title">Item Information</p>
  519. <div id="itemInformation_content" style="margin:10px">
  520. <div id="taskBar"><a href="comments.php?request_id=<?= $_GET['id']; ?>&eid=<?= $_SESSION['eid']; ?>" title="Actions Menu|View All Details" rel="gb_page_center[675,325]"><img src="/Common/images/menu-collapsed.gif" border="0" align="absmiddle">&nbsp;View All Details&nbsp;</a></div>
  521. <div id="itemsTable"></div>
  522. </div>
  523. </div>
  524. <!-- End Panel Two -->
  525. <!-- Start Panel Three -->
  526. <div id="track_panel" class="md-sub2">
  527. <p id="track_title">Track Shipments</p>
  528. <div id="track_content" style="margin:10px">
  529. <div id="taskBar"><div id="addTracking" style="display:none; text-align:left;">Tracking number: <input name="track_number" type="text" id="track_number" size="30" maxlength="30" /> <input name="addTracking" type="image" src="../images/button.php?i=w90.png&l=Add" alt="Add Tracking Number" border="0"><hr color="#FFFFFF" size="1px" noshade></div><div id="addTrackingToggle"><img src="../images/add.gif" width="12" height="12" border="0" align="absmiddle">&nbsp;Tracking Number&nbsp;</div>
  530. </div>
  531. <div id="track_tabs">
  532. <ul class="ui-tabs-nav">
  533. <li><a href="#track_tabs-main"><span>List</span></a></li>
  534. <?php for ($t=0; $t < count($TRACKING); $t++) { ?>
  535. <li><a href="#track_tabs-<?= $t; ?>"><span><?= $TRACKING[$t][track_number]; ?></span></a></li>
  536. <?php } ?>
  537. </ul>
  538. <div id="track_tabs-main" class="ui-tabs-panel">
  539. <div id="shipmentListTable"></div>
  540. </div>
  541. <?php for ($t=0; $t < count($TRACKING); $t++) { ?>
  542. <div id="track_tabs-<?= $t; ?>" class="ui-tabs-panel" >
  543. <div id="<?= $TRACKING[$t][track_number]; ?>Table"></div>
  544. </div>
  545. <?php } ?>
  546. </div>
  547. </div>
  548. </div>
  549. <!-- End Panel Three -->
  550. <!-- Start Panel Four -->
  551. <div id="attachments_panel" class="md-sub2">
  552. <p id="attachments_title">Attachments</p>
  553. <div id="attachments_content" style="margin:10px">
  554. <div id="taskBar"><div id="uploadFile" style="display:none; text-align:left">Choose a file to upload: <input name="file" type="file" size="38"> <input name="submitUpload" type="image" src="../images/button.php?i=w90.png&l=Upload" alt="Upload File" border="0"><hr color="#FFFFFF" size="1px" noshade></div><div id="uploadToggle"><img src="/Common/images/upload.gif" width="16" height="16" border="0" align="absmiddle">&nbsp;Upload File&nbsp;</div>
  555. </div>
  556. <div id="attachmentsTable"></div>
  557. </div>
  558. </div>
  559. <!-- End Panel Four -->
  560. <!-- Start Panel Five -->
  561. <div id="comments_panel" class="md-sub2">
  562. <p id="comments_title">Comments</p>
  563. <div id="comments_content" style="margin:10px">
  564. <div id="taskBar"><a href="comments.php?request_id=<?= $_GET['id']; ?>&eid=<?= $_SESSION['eid']; ?>" title="Actions Menu|Post a new comment" rel="gb_page_center[675,325]"><img src="../images/add.gif" width="12" height="12" border="0" align="absmiddle">&nbsp;New Comment&nbsp;</a></div>
  565. <?php if ($post_count > 0) { ?>
  566. <div id="commentsCounter">
  567. There <?= ($post_count > 1) ? are : is; ?> currently <strong><?= $post_count; ?></strong> comment<?= ($post_count > 1) ? s : ''; ?>.
  568. The last comment was posted on <strong><?= date('F d, Y \a\t H:i A', strtotime($LAST_POST['posted'])); ?></strong>.
  569. <br>
  570. <br>
  571. <div class="clickToView">Click to view all Comments.</div>
  572. </div>
  573. <?php } else { ?>
  574. <div id="commentsCounter">There are currently <strong>NO</strong> comments.</div>
  575. <?php } ?>
  576. <div width="95%" border="0" align="center" id="commentsArea" style="display:none"> <br>
  577. <?php
  578. $count=0;
  579. while($post_sth->fetchInto($POST)) {
  580. $count++;
  581. ?>
  582. <div class="comment">
  583. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  584. <tr>
  585. <td width="55" rowspan="3" valign="top" class="comment_datenum"><div class="comment_month">
  586. <?= date("M", strtotime($POST['posted'])); ?>
  587. </div>
  588. <div class="comment_day">
  589. <?= date("d", strtotime($POST['posted'])); ?>
  590. </div>
  591. <div class="comment_year">
  592. <?= date("y", strtotime($POST['posted'])); ?>
  593. </div></td>
  594. <td class="comment_wrote"><?= caps($EMPLOYEES[$POST[eid]]); ?> wrote... </td>
  595. </tr>
  596. <tr>
  597. <td class="commentbody"><?= caps(stripslashes($POST['comment'])); ?></td>
  598. </tr>
  599. <tr>
  600. <td class="comment_date"><?= date("h:i A", strtotime($POST['posted'])); ?></td>
  601. </tr>
  602. </table>
  603. </div>
  604. <br>
  605. <?php } ?>
  606. </div>
  607. </div>
  608. </div>
  609. <!-- End Panel Five -->
  610. <!-- Start Panel Six -->
  611. <?php if ($_SESSION['request_role'] == 'controller' OR $_SESSION['request_role'] == 'executive') { ?>
  612. <div id="financeDepartment_panel" class="md-sub2">
  613. <p id="financeDepartment_title">Finance Department</p>
  614. <div id="financeDepartment_content" style="margin:10px">
  615. <!-- ===================== START BILLING TAB ===================== -->
  616. <table width="100%" border="0" cellspacing="5" cellpadding="0" id="financeInfo">
  617. <tr>
  618. <td width="194" nowrap>CER Number:</td>
  619. <td width="150" class="label"><a href="../CER/detail.php?id=<?= $PO['cer']; ?>" class="dark" rel="gb_page_fs[]">
  620. <?= $CER[$PO['cer']]; ?>
  621. </a></td>
  622. <td nowrap><!--Credit Card Purchase:--></td>
  623. <td width="187"><!--<select name="creditcard" id="creditcard" >
  624. <option value="no" <?= ($PO['creditcard'] == 'no') ? selected : $blank; ?>>No</option>
  625. <option value="yes" <?= ($PO['creditcard'] == 'yes') ? selected : $blank; ?>>Yes</option>
  626. </select>--></td>
  627. </tr>
  628. <tr>
  629. <td nowrap><table width="100%" border="0" cellspacing="0" cellpadding="0">
  630. <tr>
  631. <td nowrap>Change CER Number:</td>
  632. <td width="35" align="right"><a href="cer_list.php" rel="gb_page_center[700, 600]" title="Capital Acquision List|Click here to get a list of approved Capital Acquisition Requests"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a></td>
  633. </tr>
  634. </table></td>
  635. <td><select name="cer" id="cer">
  636. <option value="0">Select One</option>
  637. <?php
  638. $cer_sth = $dbh->execute($cer_query);
  639. while($cer_sth->fetchInto($DATA)) {
  640. echo " <option value=\"".$DATA['id']."\">".caps($DATA['cer'])."</option>\n";
  641. }
  642. ?>
  643. </select></td>
  644. <td nowrap><!--In Budget:--></td>
  645. <td><!--<select name="inBudget" id="inBudget">
  646. <option value="no" <?= ($PO['inBudget'] == 'no') ? selected : $blank; ?>>No</option>
  647. <option value="yes" <?= ($PO['inBudget'] == 'yes') ? selected : $blank; ?>>Yes</option>
  648. </select>--></td>
  649. </tr>
  650. <tr>
  651. <td height="5" colspan="4" nowrap><img src="../images/spacer.gif" width="5" height="5"></td>
  652. </tr>
  653. <tr>
  654. <td nowrap>Bill to Plant: </td>
  655. <td class="label"><?= caps($PLANTS[$PO['plant']]); ?></td>
  656. <td nowrap>Department:</td>
  657. <td nowrap class="label"><?= caps($DEPARTMENT[$PO['department']]); ?></td>
  658. </tr>
  659. <tr>
  660. <td nowrap>Change Bill to Plant: </td>
  661. <td><select name="plant" id="plant">
  662. <option value="0">Select One</option>
  663. <?php
  664. $plant_sth = $dbh->execute($plant_query);
  665. while($plant_sth->fetchInto($DATA)) {
  666. $selected = ($PO['plant'] == $DATA['id']) ? selected : $blank;
  667. echo " <option value=\"".$DATA['id']."\" ".$selected.">".caps($DATA['name'])."</option>\n";
  668. }
  669. ?>
  670. </select></td>
  671. <td nowrap>Change Department:</td>
  672. <td><select name="department" id="department">
  673. <option value="0">Select One</option>
  674. <?php
  675. $dept_sth = $dbh->execute($dept_query);
  676. while($dept_sth->fetchInto($DEPT)) {
  677. $selected = ($PO['department'] == $DEPT['id']) ? selected : $blank;
  678. echo " <option value=\"".$DEPT['id']."\" ".$selected.">".caps($DEPT['fullname'])."</option>\n";
  679. }
  680. ?>
  681. </select></td>
  682. </tr>
  683. <tr>
  684. <td height="5" colspan="4" nowrap><img src="../images/spacer.gif" width="5" height="5"></td>
  685. </tr>
  686. <tr>
  687. <td>&nbsp;</td>
  688. <td>&nbsp;</td>
  689. <td>&nbsp;</td>
  690. <td><!--<input name="updaterequest" type="image" src="../images/button.php?i=w130.png&l=Update Request" alt="Update Request" border="0">-->
  691. <input name="action" type="hidden" id="action" value="finance_update">
  692. &nbsp;</td>
  693. </tr>
  694. </table>
  695. <!-- ===================== END BILLING TAB ===================== -->
  696. </div>
  697. </div>
  698. <?php } ?>
  699. <!-- End Panel Six -->
  700. <!-- Start Panel Seven -->
  701. <div id="approvals_panel" class="md-sub2">
  702. <p id="approvals_title">Approvals</p>
  703. <div id="approvals_content" style="margin:10px">
  704. <table border="0">
  705. <tr class="hd">
  706. <td height="25" nowrap>&nbsp;</td>
  707. <td width="30" nowrap>&nbsp;</td>
  708. <td nowrap><h2>Name</h2></td>
  709. <td nowrap><h2>Date</h2></td>
  710. <td width="30" align="center" nowrap><a href="javascript:void(0);" title="Requestion Metrics|Days between Approvals"><img src="/Common/images/clock.gif" width="16" height="16" border="0"></a></td>
  711. <td width="30" align="center" nowrap><a href="javascript:void(0);" title="Message Center|Number of comments submitted by each Approver"><img src="../images/comments.gif" width="19" height="16" border="0"></a></td>
  712. <td width="400" ><h2>Comments</h2></td>
  713. <td>
  714. <?= (array_key_exists('approval', $_GET)) ? '<h2>Approval</h2>' : $blank; ?></td>
  715. </tr>
  716. <tr id="reqStatus">
  717. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle">Requester:</td>
  718. <td align="center" nowrap><a href="comments.php?eid=<?= $PO['req']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$PO['req']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a></td>
  719. <td nowrap class="label"><?= caps($EMPLOYEES[$PO['req']]); ?></td>
  720. <td nowrap class="label"><?= $PO['_reqDate']; ?></td>
  721. <td align="center" nowrap class="TrainActive">-</td>
  722. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments"><?= checkComments($_GET['id'], $PO['req']); ?></a></td>
  723. <td nowrap>&nbsp;</td>
  724. <td nowrap>&nbsp;</td>
  725. </tr>
  726. <!-- END REQUESTER -->
  727. <?php if (strlen($AUTH['controller']) == 5) { ?>
  728. <!-- START CONTROLLER -->
  729. <tr id="controllerStatus">
  730. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle">Controller:</td>
  731. <td align="center" nowrap><?php if ($AUTH['level'] == 'controller') { ?>
  732. <img src="../images/resend_email.gif" title="Message Center|Email approvel request to <?= caps($EMPLOYEES[$AUTH['controller']]); ?>">
  733. <?php } else { ?>
  734. <a href="comments.php?eid=<?= $AUTH['controller']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$AUTH['controller']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a>
  735. <?php } ?> </td>
  736. <td nowrap class="label"><?= caps($EMPLOYEES[$AUTH['controller']]); ?></td>
  737. <td nowrap class="label"><?php if (isset($AUTH['controllerDate'])) { echo date("F d, Y", strtotime($AUTH['controllerDate'])); } ?></td>
  738. <td align="center" nowrap class="TrainActive"><?php if (isset($AUTH['controllerDate'])) { echo abs(ceil((strtotime($PO['reqDate']) - strtotime($AUTH['controllerDate'])) / (60 * 60 * 24))); } ?></td>
  739. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments">
  740. <?= checkComments($_GET['id'], $AUTH['controller']); ?>
  741. </a></td>
  742. <td nowrap class="label"><?= displayAppComment('controller', $_GET['approval'], $AUTH['controller'], $AUTH['controllerCom'], $AUTH['controllerDate']); ?></td>
  743. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'controller', $AUTH['controller'], $AUTH['controllerDate']); ?></td>
  744. </tr>
  745. <?php } ?>
  746. <!-- END CONTROLLER -->
  747. <!-- START APPROVER 1 -->
  748. <tr id="app1Status">
  749. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle"><?= $language['label']['app1']; ?>:</td>
  750. <td align="center" nowrap><?php if ($AUTH['level'] == 'app1') { ?>
  751. <img src="../images/resend_email.gif" title="Email approvel request to <?= caps($EMPLOYEES[$AUTH['app1']]); ?>">
  752. <?php } else { ?>
  753. <a href="comments.php?eid=<?= $AUTH['app1']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$AUTH['app1']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a>
  754. <?php } ?> </td>
  755. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  756. <td nowrap class="label"><?php if (isset($AUTH['app1Date'])) { echo date("F d, Y", strtotime($AUTH['app1Date'])); } ?></td>
  757. <td align="center" nowrap class="TrainActive"><?php if (isset($AUTH['app1Date'])) { echo abs(ceil((strtotime($PO['reqDate']) - strtotime($AUTH['app1Date'])) / (60 * 60 * 24))); } ?></td>
  758. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments">
  759. <?= checkComments($_GET['id'], $AUTH['app1']); ?>
  760. </a></td>
  761. <td nowrap class="label"><?= displayAppComment('app1', $_GET['approval'], $AUTH['app1'], $AUTH['app1Com'], $AUTH['app1Date']); ?></td>
  762. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app1', $AUTH['app1'], $AUTH['app1Date']); ?></td>
  763. </tr>
  764. <!-- END APPROVER 1 -->
  765. <?php if (strlen($AUTH['app2']) == 5 OR $PO['status'] == 'N') { ?>
  766. <!-- START APPROVER 2 -->
  767. <tr id="app2Status">
  768. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle"><?= $language['label']['app2']; ?>:</td>
  769. <td align="center" nowrap><?php if ($AUTH['level'] == 'app2') { ?>
  770. <img src="../images/resend_email.gif" title="Email approvel request to <?= caps($EMPLOYEES[$AUTH['app2']]); ?>">
  771. <?php } else { ?>
  772. <a href="comments.php?eid=<?= $AUTH['app2']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$AUTH['app2']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a>
  773. <?php } ?> </td>
  774. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  775. <td nowrap class="label"><?php if (isset($AUTH['app2Date'])) { echo date("F d, Y", strtotime($AUTH['app2Date'])); } ?></td>
  776. <td align="center" nowrap class="TrainActive"><?php if (isset($AUTH['app2Date'])) { echo abs(ceil((strtotime($AUTH['app1Date']) - strtotime($AUTH['app2Date'])) / (60 * 60 * 24))); } ?></td>
  777. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments">
  778. <?= checkComments($_GET['id'], $AUTH['app2']); ?>
  779. </a></td>
  780. <td nowrap class="label"><?= displayAppComment('app2', $_GET['approval'], $AUTH['app2'], $AUTH['app2Com'], $AUTH['app2Date']); ?></td>
  781. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app2', $AUTH['app2'], $AUTH['app2Date']); ?></td>
  782. </tr>
  783. <!-- END APPROVER 2 -->
  784. <?php } ?>
  785. <?php if (strlen($AUTH['app3']) == 5 OR $PO['status'] == 'N') { ?>
  786. <!-- END APPROVER 3 -->
  787. <tr id="app3Status">
  788. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle"><?= $language['label']['app3']; ?>:</td>
  789. <td align="center" nowrap><?php if ($AUTH['level'] == 'app3') { ?>
  790. <img src="../images/resend_email.gif" title="Email approvel request to <?= caps($EMPLOYEES[$AUTH['app3']]); ?>">
  791. <?php } else { ?>
  792. <a href="comments.php?eid=<?= $AUTH['app3']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$AUTH['app3']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a>
  793. <?php } ?> </td>
  794. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  795. <td nowrap class="label"><?php if (isset($AUTH['app3Date'])) { echo date("F d, Y", strtotime($AUTH['app3Date'])); } ?></td>
  796. <td align="center" nowrap class="TrainActive"><?php if (isset($AUTH['app3Date'])) { echo abs(ceil((strtotime($AUTH['app2Date']) - strtotime($AUTH['app3Date'])) / (60 * 60 * 24))); } ?></td>
  797. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments">
  798. <?= checkComments($_GET['id'], $AUTH['app3']); ?>
  799. </a></td>
  800. <td nowrap class="label"><?= displayAppComment('app3', $_GET['approval'], $AUTH['app3'], $AUTH['app3Com'], $AUTH['app3Date']); ?></td>
  801. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app3', $AUTH['app3'], $AUTH['app3Date']); ?></td>
  802. </tr>
  803. <!-- END APPROVER 3 -->
  804. <?php } ?>
  805. <?php if (strlen($AUTH['app4']) == 5 OR $PO['status'] == 'N') { ?>
  806. <!-- START APPROVER 4 -->
  807. <tr id="app4Status">
  808. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle"><?= $language['label']['app4']; ?>:</td>
  809. <td align="center" nowrap><?php if ($AUTH['level'] == 'app4') { ?>
  810. <img src="../images/resend_email.gif" title="Email approvel request to <?= caps($EMPLOYEES[$AUTH['app4']]); ?>">
  811. <?php } else { ?>
  812. <a href="comments.php?eid=<?= $AUTH['app4']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$AUTH['app4']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a>
  813. <?php } ?> </td>
  814. <td nowrap class="label"><?= displayApprover($_GET['id'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  815. <td nowrap class="label"><?php if (isset($AUTH['app4Date'])) { echo date("F d, Y", strtotime($AUTH['app4Date'])); } ?></td>
  816. <td align="center" nowrap class="TrainActive"><?php if (isset($AUTH['app4Date'])) { echo abs(ceil((strtotime($AUTH['app3Date']) - strtotime($AUTH['app4Date'])) / (60 * 60 * 24))); } ?></td>
  817. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments">
  818. <?= checkComments($_GET['id'], $AUTH['app4']); ?>
  819. </a></td>
  820. <td nowrap class="label"><?= displayAppComment('app4', $_GET['approval'], $AUTH['app4'], $AUTH['app4Com'], $AUTH['app4Date']); ?></td>
  821. <td nowrap><?= displayAppButtons($_GET['id'], $_GET['approval'], 'app4', $AUTH['app4'], $AUTH['app4Date']); ?></td>
  822. </tr>
  823. <!-- END APPROVER 4 -->
  824. <?php } ?>
  825. <?php if (!is_null($PO['po'])) { ?>
  826. <!-- START PURCHASER -->
  827. <tr id="issuerStatus">
  828. <td nowrap><img src="/Common/images/spacer.gif" width="22" height="20" align="absmiddle">Purchaser: </td>
  829. <td align="center" nowrap><a href="comments.php?eid=<?= $AUTH['issuer']; ?>&request_id=<?= $PO['id']; ?>&type=private" title="Message Center|Send a private message to <?= caps($EMPLOYEES[$AUTH['issuer']]); ?>" rel="gb_page_center[675,325]"><img src="../images/comments.gif" border="0"></a></td>
  830. <td nowrap class="label"><?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  831. <td nowrap class="label"><?= date("F j, Y", strtotime($AUTH['issuerDate'])); ?></td>
  832. <td align="center" nowrap class="TrainActive"><?php if (isset($AUTH['issuerDate'])) { echo abs(ceil((strtotime($PO['reqDate']) - strtotime($AUTH['issuerDate'])) / (60 * 60 * 24))); } ?></td>
  833. <td align="center" nowrap class="TrainActive"><a href="javascript:void(0);" class="checkComments">
  834. <?= checkComments($_GET['id'], $AUTH['issuer']); ?>
  835. </a></td>
  836. <td nowrap>&nbsp;</td>
  837. <td nowrap>&nbsp;</td>
  838. </tr>
  839. <!-- END PURCHASER -->
  840. <?php } ?>
  841. <!-- START TOTAL -->
  842. <tr class="xpHeaderTotal">
  843. <td height="25" nowrap>Totals:</td>
  844. <td nowrap>&nbsp;</td>
  845. <td nowrap>&nbsp;</td>
  846. <td nowrap>&nbsp;</td>
  847. <td align="center" nowrap><?= abs(ceil((strtotime($REQUEST['reqDate']) - strtotime($AUTH['issuerDate'])) / (60 * 60 * 24))); ?></td>
  848. <td nowrap>&nbsp;</td>
  849. <td nowrap class="TipLabel">Days</td>
  850. <td nowrap>&nbsp;</td>
  851. </tr>
  852. <!-- END TOTAL -->
  853. </table>
  854. </div>
  855. </div>
  856. <!-- End Panel Seven -->
  857. <!-- Start Panel Eight -->
  858. <?php if ($_SESSION['request_role'] == 'purchasing' OR $_SESSION['request_role'] == 'executive') { ?>
  859. <div id="purchasingDepartment_panel" class="md-sub2">
  860. <p id="purchasingDepartment_title">Purchasing Department</p>
  861. <div id="purchasingDepartment_content" style="margin:10px; text-align:left">
  862. <?php if (is_null($PO['po']) AND $PO['status'] == 'A') { ?>
  863. <div id="approvalTime"> Time elapsed since Requisition approval: <strong>
  864. <?= elapsedApprovalTime($_GET['id']); ?>
  865. hours</strong> </div>
  866. <?php } ?>
  867. <div id="purchasing_tabs">
  868. <ul class="ui-tabs-nav">
  869. <li><a href="#purchasing_tabs-1"><span>Information</span></a></li>
  870. <li><a href="#purchasing_tabs-2"><span>Vendor Payments</span></a></li>
  871. <li><a href="#purchasing_tabs-3"><span>Contacts Information</span></a></li>
  872. <li><a href="#purchasing_tabs-4"><span>Send Purchase Order</span></a></li>
  873. </ul>
  874. <div id="purchasing_tabs-1" class="ui-tabs-panel">
  875. <!-- ===================== START INFORMATION TAB ===================== -->
  876. <table width="100%" border="0" cellspacing="5" cellpadding="0" id="purchasingInfo">
  877. <tr>
  878. <td colspan="4" class="blueNoteArea"> Purchase Order Number:
  879. <input name="po" type="text" id="po" value="<?= $PO['po']; ?>" size="10" maxlength="7">
  880. <?php if (empty($PO['po'])) { ?>
  881. &nbsp;
  882. <input name="completed" type="image" src="../images/button.php?i=w130.png&l=Vendor Kickoff" alt="Supplier Kickoff" border="0">
  883. <?php } ?></td>
  884. </tr>
  885. <tr>
  886. <td nowrap="nowrap">Purchaser:</td>
  887. <td class="label"><?= caps($EMPLOYEES[$AUTH['issuer']]); ?></td>
  888. <td nowrap="nowrap">Vendor Kickoff:</td>
  889. <td class="label"><?= ($AUTH['issuerDate'] == '0000-00-00 00:00:00' OR is_null($AUTH['issuerDate'])) ? $blank : date("F j, Y h:iA", strtotime($AUTH['issuerDate'])); ?></td>
  890. </tr>
  891. <tr>
  892. <td colspan="4" nowrap="nowrap">&nbsp;</td>
  893. </tr>
  894. <tr>
  895. <td nowrap="nowrap">Private Requisition:</td>
  896. <td><select name="private" id="private" disabled="disabled">
  897. <option value="no" <?= ($PO['private'] == 'no') ? selected : $blank; ?>>No</option>
  898. <option value="yes" <?= ($PO['private'] == 'yes') ? selected : $blank; ?>>Yes</option>
  899. </select></td>
  900. <td nowrap="nowrap">HOT Requisition:</td>
  901. <td><select name="hot" id="hot">
  902. <option value="no" <?= ($PO['hot'] == 'no') ? selected : $blank; ?>>No</option>
  903. <option value="yes" <?= ($PO['hot'] == 'yes') ? selected : $blank; ?>>Yes</option>
  904. </select></td>
  905. </tr>
  906. <tr>
  907. <td nowrap="nowrap">FOB:</td>
  908. <td><input name="fob" type="text" id="fob" value="<?= $PO['fob']; ?>" size="15" maxlength="15" /></td>
  909. <td nowrap="nowrap">Requisition Type: </td>
  910. <td><select name="reqType" id="reqType">
  911. <option value="0">Select One</option>
  912. <option value="blanket" <?= ($PO['reqType'] == 'blanket') ? selected : $blank; ?>>Blanket Order</option>
  913. <option value="capex" <?= ($PO['reqType'] == 'capex') ? selected : $blank; ?>>Capital Expense</option>
  914. <option value="mro" <?= ($PO['reqType'] == 'mro') ? selected : $blank; ?>>MRO</option>
  915. <option value="tooling" <?= ($PO['reqType'] == 'tooling') ? selected : $blank; ?>>Tooling</option>
  916. </select></td>
  917. </tr>
  918. <tr>
  919. <td>Ship Via:</td>
  920. <td><input name="via" type="text" id="via" value="<?= $PO['via']; ?>" size="15" maxlength="15" /></td>
  921. <td>Final Terms:</td>
  922. <td><select name="terms" id="terms">
  923. <option value="0">Select One</option>
  924. <?php
  925. $terms_sth = $dbh->execute($terms_query);
  926. while($terms_sth->fetchInto($TERMS2)) {
  927. $selected = ($PO['terms'] == $TERMS2['id']) ? selected : $blank;
  928. print "<option value=\"".$TERMS2['id']."\" ".$selected.">".$TERMS2['name']."</option>";
  929. }
  930. ?>
  931. </select></td>
  932. </tr>
  933. <tr>
  934. <td colspan="4">&nbsp;</td>
  935. </tr>
  936. <tr>
  937. <td>&nbsp;</td>
  938. <td colspan="2" class="dHeader">Name</td>
  939. <td class="dHeader">Terms</td>
  940. </tr>
  941. <tr>
  942. <td nowrap>Recommended Vendor:</td>
  943. <td colspan="2" nowrap="nowrap" class="label"><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?>
  944. <?php
  945. /* Getting suppliers from Suppliers */
  946. $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
  947. FROM Standards.Vendor
  948. WHERE BTVEND = '" . $PO['sup'] . "'");
  949. ?>
  950. <span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&amp;name=<?= caps($SUPPLIER['name']); ?>&amp;address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle" /></a>
  951. <?php if (!empty($SUPPLIER['web'])) { ?>
  952. &nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle" /></a>
  953. <?php } ?>
  954. <a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle" /></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&amp;company=<?= $PO['company']; ?>" title="Fax Center|Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle" />&nbsp;&nbsp;</a></span></td>
  955. <td class="label"><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  956. </tr>
  957. <?php if (strlen($PO['sup2'])== 6) { ?>
  958. <tr>
  959. <td>Final Vendor:</td>
  960. <td colspan="2" nowrap="nowrap" class="label"><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?>
  961. <?php
  962. /* Getting suppliers from Suppliers */
  963. $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
  964. FROM Standards.Vendor
  965. WHERE BTVEND = '" . $PO['sup2'] . "'");
  966. ?>
  967. <span class="padding"><a href="../Common/vendor_map.php?id=<?= strtoupper($SUPPLIER['id']); ?>&amp;name=<?= caps($SUPPLIER['name']); ?>&amp;address=<?= $SUPPLIER['address']; ?> <?= $SUPPLIER['city']; ?>, <?= $SUPPLIER['state']; ?> <?= $SUPPLIER['zip5']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s Location" rel="gb_page_center[602, 602]"><img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle" /></a>
  968. <?php if (!empty($SUPPLIER['web'])) { ?>
  969. &nbsp;<a href="http://<?= $SUPPLIER['web']; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?>'s website." rel="gb_page_fs[]"><img src="/Common/images/globe.gif" width="18" height="18" border="0" align="absmiddle" /></a>
  970. <?php } ?>
  971. <a href="../Administration/vendor_details.php?id=<?= $SUPPLIER[id]; ?>" title="Information Center|<?= caps($SUPPLIER['name']); ?> information" rel="gb_page[400, 511]"><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle" /></a>&nbsp;<a href="fax.php?id=<?= $PO['sup']; ?>&amp;company=<?= $PO['company']; ?>" title="Fax Center|Generate a fax cover sheet" target="_blank"><img src="../images/printer.gif" border="0" align="absmiddle" />&nbsp;&nbsp;</a></span></td>
  972. <td class="label"><?= $TERMS[$SUPPLIER['terms']]; ?></td>
  973. </tr>
  974. <?php } ?>
  975. <tr>
  976. <td>Change Vendor:</td>
  977. <td colspan="3" class="label"><input id="vendSearch" name="vendSearch" type="text" size="50" />
  978. <script type="text/javascript">
  979. /* Event.observe(window, "load", function() {
  980. var aa = new AutoAssist("vendSearch", function() {
  981. return "../Common/vendor.php?q=" + this.txtBox.value;
  982. });
  983. });*/
  984. </script>
  985. <input name="supplierNew" type="hidden" id="supplierNew" />
  986. <input name="supplierNewTerms" type="hidden" id="supplierNewTerms" /></td>
  987. </tr>
  988. <tr>
  989. <td>&nbsp;</td>
  990. <td>&nbsp;</td>
  991. <td>&nbsp;</td>
  992. <td><input name="updaterequest" type="image" src="../images/button.php?i=w130.png&amp;l=Update Request" alt="Update Request" border="0" />
  993. <input name="action" type="hidden" id="action" value="purchasing_update" />
  994. &nbsp;</td>
  995. </tr>
  996. </table>
  997. <!-- ===================== END INFORMATION TAB ===================== -->
  998. </div>
  999. <div id="purchasing_tabs-2" class="ui-tabs-panel" >
  1000. <!-- ===================== START VENDOR PAYMENTS TAB ===================== -->
  1001. <div class="blueNoteArea" style="text-align:right" id="outstanding"></div>
  1002. <br>
  1003. <table border="0" align="center" cellpadding="0" cellspacing="5" id="vendorPayments">
  1004. <tr>
  1005. <td valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  1006. <tr>
  1007. <td class="blueNoteAreaBorder"><table border="0">
  1008. <tr class="blueNoteArea">
  1009. <td class="label">Amount</td>
  1010. <td class="label">Date</td>
  1011. <td class="label">&nbsp;</td>
  1012. </tr>
  1013. <tr>
  1014. <td class="label">$<input name="pay_amount" type="text" id="pay_amount" size="15" /></td>
  1015. <td class="label"><input name="paymentDate" type="text" id="paymentDate" size="10" maxlength="10" class="popupcalendar" value="<?= $PAYMENTS['0']['pay_date']; ?>" /></td>
  1016. <td class="label"><input name="addPayment" type="image" id="addPayment" src="../images/add.gif" /></td>
  1017. </tr>
  1018. </table></td>
  1019. </tr>
  1020. </table></td>
  1021. <td rowspan="2" align="right" valign="top"><img src="../images/spacer.gif" width="50" height="10" /></td>
  1022. <td align="right" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0">
  1023. <tr>
  1024. <td class="blueNoteAreaBorder"><?php if ($payments_count > 0) { ?>
  1025. <table border="0">
  1026. <tr class="blueNoteArea">
  1027. <td class="label">&nbsp;</td>
  1028. <td class="label">Amount</td>
  1029. <td class="label">Date</td>
  1030. <td class="label">Delete</td>
  1031. </tr>
  1032. <?php
  1033. $count=0;
  1034. $total=$PO['total'];
  1035. while ($payments->fetchInto($PAYMENTS)) {
  1036. $count++;
  1037. $total -= $PAYMENTS['pay_amount'];
  1038. ?>
  1039. <tr>
  1040. <td class="label"><?= $count; ?><input type="hidden" name="pay_id<?= $count; ?>" id="pay_id<?= $count; ?>" value="<?= $PAYMENTS['pay_id']; ?>" /></td>
  1041. <td class="label">$<input name="pay_amount<?= $count; ?>" type="text" id="pay_amount<?= $count; ?>" value="<?= number_format($PAYMENTS['pay_amount'],2); ?>" size="15" /></td>
  1042. <td class="label"><input name="pay_date<?= $count; ?>" type="text" id="pay_date<?= $count; ?>" class="popupcalendar" size="10" maxlength="10" value="<?= $PAYMENTS['pay_date']; ?>" /></td>
  1043. <td align="center" class="label"><input type="checkbox" name="pay_remove<?= $count; ?>" id="pay_remove<?= $count; ?>" value="yes" /></td>
  1044. </tr>
  1045. <?php } ?>
  1046. </table>
  1047. <input name="payments_count" id="payments_count" type="hidden" value="<?= $payments_count; ?>" />
  1048. <script>
  1049. $(document).ready(function(){
  1050. $('#outstanding').append('Oustanding: $<?= number_format($total,2); ?>');
  1051. });
  1052. </script>
  1053. <?php } else { ?>
  1054. <script>
  1055. $(document).ready(function(){
  1056. $('#outstanding').append('Oustanding: $<?= number_format($PO['total'],2); ?>');
  1057. });
  1058. </script>
  1059. <?php } ?></td>
  1060. </tr>
  1061. </table></td>
  1062. </tr>
  1063. <tr>
  1064. <td>&nbsp;</td>
  1065. <td align="right" height="30"><input name="updatePayments" id="updatePayments" type="image" src="../images/button.php?i=w70.png&amp;l=Update" alt="Update Payments" border="0" /></td>
  1066. </tr>
  1067. </table>
  1068. <!-- ===================== END VENDOR PAYMENTS TAB ===================== -->
  1069. </div>
  1070. <div id="purchasing_tabs-3" class="ui-tabs-panel">
  1071. <!-- ===================== START CONTACTS TAB ===================== -->
  1072. <center>
  1073. <div id="contactsXML"></div>
  1074. </center>
  1075. <!-- ===================== END CONTACTS TAB ===================== -->
  1076. </div>
  1077. <div id="purchasing_tabs-4" class="ui-tabs-panel">
  1078. <!-- ===================== START SEND PURCHASE ORDER TAB ===================== -->
  1079. <center>
  1080. <div id="sendPoXML"></div>
  1081. </center>
  1082. <!-- ===================== END SEND PURCHASE ORDER TAB ===================== -->
  1083. </div>
  1084. </div>
  1085. </div>
  1086. </div>
  1087. <?php } ?>
  1088. <!-- End Panel Eight -->
  1089. <!-- Start Controls Panel -->
  1090. <div id="controls">
  1091. <div id="controls_content" style="margin:10px">
  1092. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  1093. <tr>
  1094. <td width="50%"><?php if ($_SESSION['eid'] == $PO['req'] AND $PO['status'] != 'X' AND $PO['status'] != 'C' AND empty($_GET['approval'])) { ?>
  1095. <table border="0" cellspacing="0" cellpadding="0">
  1096. <tr>
  1097. <td width="20" valign="middle"><input name="cancel" type="checkbox" id="cancel" value="yes"></td>
  1098. <td><input name="cancelrequest" type="image" src="../images/button.php?i=w130.png&l=Cancel Request" alt="Cancel Request" border="0"></td>
  1099. <!--<td>&nbsp;</td>
  1100. <td><input name="copyrequest" type="image" src="../images/button.php?i=w130.png&l=Copy Request" alt="Copy Request" border="0"></td>-->
  1101. </tr>
  1102. </table>
  1103. <?php } ?>
  1104. <?php if ($_SESSION['eid'] == $PO['req'] AND ($PO['status'] == 'X' OR $PO['status'] == 'C')) { ?>
  1105. <table border="0" cellspacing="0" cellpadding="0">
  1106. <tr>
  1107. <td width="20" valign="middle"><input name="restore" type="checkbox" id="restore" value="yes"></td>
  1108. <td><input name="restorerequest" type="image" src="../images/button.php?i=w130.png&l=Restore Request" alt="Restore Request"></td>
  1109. </tr>
  1110. </table>
  1111. <?php } ?>
  1112. &nbsp;</td>
  1113. <td width="50%" align="right"><input name="id" type="hidden" id="id" value="<?= $PO['id']; ?>">
  1114. <input name="type_id" type="hidden" id="type_id" value="<?= $PO['id']; ?>">
  1115. <input name="req" type="hidden" id="req" value="<?= $PO['req']; ?>">
  1116. <input name="purpose" type="hidden" id="purpose" value="<?= $PO['purpose']; ?>">
  1117. <input name="auth_id" type="hidden" id="auth_id" value="<?= $AUTH['id']; ?>">
  1118. <?php
  1119. if (($_SESSION['eid'] == $AUTH[$_GET['approval']] OR
  1120. $_SESSION['eid'] == $PO['req'] OR
  1121. $_SESSION['eid'] == $AUTH['issuer'])) { ?>
  1122. <?php
  1123. if (isset($_GET['approval'])) {
  1124. /* Set auth level to GET[approval] */
  1125. $auth_value = $_GET['approval'];
  1126. } elseif ($_SESSION['eid'] == $PO['req']) {
  1127. /* Allow update if GET[approval] was sent and Requester is viewing */
  1128. $auth_value = "req";
  1129. } elseif ($_SESSION['eid'] == $AUTH['issuer']) {
  1130. /* Allow update if GET[approval] was sent and Requester is viewing */
  1131. $auth_value = "issuer";
  1132. }
  1133. ?>
  1134. <input name="auth" type="hidden" id="auth" value="<?= $auth_value; ?>">
  1135. <input name="stage" type="hidden" id="stage" value="update">
  1136. <!--<input name="imageField" type="image" src="../images/button.php?i=b150.png&l=Update Request" alt="Update Request">-->
  1137. <?php } ?></td>
  1138. </tr>
  1139. </table>
  1140. </div>
  1141. </div>
  1142. <!-- End Controls Panel -->
  1143. </div>
  1144. </div>
  1145. <div id="backToTopContainer" style="width:800px;margin-left: auto;margin-right:auto;">
  1146. <div id="backToTop">BACK TO TOP <img src="/Common/images/upload.gif" width="16" height="16" align="absmiddle"></div>
  1147. </div>
  1148. </form>
  1149. <!-- YOUR DATA GOES HERE -->
  1150. </div>
  1151. </div>
  1152. <div id="ft" style="padding-top:50px">
  1153. <div class="yui-gb">
  1154. <div class="yui-u first"><?php include('../include/copyright.php'); ?></div>
  1155. <div class="yui-u"><!-- FOOTER CENTER AREA -->&nbsp;</div>
  1156. <div class="yui-u" style="text-align:right"><!-- FOOTER RIGHT AREA -->&nbsp;</div>
  1157. </div>
  1158. </div>
  1159. </div>
  1160. </div>
  1161. <script>
  1162. var request_id='<?= $_GET['id']; ?>';
  1163. var approval='<?= $_GET['approval']; ?>';
  1164. var level='<?= $AUTH['level']; ?>';
  1165. var status='<?= $PO['status']; ?>';
  1166. var canceled='<?= $canceled; ?>';
  1167. var message='<?= $message; ?>';
  1168. var msgClass='<?= $msgClass; ?>';
  1169. var request_role='<?= $_SESSION['request_role']; ?>';
  1170. var trackingLength='<?= count($TRACKING); ?>';
  1171. var tracking = {"list": [
  1172. <?php for ($t=0; $t < count($TRACKING); $t++) { ?>
  1173. {track_id:"<?= $TRACKING[$t][track_id]; ?>",track_number:"<?= $TRACKING[$t][track_number]; ?>",track_date:"<?= $TRACKING[$t][track_date]; ?>",track_latest:"<?= $TRACKING[$t][track_latest]; ?>",track_url:"<?= $TRACKING[$t][track_url]; ?>"},
  1174. <?php } ?>
  1175. ]};
  1176. </script>
  1177. <script type="text/javascript" src="/Common/js/yahoo/yahoo-dom-event/yahoo-dom-event.js" ></script> <!-- Menu, TabView, Datatable -->
  1178. <script type="text/javascript" src="/Common/js/yahoo/container/container-min.js"></script> <!-- Menu -->
  1179. <script type="text/javascript" src="/Common/js/yahoo/menu/menu-min.js"></script> <!-- Menu -->
  1180. <script type="text/javascript" src="/Common/js/yahoo/utilities/utilities.js"></script> <!-- Datatable -->
  1181. <script type="text/javascript" src="/Common/js/yahoo/datasource/datasource-beta-min.js"></script> <!-- Datatable -->
  1182. <script type="text/javascript" src="/Common/js/yahoo/datatable/datatable-beta-min.js"></script> <!-- Datatable -->
  1183. <script type="text/javascript" src="/Common/js/yahoo/connection/connection-min.js" ></script> <!-- Datatable -->
  1184. <script type="text/javascript" src="/Common/js/yahoo/element/element-beta-min.js"></script> <!-- TabView, Datatable -->
  1185. <script type="text/javascript" src="../js/YUIdetail-min.js"></script> <!-- Requires - Datatable -->
  1186. <script type="text/javascript" src="../js/jQdefault.js"></script>
  1187. <script type="text/javascript" src="../js/jQdetail.js"></script>
  1188. <?php if ($_SESSION['request_access'] == '3') { ?>
  1189. <!--<script type="text/javascript" src="../js/adminDepartment.js"></script>--> <!-- Requires - Datatable -->
  1190. <?php } ?>
  1191. <script type="text/javascript" src="/Common/js/greybox5/options1.js"></script>
  1192. <script type="text/javascript" src="/Common/js/greybox5/AJS.js"></script>
  1193. <script type="text/javascript" src="/Common/js/greybox5/AJS_fx.js"></script>
  1194. <script type="text/javascript" src="/Common/js/greybox5/gb_scripts.js"></script>
  1195. <script type="text/javascript" src="/Common/js/jquery/ui/ui.tabs-min.js"></script>
  1196. <script type="text/javascript" src="/Common/js/jquery/jQpanels/jquery.slidepanel.js"></script>
  1197. <script type="text/javascript" src="/Common/js/jquery/scrollTo/jquery.scrollTo-min.js"></script>
  1198. <script type="text/javascript" src="/Common/js/jquery/cluetip/jquery.dimensions-min.js"></script>
  1199. <script type="text/javascript" src="/Common/js/jquery/cluetip/jquery.cluetip-min.js"></script>
  1200. <script type="text/javascript">
  1201. /* ========== YUI Main Menu ========== */
  1202. YAHOO.util.Event.onContentReady("productsandservices", function () {
  1203. var oMenuBar = new YAHOO.widget.MenuBar("productsandservices", { autosubmenudisplay: true, hidedelay: 750, lazyload: true });
  1204. oMenuBar.render();
  1205. });
  1206. </script>
  1207. <?php if (!$debug_page) { ?>
  1208. <!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  1209. </script>
  1210. <script type="text/javascript">
  1211. _uacct = "<?= $default['google_analytics']; ?>";
  1212. urchinTracker();
  1213. </script>-->
  1214. <?php } ?>
  1215. </body>
  1216. </html>
  1217. <?php
  1218. //getProxyDATA("http://isnoop.net/tracking/index.php?t=1Z1812690306250111&rss=1", "1Z1812690306250111.rss");
  1219. /**
  1220. * - Display Debug Information
  1221. */
  1222. include_once('debug/footer.php');
  1223. /**
  1224. * - Disconnect from database
  1225. */
  1226. $dbh->disconnect();
  1227. ?>