Receipt Slip
- Author: Ken Herold
- Additional author(s):
- Institution:
- Year: 2008
- License: BSD style
- Short description: Use, modification and distribution of the code are permitted provided the copyright notice, list of conditions and disclaimer appear in all related material.
- Link to terms: Detailed license terms
- Skill required for using this code:
Choose one of the following: basic, intermediate, technical. Please also add your choice as a tag at the bottom of the page.
Description
Workslip page for printing and routing received item to requestor.
State
Stable
Installation instructions
PHP 5.2.0 using oci8 for Oracle 9.2.0 and Apache 2.0.59
<Code sample> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="GET"> Enter Purchase Order Number: <input type="text" name="orderno" /> <br /> <input type="submit" name="Get workslip" /> </form> <? } else { // This include file contains the logon username, password, and database name require('../db-include.inc'); // Connect to the database by passing logon information $iDBConn = OCIpLogon(DB_USER, DB_PASS, DB_NAME); // Define your query in SQL $query = " SELECT DISTINCT bib_text.bib_id, line_item.requestor, bib_text.author, bib_text.title, bib_text.edition, bib_text.series, bib_text.publisher, bib_text.publisher_date, line_item.line_item_id, line_item_copy_status.line_item_id, line_item_copy_status.copy_id, line_item_funds.copy_id, line_item_funds.fund_id, fund.fund_id, location.location_id, fund.fund_name, location.location_display_name, line_item_copy_status.location_id, purchase_order.po_id, line_item.po_id, purchase_order.po_number FROM bib_text, line_item, line_item_copy_status, line_item_funds, fund, location, purchase_order WHERE bib_text.bib_id = line_item.bib_id AND fund.ledger_id = '<your ledger_id here>' AND line_item.line_item_id = line_item_copy_status.line_item_id AND line_item_copy_status.copy_id = line_item_funds.copy_id AND line_item_funds.fund_id = fund.fund_id AND line_item_copy_status.location_id = location.location_id AND line_item.po_id = purchase_order.po_id AND purchase_order.po_number = '$entry' "; // Get a statement identifier from the database using OCIParse $iStatement = @OCIParse($iDBConn, $query); // Verify that the SQL statement is valid $arrError = OCIError($iStatement); if ($arrError['code']) { print $arrError['message']; OCIRollback($iDBConn); exit; } // Run the query on the database @OCIExecute($iStatement, OCI_DEFAULT); // Display the select statement // echo "Select statement = $query<br><br>"; ?> <table align=center width=80%> <? // Loop throught the results $line=1; while (OCIFetchInto($iStatement, &$array1, OCI_ASSOC+OCI_RETURN_NULLS)) { ?> <tr><td> Bib-ID: <?= $array1['BIB_ID'] ?></td> <td> PO# <b><?= $array1['PO_NUMBER'] ?></b></td> </tr><tr><td> Location: <?= $array1['LOCATION_DISPLAY_NAME'] ?></td> <td> Req: <?= $array1['REQUESTOR'] ?></td> </tr><tr><td> Fund: <?= $array1['FUND_NAME'] ?></td></tr> <tr><td> Author: <?= $array1['AUTHOR'] ?></td></tr> <tr><td rowspan=2> Title: <?= $array1['TITLE'] ?></td></tr> <tr><td rowspan=1> Edition: <?= $array1['EDITION'] ?></td></tr> <tr><td> Series: <?= $array1['SERIES'] ?></td></tr> <tr><td> Publisher: <?= $array1['PUBLISHER'] ?></td></tr> <tr><td> Pub Date: <?= $array1['PUBLISHER_DATE'] ?></td></tr> <? $BIB = $array1['BIB_ID'] ; $line++; } ?> <tr><td> <? // Section to retrieve OCLC number string from custom perl script deleted ?> </td></tr></table> <? if ($line>=4){echo "<br>";} else { if ($line>=3){echo "<br><br><br><br><br><br><br><br><br><br><br><br>";} else { if ($line>=2){echo "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";} } ?> <HR> <table align=center width=80%> <tr><td> <b>To: <?= $array1['REQUESTOR'] ?></b></td><br></tr><tr><td> Location: <?= $array1['LOCATION_DISPLAY_NAME'] ?></td></tr><tr><td> <? if ($array1['AUTHOR'] <> ''){ ?> Author: <?= $array1['AUTHOR'] ?></td></tr><tr><td> <? } else { } ?> Title: <?= $array1['TITLE'] ?></td></tr><tr><td> <? if ($array1['EDITION'] <> ''){ ?> Edition: <?= $array1['EDITION'] ?></td></tr><tr><td> <? } else { } ?> <? if ($array1['SERIES'] <> ''){ ?> Series: <?= $array1['SERIES'] ?></td></tr><tr><td> <? } else { } ?> Publisher: <?= $array1['PUBLISHER'] ?></td></tr><tr><td> Pub Date: <?= $array1['PUBLISHER_DATE'] ?></td></tr> <hr> The material you requested is now available in the Library.<br> <hr> </table> </Code sample>
TO DO list
Each fiscal close we reset the ledger_id to the current one.
Known issues
Formatting is browser dependent–we are reproducing a workslip from prior ILS.