/_tmp/detail_tmp.php
PHP | 1754 lines | 1487 code | 85 blank | 182 comment | 192 complexity | e600ea4d6fa7f14bb4d5cbbeba5c05de MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- <?php
- /**
- * Request System
- *
- * detail.php displays detailed information on PO.
- *
- * @version 1.5
- * @link http://www.yourdomain.com/go/Request/
- * @author Thomas LeZotte (tom@lezotte.net)
- *
- * @package PO
- * @filesource
- *
- * PHP Debug
- * @link http://phpdebug.sourceforge.net/
- * PDF Toolkit
- * @link http://www.accesspdf.com/
- */
- /**
- * - Forward BlackBerry users to BlackBerry version
- */
- require_once('../include/BlackBerry.php');
-
- /**
- * - Start Page Loading Timer
- */
- include_once('../include/Timer.php');
- $starttime = StartLoadTimer();
- /**
- * - Set debug mode
- */
- $debug_page = false;
- include_once('debug/header.php');
- /**
- * - Database Connection
- */
- require_once('../Connections/connDB.php');
- /**
- * - Config Information
- */
- require_once('../include/config.php');
- /**
- * - Check User Access
- */
- require_once('../security/check_user.php');
- /**
- * - Form Validation
- */
- //include('vdaemon/vdaemon.php');
- /* ------------- Give an error when no Requisition number is provided ------------- */
- /*if (!array_key_exists('id', $_GET) OR !array_key_exists('id', $_POST)) {
- $_SESSION['error'] = "Requisition Number was not provided.";
- $forward = "../error.php";
- header("Location: ".$forward);
- exit();
- }
- */
-
-
- /* -------------------------------------------------------------
- * ------------- START FINANCE PROCESSING -------------------
- * -------------------------------------------------------------
- */
- if ($_POST['action'] == 'finance_update') {
- /* ----- Controller changes Plant ----- */
- if ($_POST['currentPlant'] != $_POST['plant']) {
- $sql = "UPDATE PO SET plant='" . $_POST['plant'] . "' WHERE id=" . $_POST['type_id']; // Update Bill to Plant
- $dbh->query($sql);
- if ($default['debug_capture'] == 'on') {
- debug_capture($_SESSION['eid'], $PO_ID, 'debug', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
- }
- $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=controller&plant=" . $_POST['plant'] . "&department=" . $_POST['department']; // Check Controler
-
- /* ----- Controller changes Department ----- */
- } elseif ($_POST['currentDepartment'] != $_POST['department']) {
- $sql = "UPDATE PO SET department='" . $_POST['department'] . "' WHERE id=" . $_POST['type_id']; // Update Department
- $dbh->query($sql);
- if ($default['debug_capture'] == 'on') {
- debug_capture($_SESSION['eid'], $PO_ID, 'debug', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
- }
-
- $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=controller&plant=" . $_POST['plant'] . "&department=" . $_POST['department']; // Check Controler
- }
-
- /* ----- Cycle through items ----- */
- for ($x=1; $x <= $_POST['items_count']; $x++) {
- $item = "item" . $x; // Item ID
- $item_COA = $item . "_newCOA"; // COA value
- $item_COAid = $item_COA . "id"; // COA value ID
-
-
- if (strlen($item_coa) > 0) {
- $sql = "UPDATE Items SET cat='" . $_POST[$item_COAid] . "' WHERE id=" . $_POST[$item];
- $dbh->query($sql);
- }
- if ($default['debug_capture'] == 'on') {
- debug_capture($_SESSION['eid'], $PO_ID, 'debug', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
- }
- }
-
- /* ----- Update CER numbers and Credit Card ----- */
- $dbh->query("UPDATE PO SET cer='" . $_POST['cer'] . "',
- creditcard='" . $_POST['creditcard'] . "'
- WHERE id=" . $_POST['type_id']);
- }
- /* -------------------------------------------------------------
- * ------------- END FINANCE PROCESSING -------------------
- * -------------------------------------------------------------
- */
-
-
-
- /* -------------------------------------------------------------
- * ------------- START UPDATE PROCESSING -----------------------
- * -------------------------------------------------------------
- */
- if ($_POST['stage'] == "update") {
- /* -------------------------------------------------------------
- * ---------- START REQUESTER PROCESSING -----------------------
- * -------------------------------------------------------------
- */
- if ($_POST['auth'] == "req") {
- /* ---------------- START CANCEL PURCHASE ORDER -------------- */
- if ($_POST['cancel'] == 'yes') {
- setRequestStatus($_POST['type_id'], 'C'); // Update PO status
-
- header("location: list.php?action=my&access=0");
- exit();
- }
- /* --------- END CANCEL PURCHASE ORDER ----------------------- */
- /* ---------------- START COPY PURCHASE ORDER ---------------- */
- // if (array_key_exists('copyrequest_x',$_POST)) {
- // /* Getting PO information */
- // $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
- // FROM PO
- // WHERE id = ?",array($_POST['type_id']));
- //
- // /* -- Read $PO into $_SESSION -- */
- // foreach ($PO as $key => $value) {
- // $_SESSION[$key] = $value;
- // }
- //
- // header("location: information.php");
- // exit();
- // }
- /* --------- END COPY PURCHASE ORDER ----------------------- */
-
- /* ---------------- START RESEND PURCHASE ORDER ---------------- */
- if (array_key_exists('restorerequest_x',$_POST)) {
- setRequestStatus($_POST['type_id'], 'N'); // Update PO status
-
- header("location: router.php?type_id=" . $_POST['type_id'] . "&approval=app0"); // Forward to router as new Request
- exit();
- }
- /* --------- END RESEND PURCHASE ORDER ----------------------- */
- }
- /* -------------------------------------------------------------
- * ---------- END REQUESTER PROCESSING -----------------------
- * -------------------------------------------------------------
- */
- /* -------------------------------------------------------------
- * ---------- START APP1 and APP2 APPROVAL PROCESSING ----------
- * -------------------------------------------------------------
- */
- if (substr($_POST['auth'],0,3) == 'app' OR $_POST['auth'] == 'controller') {
- if (array_key_exists('yes_x', $_POST)) { $yn = "yes"; } // Set approval button pressed
- if (array_key_exists('no_x', $_POST)) { $yn = "no"; } // Set approval button pressed
- /* ---------------- Check to see if a Comment was provided ---------------- */
- if (empty($_POST['Com']) AND $yn == 'no') {
- $_SESSION['error'] = "A denied Requisition requires you to enter a Comment.";
- $_SESSION['redirect'] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
-
- header("location: ../error.php");
- exit();
- }
-
- /* ---------------- Change status for non approved request ---------------- */
- if ($yn == 'no') {
- setRequestStatus($_POST['type_id'], 'X'); // Update PO status
- }
-
- /* ---------------- Update the approvals for the PO ---------------- */
- $dbh->query("UPDATE Authorization
- SET ".$_POST['auth']."yn='" . $yn . "',
- ".$_POST['auth']."Date=NOW(),
- ".$_POST['auth']."Com='" . htmlentities($_POST['Com'], ENT_QUOTES, 'UTF-8') . "'
- WHERE id = ".$_POST['auth_id']);
-
- if ($_POST['auth'] == 'controller') {
- $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=app0"; // Forward to Approver 1
- } else {
- $forward = "router.php?type_id=" . $_POST['type_id'] . "&approval=" . $_POST['auth'] . "&yn=" . $yn; // Record Controllers Approval
- }
-
- header("Location: ".$forward);
- exit();
- }
- /* -------------------------------------------------------------
- * ---------- END APP1 and APP2 APPROVAL PROCESSING ----------
- * -------------------------------------------------------------
- */
- }
- /* -------------------------------------------------------------
- * ------------- END UPDATE PROCESSING -----------------------
- * -------------------------------------------------------------
- */
- /* -------------------------------------------------------------
- * ------------- START PURCHASING PROCESSING -------------------
- * -------------------------------------------------------------
- */
- if ($_POST['action'] == 'purchasing_update') {
- /* ------------- Adding supplier contact information ------------- */
- if (array_key_exists('addContact_x',$_POST)) {
- $sql = "INSERT INTO Contacts VALUES (NULL,
- '" . $_POST['id'] . "',
- '" . $_SESSION['eid'] . "',
- NOW(),
- '" . $_POST['cc_name'] . "',
- '" . $_POST['cc_phone'] . "',
- '" . $_POST['cc_ext'] . "',
- '" . $_POST['cc_email'] . "'
- )";
- $dbh->query($sql);
- header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
- exit();
- }
-
- /* ------------- Adding payment information ------------- */
- if (array_key_exists('addPayment_x',$_POST)) {
- $sql = "INSERT INTO Payments VALUES (NULL,
- '" . $_POST['id'] . "',
- '" . $_SESSION['eid'] . "',
- NOW(),
- '" . mysql_real_escape_string($_POST['pay_amount']) . "',
- '" . mysql_real_escape_string($_POST['paymentDate']) . "',
- '0')";
- $dbh->query($sql);
- header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
- exit();
- }
-
- /* ------------- Update payment information ------------- */
- if (array_key_exists('updatePayments_x',$_POST)) {
- for ($i=1; $i <= $_POST['payments_count']; $i++) {
- $pay_id = "pay_id" . $i;
- $pay_amount = "pay_amount" . $i;
- $pay_date = "pay_date" . $i;
- $pay_remove = "pay_remove" . $i;
- $pay_status = ($_POST[$pay_remove] == 'yes') ? 1 : 0;
-
- $sql = "UPDATE Payments SET pay_eid = '" . $_SESSION['eid'] . "',
- pay_recorded = NOW(),
- pay_amount = '" . mysql_real_escape_string($_POST[$pay_amount]) . "',
- pay_date = '" . mysql_real_escape_string($_POST[$pay_date]) . "',
- pay_status = '" . $pay_status . "'
- WHERE pay_id = " . $_POST[$pay_id];
- $dbh->query($sql);
- }
-
- header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
- exit();
- }
-
- /* ------------- Purchaser marks Request as Complete ------------- */
- if (array_key_exists('completed_x',$_POST)) {
- /* Record Purchasing agent */
- $auth_sql = "UPDATE Authorization SET issuer='" . $_SESSION['eid'] . "',
- issuerDate=NOW(),
- level='O'
- WHERE id = " . $_POST['auth_id'];
- $dbh->query($auth_sql);
- /* Update Request Status */
- $po_sql = "UPDATE PO SET po='" . $_POST['po'] . "',
- status='O'
- WHERE id = " . $_POST['id'];
- $dbh->query($po_sql);
-
- sendCompleted($_POST['req'],$_POST['id'],htmlspecialchars($_POST['purpose']),$_POST['po'], $_SESSION['eid']); // Send email to Requester
- //sendVendor($_POST['id']);
-
- header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
- exit();
- }
-
- /* ------------- Add Vendor and change Terms when Purchasing changes Vendor ------------- */
- if (strlen($_POST['vendSearch']) > 0) {
- $supplier2 = "sup2='" . $_POST['supplierNew'] . "',";
- $supplier2 .= "terms='" . $_POST['supplierNewTerms'] . "',";
- } else {
- $supplier2 = "terms='".$_POST['terms']."',";
- }
-
- /* ------------- Creating update fields ------------- */
- $PO = "fob='".$_POST['fob']."',
- via='".$_POST['via']."',
- purchaseUpdate=NOW(),
- reqType='".$_POST['reqtype']."',
- $supplier2
- private='".$_POST['private']."',
- hot='".$_POST['hot']."'
- ";
- $sql = "UPDATE PO SET $PO WHERE id = ".$_POST['id'];
- $dbh->query($sql);
- History($_SESSION['eid'], 'update', $_SERVER['PHP_SELF'], addslashes(htmlentities($sql))); // Record transaction for history
- header("location: " . $_SERVER['PHP_SELF'] . "?id=" . $_POST['id']);
- exit();
- }
- /* -------------------------------------------------------------
- * ------------- END PURCHASING PROCESSING -------------------
- * -------------------------------------------------------------
- */
- /* -------------------------------------------------------------
- * ------------- START DATABASE CONNECTIONS -------------------
- * -------------------------------------------------------------
- */
- /* ------------- Getting PO information ------------- */
- $PO = $dbh->getRow("SELECT *, DATE_FORMAT(reqDate,'%M %e, %Y') AS _reqDate
- FROM PO
- WHERE id = ?",array($_GET['id']));
- /* ------------- Getting Authoriztions for above PO ------------- */
- $AUTH = $dbh->getRow("SELECT * FROM Authorization WHERE type_id = ? and type = 'PO'",array($PO['id']));
- /* ------------- Get Employee names from Standards database ------------- */
- $EMPLOYEES = $dbh->getAssoc("SELECT eid, CONCAT(fst,' ',lst) AS name
- FROM Standards.Employees");
- /* ------------- Getting Vendor information from Standards ------------- */
- $VENDOR = $dbh->getAssoc("SELECT BTVEND, BTNAME FROM Standards.Vendor");
- /* ------------- Getting Company information from Standards ------------- */
- //$COMPANY = $dbh->getAssoc("SELECT id, name FROM Standards.Companies");
- /* ------------- Getting Plant information from Standards ------------- */
- $plant_sql = "SELECT id, name FROM Standards.Plants WHERE status = '0'";
- $PLANTS = $dbh->getAssoc($plant_sql);
- $plant_query = $dbh->prepare($plant_sql);
- $PLANT = $dbh->getRow("SELECT * FROM Standards.Plants WHERE id=" . $PO['plant']);
- /* ------------- Getting Department information from Standards ------------- */
- $dept_sql = "SELECT id, CONCAT('(',id,') ',name) AS fullname FROM Standards.Department WHERE status='0' ORDER BY name";
- $DEPARTMENT = $dbh->getAssoc($dept_sql);
- $dept_query = $dbh->prepare($dept_sql);
- /* ------------- Getting Category information from Standards ------------- */
- $COA = $dbh->getAssoc("SELECT CONCAT(coa_account,'-',coa_suffix) AS id, coa_description AS name
- FROM Standards.COA
- WHERE coa_plant=" . $PLANT['conbr']);
- /* ------------- Getting CER numbers from CER ------------- */
- $cer_sql = "SELECT id, cer FROM CER WHERE cer IS NOT NULL ORDER BY cer+0";
- $CER = $dbh->getAssoc($cer_sql);
- $cer_query = $dbh->prepare($cer_sql);
- /* ------------- Getting Vendor terms from Standards ------------- */
- $terms_sql = "SELECT terms_id AS id, terms_name AS name FROM Standards.VendorTerms ORDER BY name";
- $TERMS = $dbh->getAssoc($terms_sql);
- $terms_query = $dbh->prepare($terms_sql);
- /* ------------- Get items related to this Request -------------*/
- $items_sql = "SELECT * FROM Items WHERE type_id = ".$PO['id'];
- $items_query = $dbh->prepare($items_sql);
- $items_sth = $dbh->execute($items_query);
- $items_count = $items_sth->numRows();
- /* ------------- Get Purchase Request users ------------- */
- $purchaser_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
- FROM Users U
- INNER JOIN Standards.Employees E ON U.eid = E.eid
- WHERE U.role = 'purchasing'
- AND E.status = '0'
- AND U.eid <> '08745'
- ORDER BY E.lst ASC");
- /* ------------- Get Purchase Request users ------------- */
- $financer_sql = $dbh->prepare("SELECT U.eid, E.fst, E.lst, E.email
- FROM Users U
- INNER JOIN Standards.Employees E ON U.eid = E.eid
- WHERE U.role = 'financing'
- AND E.status = '0'
- AND U.eid <> '08745'
- ORDER BY E.lst ASC");
- /* ------------- Get Vendor Payments ------------- */
- $payments = $dbh->query("SELECT * FROM Payments WHERE request_id=" . $PO['id'] . " AND pay_status='0' ORDER BY pay_date ASC");
- $payments_count = $payments->numRows();
- /* ------------- Get Contact Information ------------- */
- $contacts = $dbh->query("SELECT * FROM Contacts WHERE request_id=" . $PO['id'] . " ORDER BY id DESC");
- $contacts_count = $contacts->numRows();
- /* ------------- Getting Comments Information ------------- */
- $post_sql = "SELECT * FROM Postings
- WHERE request_id = ".$_GET['id']."
- AND type = 'global'
- ORDER BY posted DESC";
- $LAST_POST = $dbh->getRow($post_sql); // Get the last posted comment
- $post_query = $dbh->prepare($post_sql);
- $post_sth = $dbh->execute($post_query);
- $post_count = $post_sth->numRows();
- /* -------------------------------------------------------------
- * ------------- END DATABASE CONNECTIONS -------------------
- * -------------------------------------------------------------
- */
- /* -------------------------------------------------------------
- * ------------- START VARIABLES -------------------------------
- * -------------------------------------------------------------
- */
- /* ------------- Check current level and current user ------------- */
- if (array_key_exists('approval', $_GET)) {
- if ($_GET['approval'] == $AUTH['level'] AND $AUTH[$_GET['approval']] == $_SESSION['eid']) {
- $_GET['approval'] = $_GET['approval'];
- } elseif ($_GET['approval'] != $AUTH['level']) {
- $message="Requisition is currently not at your approval level.";
- unset($_GET['approval']);
- } elseif ($PO['status'] != 'N') {
- switch ($PO['status']) {
- case 'C': $message="Requisition has been marked Canceled."; break;
- case 'X': $message="Requisition has been marked Not Approved."; break;
- case 'A': $message="Requisition has been already Approved."; break;
- case 'O': $message="Requisition has been Kicked off to the Vendor."; break;
- }
- unset($_GET['approval']);
- }
- }
- /* ------------- Set message for Message Center ------------- */
- switch ($_GET['approval']) {
- // case 'controller': $message="Finance can edit the Finance area and fields highlighted in <span style=\"color:#009900;\">GREEN</span>."; break;
- }
- $highlight='class="highlight"'; // Highlighted style sheet class
- /* ------------- Set items display mode ------------- */
- if ($_GET['approval'] == 'controller') {
- $displayItem = "display"; // Display Items detail
- } else {
- $displayItem = "none"; // Don't display Items detail
- }
- /* -------------------------------------------------------------
- * ------------- END VARIABLES -------------------------------
- * -------------------------------------------------------------
- */
- /**
- * - Display attachments from V3
- */
- include_once('attachment.php');
- /* ------------- Setup onLoad javascript program ------------- */
- if ($default['pageloading'] == 'on') {
- $ONLOAD_OPTIONS="pageloading();";
- }
- $ONLOAD_OPTIONS.="function() {
- new Effect.Pulsate('hotMessage', {delay:2, duration:5});
- new Effect.Shake('messageCenter', {delay:8});
- }";
- if (isset($ONLOAD_OPTIONS)) { $ONLOAD="onLoad=\"$ONLOAD_OPTIONS\""; }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html><!-- InstanceBegin template="/Templates/vnmain.dwt.php" codeOutsideHTMLIsLocked="false" -->
- <head>
- <!-- InstanceBeginEditable name="doctitle" -->
- <title><?= $default['title1']; ?></title>
- <!-- InstanceEndEditable -->
- <meta http-equiv="imagetoolbar" content="no">
- <meta name="copyright" content="2004 Your Company" />
- <meta name="author" content="Thomas LeZotte" />
- <link type="text/css" href="/Common/Print.css" rel="stylesheet" media="print">
- <link type="text/css" href="../default.css" charset="UTF-8" rel="stylesheet">
- <?php if ($default['rss'] == 'on') { ?>
- <link rel="alternate" type="application/rss+xml" title="Purchase Requisition Announcements" href="<?= $default['URL_HOME']; ?>/PO/<?= $default['rss_file']; ?>">
- <link rel="alternate" type="application/rss+xml" title="Capital Acquisition Announcements" href="<?= $default['URL_HOME']; ?>/CER/<?= $default['rss_file']; ?>">
- <?php } ?>
- <script type="text/javascript" src="/Common/js/overlibmws.js"></script>
- <!-- InstanceBeginEditable name="head" -->
- <script type="text/javascript" src="/Common/js/yahoo/yahoo/yahoo.js"></script>
- <script type="text/javascript" src="/Common/js/yahoo/event/event.js" ></script>
- <script type="text/javascript" src="/Common/js/yahoo/dom/dom.js" ></script>
- <script type="text/javascript" src="/Common/js/yahoo/animation/animation.js" ></script>
- <script type="text/javascript" src="/Common/js/yahoo/connection/connection.js" ></script>
- <script type="text/javascript" src="/Common/js/yahoo/container/container.js"></script>
- <link type="text/css" rel="stylesheet" href="/Common/js/yahoo/container/assets/container.css">
-
- <script type="text/javascript" src="/Common/js/pointers.js"></script>
-
- <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/overlibmws_exclusive.js"></SCRIPT>
- <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/overlibmws_draggable.js"></SCRIPT>
- <SCRIPT type="text/javascript" SRC="/Common/js/overlibmws/calendarmws.js"></SCRIPT>
-
- <script type="text/javascript" src="/Common/js/prototype/prototype.js"></script>
- <script type="text/javascript" src="/Common/js/scriptaculous/scriptaculous.js?load=effects"></script>
- <script type="text/javascript" src="/Common/js/autoassist/autoassist.js"></script>
- <link href="/Common/js/autoassist/autoassist.css" rel="stylesheet" type="text/css">
-
- <script type="text/javascript" src="/Common/js/greybox5/options1.js"></script>
- <script type="text/javascript" src="/Common/js/greybox5/AJS.js"></script>
- <script type="text/javascript" src="/Common/js/greybox5/AJS_fx.js"></script>
- <script type="text/javascript" src="/Common/js/greybox5/gb_scripts.js"></script>
- <link type="text/css" href="/Common/js/greybox5/gb_styles.css" rel="stylesheet" media="all">
- <script language="javascript">
- function toggleItemDisplay(id) {
- $R(1, <?= $items_count+1; ?>, true).each(function(s) {
- $('itemDetails' + s).toggle();
- });
- }
- </script>
-
- <script>
- YAHOO.namespace("example.container");
- function init() {
-
- // Define various event handlers for Dialog
- var handleYes = function() {
- document.Form.submit();
- this.hide();
- };
- var handleNo = function() {
- this.hide();
- };
- // Instantiate the Dialog
- YAHOO.example.container.simpledialog1 = new YAHOO.widget.SimpleDialog("simpledialog1",
- { width: "325px",
- fixedcenter: true,
- visible: false,
- draggable: false,
- modal: true,
- close: true,
- text: "Do you want to change, this may change the Financial Controller?",
- icon: YAHOO.widget.SimpleDialog.ICON_WARN,
- constraintoviewport: true,
- buttons: [ { text:"Yes", handler:handleYes },
- { text:"No", handler:handleNo, isDefault:true } ]
- } );
- YAHOO.example.container.simpledialog1.setHeader("Are you sure?");
-
- // Render the Dialog
- YAHOO.example.container.simpledialog1.render(document.body);
- YAHOO.util.Event.addListener("plant", "change", YAHOO.example.container.simpledialog1.show, YAHOO.example.container.simpledialog1, true);
- <?php
- /* ----- Only display department change dialog for HQ(9) ----- */
- if ($PO['plant'] == '9') {
- ?>
- YAHOO.util.Event.addListener("department", "change", YAHOO.example.container.simpledialog1.show, YAHOO.example.container.simpledialog1, true);
- <?php } ?>
- }
- YAHOO.util.Event.addListener(window, "load", init);
- </script>
-
- <script type="text/javascript" src="../js/dynamicInputItems.js"></script>
- <link rel="stylesheet" type="text/css" href="<?= $default['URL_HOME']; ?>/style/dd_tabs.css" />
- <style type="text/css">
- form.inplaceeditor-form a {
- color:#FFFFFF;
- }
- </style>
- <!-- InstanceEndEditable -->
- <?php if ($ONLOAD_OPTIONS) { ?>
- <script language="javascript">
- AJS.AEV(window, "load", <?= $ONLOAD_OPTIONS; ?>);
- </script>
- <?php } ?>
- </head>
- <body class="yui-skin-sam">
- <img src="/Common/images/CompanyPrint.gif" alt="Your Company" width="437" height="61" id="Print" />
- <div id="noPrint">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
- <tbody>
- <tr>
- <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>
- <td align="right" valign="top">
- <!-- InstanceBeginEditable name="topRightMenu" --><!-- #BeginLibraryItem "/Library/help.lbi" --><table cellspacing="0" cellpadding="0" summary="" border="0">
- <tr>
- <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>
- <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>
- <td class="DarkHeaderSubSub"> <a href="../Help/index.php" rel="gb_page_fs[]" class="dark">Help</a></td>
- </tr>
- </table>
- <!-- #EndLibraryItem --><!-- InstanceEndEditable --></td>
- </tr>
- <tr>
- <td valign="bottom" align="right" colspan="2"><!-- InstanceBeginEditable name="rightMenu" -->
- <?php include('../include/menu/main_right.php'); ?>
- <!-- InstanceEndEditable --></td>
- <td>
- </td>
- </tr>
- <tr>
- <td width="100%" colspan="3"><table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
- <tbody>
- <tr>
- <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghtl.gif" width="4"></td>
- <td colspan="4"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ght.gif" border="0">
- <tbody>
- <tr>
- <td height="4"></td>
- </tr>
- </tbody>
- </table></td>
- <td class="BGColorDark" valign="top" rowspan="2"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ght.gif" border="0">
- <tbody>
- <tr>
- <td height="4"></td>
- </tr>
- </tbody>
- </table></td>
- <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghtr.gif" width="4"></td>
- </tr>
- <tr>
- <td class="BGGrayLight" rowspan="3"></td>
- <td class="BGGrayMedium" rowspan="3"></td>
- <td class="BGGrayDark" rowspan="3"></td>
- <td class="BGColorDark" rowspan="3"></td>
- <td class="BGColorDark" rowspan="3"><!-- InstanceBeginEditable name="leftMenu" --><?php include('../include/menu/main_left.php'); ?><!-- InstanceEndEditable --></td>
- <td class="BGColorDark" rowspan="3"></td>
- <td class="BGColorDark" rowspan="2"></td>
- <td class="BGColorDark" rowspan="2"></td>
- <td class="BGColorDark" rowspan="2"></td>
- <td class="BGGrayDark" rowspan="2"></td>
- <td class="BGGrayMedium" rowspan="2"></td>
- <td class="BGGrayLight" rowspan="2"></td>
- </tr>
- <tr>
- <td class="BGColorDark" width="100%"><?php
- if (isset($_SESSION['username'])) {
- ?>
- <div align="right" class="FieldNumberDisabled"> </div>
- <?php
- } else {
- echo " ";
- }
- ?>
- </td>
- </tr>
- <tr>
- <td valign="top"><img height="20" alt="" src="../images/c-ghct.gif" width="25"></td>
- <td valign="top" colspan="2"><table cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ghb.gif" border="0">
- <tbody>
- <tr>
- <td height="4"></td>
- </tr>
- </tbody>
- </table></td>
- <td valign="top" colspan="4"><img height="20" alt="" src="../images/c-ghbr.gif" width="4"></td>
- </tr>
- <tr>
- <td width="4" colspan="4" height="4"><img height="4" alt="" src="../images/c-ghbl.gif" width="4"></td>
- <td><table height="4" cellspacing="0" cellpadding="0" width="100%" summary="" background="../images/c-ghb.gif" border="0">
- <tbody>
- <tr>
- <td></td>
- </tr>
- </tbody>
- </table></td>
- <td><img height="4" alt="" src="../images/c-ghcb.gif" width="3"></td>
- <td colspan="7"></td>
- </tr>
- </tbody>
- </table></td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- InstanceBeginEditable name="main" -->
- <?php
- if ($_SESSION['request_access'] == '3') {
- echo "<img src=\"/Common/images/adminAction.gif\" onClick=\"new Effect.toggle('adminPanel', 'slide')\">";
- echo " <img src=\"/Common/images/adminSQLAction.gif\" onClick=\"new Effect.toggle('debugPanel', 'slide')\">";
-
- include('../Administration/include/detail_tmp.php');
- include('../Administration/include/sql_debug.php');
- }
- ?>
- <table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
- <tbody>
- <tr>
- <td height="2"></td>
- </tr>
- <tr>
- <td><table cellspacing="0" cellpadding="0" width="100%" summary="" border="0">
- <tbody>
- <tr>
- <td align="center">
- <div id="hotMessage" style="width: 700px;display:<?= ($PO['hot'] == 'yes') ? display : none; ?>" onMouseOver="new Effect.Pulsate(this);">This Requisition has been tagged HOT!!</div>
- <div id="messageCenter" style="width: 700px;display:<?= (isset($message)) ? display : none; ?>"><?= $message; ?></div>
- <form action="<?= $_SERVER['PHP_SELF']; ?>" method="POST" name="Form" id="Form" runat="vdaemon">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td></td>
- <td height="26" valign="bottom">
- <table border="0" align="right" cellpadding="0" cellspacing="0">
- <tr>
- <?php if ($_SESSION['eid'] == $PO['req'] and ! empty($PO['po'])) { ?>
- <td><div id="ddcolortabs">
- <ul>
- <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 Request</span></a></li>
- </ul>
- </div></td>
- <td>
- <div id="ddcolortabs">
- <ul>
- <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 Slip</span></a></li>
- </ul>
- </div></td>
- <?php } ?>
- <td><div id="ddcolortabs">
- <ul>
- <li id="inactive"><a href="javascript: window.print();" <?php help('', 'Click here to print this Request', 'default'); ?>><span>Print Requisition</span></a></li>
- </ul>
- </div></td>
- <td> </td>
- </tr>
- </table></td>
- </tr>
- <tr class="BGAccentVeryDark">
- <td width="50%" height="30" nowrap class="DarkHeaderSubSub"> Purchase Order Requisition...</td>
- <td width="50%"></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td class="BGAccentVeryDarkBorder"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td valign="top" class="BGAccentDarkBorder"><table width="100%" border="0">
- <tr>
- <td height="25" colspan="4" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><img src="../images/info.png" width="16" height="16" align="texttop"><strong> Information</strong></td>
- <td><div align="right" class="mainsection">Status: <strong><?= reqStatus($PO['status']); ?></strong>
- <input type="hidden" name="status" value="<?= $PO['status']; ?>">
- </div></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td nowrap>Requisition Number:</td>
- <td class="label"><?= $_GET['id']; ?></td>
- <td nowrap> </td>
- <td> </td>
- </tr>
- <tr>
- <td width="12%" nowrap>Purchase Order Number:</td>
- <td width="45%" class="label"><?= ($PO['creditcard'] == 'yes') ? "Credit Card" : $PO['po']; ?></td>
- <td width="13%" nowrap><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td nowrap>CER Number:</td>
- <td width="35" align="right"><a href="cer_list.php" rel="gb_page_center[700, 600]" <?php help('', 'Click here to get a list of approved Capital Acquisition Requests', 'default'); ?>><img src="../images/detail.gif" width="18" height="20" border="0" align="absmiddle"></a></td>
- </tr>
- </table></td>
- <td width="26%"><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="label"><a href="../CER/detail.php?id=<?= $PO['cer']; ?>" class="dark" rel="gb_page_fs[]"><?= $CER[$PO['cer']]; ?></a></td>
- <td><?php if (!empty($PO['cer'])) { ?>
- <a href="<?= $default['URL_HOME']; ?>/CER/print.php?id=<?= $PO['cer']; ?>" <?php help('', 'Click here to print this Capital Acquisition Request', 'default'); ?>><img src="../images/printer.gif" border="0" align="absmiddle"></a>
- <?php } ?></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td>Requisitioner:</td>
- <td class="label"><?= caps($EMPLOYEES[$PO['req']]); ?></td>
- <td nowrap>Requisition Date:</td>
- <td class="label"><?= $PO['_reqDate']; ?></td>
- </tr>
- <?php if (!empty($PO['incareof']) AND $PO['req'] != $PO['incareof']) { ?>
- <tr>
- <td><img src="/Common/images/menupointer2.gif" width="4" height="7" align="absmiddle"> In Care Of:</td>
- <td class="label"><?= caps($EMPLOYEES[$PO['incareof']]); ?></td>
- <td> </td>
- <td> </td>
- </tr>
- <?php } ?>
- <tr>
- <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
- </tr>
- <?php if (strlen($PO['sup2']) == 6) { ?>
- <tr>
- <td nowrap>Final Vendor: </td>
- <td nowrap class="label"><?= caps($VENDOR[$PO['sup2']]) . " (" . strtoupper($PO['sup2']) . ")"; ?><?php
- /* Getting suppliers from Suppliers */
- $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
- FROM Standards.Vendor
- WHERE BTVEND = '".$PO['sup2']."'");
- ?><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[]"> <img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle"></a><?php if (!empty($SUPPLIER['web'])) { ?> <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 } ?><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> <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>
- <td>Kickoff Date:</td>
- <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>
- </tr>
- <?php } ?>
- <tr>
- <td nowrap><?= (empty($PO['po'])) ? Recommended : Final; ?> Vendor:</td>
- <td nowrap class="label"><?= caps($VENDOR[$PO['sup']]) . " (" . strtoupper($PO['sup']) . ")"; ?><?php
- /* Getting suppliers from Suppliers */
- $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
- FROM Standards.Vendor
- WHERE BTVEND = '".$PO['sup']."'");
- ?><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[]"> <img src="/Common/images/map.gif" width="20" height="20" border="0" align="absmiddle"></a><?php if (!empty($SUPPLIER['web'])) { ?> <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 } ?><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> <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>
- <?php if (strlen($PO['sup2']) != 6 AND !empty($PO['po'])) { ?>
- <td>Kickoff Date:</td>
- <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>
- <?php } else { ?>
- <td> </td>
- <td> </td>
- <?php } ?>
- </tr>
- <!-- <tr>
- <td>Company:</td>
- <td class="label"><?= caps($COMPANY[$PO[company]]); ?></td>
- <td nowrap> </td>
- <td> </td>
- </tr>-->
- <tr>
- <td>Bill to Plant: </td>
- <td class="label"><?= caps($PLANTS[$PO['plant']]); ?><input type="hidden" name="currentPlant" id="currentPlant" value="<?= $PO['plant']; ?>"></td>
- <td>Deliver to Plant: </td>
- <td class="label"><?= caps($PLANTS[$PO['ship']]); ?></td>
- </tr>
- <tr>
- <td>Department:</td>
- <td class="label"><?= caps($DEPARTMENT[$PO['department']]); ?><input type="hidden" name="currentDepartment" id="currentDepartment" value="<?= $PO['department']; ?>"></td>
- <td>Job Number: </td>
- <td class="label"><?= $PO['job']; ?></td>
- </tr>
- <tr>
- <td height="5" colspan="4"><img src="../images/spacer.gif" width="5" height="5"></td>
- </tr>
- <tr>
- <td valign="top" nowrap>Purpose / Usage:</td>
- <td colspan="3" class="label"><?= caps(stripslashes($PO['purpose'])); ?></td>
- </tr>
- </table></td>
- </tr>
- <!--
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td class="BGAccentDarkBorder"><table width="100%" border="0">
- <tr>
- <td width="100%" height="25" colspan="6" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td> <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"> Track Shipments </strong></a></td>
- <td width="120"> </td>
- </tr>
- </table></td>
- </tr>
- <td> </td>
- </table>
- </td>
- </tr>
- -->
- <tr>
- <td> </td>
- </tr>
- <tr><td class="BGAccentDarkBorder"><table width="100%" border="0">
- <tr>
- <td height="25" class="BGAccentDark"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td> <a href="javascript:void(0);" onClick="new Effect.toggle('itemsContainer','blind')" class="black" <?php help('', 'Show or Hide the Item Information', 'default'); ?>><strong><img src="../images/text.gif" width="16" height="16" border="0" align="texttop"> Item Information</strong></a></td>
- <td width="120"><a href="javascript:toggleItemDisplay('itemsContainer');" class="viewcomments">View All Details </a></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td>
- <div id="itemsContainer">
- <table width="100%" border="0">
- <tr>
- <td width="35" class="HeaderAccentDark"> </td>
- <td width="35" class="HeaderAccentDark">Unit</td>
- <td width="80" nowrap class="HeaderAccentDark">Company# </td>
- <td width="60" nowrap class="HeaderAccentDark">Manuf# </td>
- <td class="HeaderAccentDark">Item Description</td>
- <td width="80" nowrap class="HeaderAccentDark">Price</td>
- </tr>
- <?php
- while($items_sth->fetchInto($ITEMS)) {
- $count_items++;
- $row_color = ($count_items % 2) ? FFFFFF : DFDFBF;
- ?>
- <!-- Start of Item<?= $count_items; ?> -->
- <tr <?php pointer($row_color); ?>>
- <td width="50" bgcolor="#<?= $row_color; ?>" class="label"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <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">
- <input name="item<?= $count_items; ?>" type="hidden" id="item<?= $count_items; ?>" value="<?= $ITEMS['id']; ?>">
- </a></td>
- <td><strong><?= $ITEMS['qty']; ?></strong></td>
- </tr>
- </table></td>
- <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper($ITEMS['unit']); ?></td>
- <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['part'])); ?></td>
- <td class="label" bgcolor="#<?= $row_color; ?>"><?= strtoupper(stripslashes($ITEMS['manuf'])); ?></td>
- <td nowrap bgcolor="#<?= $row_color; ?>" class="label">
- <?php
- if (strlen($ITEMS['descr']) > 50) {
- echo caps(substr(stripslashes($ITEMS['descr']), 0, 50));
- echo "...<a href=\"javascript:void(0);\" class=black onmouseover=\"return overlib('" . caps(stripslashes($ITEMS['descr'])) . "', TEXTPADDING, 10, WIDTH, 300, WRAPMAX, 300, AUTOSTATUS, BGCOLOR, '#000000', CGCOLOR, '#E68B2C', FGCOLOR, '#B0D585');\" onmouseout=\"nd();\"><img src=\"../images/bubble.gif\" width=14 height=17 border=0 align=absmiddle></a>";
- } else {
- echo caps(stripslashes($ITEMS['descr']));
- }
- ?></td>
- <td bgcolor="#<?= $row_color; ?>" class="label"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><strong>$</strong></td>
- <td align="right"><strong><?php $d=(substr($ITEMS['price'], -2, 2) == '00') ? 2 : 4; echo number_format($ITEMS['price'],$d); ?><?= ($d == 2) ? "<img src=\"/Common/images/spacer.gif\" width=\"18\" height=\"5\">" : ''; ?></strong></td>
- </tr>
- </table></td>
- …
Large files files are truncated, but you can click here to view the full file