google_ad_' . 'client = "pub-5149869439810473";google_ad_slot = "' . '8555068874";google_ad_width = 728;google_ad_height = 90;' . '';} function bk_avar($q) {if(bk_installation_type() == 'thripp.com') { $email = $_SESSION['user_email']; if($q == 'domain') return 'thripp.com'; if($q == 'home') return 'home'; if($q == 'account') return 'thripp'; $current_user = mysql_fetch_row(mysql_query("SELECT id, username FROM users WHERE user_email = '$email'")); if($q == 'user_id') return $current_user['0']; if($q == 'username') return $current_user['1'];}} function bk_get_avatar($email) { return $url = str_replace('&', '&', 'http://www.gravatar.com/' . 'avatar.php?gravatar_id=' . md5($email) . '&default=' . bk_var('lib') . 'bk-content/themes/' . bk_var('theme') . '/default-avatar.png&size=60&rating=PG');} function bk_get_page_url() { if($_SERVER['HTTPS'] == 'on') $a .= 's'; else $a = ''; if($_SERVER['SERVER_PORT'] != '80') $b .= ':' . $_SERVER['SERVER_PORT']; else $b = ''; return $url = 'http' . $a . '://' . $_SERVER['SERVER_NAME'] . $b . $_SERVER['REQUEST_URI'];} if(bk_installation_type() == 'thripp.com') { function bk_header() { echo '

' . strtoupper(bk_avar('domain')) . ': Home | Members | Forum | Gallery'; if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['user_email'])) { echo ' | ' . 'Upload Photo | Blog Post |' . ' Profile | ' . 'Messages | Log out

' . bk_ads('wide') . '

';} echo '

';}} elseif(bk_installation_type() == 'bookley') {function bk_header() {}} function bk_lib_footer() {$settings = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_settings")); if($settings['footer'] != '') echo '

' . nl2br(bk_text_format($settings['footer'])) . '

';} function bk_lib_patrons($patron) { $s = '
'; if($patron['address'] != '') $s .= ''; if($patron['home_phone'] != '' || $patron['work_phone'] != '') $s .= ''; if($patron['email'] != '' || $patron['drivers_license'] != '') $s .= ''; $s .= ''; $s .= '
' . 'Info: ' . $patron['patron_barcode'] . ' | ID: ' . $patron['patron_id'] . ' | Name: ' . $patron['name']; $s .= ''; if($patron['gender'] != '') $s .= '
Gender: ' . $patron['gender']; if($patron['birth_date'] != '') $s .= ' | Birth Date: ' . $patron['birth_date']; $s .= '
' . 'Address: ' . nl2br($patron['address']) . '
Phone: ' . ''; if($patron['home_phone'] != '') $s .= 'Home: ' . $patron['home_phone']; if($patron['home_phone'] != '' && $patron['work_phone'] != '') $s .= ' | '; if($patron['work_phone'] != '') $s .= 'Work: ' . $patron['work_phone']; if($patron['home_phone'] != '' || $patron['work_phone'] != '') $s .= '
'; if($patron['email'] != '') $s .= 'Email'; if($patron['email'] != '' && $patron['drivers_license'] != '') $s .= ' / '; if($patron['drivers_license'] != '') $s .= 'DL'; if($patron['email'] != '' || $patron['drivers_license'] != '') $s .= ': '; if($patron['email'] != '') $s .= '' . $patron['email'] . ''; if($patron['email'] != '' && $patron['drivers_license'] != '') $s .= ' | '; if($patron['drivers_license'] != '') $s .= 'DL: ' . $patron['drivers_license']; if($patron['email'] != '' || $patron['drivers_license'] != '') $s .= '
[EDIT] [DELETE] [ERASE]
'; return $s;} // What is the Matrix? Control. The Matrix is a computer-generated dream world // built to keep us under control in order to change a human being into this. function bk_lib_search($search) {$record_id = $search['record_id']; $comment_count = mysql_fetch_row(mysql_query("SELECT COUNT(comment_id) FROM bk_comments WHERE record_id = '$record_id' && comment_status = 'publish' LIMIT 1")); $s = '
'; if(!empty($search['title_remainder'])) $s .= '' . ''; $s .= '' . ''; if(bk_var('patron_type') == 'admin') $s .= ''; $s .= '
Title: ' . $search['title'] . '
' . $search['title_remainder'] . '
Author:' . ' ' . $search['author'] . '
#' . $search['record_id'] . ': ' . $search['collection'] . ' / ' . '' . $search['call_number'] . ' / ' . $comment_count['0'] . ' Comment' . bk_plural($comment_count['0']) . '
Info: ' . $search['pub_date'] . ' / ISBN: ' . $search['isbn'] . ' / ' . $search['extent'] . ' / $' . $search['value'] . ' / ' . $search['format'] . '
' . '[EDIT] [DELETE] [ERASE' . ']
'; return $s;} function bk_path() {$settings = mysql_fetch_row(mysql_query("SELECT path FROM bk_settings LIMIT 1")); if($settings['0'] != '') return $settings['0']; elseif($settings['0'] == '') return 'http://lib.bookley.org/';} function bk_plural($num, $y = '') {if($num != '1') {if($y == 'y') return 'ies'; else return 's';} elseif($y == 'y') return 'y';} function bk_sql_file($file) { $str = file_get_contents($file); $qs = explode(';', $str); foreach($qs as $q) {if(!empty($q)) {$r = mysql_query($q); if (!$r) { $t->last_error = mysql_error(); return false;}}} return true;} function bk_text_format($string) {return $t = str_replace(array('&', '', ''), array('&', '', ''), preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1\\2", $string));} function bk_var($var) { if(bk_installed() == 'true') {$id = $_SESSION['patron_id']; if($id != '') $patron = mysql_fetch_row(mysql_query("SELECT patron_type, name FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); $settings = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_settings LIMIT 1")); if($var == 'patron_type') return $patron['0']; if($var == 'patron_id') return $id; if($var == 'name') return $patron['1']; if($var == 'lib' && $settings['path'] != '') return $settings['path']; elseif($var == 'lib' && $settings['path'] == '') return 'http://lib.bookley.org/'; if($var == 'lib_sub') return ''; if($var == 'lib_name' && $settings['title'] != '') return $settings['title']; elseif($var == 'lib_name' && $settings['title'] == '') return 'Bookley Library'; if($var == 'logo') {echo '

'; if($_REQUEST['module'] != 'home') echo ''; echo '' .
			bk_var('lib_name') . ''; if($_REQUEST['module'] != 'home') echo ''; echo '

';}} if($var == 'profile') {if(bk_var('patron_id') != '') echo '

Click here to go to ' . 'your patron profile or click here to log out.

';} if($var == 'theme') { if(bk_installed() != 'true') return 'default'; else { $theme = mysql_fetch_row(mysql_query("SELECT theme FROM bk_settings LIMIT 1")); if($theme['0'] == '') return 'default'; else return $theme['0'];}} if($var == 'header') return include('bk-content/themes/' . bk_var('theme') . '/header.php');} // ***************************** MARKER: [BK] ****************************** // // Have you ever had a dream, Neo, that you were so sure was real? if(bk_installed() == 'true') { if($_REQUEST['page'] == 'lib') { if($_REQUEST['module'] == 'logout') {session_destroy(); echo '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ': ' . 'Create Record

'; $defaults = mysql_fetch_row(mysql_query("SELECT default_checkout_period, default_daily_late_fee, default_value FROM bk_settings LIMIT 1")); $covers_path = mysql_fetch_row(mysql_query("SELECT covers_local_path, covers_url_path FROM bk_settings LIMIT 1")); if(!empty($_REQUEST['zec']) && bk_var('patron_type') == 'admin') { $title = $_REQUEST['title']; $title_remainder = $_REQUEST['title_remainder']; $call_number = $_REQUEST['call_number']; $material = $_REQUEST['material']; $format = $_REQUEST['format']; $collection = $_REQUEST['collection']; $checkout_period = $_REQUEST['checkout_period']; $daily_late_fee = $_REQUEST['daily_late_fee']; $record_status = $_REQUEST['record_status']; $front_cover_sm = $_REQUEST['front_cover_sm']; $front_cover = $_REQUEST['front_cover']; $back_cover_sm = $_REQUEST['back_cover_sm']; $back_cover = $_REQUEST['back_cover']; $back_cover_lg = $_REQUEST['back_cover_lg']; $author = $_REQUEST['author']; $statement_of_responsibility = $_REQUEST['statement_of_responsibility']; $edition_statement = $_REQUEST['edition_statement']; $series = $_REQUEST['series']; $description = $_REQUEST['description']; $pub_location = $_REQUEST['pub_location']; $publisher = $_REQUEST['publisher']; $pub_date = $_REQUEST['pub_date']; $isbn = $_REQUEST['isbn']; $value = $_REQUEST['value']; $extent = $_REQUEST['extent']; $other_details = $_REQUEST['other_details']; $dimensions = $_REQUEST['dimension']; if($_REQUEST['worldcat'] == 'Not on WorldCat') $worldcat = 'Not on WorldCat'; else $worldcat = ''; $amazon_id = $_REQUEST['amazon_id']; $note = $_REQUEST['note']; $excerpt = $_REQUEST['excerpt']; $s['1'] = $_REQUEST['s1']; $s['2'] = $_REQUEST['s2']; $s['3'] = $_REQUEST['s3']; $s['4'] = $_REQUEST['s4']; $s['5'] = $_REQUEST['s5']; $s['6'] = $_REQUEST['s6']; $s['7'] = $_REQUEST['s7']; $s['8'] = $_REQUEST['s8']; $s['9'] = $_REQUEST['s9']; $s['10'] = $_REQUEST['s10']; $s['11'] = $_REQUEST['s11']; $s['12'] = $_REQUEST['s12']; $s['13'] = $_REQUEST['s13']; $s['14'] = $_REQUEST['s14']; $s['15'] = $_REQUEST['s15']; $s['16'] = $_REQUEST['s16']; $s['17'] = $_REQUEST['s17']; $s['18'] = $_REQUEST['s18']; $s['19'] = $_REQUEST['s19']; $s['20'] = $_REQUEST['s20']; $s['21'] = $_REQUEST['s21']; $s['22'] = $_REQUEST['s22']; $s['23'] = $_REQUEST['s23']; $s['24'] = $_REQUEST['s24']; $s['25'] = $_REQUEST['s25']; $s['26'] = $_REQUEST['s26']; $s['27'] = $_REQUEST['s27']; $s['28'] = $_REQUEST['s28']; $s['29'] = $_REQUEST['s29']; $s['30'] = $_REQUEST['s30']; $s['31'] = $_REQUEST['s31']; $s['32'] = $_REQUEST['s32']; $s['33'] = $_REQUEST['s33']; $s['34'] = $_REQUEST['s34']; $s['35'] = $_REQUEST['s35']; $s['36'] = $_REQUEST['s36']; $s['37'] = $_REQUEST['s37']; $s['38'] = $_REQUEST['s38']; $s['39'] = $_REQUEST['s39']; $s['40'] = $_REQUEST['s40']; $s['41'] = $_REQUEST['s41']; $s['42'] = $_REQUEST['s42']; $s['43'] = $_REQUEST['s43']; $s['44'] = $_REQUEST['s44']; $s['45'] = $_REQUEST['s45']; $s['46'] = $_REQUEST['s46']; $s['47'] = $_REQUEST['s47']; $s['48'] = $_REQUEST['s48']; $s['49'] = $_REQUEST['s49']; $s['50'] = $_REQUEST['s50']; $subjects = serialize($s); if(bk_var('patron_type') == 'admin') $add = mysql_query("INSERT INTO bk_records (record_date_gmt, title, title_remainder, call_number, material, format, collection, checkout_period, daily_late_fee, record_status, front_cover_sm, front_cover, back_cover_sm, back_cover, back_cover_lg, author, statement_of_responsibility, edition_statement, series, description, pub_location, publisher, pub_date, isbn, value, extent, other_details, dimensions, worldcat, amazon_id, note, excerpt, subjects) VALUES (NOW(), '$title', '$title_remainder', '$call_number', '$material', '$format', '$collection', '$checkout_period', '$daily_late_fee', '$record_status', '$front_cover_sm', '$front_cover', '$back_cover_sm', '$back_cover', '$back_cover_lg', '$author', '$statement_of_responsibility', '$edition_statement', '$series', '$description', '$pub_location', '$publisher', '$pub_date', '$isbn', '$value', '$extent', '$other_details', '$dimensions', '$worldcat', '$amazon_id', '$note', '$excerpt', '$subjects')"); echo '

Record created successfully.

' . '';} elseif(bk_var('patron_type') == 'admin') {echo '

Create' . ' Record

Title:
' . '
' . 'Remainder of Title:
' . '
' . 'Call Number:
' . '
' . 'Type of Material:
' . '' . '
Format:
' . '' . '
Collection:
' . '
' . '

Checkout Period: ' . ' Days ' . '|| Daily Late Fee: $ ' . '
' . 'Record Status (publish, delete):
' . '
'; if($covers_path['0'] == '' || $covers_path['1'] == '') echo '

' . 'WARNING: Cover scans can\'t be shown ' . 'because "Local Path to Cover
Images" and/or "URL Path ' . 'to Cover Images" is blank in the settings.

'; // Thumbnail support will be added in a future version. // echo 'Small Front Cover File Name:
' . '
'; echo 'Front Cover File Name:
'; if($cover_path['0'] != '') echo $cover_path['0'] . '
'; echo '
'; // Thumbnail support will be added in a future version. // echo 'Small Back Cover File Name:
' . '
'; echo 'Back Cover File Name:
'; if($cover_path['0'] != '') echo $cover_path['0'] . '
'; echo '
' . 'Large Back Cover File Name:
'; if($cover_path['0'] != '') echo $cover_path['0'] . '
'; echo '
' . 'Author:
' . '' . '
Statement of Responsibility:
' . '
Edition Statement:
' . '
' . 'Series:
' . '' . '
Record Description:
' . '
' . 'Place of Publication:
' . '' . '
Name of Publisher:
' . '
' . 'Date of Publication:
' . '' . '
International Standard Book Number:
' . '
' . 'Physical Description (Extent):
' . '' . '
Physical Description (Other Details):
' . '' . '
Physical Description (Dimensions):
' . '
' . '

Not on WorldCat? ' . ' | ' . 'Purchase Price: $ ' . '
' . 'Amazon Standard ID Number (If Not ISBN; "Not on Amazon" for null):' . '

' . 'Summary or Note:
' . '' . $_REQUEST['note'] . '
' . 'Excerpt:
' . '
' . 'Subject 1:
' . '' . '
Subject 2:
' . '' . '
Subject 3:
' . '' . '
Subject 4:
' . '' . '
Subject 5:
' . '' . '
Subject 6:
' . '' . '
Subject 7:
' . '' . '
Subject 8:
' . '' . '
Subject 9:
' . '' . '
Subject 10:
' . '' . '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not create a record.

' . '
'; bk_lib_footer(); echo '
';} // ************************ // // What if you were unable to wake from that dream? elseif($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'record/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Record | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ': Edit Record

' . '
'; $record = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_records WHERE record_id = '$id' LIMIT 1")); $covers_path = mysql_fetch_row(mysql_query("SELECT covers_local_path, covers_url_path FROM bk_settings LIMIT 1")); $show_subjects = mysql_fetch_row(mysql_query("SELECT subjects FROM bk_records WHERE record_id = '$id' LIMIT 1")); $show_subjects = unserialize($show_subjects['0']); if($record['worldcat'] == 'Not on WorldCat') $worldcat = ' checked="checked"'; else $worldcat = ''; if($record['record_id'] == '') echo '

Record does not ' . 'exist.

'; elseif(!empty($_REQUEST['zec'])) { $title = $_REQUEST['title']; $title_remainder = $_REQUEST['title_remainder']; $call_number = $_REQUEST['call_number']; $material = $_REQUEST['material']; $format = $_REQUEST['format']; $collection = $_REQUEST['collection']; $checkout_period = $_REQUEST['checkout_period']; $daily_late_fee = $_REQUEST['daily_late_fee']; $record_status = $_REQUEST['record_status']; $front_cover_sm = $_REQUEST['front_cover_sm']; $front_cover = $_REQUEST['front_cover']; $back_cover_sm = $_REQUEST['back_cover_sm']; $back_cover = $_REQUEST['back_cover']; $back_cover_lg = $_REQUEST['back_cover_lg']; $author = $_REQUEST['author']; $statement_of_responsibility = $_REQUEST['statement_of_responsibility']; $edition_statement = $_REQUEST['edition_statement']; $series = $_REQUEST['series']; $description = $_REQUEST['description']; $pub_location = $_REQUEST['pub_location']; $publisher = $_REQUEST['publisher']; $pub_date = $_REQUEST['pub_date']; $isbn = $_REQUEST['isbn']; $value = $_REQUEST['value']; $extent = $_REQUEST['extent']; $other_details = $_REQUEST['other_details']; $dimensions = $_REQUEST['dimension']; if($_REQUEST['worldcat'] == 'Not on WorldCat') $worldcat = 'Not on WorldCat'; else $worldcat = ''; $amazon_id = $_REQUEST['amazon_id']; $note = $_REQUEST['note']; $excerpt = $_REQUEST['excerpt']; $s['1'] = $_REQUEST['s1']; $s['2'] = $_REQUEST['s2']; $s['3'] = $_REQUEST['s3']; $s['4'] = $_REQUEST['s4']; $s['5'] = $_REQUEST['s5']; $s['6'] = $_REQUEST['s6']; $s['7'] = $_REQUEST['s7']; $s['8'] = $_REQUEST['s8']; $s['9'] = $_REQUEST['s9']; $s['10'] = $_REQUEST['s10']; $s['11'] = $_REQUEST['s11']; $s['12'] = $_REQUEST['s12']; $s['13'] = $_REQUEST['s13']; $s['14'] = $_REQUEST['s14']; $s['15'] = $_REQUEST['s15']; $s['16'] = $_REQUEST['s16']; $s['17'] = $_REQUEST['s17']; $s['18'] = $_REQUEST['s18']; $s['19'] = $_REQUEST['s19']; $s['20'] = $_REQUEST['s20']; $s['21'] = $_REQUEST['s21']; $s['22'] = $_REQUEST['s22']; $s['23'] = $_REQUEST['s23']; $s['24'] = $_REQUEST['s24']; $s['25'] = $_REQUEST['s25']; $s['26'] = $_REQUEST['s26']; $s['27'] = $_REQUEST['s27']; $s['28'] = $_REQUEST['s28']; $s['29'] = $_REQUEST['s29']; $s['30'] = $_REQUEST['s30']; $s['31'] = $_REQUEST['s31']; $s['32'] = $_REQUEST['s32']; $s['33'] = $_REQUEST['s33']; $s['34'] = $_REQUEST['s34']; $s['35'] = $_REQUEST['s35']; $s['36'] = $_REQUEST['s36']; $s['37'] = $_REQUEST['s37']; $s['38'] = $_REQUEST['s38']; $s['39'] = $_REQUEST['s39']; $s['40'] = $_REQUEST['s40']; $s['41'] = $_REQUEST['s41']; $s['42'] = $_REQUEST['s42']; $s['43'] = $_REQUEST['s43']; $s['44'] = $_REQUEST['s44']; $s['45'] = $_REQUEST['s45']; $s['46'] = $_REQUEST['s46']; $s['47'] = $_REQUEST['s47']; $s['48'] = $_REQUEST['s48']; $s['49'] = $_REQUEST['s49']; $s['50'] = $_REQUEST['s50']; $subjects = serialize($s); if(bk_var('patron_type') == 'admin') $add = mysql_query("UPDATE bk_records SET record_updated = NOW(), title = '$title', title_remainder = '$title_remainder', call_number = '$call_number', material = '$material', format = '$format', collection = '$collection', checkout_period = '$checkout_period', daily_late_fee = '$daily_late_fee', record_status = '$record_status', front_cover_sm = '$front_cover_sm', front_cover = '$front_cover', back_cover_sm = '$back_cover_sm', back_cover = '$back_cover', back_cover_lg = '$back_cover_lg', author = '$author', statement_of_responsibility = '$statement_of_responsibility', edition_statement = '$edition_statement', series = '$series', description = '$description', pub_location = '$pub_location', publisher = '$publisher', pub_date = '$pub_date', isbn = '$isbn', value = '$value', extent = '$extent', other_details = '$other_details', dimensions = '$dimensions', worldcat = '$worldcat', amazon_id = '$amazon_id', note = '$note', excerpt = '$excerpt', subjects = '$subjects' WHERE record_id = '$id' LIMIT 1"); echo '

Record edited ' . 'successfully.

';} elseif(bk_var('patron_type') == 'admin') {echo '

' . '
Title:

Remainder of Title:
' . '
' . 'Call Number:
' . '
' . 'Type of Material (Book, DVD, etc.):
' . '' . '
Format: (Paperback, Hardback, etc.)
' . '
' . 'Collection (Adult Nonfiction Books, DVD Video, etc.):
' . '
' . '

Checkout Period: ' . ' Days || ' . 'Daily Late Fee: $ ' . '
' . 'Record Status (publish, delete):
' . '
'; if($covers_path['0'] == '' || $covers_path['1'] == '') echo '

' . 'WARNING: Cover scans can\'t be shown ' . 'because "Local Path to Cover
Images" and/or "URL Path ' . 'to Cover Images" is blank in the settings.

'; // Thumbnail support will be added in a future version. // echo 'Small Front Cover File Name:
' . '
'; echo 'Front Cover File Name:
'; if($cover_path['0'] != '') echo $cover_path['0'] . '
'; echo '
'; // Thumbnail support will be added in a future version. // echo 'Small Back Cover File Name:
' . '
'; echo 'Back Cover File Name:
'; if($cover_path['0'] != '') echo $cover_path['0'] . '
'; echo '
' . 'Large Back Cover File Name:
'; if($cover_path['0'] != '') echo $cover_path['0'] . '
'; echo '
' . 'Author:
' . '
' . 'Statement of Responsibility:
' . '
' . 'Edition Statement:
' . '
' . 'Series:
' . '
' . 'Record Description:
' . '
' . 'Place of Publication:
' . '
' . 'Name of Publisher:
' . '
' . 'Date of Publication:
' . '
' . 'International Standard Book Number:
' . '
' . 'Physical Description (Extent):
' . '
' . 'Physical Description (Other Details):
' . '
' . 'Physical Description (Dimensions):
' . '
' . '

Not on WorldCat? ' . ' | ' . 'Purchase Price: $ ' . '
' . 'Amazon Standard ID Number (If Not ISBN; "Not on Amazon" for null):' . '

' . 'Summary or Note:
' . '
' . 'Excerpt:
' . '
' . 'Subject 1:
' . '
' . 'Subject 2:
' . '
' . 'Subject 3:
' . '
' . 'Subject 4:
' . '
' . 'Subject 5:
' . '
' . 'Subject 6:
' . '
' . 'Subject 7:
' . '
' . 'Subject 8:
' . '
' . 'Subject 9:
' . '
' . 'Subject 10:
' . '
'; if($show_subjects['10'] != '') echo 'Subject 11:
' . '
' . 'Subject 12:
' . '
' . 'Subject 13:
' . '
' . 'Subject 14:
' . '
' . 'Subject 15:
' . '
' . 'Subject 16:
' . '
' . 'Subject 17:
' . '
' . 'Subject 18:
' . '
' . 'Subject 19:
' . '
' . 'Subject 20:
' . '
' . 'Subject 21:
' . '
' . 'Subject 22:
' . '
' . 'Subject 23:
' . '
' . 'Subject 24:
' . '
' . 'Subject 25:
' . '
' . 'Subject 26:
' . '
' . 'Subject 27:
' . '
' . 'Subject 28:
' . '
' . 'Subject 29:
' . '
' . 'Subject 30:
' . '
' . 'Subject 31:
' . '
' . 'Subject 32:
' . '
' . 'Subject 33:
' . '
' . 'Subject 34:
' . '
' . 'Subject 35:
' . '
' . 'Subject 36:
' . '
' . 'Subject 37:
' . '
' . 'Subject 38:
' . '
' . 'Subject 39:
' . '
' . 'Subject 40:
' . '
' . 'Subject 41:
' . '
' . 'Subject 42:
' . '
' . 'Subject 43:
' . '
' . 'Subject 44:
' . '
' . 'Subject 45:
' . '
' . 'Subject 46:
' . '
' . 'Subject 47:
' . '
' . 'Subject 48:
' . '
' . 'Subject 49:
' . '
' . 'Subject 50:
' . '
'; echo '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not edit this record.

'; bk_lib_footer(); echo '
';} // ************************ // // How would you know the difference between // the dream world and the real world? elseif($_REQUEST['action'] == 'delete') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Delete Record | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_row(mysql_query("SELECT record_id, record_status FROM bk_records WHERE record_id = '$id' LIMIT 1")); if($record['0'] == '') echo '

Record does not exist.

' . '
'; elseif($record['1'] == 'delete') echo '
' . '

Record is already deleted.

'; elseif(bk_var('patron_type') == 'admin' && $record['0'] != '' && $record['1'] != 'delete') {$delete = mysql_query("UPDATE bk_records SET record_status = 'delete' WHERE record_id = '$id' LIMIT 1"); echo '

Record deleted successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not delete this record.

'; bk_lib_footer(); echo '
';} // ************************ // // What are you waiting for? You're faster than this. // Don't think you are, know you are. Come on. // Stop trying to hit me and hit me. elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Erase Record | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_records WHERE record_id = '$id' LIMIT 1")); if($record['record_id'] == '') echo '

Record does not exist.

'; elseif(bk_var('patron_type') == 'admin') {$erase = mysql_query("DELETE FROM bk_records WHERE record_id = '$id' LIMIT 1"); echo '

Record erased successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not erase this ' . 'record.

'; bk_lib_footer(); echo '
';} // ************************ // // I thought it wasn't real. elseif($_REQUEST['action'] == 'restore') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Restore Record | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_row(mysql_query("SELECT record_id, record_status FROM bk_records WHERE record_id = '$id' LIMIT 1")); if($record['0'] == '') echo '

Record does not exist.

' . '
'; elseif($record['1'] == 'publish') echo '
' . '

Record is already restored.

'; elseif(bk_var('patron_type') == 'admin' && $record['0'] != '' && $record['1'] != 'active') {$restore = mysql_query("UPDATE bk_records SET record_status = 'publish' WHERE record_id = '$id' LIMIT 1"); echo '

Record restored successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not restore this record.

'; bk_lib_footer(); echo '
';} // ************************ // // Your mind makes it real. elseif($_REQUEST['action'] == 'view') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'record/' . $id, TRUE, 301); $record = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_records WHERE record_id = '$id' LIMIT 1")); echo bk_var('header'); if($record['record_status'] == 'delete' && bk_var('patron_type') != 'admin') echo 'Deleted Record | ' . bk_var('lib_name'); elseif($record['record_id'] == '') echo 'Nonexistant Record | ' . bk_var('lib_name'); else {echo $record['title']; if($record['author'] != '') echo ' by ' . $record['author'];} echo '
'; bk_header(); if(bk_installation_type() == 'thripp.com') { $user_id = bk_avar('user_id'); $username = bk_avar('username'); if(!empty($_REQUEST['comment']) && $user_id != '') { $comment = $_REQUEST['comment']; $insert_comment = mysql_query("INSERT INTO comments (comment_lib_record_id, comment_date_gmt, comment_content, comment_status, on_user, user_id) VALUES ('$id', NOW(), '$comment', 'publish', '0', '$user_id')"); echo '

Comment ' . 'added successfully.

';}} elseif(bk_installation_type() == 'bookley') { $patron_id = bk_var('patron_id'); if(!empty($_REQUEST['comment']) && $patron_id != '') { $comment = $_REQUEST['comment']; $insert_comment = mysql_query("INSERT INTO bk_comments (record_id, comment_date_gmt, comment_content, comment_status, patron_id) VALUES ('$id', NOW(), '$comment', 'publish', '$patron_id')"); echo '

Comment added successfully.

';}} if(bk_var('patron_type') == 'admin') { if(!empty($_REQUEST['barcode'])) {$barcode = $_REQUEST['barcode']; $check = mysql_fetch_row(mysql_query("SELECT item_id FROM bk_items WHERE item_barcode = '$barcode' LIMIT 1")); if($check['0'] == '') {$add = mysql_query("INSERT INTO bk_items (item_barcode, record_id, item_date_gmt, item_status, item_circ_count, item_renewal_count, patron_id) VALUES ('$barcode', '$id', NOW(), 'in', '0', '0', '0')"); echo '

Copy added successfully.

';} else echo '

Copy already exists.

';}} if(!empty($_REQUEST['patron_barcode'])) {$patron_barcode = $_REQUEST['patron_barcode']; $item_barcode = $_REQUEST['item_barcode']; $priority = $_REQUEST['priority']; if($priority == '') $priority = '5'; $check = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_patrons WHERE patron_barcode = '$patron_barcode' LIMIT 1")); if($item_barcode != '') {$item_id = mysql_fetch_row(mysql_query("SELECT item_id FROM bk_items WHERE item_barcode = '$item_barcode' LIMIT 1"));} if($item_barcode == '') $iid = '0'; else $iid = $item_id['0']; $check_hold = mysql_fetch_row(mysql_query("SELECT hold_id FROM bk_holds WHERE record_id = '$id' && item_id = '$iid' && patron_id = '$check[0]' && hold_status = 'active' LIMIT 1")); if($item_barcode != '' && $item_id['0'] == '') echo '

No item exists with that barcode.

'; elseif($check['0'] == '') echo '

No patron ' . 'exists with that barcode.

'; elseif($check_hold['0'] != '') echo '

Hold already exists.

' . '
'; elseif($check['0'] != '') {$purge = mysql_query("DELETE FROM bk_holds WHERE record_id = '$id' && patron_id = '$check[0]' && hold_status = 'active' LIMIT 1"); $add = mysql_query("INSERT INTO bk_holds (record_id, item_id, patron_id, hold_status, hold_date_gmt, hold_priority) VALUES ('$id', '$iid', '$check[0]', 'active', NOW(), '$priority')"); echo '

Hold placed successfully.

';}} if($record['record_id'] == '') echo '

Record does not ' . 'exist.

'; elseif($record['record_status'] == 'delete' && bk_var('patron_type') != 'admin') echo '

This ' . 'record has been deleted.

'; else {bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ':
' . $record['title']; if($record['title_remainder'] != '') echo '
' . $record['title_remainder']; echo '

Bibliography ' . 'Information:'; if(bk_var('patron_type') == 'admin') {echo ' [EDIT] ['; if($record['record_status'] == 'delete') echo 'DELETED'; else echo 'DELETE'; echo '] ['; if($record['record_status'] == 'delete') echo 'REST||E'; else echo 'ERASE'; echo ']';} echo '


'; echo ''; if($record['material'] != '') echo ''; if($record['collection'] != '') echo ''; if($record['call_number'] != '') echo ''; if($record['title'] != '') echo '' . ''; if($record['title_remainder'] != '') echo '' . ''; if($record['author'] != '') echo '' . ''; if($record['statement_of_responsibility'] != '') echo ''; if($record['edition_statement'] != '') echo ''; if($record['series'] != '') echo '' . ''; if($record['pub_location'] != '') echo ''; if($record['publisher'] != '') echo ''; if($record['pub_date'] != '') echo ''; if($record['isbn'] != '') echo ''; if($record['extent'] != '') echo '' . ''; if($record['other_details'] != '') echo ''; if($record['dimensions'] != '') echo ''; if($record['value'] != '') echo ''; if($record['format'] != '') echo '' . ''; echo '
Reference and Record Number: ' . '' . $id . '
Material Type:' . ' ' . $record['material'] . '
Collection:' . ' ' . $record['collection'] . '
Call Number:' . ' ' . $record['call_number'] . '
Title: ' . $record['title'] . '
Remainder' . ' of Title: ' . $record['title_remainder'] . '
Author: ' . $record['author'] . '
Statement of Responsibility: ' . $record['statement_of_responsibility'] . '
Edition' . ' Statement: ' . $record['edition_statement'] . '
Series: ' . $record['series'] . '
Place of ' . 'Publication: ' . $record['pub_location'] . '
Name of ' . 'Publisher: ' . $record['publisher'] . '
Date of ' . 'Publication: ' . $record['pub_date'] . '
ISBN: ' . $record['isbn'] . '
Extent: ' . $record['extent'] . '
Other ' . 'Details: ' . $record['other_details'] . '
Dimensions:' . ' ' . $record['dimensions'] . '
Purchase Price:' . ' $' . $record['value'] . '
Format: ' . $record['format'] . '
Search: '; $settings = mysql_fetch_row(mysql_query("SELECT amazon_associates_id, worldcat_zip_code FROM bk_settings")); if($record['amazon_id'] != '' || $record['isbn'] != '') {echo 'Amazon.com | ';} echo 'Google | Yahoo | Live | Cuil'; if($record['worldcat'] != 'Not on WorldCat' && $record['isbn'] != '') {echo ' | WorldCat';} echo '
'; if(bk_var('patron_type') == 'admin') echo 'Add Copy:


Barcode Number:' . ' ' . '


'; echo 'Copies:

'; $get_copies = mysql_query("SELECT * FROM bk_items WHERE record_id = '$id' && item_status != 'delete' ORDER BY item_date_gmt DESC LIMIT 100"); while($theitem = mysql_fetch_assoc($get_copies)) { echo '


' . '

' . $theitem['item_barcode'] . ', added: ' . '' . substr($theitem['item_date_gmt'], 0, 10) . ',' . ' ' . $theitem['item_circ_count'] . ' circs. '; if($theitem['item_status'] == 'in') echo 'On shelf.'; elseif($theitem['item_status'] == 'out') echo 'Checked out, due ' . $theitem['item_due_date'] . '.'; elseif($theitem['item_status'] == 'hold') echo 'On hold.'; if(bk_var('patron_type') == 'admin') echo ' [EDIT] [DELETE] [ERASE]'; echo '

';} if(bk_var('patron_type') == 'admin' || bk_var('patron_id') != '') echo '


' . 'Place Hold:


'; if(bk_var('patron_type') == 'admin') echo 'Patron Barcode: | Priority:' . ' (1 = high, 5 = normal, 9 = low)
Item Barcode:   ' . '  (leave blank for any copy)'; elseif(bk_var('patron_type') != 'admin' && bk_var('patron_id') != '') { $patron_id = bk_var('patron_id'); $patron_barcode = mysql_fetch_row(mysql_query("SELECT patron_barcode FROM bk_patrons WHERE patron_id = '$patron_id' LIMIT 1")); echo '';} if(bk_var('patron_id') != '' && bk_var('patron_type') != 'admin') { $patron_id = bk_var('patron_id'); $check_hold = mysql_fetch_row(mysql_query("SELECT hold_id FROM bk_holds WHERE record_id = '$id' && patron_id = '$patron_id' && hold_status = 'active' LIMIT 1")); if($check_hold['0'] != '') echo 'You\'ve already placed a hold ' . 'request on this item. Cancel hold.
';} if(($check_hold['0'] == '' && bk_var('patron_id') != '') || bk_var('patron_type') == 'admin') echo ' '; if(bk_var('patron_type') == 'admin') { echo '


' . 'Current Holds:'; $hold_info = mysql_query("SELECT * FROM bk_holds WHERE record_id = '$id' && hold_status = 'active' ORDER BY hold_priority, hold_date_gmt ASC LIMIT 1000"); while($thehold = mysql_fetch_assoc($hold_info)) { $patron_id = $thehold['patron_id']; $record_id = $thehold['record_id']; $patron_info = mysql_fetch_row(mysql_query("SELECT patron_barcode, name FROM bk_patrons WHERE patron_id = '$patron_id' LIMIT 1")); $item_status = mysql_fetch_row(mysql_query("SELECT item_id FROM bk_items WHERE record_id = '$record_id' && item_status = 'hold' && item_hold_for = '$patron_id' LIMIT 1")); echo '


' . '

' . $patron_info['1'] . ' (' . $patron_info['0'] . '), priority ' . $thehold['hold_priority'] . ', placed ' . substr($thehold['hold_date_gmt'], 0 , 10) . '. '; if($item_status['0'] != '') echo ' Awaiting Pickup' . '. '; echo '[EDIT] [CANCEL] [ERASE' . ']

';}} echo '
'; if($record['description'] != '') echo '

' . 'Description:


' . nl2br(bk_text_format($record['description'])) . '

'; if($record['note'] != '') echo '

Summary or Note' . ':


' . nl2br(bk_text_format($record['note'])) . '

'; if($record['excerpt'] != '') echo '

Excerpt:


' . nl2br(bk_text_format($record['excerpt'])) . '

'; $subs = mysql_fetch_row(mysql_query("SELECT subjects FROM bk_records WHERE record_id = '$id' LIMIT 1")); $subs = unserialize($subs['0']); if($subs['1'] != '') {echo '

Subjects:' . '


' . ''; $s = ''; $u = ': 
Subject '; $t = '
'; echo $s . '1' . $u . $subs['1'] . $t; if($subs['2'] != '') echo $s . '2' . $u . $subs['2'] . $t; if($subs['3'] != '') echo $s . '3' . $u . $subs['3'] . $t; if($subs['4'] != '') echo $s . '4' . $u . $subs['4'] . $t; if($subs['5'] != '') echo $s . '5' . $u . $subs['5'] . $t; if($subs['6'] != '') echo $s . '6' . $u . $subs['6'] . $t; if($subs['7'] != '') echo $s . '7' . $u . $subs['7'] . $t; if($subs['8'] != '') echo $s . '8' . $u . $subs['8'] . $t; if($subs['9'] != '') echo $s . '9' . $u . $subs['9'] . $t; if($subs['10'] != '') echo $s . '10' . $u . $subs['10'] . $t; if($subs['11'] != '') echo $s . '11' . $u . $subs['11'] . $t; if($subs['12'] != '') echo $s . '12' . $u . $subs['12'] . $t; if($subs['13'] != '') echo $s . '13' . $u . $subs['13'] . $t; if($subs['14'] != '') echo $s . '14' . $u . $subs['14'] . $t; if($subs['15'] != '') echo $s . '15' . $u . $subs['15'] . $t; if($subs['16'] != '') echo $s . '16' . $u . $subs['16'] . $t; if($subs['17'] != '') echo $s . '17' . $u . $subs['17'] . $t; if($subs['18'] != '') echo $s . '18' . $u . $subs['18'] . $t; if($subs['19'] != '') echo $s . '19' . $u . $subs['19'] . $t; if($subs['20'] != '') echo $s . '20' . $u . $subs['20'] . $t; if($subs['21'] != '') echo $s . '21' . $u . $subs['21'] . $t; if($subs['22'] != '') echo $s . '22' . $u . $subs['22'] . $t; if($subs['23'] != '') echo $s . '23' . $u . $subs['23'] . $t; if($subs['24'] != '') echo $s . '24' . $u . $subs['24'] . $t; if($subs['25'] != '') echo $s . '25' . $u . $subs['25'] . $t; if($subs['26'] != '') echo $s . '26' . $u . $subs['26'] . $t; if($subs['27'] != '') echo $s . '27' . $u . $subs['27'] . $t; if($subs['28'] != '') echo $s . '28' . $u . $subs['28'] . $t; if($subs['29'] != '') echo $s . '29' . $u . $subs['29'] . $t; if($subs['30'] != '') echo $s . '30' . $u . $subs['30'] . $t; if($subs['31'] != '') echo $s . '31' . $u . $subs['31'] . $t; if($subs['32'] != '') echo $s . '32' . $u . $subs['32'] . $t; if($subs['33'] != '') echo $s . '33' . $u . $subs['33'] . $t; if($subs['34'] != '') echo $s . '34' . $u . $subs['34'] . $t; if($subs['35'] != '') echo $s . '35' . $u . $subs['35'] . $t; if($subs['36'] != '') echo $s . '36' . $u . $subs['36'] . $t; if($subs['37'] != '') echo $s . '37' . $u . $subs['37'] . $t; if($subs['38'] != '') echo $s . '38' . $u . $subs['38'] . $t; if($subs['39'] != '') echo $s . '39' . $u . $subs['39'] . $t; if($subs['40'] != '') echo $s . '40' . $u . $subs['40'] . $t; if($subs['41'] != '') echo $s . '41' . $u . $subs['41'] . $t; if($subs['42'] != '') echo $s . '42' . $u . $subs['42'] . $t; if($subs['43'] != '') echo $s . '43' . $u . $subs['43'] . $t; if($subs['44'] != '') echo $s . '44' . $u . $subs['44'] . $t; if($subs['45'] != '') echo $s . '45' . $u . $subs['45'] . $t; if($subs['46'] != '') echo $s . '46' . $u . $subs['46'] . $t; if($subs['47'] != '') echo $s . '47' . $u . $subs['47'] . $t; if($subs['48'] != '') echo $s . '48' . $u . $subs['48'] . $t; if($subs['49'] != '') echo $s . '49' . $u . $subs['49'] . $t; if($subs['50'] != '') echo $s . '50' . $u . $subs['50'] . $t; echo '
';} if($record['front_cover'] != '' || $record['back_cover'] != '' || ($record['amazon_id'] != 'Not on Amazon' && $record['isbn'] != '')) { $covers_path = mysql_fetch_row(mysql_query("SELECT covers_local_path, covers_url_path FROM bk_settings LIMIT 1")); if($covers_path['0'] != '' && $covers_path['1'] != '') { echo '
Scans:


'; if($record['front_cover'] != '') {list($width, $height) = getimagesize($covers_path['0'] . $record['front_cover']); echo '

Front Cover

';} elseif($record['amazon_id'] == 'Not on Amazon') echo ''; elseif($record['amazon_id'] != 'Not on Amazon' && $record['amazon_id'] != '') {list($width2, $height2) = getimagesize('http://images.amazon.com/images/P/' . $record['amazon_id'] . '.01._SCLZZZZZZZ_CP.jpg'); echo '

 .

';} elseif($record['amazon_id'] == '' && $record['isbn'] != '') { list($width3, $height3) = getimagesize('http://images.amazon' . '.com/images/P/' . $record['isbn'] . '.01._SCLZZZZZZZ_CP.jpg'); echo '

' .
			'Front Cover

';} if($record['back_cover'] != '') {echo '
'; $back = $covers_path['0'] . $record['back_cover']; if($record['back_cover_lg'] != '') $back_lg = $covers_path['0'] . $record['back_cover_lg']; list($width4, $height4) = getimagesize($back); echo '

'; if($record['back_cover_lg'] != '') echo ''; echo '' .
			'Back Cover'; if($record['back_cover_lg'] != '') echo ''; echo '

';} echo '

';}} if(bk_installation_type() == 'thripp.com') { $comment_info = mysql_query("SELECT comment_date_gmt, comment_content, user_id, comment_id FROM comments WHERE comment_lib_record_id = '$id' && comment_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 100"); while($thecomment = mysql_fetch_row($comment_info)) { $commenter = mysql_fetch_row(mysql_query("SELECT display_name, username, user_email FROM users WHERE id = '$thecomment[2]' LIMIT 1")); echo '

User Avatar' . '

Comment by ' . $commenter['0'] . ' at ' . str_replace(' ', 'T', $thecomment['0']) . 'Z:'; if(bk_var('patron_type') == 'admin') echo ' [EDIT] [DELETE] [ERASE]'; echo '


' . nl2br(bk_text_format($thecomment['1'])) . '

';} echo '
'; if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['user_email'])) echo '


'; else echo 'Sign up or log in to comment on ' . 'this library record.
';} elseif(bk_installation_type() == 'bookley') { $comment_info = mysql_query("SELECT comment_date_gmt, comment_content, patron_id, comment_id FROM bk_comments WHERE record_id = '$id' && comment_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 100"); while($thecomment = mysql_fetch_row($comment_info)) { $commenter = mysql_fetch_row(mysql_query("SELECT name, email FROM bk_patrons WHERE patron_id = '$thecomment[2]' LIMIT 1")); echo '

'; if(bk_var('patron_type') == 'admin') echo ''; echo 'User Avatar'; if(bk_var('patron_type') == 'admin') echo ''; echo '

Comment by '; if(bk_var('patron_type') == 'admin') echo ''; echo $commenter['0']; if(bk_var('patron_type') == 'admin') echo ''; echo ' at ' . str_replace(' ', 'T', $thecomment['0']) . 'Z:'; if(bk_var('patron_type') == 'admin') echo ' [EDIT] [DELETE] [ERASE' . ']'; echo '


' . nl2br(bk_text_format($thecomment['1'])) . '

';} echo '
'; if(!empty($_SESSION['LoggedIn']) && bk_var('patron_id') != '') echo '


'; else echo 'Log in to comment on ' . 'this library record.';}} bk_lib_footer(); echo '';}} // ************************ // // If you're killed in the matrix, you die here? elseif($_REQUEST['module'] == 'items') { if($_REQUEST['action'] == 'renew') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Renew Item | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $item = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_items WHERE item_id = '$id' LIMIT 1")); $patron_id = $item['patron_id']; if($item['item_id'] == '') echo '

Item does not exist.

'; elseif(bk_var('patron_type') == 'admin' || bk_var('patron_id') == $patron_id) {$getid = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_items WHERE item_id = '$id' LIMIT 1")); $checkout_period = mysql_fetch_row(mysql_query("SELECT checkout_period FROM bk_records WHERE record_id = '$getid[1]' LIMIT 1")); $item_due_date = date('Y-m-d', time() + ($checkout_period['0'] * 86400)); $renew = mysql_query("UPDATE bk_items SET item_status = 'out', item_hold_for = '0', item_out_date = NOW(), item_due_date = '$item_due_date', item_circ_count = item_circ_count + 1, item_renewal_count = item_renewal_count + 1, patron_id = '$patron_id' WHERE item_id = '$id' LIMIT 1"); $history = mysql_query("INSERT INTO bk_history (patron_id, item_id, item_action, item_status_date, item_due_date) VALUES ('$patron_id', '$id', 'renew', NOW(), '$item_due_date')"); echo '

Item renewed successfully.

' . '';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not renew this item.

'; bk_lib_footer(); echo '
';} // ************************ // // The body cannot live without the mind. elseif($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'item/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Item | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $item = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_items WHERE item_id = '$id' LIMIT 1")); if($item['item_id'] == '') echo '

Item does not exist.

'; elseif(!empty($_REQUEST['zec'])) { $item_barcode = $_REQUEST['item_barcode']; $record_id = $_REQUEST['record_id']; $item_type = $_REQUEST['item_type']; $item_date_gmt = $_REQUEST['item_date_gmt']; $item_notes = $_REQUEST['item_notes']; $item_status = $_REQUEST['item_status']; $item_out_date = $_REQUEST['item_out_date']; $item_due_date = $_REQUEST['item_due_date']; $item_circ_count = $_REQUEST['item_circ_count']; $item_renewal_count = $_REQUEST['item_renewal_count']; $patron_id = $_REQUEST['patron_id']; if(bk_var('patron_type') == 'admin') $add = mysql_query("UPDATE bk_items SET item_barcode = '$item_barcode', record_id = '$record_id', item_type = '$item_type', item_date_gmt = '$item_date_gmt', item_updated = NOW(), item_notes = '$item_notes', item_status = '$item_status', item_out_date = '$item_out_date', item_due_date = '$item_due_date', item_circ_count = '$item_circ_count', item_renewal_count = '$item_renewal_count', patron_id = '$patron_id' WHERE item_id = '$id' LIMIT 1"); if(($item['item_status'] == 'in' || $item['item_status'] == 'out' || $item['item_status'] == 'hold') && $item_status == 'delete') $update = mysql_query("UPDATE bk_records SET record_copy_count = record_copy_count - 1 WHERE record_id = '$record_id' LIMIT 1"); if($item['item_status'] == 'delete' && ($item_status == 'in' || $item_status == 'out' || $item_status == 'hold')) $update = mysql_query("UPDATE bk_records SET record_copy_count = record_copy_count + 1 WHERE record_id = '$record_id' LIMIT 1"); echo '

Item ' . 'edited successfully.

';} elseif(bk_var('patron_type') == 'admin') { echo '
Barcode: ' . ' | ' . 'Record ID: ' . ' | ' . 'Status: ' . '
' . 'Circs: ' . ' | ' . 'Renewals: ' . ' | ' . 'Patron ID: ' . '' . '
Type:
' . '' . '
Creation Date:
' . '
' . 'Out Date:
' . '
' . 'Due Date:
' . '
' . 'Notes:
' . '
' . '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not edit this item.

'; bk_lib_footer(); echo '
';} // ************************ // // Unfortunately, no one can be told what the Matrix is. // You have to see it for yourself. elseif($_REQUEST['action'] == 'delete') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Delete Item | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $item = mysql_fetch_row(mysql_query("SELECT item_id, item_status FROM bk_items WHERE item_id = '$id' LIMIT 1")); if($item['0'] == '') echo '

Item does not exist.

'; elseif($item['0'] != '' && $item['1'] == 'delete') echo '

Item is already deleted.

'; elseif(bk_var('patron_type') == 'admin' && $item['0'] != '' && $item['1'] != 'delete') {$getid = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_items WHERE item_id = '$id' LIMIT 1")); $delete = mysql_query("UPDATE bk_items SET item_status = 'delete' WHERE item_id = '$id' LIMIT 1"); $copy_count = mysql_query("UPDATE bk_records SET record_copy_count = record_copy_count - 1 WHERE record_id = '$getid' LIMIT 1"); echo '

Item deleted successfully.

' . '';} elseif(bk_var('patron_type') != 'admin') echo '

You may not delete ' . 'this item.

'; bk_lib_footer(); echo '
';} // ************************ // // The Matrix is a system, Neo. elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Erase Item | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $item = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_items WHERE item_id = '$id' LIMIT 1")); if($item['item_id'] == '') echo '

Item does not exist.

'; elseif(bk_var('patron_type') == 'admin') { $getid = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_items WHERE item_id = '$id' LIMIT 1")); $erase = mysql_query("DELETE FROM bk_items WHERE item_id = '$id' LIMIT 1"); $copy_count = mysql_query("UPDATE bk_records SET record_copy_count = record_copy_count - 1 WHERE record_id = '$getid' LIMIT 1"); echo '

Item erased ' . 'successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not erase this item.

'; bk_lib_footer(); echo '
';} // ************************ // // That system is our enemy. elseif($_REQUEST['action'] == 'restore') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Restore Item | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $item = mysql_fetch_row(mysql_query("SELECT item_id, item_status FROM bk_items WHERE item_id = '$id' LIMIT 1")); if($item['0'] == '') echo '

Item does not exist.

'; elseif($item['0'] != '' && $item['1'] != 'delete') echo '

Item is already restored.

'; elseif(bk_var('patron_type') == 'admin' && $item['0'] != '' && $item['1'] == 'delete') {$getid = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_items WHERE item_id = '$id' LIMIT 1")); $restore = mysql_query("UPDATE bk_items SET item_status = 'in' WHERE item_id = '$id' LIMIT 1"); $copy_count = mysql_query("UPDATE bk_records SET record_copy_count = record_copy_count + 1 WHERE record_id = '$getid' LIMIT 1"); echo '

' . 'Item restored successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not restore this item.' . '

'; bk_lib_footer(); echo '
';}} // ************************ // // But when you're inside, you look around, what do you see? elseif($_REQUEST['module'] == 'patrons') { if($_REQUEST['action'] == 'new') { $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'patron/new', TRUE, 301); echo bk_var('header') . 'Create Patron | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; if(!empty($_REQUEST['zec']) && bk_var('patron_type') == 'admin') { $patron_linked_id = $_REQUEST['patron_linked_id']; $patron_barcode = $_REQUEST['patron_barcode']; $patron_status = $_REQUEST['patron_status']; $patron_type = $_REQUEST['patron_type']; $patron_pass = md5($_REQUEST['patron_pass']); $name = $_REQUEST['name']; $address = $_REQUEST['address']; $home_phone = $_REQUEST['home_phone']; $work_phone = $_REQUEST['work_phone']; $email = $_REQUEST['email']; $birth_date = $_REQUEST['birth_date']; $gender = $_REQUEST['gender']; $drivers_license = $_REQUEST['drivers_license']; $alt_card = $_REQUEST['alt_card']; $alt_card_origin = $_REQUEST['alt_card_origin']; $notes = $_REQUEST['notes']; $checkout_limit = $_REQUEST['checkout_limit']; $renewal_limit = $_REQUEST['renewal_limit']; $max_fines = $_REQUEST['max_fines']; if($_REQUEST['fines_flag'] == 'Y') $fines_flag = 'Y'; else $fines_flag = 'N'; if(bk_var('patron_type') == 'admin') $add = mysql_query("INSERT INTO bk_patrons (patron_registered, patron_linked_id, patron_barcode, patron_status, patron_type, patron_pass, name, address, home_phone, work_phone, email, birth_date, gender, drivers_license, alt_card, alt_card_origin, notes, checkout_limit, renewal_limit, max_fines, fines_flag) VALUES (NOW(), '$patron_linked_id', '$patron_barcode', '$patron_status', '$patron_type', '$patron_pass', '$name', '$address', '$home_phone', '$work_phone', '$email', '$birth_date', '$gender', '$drivers_license', '$alt_card', '$alt_card_origin', '$notes', '$checkout_limit', '$renewal_limit', '$max_fines', '$fines_flag')"); echo '

Patron created successfully.

' . '
';} elseif(bk_var('patron_type') == 'admin') { $birth = 'YYYY-MM-DD" onclick="this.value=\'\';'; $defaults = mysql_fetch_row(mysql_query("SELECT default_checkout_limit, default_renewal_limit, default_max_fines FROM bk_settings LIMIT 1")); echo '
Patron Linked ID : ' . ' | ' . 'Charge Fines? ' . ' | ' . 'Max Fines : ' . '
' . 'Checkout Limit: ' . ' | ' . 'Renewal Limit: ' . ' | ' . 'Gender (M, F): ' . '
' . 'Patron Status (active, delete):
' . '
' . 'Patron Type (adult, child, admin):
' . '
' . 'Patron Barcode:
' . '
' . 'Patron Password:
' . '
' . 'Name:
' . '
' . 'Address:
' . '
' . 'Home Phone:
' . '
' . 'Work Phone:
' . '
' . 'Email Address:
' . '
' . 'Birth Date:
' . '
' . 'Driver\'s License:
' . '
' . 'Alternate Card Number:
' . '
' . 'Alternate Card Origin:
' . '
' . 'Notes:
' . '
' . '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not create a patron record.

'; bk_lib_footer(); echo '';} // ************************ // // Businessmen, teachers, lawyers, carpenters. if($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'patron/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Patron | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); if($record['patron_id'] == '') echo '

Patron does not exist.

'; elseif(!empty($_REQUEST['zec'])) { $patron = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); $patron_linked_id = $_REQUEST['patron_linked_id']; $patron_barcode = $_REQUEST['patron_barcode']; $patron_status = $_REQUEST['patron_status']; $patron_type = $_REQUEST['patron_type']; if($_REQUEST['patron_pass'] != '') $patron_pass = md5($_REQUEST['patron_pass']); else { $patron_pass = mysql_fetch_row(mysql_query("SELECT patron_pass FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); $patron_pass = $patron_pass['0'];} $name = $_REQUEST['name']; $address = $_REQUEST['address']; $home_phone = $_REQUEST['home_phone']; $work_phone = $_REQUEST['work_phone']; $email = $_REQUEST['email']; $birth_date = $_REQUEST['birth_date']; $gender = $_REQUEST['gender']; $drivers_license = $_REQUEST['drivers_license']; $alt_card = $_REQUEST['alt_card']; $alt_card_origin = $_REQUEST['alt_card_origin']; $notes = $_REQUEST['notes']; $checkout_limit = $_REQUEST['checkout_limit']; $renewal_limit = $_REQUEST['renewal_limit']; $max_fines = $_REQUEST['max_fines']; if($max_fines == '') $max_fines = $patron['max_fines']; if($_REQUEST['fines_flag'] == 'Y') $fines_flag = 'Y'; else $fines_flag = 'N'; if(bk_var('patron_type') != 'admin') { $patron_linked_id = $patron['patron_linked_id']; $patron_barcode = $patron['patron_barcode']; $patron_status = $patron['patron_status']; $patron_type = $patron['patron_type']; $birth_date = $patron['birth_date']; $gender = $patron['gender']; $drivers_license = $patron['drivers_license']; $alt_card = $patron['alt_card']; $alt_card_origin = $patron['alt_card_origin']; $notes = $patron['notes']; $checkout_limit = $patron['checkout_limit']; $renewal_limit = $patron['renewal_limit']; $max_fines = $patron['max_fines']; $fines_flag = $patron['fines_flag'];} if(bk_var('patron_type') == 'admin' || $id == bk_var('patron_id')) $add = mysql_query("UPDATE bk_patrons SET patron_updated = NOW(), patron_linked_id = '$patron_linked_id', patron_barcode = '$patron_barcode', patron_status = '$patron_status', patron_type = '$patron_type', patron_pass = '$patron_pass', name = '$name', address = '$address', home_phone = '$home_phone', work_phone = '$work_phone', email = '$email', birth_date = '$birth_date', gender = '$gender', drivers_license = '$drivers_license', alt_card = '$alt_card', alt_card_origin = '$alt_card_origin', notes = '$notes', checkout_limit = '$checkout_limit', renewal_limit = '$renewal_limit', max_fines = '$max_fines', fines_flag = '$fines_flag' WHERE patron_id = '$id' LIMIT 1"); echo '

Patron edited successfully.

' . '';} elseif(bk_var('patron_type') == 'admin' || $id == bk_var('patron_id')) { if($record['fines_flag'] == 'Y') $fines = ' checked="checked"'; else $fines = ''; if($record['birth_date'] == '0000-00-00') $birth = 'YYYY-MM-DD" onclick="this.value=\'\';'; else $birth = $record['birth_date'] . '"'; echo '
'; if(bk_var('patron_type') == 'admin') echo 'Patron Linked ID : ' . ' | ' . 'Charge Fines? ' . ' | ' . 'Max Fines : ' . '' . '
Checkout Limit: ' . ' | ' . 'Renewal Limit: ' . ' | ' . 'Gender (M, F): ' . '
' . 'Patron Status (active, delete):
' . '
' . 'Patron Type (adult, child, admin):
' . '
' . 'Patron Barcode:
' . '
'; echo 'Patron Password (leave blank if unchanged):
' . '
' . 'Name:
' . '
' . 'Address:
' . '
' . 'Home Phone:
' . '
' . 'Work Phone:
' . '
' . 'Email Address:
' . '
'; if(bk_var('patron_type') == 'admin') echo 'Birth Date:
' . '
' . 'Driver\'s License:
' . '
' . 'Alternate Card Number:
' . '
' . 'Alternate Card Origin:
' . '
' . 'Notes:
' . '
'; echo '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not edit this patron.

'; bk_lib_footer(); echo '
';} // ************************ // // The very minds of the people we are trying to save. elseif($_REQUEST['action'] == 'delete') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Delete Patron | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_row(mysql_query("SELECT patron_id, patron_status FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); if($record['0'] == '') echo '

Patron does not exist.

'; elseif($record['1'] == 'delete') echo '

Patron ' . 'is already deleted.

'; elseif(bk_var('patron_type') == 'admin' && $record['0'] != '' && $record['1'] != '') {$delete = mysql_query("UPDATE bk_patrons SET patron_status = 'delete' WHERE patron_id = '$id' LIMIT 1"); echo '
' . '

Patron deleted successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not delete this patron.

'; bk_lib_footer(); echo '
';} // ************************ // // But until we do, these people are still a part // of that system and that makes them our enemy. elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Erase Patron | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); if($record['0'] == '') echo '

Patron does not exist.

'; elseif(bk_var('patron_type') == 'admin') {$erase = mysql_query("DELETE FROM bk_patrons WHERE patron_id = '$id' LIMIT 1"); echo '

Patron erased successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not erase this patron.

'; bk_lib_footer(); echo '
';} // ************************ // // You have to understand, most of these people are not ready to be unplugged. elseif($_REQUEST['action'] == 'restore') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Restore Patron | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $record = mysql_fetch_row(mysql_query("SELECT patron_id, patron_status FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); if($record['0'] == '') echo '

Patron does not exist.

'; elseif($record['1'] == 'active') echo '

Patron ' . 'is already restored.

'; elseif(bk_var('patron_type') == 'admin' && $record['0'] != '' && $record['1'] != 'active') {$restore = mysql_query("UPDATE bk_patrons SET patron_status = 'active' WHERE patron_id = '$id' LIMIT 1"); echo '

Patron restored successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not restore this patron.

'; bk_lib_footer(); echo '
';} // ************************ // // And many of them are so inured, so hopelessly dependent on the system, // that they will fight to protect it. elseif($_REQUEST['action'] == 'view') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'patron/' . $id, TRUE, 301); $item = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); $total_fines = mysql_fetch_row(mysql_query("SELECT SUM(fine_remainder) FROM bk_fines WHERE patron_id = '$id' && fine_status = 'active' || fine_status = 'partial'")); $item_count = mysql_fetch_row(mysql_query("SELECT COUNT(item_id) FROM bk_items WHERE item_status = 'out' && patron_id = '$id'")); echo bk_var('header'); if($item['patron_status'] == 'delete' && bk_var('patron_type') != 'admin') echo 'Deleted Patron | ' . bk_var('lib_name'); else {if(bk_var('patron_type') != 'admin' && $id != bk_var('patron_id')) echo 'Private Record'; else echo 'Patron: ' . $item['name']; echo ' | ' . bk_var('lib_name');} echo '
'; bk_header(); if(!empty($_REQUEST['barcode'])) {$barcode = $_REQUEST['barcode']; $item_info = mysql_fetch_row(mysql_query("SELECT item_id, record_id, patron_id FROM bk_items WHERE item_barcode = '$barcode' LIMIT 1")); $record_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_records WHERE record_id = '$item_info[1]' LIMIT 1")); $lib_settings = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_settings LIMIT 1")); $checkout_period = mysql_fetch_row(mysql_query("SELECT checkout_period FROM bk_records WHERE record_id = '$item_info[1]' LIMIT 1")); if(!empty($_REQUEST['due_date']) && time($_REQUEST['due_date']) != '' && $_REQUEST['due_date'] != 'YYYY-MM-DD') $item_due_date = $_REQUEST['due_date']; else $item_due_date = date('Y-m-d', time() + ($checkout_period['0'] * 86400)); if($item_info['0'] == '') echo '

Item does not ' . 'exist.

'; elseif($item_info['2'] == $id) {$add = mysql_query("UPDATE bk_items SET item_status = 'out', item_out_date = NOW(), item_due_date = '$item_due_date', item_circ_count = item_circ_count + 1, item_renewal_count = item_renewal_count + 1, patron_id = '$id' WHERE item_barcode = '$barcode' LIMIT 1"); $history = mysql_query("INSERT INTO bk_history (patron_id, item_id, item_action, item_status_date, item_due_date) VALUES ('$id', '$item_info[0]', 'renew', NOW(), '$item_due_date')"); echo '

Item renewed successfully.

';} elseif($item_info['2'] != $id && $item_info['2'] != '0') echo '

Item is already checked out to another' . ' patron. Please check it in first.

'; else {$check_hold = mysql_fetch_row(mysql_query("SELECT hold_id FROM bk_holds WHERE record_id = '$item_info[1]' && item_id = '0' || item_id = '$item_info[0]' && patron_id = '$item_info[2]' && hold_status = 'active' LIMIT 1")); if($check_hold['0'] != '') $hold = mysql_query("UPDATE bk_holds SET hold_status = 'fulfilled' WHERE record_id = '$item_info[1]' && item_id = '0' or item_id = '$item_info[0]' && patron_id = '$item_info[2]' && hold_status = 'active' LIMIT 1"); $add = mysql_query("UPDATE bk_items SET item_status = 'out', item_hold_for = '0', item_out_date = NOW(), item_due_date = '$item_due_date', item_circ_count = item_circ_count + 1, patron_id = '$id' WHERE item_barcode = '$barcode' LIMIT 1"); $history = mysql_query("INSERT INTO bk_history (patron_id, item_id, item_action, item_status_date, item_due_date) VALUES ('$id', '$item_info[0]', 'out', NOW(), '$item_due_date')"); echo '

Item checked out successfully'; if($check_hold['0'] != '') { $patron_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_patrons WHERE patron_id = '$id' LIMIT 1")); echo ', fulfilling hold #' . $check_hold['0'] . '.'; // Alert emails will be added in a future version. // if($patron_info['email'] != '') {echo // ' An email has been sent to ' . // $patron_info['email'] . '.'; // mail($patron_info['name'] . '<' . // $patron_info['email'] . '>', bk_var('lib_name') . // ': Hold Request', wordwrap('Your requested item, ' . // $record_info['title'] . ', is awaiting pickup at ' . // bk_var('lib_name') . '. It will be held for ' . // 'three days.' . "\r\n\r\n" . 'To cancel your hold or' . // ' ask questions, please contact the library by email' . // ' at ' . $lib_settings['email'] . ' or by phone at ' . // $lib_settings['phone'] . '. Thank you.', 70), 'From: ' . // bk_var('lib_name') . ' <' . // $lib_settings['email'] . '>' . "\r\n" . 'Reply-To: ' . // bk_var('lib_name') . ' <' . // $lib_settings['email'] . '>' . "\r\n" . 'X-Mailer: ' . // 'PHP/' . phpversion());} } echo '

';}} bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ''; if(bk_var('patron_type') == 'admin' || $id == bk_var('patron_id')) echo ': ' . $item['patron_barcode'] . ': ' . $item['name']; echo '

'; if($item['patron_id'] == '') echo '

Patron does not exist.

'; elseif($item['patron_status'] == 'delete' && bk_var('patron_type') != 'admin') echo '

This patron has been deleted.' . '

'; elseif(bk_var('patron_type') != 'admin' && $id != bk_var('patron_id')) echo '

You may not view this patron.

'; else {if(bk_var('patron_type') == 'admin') {echo '
' . 'Check Out or Renew Item:

' . '


Barcode Number: $item['max_fines'] || $item_count['0'] == $item['checkout_limit'] || $item_count['0'] > $item['checkout_limit']) {echo ' onclick="return confirm(' . '\'Are you sure?'; if($total_fines['0'] > $item['max_fines']) { echo ' This patron has fines in excess of '; if($item['gender'] == 'M') echo 'his'; else echo 'her'; echo ' fine threshold.';} if($item_count['0'] >= $item['checkout_limit']) {echo ' This' . ' patron has reached '; if($item['gender'] == 'M') echo 'his'; else echo 'her'; echo ' checkout limit.';} echo '\');"';} echo ' /> Custom Due Date:
';} echo '

Items Out:

'; $item_info = mysql_query("SELECT * FROM bk_items WHERE patron_id = '$id' && item_status != 'delete' ORDER BY item_due_date DESC LIMIT 100"); while($theitem = mysql_fetch_assoc($item_info)) {if($theitem['item_status'] == 'delete') echo ''; else {$record_id = $theitem['record_id']; $title = mysql_fetch_row(mysql_query("SELECT title FROM bk_records WHERE record_id = '$record_id' LIMIT 1")); $patron_id = $theitem['patron_id']; $renewal_limit = mysql_fetch_row(mysql_query("SELECT renewal_limit FROM bk_patrons WHERE patron_id = '$patron_id' LIMIT 1")); echo '


' . '

' . $theitem['item_barcode'] . ': ' . '' . $title['0'] . '
Checked out: ' . substr($theitem['item_out_date'], 0, 10) . ', due ' . 'back: ' . substr($theitem['item_due_date'], 0, 10) . ', ' . $theitem['item_renewal_count'] . ' renewal' . bk_plural($theitem['item_renewal_count']) . '.'; echo ' [= $renewal_limit['0']) echo ' onclick="return confirm(\'Are ' . 'you sure? This item has been renewed the maximum number of ' . 'times.\');"'; echo '>RENEW]'; if(bk_var('patron_type') == 'admin') echo ' [EDIT] [DELETE] [ERASE]'; echo '

';}} echo '
' . '
Fines:'; if($total_fines['0'] != '' && $total_fines['0'] != '0') { echo ' [TOTAL: $' . $total_fines['0']; if(substr($total_fines['0'], -2, -1) == '.') echo '0'; echo ']';} echo '

'; $fine_info = mysql_query("SELECT * FROM bk_fines WHERE patron_id = '$id' && fine_status = 'active' || fine_status = 'partial' ORDER BY item_return_date DESC LIMIT 10000"); while($thefine = mysql_fetch_assoc($fine_info)) { if($thefine['fine_status'] == 'delete' || $thefine['fine_status'] == 'paid' || $thefine['fine_status'] == 'waive') echo ''; else { $item_id = $thefine['item_id']; $itemi = mysql_fetch_row(mysql_query("SELECT item_barcode, record_id FROM bk_items WHERE item_id = '$item_id' LIMIT 1")); $record = mysql_fetch_row(mysql_query("SELECT title FROM bk_records WHERE record_id = '$itemi[1]' LIMIT 1")); echo '


' . '

' . $itemi['0'] . ': ' . $record['0'] . '
Returned: ' . substr($thefine['item_return_date'], 0, 10) . ', ' . '' . $thefine['days_late'] . ' day' . bk_plural($thefine['days_late']) . ' late. Fine: ' . '$' . $thefine['fine_amount'] . ''; if($thefine['fine_remainder'] != $thefine['fine_amount']) echo ', Remainder: $' . $thefine['fine_remainder'] . ''; echo '.'; if(bk_var('patron_type') == 'admin') echo '
[EDIT] [PAY] [WAIVE' . '] [DELETE] [ERASE' . ']'; echo '

';}} echo '
'; echo '

Holds:

'; $hold_info = mysql_query("SELECT * FROM bk_holds WHERE patron_id = '$id' && hold_status = 'active' ORDER BY hold_priority, hold_date_gmt DESC LIMIT 10000"); while($thehold = mysql_fetch_assoc($hold_info)) { $record_id = $thehold['record_id']; $title = mysql_fetch_row(mysql_query("SELECT title FROM bk_records WHERE record_id = '$record_id' LIMIT 1")); $barcode = mysql_fetch_row(mysql_query("SELECT item_barcode FROM bk_items WHERE record_id = '$record_id' LIMIT 1")); $record_id = $thehold['record_id']; $patron_id = $thehold['patron_id']; $item_status = mysql_fetch_row(mysql_query("SELECT item_id FROM bk_items WHERE record_id = '$record_id' && item_status = 'hold' && item_hold_for = '$patron_id' LIMIT 1")); echo '


' . '

' . $barcode['0'] . ': ' . $title['0'] . '
Priority ' . $thehold['hold_priority'] . ', placed ' . substr($thehold['hold_date_gmt'], 0, 10) . '.'; if($item_status['0'] != '') echo ' Awaiting Pickup' . '.'; if(bk_var('patron_type') == 'admin') echo ' [EDIT]'; echo ' [CANCEL]'; if(bk_var('patron_type') == 'admin') echo ' [' . 'ERASE]'; echo '

';} echo '
'; echo '
Patron Information:'; if(bk_var('patron_type') == 'admin' || $id == bk_var('patron_id')) echo ' [EDIT]'; if(bk_var('patron_type') == 'admin') {echo ' ['; if($item['patron_status'] == 'delete') echo 'DELETED'; else echo 'DELETE'; echo '] ['; if($item['patron_status'] == 'delete') echo 'REST||E'; else echo 'ERASE'; echo ']'; } echo '


'; echo ''; echo ''; if($item['patron_updated'] != '0000-00-00 00:00:00') echo ''; if($item['patron_type'] != '') echo ''; if($item['name'] != '') echo ''; if($item['address'] != '') echo '' . ''; if($item['home_phone'] != '') echo ''; if($item['work_phone'] != '') echo ''; if($item['email'] != '') echo ''; if($item['birth_date'] != '0000-00-00') echo ''; if($item['drivers_license'] != '') echo ''; if($item['alt_card'] != '') echo ''; if($item['alt_card_origin'] != '') echo ''; echo '
Patron Info: ID: ' . $item['patron_id'] . ', Linked ID: ' . $item['patron_linked_id'] . ', Barcode: ' . $item['patron_barcode'] . ', Gender: ' . $item['gender'] . '
Checkout Limit: ' . $item['checkout_limit'] . ', Renewal Limit: ' . $item['renewal_limit'] . ', Fines: ' . $item['fines_flag'] . ', Max: $' . $item['max_fines'] . '
Patron Registered: ' . str_replace(' ', 'T', $item['patron_registered']) . 'Z
Patron Updated: ' . str_replace(' ', 'T', $item['patron_updated']) . 'Z
Patron Type:' . ' ' . ucfirst($item['patron_type']) . '
Name: ' . $item['name'] . '
Address: ' . nl2br($item['address']) . '
Home Phone:' . ' ' . $item['home_phone'] . '
Work Phone:' . ' ' . $item['work_phone'] . '
Email Address: ' . '' . $item['email'] . '
Birth ' . 'Date: ' . $item['birth_date'] . '
Drivers ' . 'License: ' . $item['drivers_license'] . '
Alternate Card:' . ' ' . $item['alt_card'] . '
Alternate ' . 'Card Origin: ' . $item['alt_card_origin'] . '
'; if($item['notes'] != '') echo '

Patron Notes:' . '


' . nl2br(bk_text_format($item['notes'])) . '

'; } bk_lib_footer(); echo '
';}} // ************************ // // If you are not one of us, you are one of them. elseif($_REQUEST['module'] == 'fines') { if($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'fine/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Fine | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $fine = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); if($fine['fine_id'] == '') echo '

Fine does not exist.

'; elseif(!empty($_REQUEST['zec'])) {$item_id = $_REQUEST['item_id']; $patron_id = $_REQUEST['patron_id']; $fine_status = $_REQUEST['fine_status']; $item_out_date = $_REQUEST['item_out_date']; $item_due_date = $_REQUEST['item_due_date']; $item_return_date = $_REQUEST['item_return_date']; $days_late = $_REQUEST['days_late']; $fine_amount = $_REQUEST['fine_amount']; $fine_remainder = $_REQUEST['fine_remainder']; $fine_notes = $_REQUEST['fine_notes']; if(bk_var('patron_type') == 'admin') $add = mysql_query("UPDATE bk_fines SET item_id = '$item_id', patron_id = '$patron_id', fine_status = '$fine_status', item_out_date = '$item_out_date', item_due_date = '$item_due_date', item_return_date = '$item_return_date', days_late = '$days_late', fine_amount = '$fine_amount', fine_remainder = '$fine_remainder', fine_notes = '$fine_notes' WHERE fine_id = '$id' LIMIT 1"); echo '

Fine edited successfully.

' . '';} elseif(bk_var('patron_type') == 'admin') {echo '

Edit ' . 'Fine

Item ID: ' . ' | ' . 'Patron ID: ' . ' | ' . 'Days Late: ' . '
' . 'Fine Amount: ' . '' . ' | Fine Remainder: ' . '
' . 'Fine Status (active, delete, waive, paid, partial): ' . '
Item Out Date:
' . '
' . 'Item Due Date:
' . '
' . 'Item Return Date:
' . '
' . 'Fine Notes:
' . '
' . '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not edit this fine.

'; bk_lib_footer(); echo '
';} // ************************ // // Throughout human history, we have been dependent on machines to survive. elseif($_REQUEST['action'] == 'pay') {$id = trim($_REQUEST['id']); $patron_id = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); echo bk_var('header') . 'Pay Fine | ' . bk_var('lib_name') . '
'; bk_var('logo'); bk_var('profile'); echo ''; bk_header(); $fine = mysql_fetch_row(mysql_query("SELECT fine_id, fine_status FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); if($fine['0'] == '') echo '

Fine does not exist.' . '

'; elseif($fine['1'] == 'paid') echo '
' . '

Fine is already paid.

'; elseif(bk_var('patron_type') == 'admin' && $fine['0'] != '' && $fine['1'] != '') {$pay = mysql_query("UPDATE bk_fines SET fine_status = 'paid' WHERE fine_id = '$id' LIMIT 1"); echo '

Fine paid ' . 'successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not pay this fine.

'; bk_lib_footer(); echo '
';} // ************************ // // Fate, it seems, is not without a sense of irony. elseif($_REQUEST['action'] == 'waive') {$id = trim($_REQUEST['id']); $patron_id = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); echo bk_var('header') . 'Waive Fine ' . '| ' . bk_var('lib_name') . '
'; bk_var('logo'); bk_var('profile'); echo ''; bk_header(); $fine = mysql_fetch_row(mysql_query("SELECT fine_id, fine_status FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); if($fine['0'] == '') echo '

Fine does not exist.' . '

'; elseif($fine['1'] == 'waive') echo '
' . '

Fine is already waived.

'; elseif(bk_var('patron_type') == 'admin' && $fine['0'] != '' && $fine['1'] != '') {$waive = mysql_query("UPDATE bk_fines SET fine_status = 'waive' WHERE fine_id = '$id' LIMIT 1"); echo '

Fine ' . 'waived successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not waive this fine.

'; bk_lib_footer(); echo '
';} // ************************ // // Do not try and bend the spoon. That's impossible. // Instead... only try to realize the truth. elseif($_REQUEST['action'] == 'delete') {$id = trim($_REQUEST['id']); $patron_id = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); echo bk_var('header') . 'Delete Fine' . ' | ' . bk_var('lib_name') . '
'; bk_header(); $fine = mysql_fetch_row(mysql_query("SELECT fine_id, fine_status FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ': Delete Fine

' . '
'; if($fine['0'] == '') echo '

Fine does ' . 'not exist.

'; elseif($fine['1'] == 'delete') echo '

Fine is already deleted.

'; elseif(bk_var('patron_type') == 'admin' && $fine['0'] != '' && $fine['1'] != 'delete') {$delete = mysql_query("UPDATE bk_fines SET fine_status = 'delete' WHERE fine_id = '$id' LIMIT 1"); echo '
' . '

Fine deleted successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not delete this fine.

'; bk_lib_footer(); echo '
';} // ************************ // // Do you believe in fate, Neo? elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); $patron_id = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); echo bk_var('header') . 'Erase Fine ' . '| ' . bk_var('lib_name') . '
'; bk_var('logo'); bk_var('profile'); echo ''; bk_header(); $fine = mysql_fetch_assoc(mysql_query("SELECT fine_id FROM bk_fines WHERE fine_id = '$id' LIMIT 1")); if($fine['fine_id'] == '') echo '

Fine does not ' . 'exist.

'; elseif(bk_var('patron_type') == 'admin') {$erase = mysql_query("DELETE FROM bk_fines WHERE fine_id = '$id' LIMIT 1"); echo '
' . '

Fine erased successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not erase this fine.

'; bk_lib_footer(); echo '
';}} // ************************ // // No. elseif($_REQUEST['module'] == 'holds') { if($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'hold/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Hold | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $hold = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_holds WHERE hold_id = '$id' LIMIT 1")); if($hold['hold_id'] == '') echo '

Hold does not exist.

'; elseif(!empty($_REQUEST['zec'])) {$record_id = $_REQUEST['record_id']; $item_id = $_REQUEST['item_id']; $patron_id = $_REQUEST['patron_id']; $hold_status = $_REQUEST['hold_status']; $hold_date_gmt = $_REQUEST['hold_date_gmt']; $hold_priority = $_REQUEST['hold_priority']; $hold_notes = $_REQUEST['hold_notes']; if(bk_var('patron_type') == 'admin') $add = mysql_query("UPDATE bk_holds SET record_id = '$record_id', item_id = '$item_id', patron_id = '$patron_id', hold_status = '$hold_status', hold_date_gmt = '$hold_date_gmt', hold_priority = '$hold_priority', hold_notes = '$hold_notes' WHERE hold_id = '$id' LIMIT 1"); echo '

Hold edited successfully.

' . '';} elseif(bk_var('patron_type') == 'admin') { echo '
Record ID: ' . ' | ' . 'Item ID: ' . ' | ' . 'Patron ID: ' . '' . '
Priority (1 = high, 5 = normal, 9 = low): ' . '
' . 'Hold Status (active, cancel, fulfilled): ' . '
' . 'Date Placed:
' . '
' . 'Hold Notes:
' . '
' . '' . '

' . '
';} elseif(bk_var('patron_type') != 'admin') echo '

You may not edit this hold.

'; bk_lib_footer(); echo '
';} // ************************ // // Why not? elseif($_REQUEST['action'] == 'cancel') {$id = trim($_REQUEST['id']); $record = mysql_fetch_row(mysql_query("SELECT record_id, hold_status FROM bk_holds WHERE hold_id = '$id' LIMIT 1")); echo bk_var('header') . 'Cancel Hold | ' . bk_var('lib_name') . '
'; bk_header(); $patron_id = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_holds WHERE hold_id = '$id' LIMIT 1")); bk_var('logo'); bk_var('profile'); echo ''; if($record['0'] == '') echo '

Hold does not exist.

' . '
'; elseif($record['1'] == 'cancel') echo '
' . '

Hold is already canceled.

'; elseif((bk_var('patron_type') == 'admin' || $patron_id['0'] == bk_var('patron_id')) && $record['0'] != '' && $record['1'] != 'cancel') {$cancel = mysql_query("UPDATE bk_holds SET hold_status = 'cancel' WHERE hold_id = '$id' LIMIT 1"); $item = mysql_fetch_row(mysql_query("SELECT item_status, item_hold_for FROM bk_items WHERE record_id = '$record[0]' LIMIT 1")); if($item['0'] == 'hold') $hold = mysql_query("UPDATE bk_items SET item_status = 'in', item_hold_for = '0' WHERE record_id = '$record[0]' LIMIT 1"); elseif($item['0'] != 'hold' && $item['1'] != '0') $hold = mysql_query("UPDATE bk_items SET item_hold_for = '0' WHERE record_id = '$record[0]' LIMIT 1"); echo '

Hold canceled successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not cancel this hold.

'; bk_lib_footer(); echo '
';} // ************************ // // Because I don't like the idea that I'm not in control of my life. elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); $record_id = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_holds WHERE hold_id = '$id' LIMIT 1")); echo bk_var('header') . 'Erase Hold ' . '| ' . bk_var('lib_name') . '
'; bk_var('logo'); bk_var('profile'); echo ''; bk_header(); if($record_id['0'] == '') echo '

Hold does not exist.

'; elseif(bk_var('patron_type') == 'admin' && $record_id['0'] != '') { $erase = mysql_query("DELETE FROM bk_holds WHERE hold_id = '$id' LIMIT 1"); echo '

Hold erased successfully.

' . '';} elseif(bk_var('patron_type') != 'admin') echo '

You may not erase this hold.

'; bk_lib_footer(); echo '
';} // ************************ // // I know *exactly* what you mean. Let me tell you why you're here. // You're here because you know something. // What you know you can't explain, but you feel it. You've felt it // your entire life, that there's something wrong with the world. // You don't know what it is, but it's there, like a splinter in your mind, // driving you mad. It is this feeling that has brought you to me. // Do you know what I'm talking about? elseif($_REQUEST['action'] == 'fulfill') {$id = trim($_REQUEST['id']); $patron_id = trim($_REQUEST['p']); $record_id = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_holds WHERE hold_id = '$id' LIMIT 1")); echo bk_var('header') . 'Fulfill Hold | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; if($record_id['0'] == '') echo '

Hold does not exist.

'; elseif(bk_var('patron_type') == 'admin' && $record_id['0'] != '') { $fulfill = mysql_query("UPDATE bk_items SET item_status = 'hold', item_hold_for = '$patron_id' WHERE record_id = '$record_id[0]' LIMIT 1"); echo '

Hold fulfilled successfully.

' . '
';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not fulfill this hold.

'; bk_lib_footer(); echo '
';}} // ************************ // // The Matrix. // Branch support will be added in a future version. if(bk_version() == '1.1') { if($_REQUEST['module'] == 'branches') { if($_REQUEST['action'] == 'new') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'branch/new', TRUE, 301); echo bk_var('header') . 'Create Branch | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; if(!empty($_REQUEST['zec'])) { $branch_name = $_REQUEST['branch_name']; $branch_hours = $_REQUEST['branch_hours']; $branch_status = $_REQUEST['branch_status']; $branch_email = $_REQUEST['branch_email']; if(bk_var('patron_type') == 'admin') $add = mysql_query("INSERT INTO bk_branches (branch_name, branch_hour, branch_status, branch_email) VALUES('$branch_name', '$branch_hours', '$branch_status', '$branch_email')"); echo '

Branch created successfully.

' . '';} elseif(bk_var('patron_type') == 'admin') { echo '
Branch Name:
' . '
Branch Hours:
' . '
Branch Status (open, closed, delete):' . '

Branch Email: ' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

' . 'You may not edit this branch.

'; bk_lib_footer(); echo '
';} // ************************ // // Do you want to know what it is? elseif($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'branch/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Branch | ' . bk_var('lib_name') . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $branch = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_branches WHERE branch_id = '$id' LIMIT 1")); if($branch['branch_id'] == '') echo '

Branch does not exist.

'; elseif(!empty($_REQUEST['zec'])) { $branch_name = $_REQUEST['branch_name']; $branch_hours = $_REQUEST['branch_hours']; $branch_status = $_REQUEST['branch_status']; $branch_email = $_REQUEST['branch_email']; if(bk_var('patron_type') == 'admin') $add = mysql_query("UPDATE bk_branches SET branch_name = '$branch_name', branch_hours = '$branch_hours', branch_status = '$branch_status', branch_email = '$branch_email' WHERE branch_id = '$id' LIMIT 1"); echo '

Branch edited successfully.

' . '';} elseif(bk_var('patron_type') == 'admin') { echo '
Branch Name:
' . '
Branch Hours:
' . '
Branch Status (open, closed, delete):
' . '
Branch Email: ' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not edit this branch.' . '

'; bk_lib_footer(); echo '
';} // ************************ // // Yes. elseif($_REQUEST['action'] == 'delete') {$id = trim($_REQUEST['id']); $branch = mysql_fetch_row(mysql_query("SELECT branch_status FROM bk_branches WHERE branch_id = '$id' LIMIT 1")); echo bk_var('header') . 'Delete ' . 'Branch | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; if($branch['0'] == '') echo '

Branch does not exist.

' . '
'; elseif($branch['0'] == 'delete') echo '
' . '

Hold is already deleted.

'; elseif(bk_var('patron_type') == 'admin' && $branch['0'] != '' && $branch['0'] != 'delete') {$delete = mysql_query("UPDATE bk_branches SET branch_status = 'delete' WHERE branch_id = '$id' LIMIT 1"); echo '

Branch deleted successfully.

' . '';} elseif(bk_var('patron_type') != 'admin') echo '

You may not delete this branch.

'; bk_lib_footer(); echo '
';} // ************************ // // The Matrix is everywhere, it is all around us, even now in this very room. // You can see it when you look out your window, or you turn on your // television. You can feel it when you go to work, when you go to church, when // you pay your taxes. It is the world that has been pulled over your eyes to // blind you from the truth. elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); $branch = mysql_fetch_row(mysql_query("SELECT branch_status FROM bk_branches WHERE branch_id = '$id' LIMIT 1")); echo bk_var('header') . 'Erase ' . 'Branch | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; if($branch['0'] == '') echo '

Branch does not exist.

'; elseif(bk_var('patron_type') == 'admin' && $branch['0'] != '') { $erase = mysql_query("DELETE FROM bk_branches WHERE branch_id = '$id' LIMIT 1"); echo '

Branch erased ' . 'successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not erase this ' . 'branch.

'; bk_lib_footer(); echo '
';} // ************************ // // What truth? elseif($_REQUEST['action'] == 'restore') {$id = trim($_REQUEST['id']); $branch = mysql_fetch_row(mysql_query("SELECT branch_status FROM bk_branches WHERE branch_id = '$id' LIMIT 1")); echo bk_var('header') . 'Restore ' . 'Branch | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; if($branch['0'] == '') echo '

Branch does not exist.

' . '
'; elseif($branch['0'] == 'open') echo '
' . '

Hold is already restored.

'; elseif(bk_var('patron_type') == 'admin' && $branch['0'] != '' && $branch['0'] != 'open') {$restore = mysql_query("UPDATE bk_branches SET branch_status = 'open' WHERE branch_id = '$id' LIMIT 1"); echo '

Branch restored successfully.

' . '';} elseif(bk_var('patron_type') != 'admin') echo '

You may not restore this branch.

'; bk_lib_footer(); echo '
';}}} // ************************ // // That you are a slave, Neo. Like everyone else, you were born into bondage... // born into a prison that you cannot smell or taste or touch. // A prison for your mind. if(bk_installation_type() == 'bookley') { if($_REQUEST['module'] == 'comments') { if($_REQUEST['action'] == 'edit') {$id = trim($_REQUEST['id']); $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if(bk_var('lib_sub') != '' && ($subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'comment/edit/' . $id, TRUE, 301); echo bk_var('header') . 'Edit Comment | ' . bk_var('lib_name') . '' . '' . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $comment = mysql_fetch_row(mysql_query("SELECT record_id, comment_content FROM bk_comments WHERE comment_id = '$id' LIMIT 1")); if($comment['0'] == '') echo '

Comment does not exist.

'; elseif(!empty($_REQUEST['bec']) && bk_var('patron_type') == 'admin') echo '

Comment edited successfully.

' . ''; if(bk_var('patron_type') == 'admin' && empty($_REQUEST['bec']) && $comment['0'] != '') echo '
Content:

' . '

'; if(!empty($_REQUEST['bec']) && bk_var('patron_type') == 'admin' && $comment['0'] != '') {$content = $_REQUEST['content']; $edit_comment = mysql_query("UPDATE bk_comments SET comment_content = '$content' WHERE comment_id = '$id' LIMIT 1");} elseif(bk_var('patron_type') != 'admin' && $comment['0'] != '') echo '

You may not edit this comment.

'; bk_lib_footer(); echo '
';} // ************************ // // I'm trying to free your mind, Neo. But I can only show you the door. // You're the one that has to walk through it. elseif($_REQUEST['action'] == 'delete') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Delete Comment | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $comment = mysql_fetch_row(mysql_query("SELECT record_id, comment_status FROM bk_comments WHERE comment_id = '$id' LIMIT 1")); if($comment['0'] == '') echo '

Comment does not exist.

'; elseif($comment['1'] == 'delete') echo '

Comment' . ' is already deleted.

'; if(bk_var('patron_type') == 'admin' && $comment['0'] != '' && $comment['1'] != 'delete') { $delete = mysql_query("UPDATE bk_comments SET comment_status = 'delete' WHERE comment_id = '$id' LIMIT 1"); echo '
' . '

Comment deleted successfully.

';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not delete this comment.

'; bk_lib_footer(); echo '
';} // ************************ // // Why do my eyes hurt? elseif($_REQUEST['action'] == 'erase') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Erase Comment | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $comment = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_comments WHERE comment_id = '$id' LIMIT 1")); if($comment['0'] == '') echo '

Comment does not exist.

'; if(bk_var('patron_type') == 'admin' && $comment['0'] != '') { $erase = mysql_query("DELETE FROM bk_comments WHERE comment_id = '$id' LIMIT 1"); echo '

Comment erased successfully.

' . '';} elseif(bk_var('patron_type') != 'admin') echo '

You may not erase ' . 'this comment.

'; bk_lib_footer(); echo '
';} // ************************ // // You've never used them before. elseif($_REQUEST['action'] == 'restore') {$id = trim($_REQUEST['id']); echo bk_var('header') . 'Restore Comment | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo ''; $comment = mysql_fetch_row(mysql_query("SELECT record_id, comment_status FROM bk_comments WHERE comment_id = '$id' LIMIT 1")); if($comment['0'] == '') echo '

Comment does not exist.

'; elseif($comment['1'] == 'publish') echo '

' . 'Comment is already restored.

'; if(bk_var('patron_type') == 'admin' && $comment['0'] != '' && $comment['1'] != 'publish') { $restore = mysql_query("UPDATE bk_comments SET comment_status = 'publish' WHERE comment_id = '$id' LIMIT 1"); echo '

Comment restored successfully.

' . '
';} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not restore this comment.

'; bk_lib_footer(); echo '
';}}} // ************************ // // Neo, sooner or later you're going to realize just as I did that // there's a difference between knowing the path and walking the path. if($_REQUEST['module'] == 'home') { $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if(bk_var('lib_sub') != '' && $subd != bk_var('lib_sub')) header('Location: ' . bk_var('lib'), TRUE, 301); if($_REQUEST['q'] != '') header('Location: ' . bk_var('lib') . 'search/' . $_REQUEST['mode'] . '/' . urlencode($_REQUEST['q']), TRUE, 301); echo bk_var('header') . bk_var('lib_name') . '' . '
'; bk_header(); if(!empty($_REQUEST['patron_barcode']) && !empty($_REQUEST['patron_pass'])) { $patron_barcode = $_REQUEST['patron_barcode']; $patron_pass = md5($_REQUEST['patron_pass']); $check = mysql_fetch_row(mysql_query("SELECT patron_pass, name, home_phone, work_phone FROM bk_patrons WHERE patron_barcode = '$patron_barcode' LIMIT 1")); if($check['0'] == '') { $last_name = preg_split('/\s+/', trim($check['1'])); $last_4_home = substr($check['2'], -4); $last_4_work = substr($check['3'], -4); if($last_4_home != '' && strlen($last_4_home) == '4') $last_4 = $last_4_home; elseif($last_4_work != '' && strlen($last_4_work) == '4') $last_4 = $last_4_work; else $last_4 = ''; $patron_pass = $last_name[count($last_name) - 1] . $last_4; if($_REQUEST['patron_pass'] == strtolower($patron_pass)) $patron_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_patrons WHERE patron_barcode = '$patron_barcode' && patron_pass = '' LIMIT 1"));} else $patron_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_patrons WHERE patron_barcode = '$patron_barcode' && patron_pass = '$patron_pass' LIMIT 1")); if($patron_info['patron_id'] != '') {$_SESSION['LoggedIn'] = 1; $_SESSION['user_email'] = $patron_info['email']; $_SESSION['patron_id'] = $patron_info['patron_id']; $_SESSION['patron_barcode'] = $patron_barcode;} else echo '

Login failed. Incorrect barcode or ' . 'password.

';} if(bk_var('patron_type') == 'admin') { if(!empty($_REQUEST['patron_lookup'])) { $patron_lookup = $_REQUEST['patron_lookup']; $patron_lookup = mysql_fetch_row(mysql_query("SELECT patron_id FROM bk_patrons WHERE patron_barcode = '$patron_lookup' LIMIT 1")); if($patron_lookup['0'] == '') echo '

Patron does not ' . 'exist.

'; elseif($patron_lookup['0'] != '') echo '

Patron located successfully. Forwarding...

' . '
';}} if(!empty($_REQUEST['record_lookup'])) { $record_lookup = $_REQUEST['record_lookup']; $record_lookup = mysql_fetch_row(mysql_query("SELECT record_id FROM bk_items WHERE item_barcode = '$record_lookup' LIMIT 1")); if($record_lookup['0'] == '') echo '

Record does' . ' not exist.

'; elseif($record_lookup['0'] != '') echo '

Record located successfully. Forwarding...

' . '
';} if(!empty($_REQUEST['barcode'])) {$barcode = $_REQUEST['barcode']; $check = mysql_fetch_row(mysql_query("SELECT item_id, patron_id, item_out_date, item_due_date, record_id, item_status FROM bk_items WHERE item_barcode = '$barcode' LIMIT 1")); if($_REQUEST['return_date'] == '' || $_REQUEST['return_date'] == 'YYYY-MM-DD') {$days_late = (strtotime(date('Y-m-d')) - strtotime($check['3'])) / 86400; if(substr($days_late, 0, 1) == '-') $days_late = '0'; $return_date = date('Y-m-d H:i:s');} else { $days_late = (strtotime($_REQUEST['return_date']) - strtotime($check['3'])) / 86400; if(substr($days_late, 0, 1) == '-') $days_late = '0'; $return_date = $_REQUEST['return_date'];} $check_holds = mysql_fetch_row(mysql_query("SELECT patron_id, hold_status, hold_id FROM bk_holds WHERE record_id = '$check[4]' && item_id = '0' || item_id = '$check[0]' && patron_id = '$check[1]' && hold_status = 'active' ORDER BY hold_status, hold_priority, hold_date_gmt ASC LIMIT 1")); if($days_late > 3650 || $check['3'] == '' || $check['3'] == '0000-00-00') $days_late = '0'; if($check['0'] == '') echo '

Item ' . $barcode . ' does not exist.

'; elseif($check['5'] == 'in' && $check_holds['1'] != 'active') echo '

Item ' . $barcode . ' is on shelf.

'; else {if($days_late != '' && $days_late != '0') {$daily_late_fee = mysql_fetch_row(mysql_query("SELECT daily_late_fee FROM bk_records WHERE record_id = '$check[4]' LIMIT 1")); $late_fee = ($daily_late_fee['0'] * $days_late); if(substr($late_fee, -2) != '00' && substr($late_fee, -2) != '25' && substr($late_fee, -2) != '50' && substr($late_fee, -2) != '75' && substr($late_fee, -2, -1) == '.') $late_fee .= '0'; $fines_on = mysql_fetch_row(mysql_query("SELECT fines_flag FROM bk_patrons WHERE patron_id = '$check[1]' LIMIT 1")); if(($_REQUEST['fines_flag'] == 'Y' || $fines_on['0'] == 'Y') && $days_late != '' && $days_late != '0' && $check['5'] != 'in') $fine = mysql_query("INSERT INTO bk_fines (item_id, patron_id, fine_status, item_out_date, item_due_date, item_return_date, days_late, fine_amount, fine_remainder) VALUES ('$check[0]', '$check[1]', 'active', '$check[2]', '$check[3]', '$return_date', '$days_late', '$late_fee', '$late_fee')");} $update = mysql_query("UPDATE bk_items SET item_status = 'in', item_out_date = '0000-00-00 00:00:00', item_due_date = '0000-00-00', item_renewal_count = '0', patron_id = '0' WHERE item_barcode = '$barcode' LIMIT 1"); if($check['5'] != 'in') $history = mysql_query("INSERT INTO bk_history (patron_id, item_id, item_action, item_status_date, item_due_date, item_return_date, item_fine) VALUES ('$check[1]', '$check[0]', 'in', NOW(), '$check[3]', '$return_date', '$late_fee')"); echo '

Item ' . $barcode . ' checked in successfully.'; if(($_REQUEST['fines_flag'] == 'Y' || $fines_on['0'] == 'Y') && $days_late != '' && $days_late != '0' && $check['5'] != 'in') {echo ' The item was ' . number_format($days_late) . ' days late; a ' . 'fine of $' . $late_fee . ' has ' . 'been assessed.';} echo '

'; if($check_holds['1'] == 'active') { $patron = mysql_fetch_row(mysql_query("SELECT patron_barcode, name, address, home_phone, work_phone, email FROM bk_patrons WHERE patron_id = '$check_holds[0]' LIMIT 1")); echo '

Please fulfill this ' . 'item\'s open hold:


Patron Barcode: ' . '' . '' . ''; if($patron['3'] != '') echo '' . '' . ''; if($patron['4'] != '') echo ''; if($patron['5'] != '') echo ''; echo '
' . $patron['0'] . '' . '
Name:' . ' ' . $patron['1'] . '
Address: ' . '' . nl2br($patron['2']) . '
Home Phone: ' . $patron['3'] . '
Work Phone: ' . $patron['4'] . '
Email Address: ' . $patron['5'] . '
' . '

Once you have placed this item' . ' on the holds cart, click here.' . '

';} echo '
';}} $settings = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_settings")); bk_var('logo'); bk_var('profile'); if(bk_var('patron_type') == 'admin') echo '

Check In Item:


Barcode Number: ' . ' ' . ' Custom Return Date: ' . ' Charge Fines?
'; if(bk_var('patron_id') == '') echo '

Log In:


' . 'Password:

' . '


If you did not provide one' . ', your password is your last name (in lowercase) followed by the ' . 'last four digits of your home phone number. If you did not provide ' . 'your home phone number, your password is your last name (in ' . 'lowercase) followed by the last four digits of your work phone ' . 'number. If you provided no phone numbers, your password is simply ' . 'your last name (in lowercase). If your name ends in a suffix such ' . 'as "Jr.", "Sr.", or "III," substitute that for your last name.

' . '
'; if(bk_var('patron_type') == 'admin') echo '

' . 'Patron Lookup:


Barcode Number:
'; echo '

Record Lookup:


Item ' . 'Barcode: ' . '
'; if($settings['home_text_top'] != '') echo '

' . nl2br(bk_text_format($settings['home_text_top'])) . '

'; // Search will be added in a future version. // echo '
'; echo '

Browse ' . 'Catalog'; if(bk_var('patron_type') == 'admin') {echo ' | Browse Patrons | Bookley Help';} echo '

' . '
'; if($settings['hours'] != '' || $settings['phone'] != '' || $settings['email'] != '') echo '
'; if($settings['hours'] != '') echo ''; if($settings['phone'] != '') echo ''; if($settings['email'] != '') echo ''; if($settings['hours'] != '' || $settings['phone'] != '' || $settings['email'] != '') echo '
Library ' . 'Hours: ' . $settings['hours'] . '
Library Phone:' . ' ' . $settings['phone'] . '
Library Email:' . ' ' . $settings['email'] . '
'; if(bk_var('patron_type') == 'admin') {echo '';} $patron_count = mysql_fetch_row(mysql_query("SELECT COUNT(patron_id) FROM bk_patrons")); $adult_count = mysql_fetch_row(mysql_query("SELECT COUNT(patron_id) FROM bk_patrons WHERE patron_type = 'adult' || patron_type = 'admin'")); $child_count = mysql_fetch_row(mysql_query("SELECT COUNT(patron_id) FROM bk_patrons WHERE patron_type = 'children'")); $item_count = mysql_fetch_row(mysql_query("SELECT COUNT(item_id) FROM bk_items")); $record_count = mysql_fetch_row(mysql_query("SELECT COUNT(record_id) FROM bk_records")); $anb_count = mysql_fetch_row(mysql_query("SELECT COUNT(record_id) FROM bk_records WHERE collection = 'Adult Nonfiction Books'")); $afb_count = mysql_fetch_row(mysql_query("SELECT COUNT(record_id) FROM bk_records WHERE collection = 'Adult Fiction Books'")); $dvd_count = mysql_fetch_row(mysql_query("SELECT COUNT(record_id) FROM bk_records WHERE collection = 'DVD Video'")); $out_count = mysql_fetch_row(mysql_query("SELECT COUNT(item_id) FROM bk_items WHERE item_status = 'out'")); $in_count = mysql_fetch_row(mysql_query("SELECT COUNT(item_id) FROM bk_items WHERE item_status = 'in'")); $checkouts = mysql_fetch_row(mysql_query("SELECT COUNT(history_id) FROM bk_history WHERE item_action = 'out'")); $renewals = mysql_fetch_row(mysql_query("SELECT COUNT(history_id) FROM bk_history WHERE item_action = 'renew'")); echo '

Live Statistics:

' . bk_var('lib_name') . ' has ' . $patron_count['0'] . ' patron' . bk_plural($patron_count['0']) . ': ' . $adult_count['0'] . ' adult' . bk_plural($adult_count['0']) . ' and ' . $child_count['0'] . ' child'; if($child_count['0'] != '1') echo 'ren'; else echo ''; echo '.

There '; if($item_count['0'] != '1') echo 'are'; else echo 'is'; echo ' ' . $item_count['0'] . ' item' . bk_plural($item_count['0']) . ' contained within ' . $record_count['0'] . ' record' . bk_plural($record_count['0']) . '.

' . $anb_count['0'] . ' record'; if($anb_count['0'] != '1') echo 's are nonfiction books'; else echo ' is a nonfiction book'; echo ', ' . $afb_count['0'] . ' '; if($afb_count['0'] != '1') echo 'are fiction books'; else echo 'is a fiction book'; echo ', and ' . $dvd_count['0'] . ' '; if($dvd_count['0'] != '1') echo 'are DVDs'; else echo 'is a DVD'; echo '.

' . $out_count['0'] . ' '; if($out_count['0'] != '1') echo 'items are'; else echo 'item is'; echo ' checked out and ' . $in_count['0'] . ' '; if($in_count['0'] != '1') echo 'are'; else echo 'is'; echo ' on shelf.

'; printf('%01.2f', ($out_count['0'] / $item_count['0']) * 100); echo '% of the catalog is checked' . ' out. The average patron has '; printf('%01.2f', $out_count['0'] / $patron_count['0']); echo ' item' . bk_plural($out_count['0'] / $patron_count['0']) . ' out.

' . 'There '; if(($item_count['0'] / $patron_count['0']) != '1') echo 'are'; else echo 'is'; echo ' '; printf('%01.2f', $item_count['0'] / $patron_count['0']); echo ' item' . bk_plural($item_count['0'] / $patron_count['0']) . ' for every ' . '1 patron.

There have been ' . $checkouts['0'] . ' checkout' . bk_plural($checkouts['0']) . ' and ' . $renewals['0'] . ' renewal' . bk_plural($renewals['0']) . '; a total of ' . '' . ($checkouts['0'] + $renewals['0']) . '.

' . '    This is an average of '; printf('%01.2f', ($checkouts['0'] + $renewals['0']) / $patron_count['0']); echo ' per patron, or '; printf('%01.2f', ($checkouts['0'] + $renewals['0']) / $item_count['0']); echo ' per item.

'; if($settings['home_text_bottom'] != '') echo '

' . nl2br(bk_text_format($settings['home_text_bottom'])) . '

'; bk_lib_footer(); echo '
';} // ************************ // // You're cuter than I thought. I can see why she likes you. elseif($_REQUEST['module'] == 'help') { $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub')) || substr(bk_get_page_url(), -1) != 'p') header('Location: ' . bk_var('lib') . 'help', TRUE, 301); echo bk_var('header') . 'Bookley Help | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo '
' . '

How do I partially pay a fine?

Go to the ' . 'patron\'s record, click "EDIT" below the fine, enter the new amount' . ' in "Fine Remainder," set "Fine Status" to "partial", and click ' . '"Save Fine."


' . '

How do I change the library logo?

Overwrite ' . 'logo.png in the directory "/bk-content/themes/YOURTHEME/".

' . '

' . '

How do I create a theme?

Make a copy of the ' . 'directory "/bk-content/themes/default/". Edit the file header.php ' . 'to change the DOCTYPE or CSS. Overwrite bg.png to change the ' . 'background, overwrite favicon.ico to change the favicon, overwrite ' . 'logo.png to change the logo, or overwrite default-avatar.png to ' . 'change the default avatar.


' . '

Can Bookley be used with a barcode scanner?

' . '

' . 'Yes! Just scan the barcode and the text will be entered into the ' . 'box. If your scanner presses enter automatically, you can check in ' . 'items on the home page in rapid succession without touching the ' . 'mouse or keyboard.


' . '

Can I change the default password if the password ' . 'field is left blank?

Search bk.php for "$last_4" and edit ' . 'the code manually.


' . '

Can I use a custom MySQL table prefix?

Not yet.' . '


' . '

How can I change the daily late fee for all DVD Videos' . ' from $0.25 to $1.00?

Run a MySQL query against the ' . 'database: "UPDATE bk_records SET daily_late_fee = \'$1.00\' WHERE ' . 'material = \'DVD Video\' && daily_late_fee = \'$0.25\'", assuming ' . 'you set "Type of Material" to "DVD Video" (case sensitive). You can' . ' use similar queries for other fields.


' . '

How do I create a record template?

You must ' . 'access the file bk.php directly with parameters encoded as an HTTP ' . 'GET request. The format is "http://yourdomain.com/bk.php?page=lib' . '&module=records&action=new&var1=text&var2=text". ' . '"&var1=text&var2=text" gets replaced by a list of parameters, ' . 'followed by equal signs and their values, preceded by ampersands.' . '


The parameter list is below:

title
title_remainder
call_number
' . 'material
format
collection
checkout_period
' . 'daily_late_fee
record_status
front_cover
back_cover' . '
back_cover_lg
author
statement_of_responsibility' . '
edition_statement
series
description
pub_' . 'location
publisher
pub_date
isbn
value
' . 'extent
other_details
dimensions
worldcat
amazon' . '_id
note
excerpt
s1, s2, s3, s4, s5, s6, s7, s8, s9,' . ' s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, ' . 's23, s24, s25, s26, s27, s28, s29, s30, s31, s32, s33, s34, s35, ' . 's36, s37, s38, s39, s40, s41, s42, s43, s44, s45, s46, s47, s48, ' . 's49, s50


Not all of the parameters need to be ' . 'present.


Here is an example template:

http://lib.bookley.org/bk.php?page=lib&' . 'module=records&action=new&title=The+a-z+of+creative
+' . 'photography+:&title_remainder=over+70+techniques+explained+in+full.' . '&call_number=771+Fro&
material=Book&format=Paperback&' . 'collection=Adult+Nonfiction+Books&record_status=publish&
back_' . 'cover=b/1-b.jpg&author=Frost,+Lee.&statement_of_responsibility=Lee+' . 'Frost&
pub_location=New+York+:&publisher=Amphoto+Books,&pub_' . 'date=1998&isbn=0817433139&extent=
160+pages&value=14.99&s1=' . 'Photography&s2=Creativity&s3=Art


' . '

How do I create a new administrator?

Edit the ' . 'patron\'s profile, setting "Patron Type" to "admin".

' . '
' . '

How do I restore something?

To restore a ' . 'patron, navigate to "http://yourdomain.com/patron/restore/ID" or ' . 'set patron_status to "adult" in the MySQL table "bk_patrons".

' . '

To restore a record, navigate to "http://yourdomain.com/' . 'record/restore/ID" or set record_status to "publish" in the MySQL ' . 'table "bk_records".


To restore an item, navigate to ' . '"http://yourdomain.com/item/restore/ID" or set item_status to "in" ' . 'in the MySQL table "bk_items".


To restore a comment, ' . 'navigate to "http://yourdomain.com/comment/restore/ID" or set ' . 'comment_status to "publish" in the MySQL table "bk_comments".

' . '

To restore a branch, navigate to "http://yourdomain.com/' . 'branch/restore/ID" and set branch_status to "open", or set branch_' . 'status to "open" in the MySQL table "bk_branches".


To ' . 'restore a fine, set fine_status to "active" in the MySQL table ' . '"bk_fines".


To restore a hold, set hold_status to ' . '"active" in the MySQL table "bk_holds".


' . '

What statuses can be used?

Records: publish, ' . 'delete (will be hidden in the OPAC).


Items: in, out, ' . 'hold (awaiting pickup), delete.


Patrons: active, ' . 'delete.


Fines: active, delete, waive, paid, partial ' . '(partially paid).


Holds: active, cancel, fulfilled.

' . '

Branches: open, closed, delete.


Comments: ' . 'publish, delete (will be hidden).


' . '

How do I upgrade Bookley?

You can download the ' . 'latest version of Bookley at ' . 'Bookley.org. The general procedure is to unzip the package and ' . 'upload, overwriting the old files. However, read the README.txt ' . 'file in case this has changed.

'; bk_lib_footer(); echo '
';} // ************************ // // This is your last chance. After this, there is no turning back. // You take the blue pill; the story ends, you wake up in your bed and // believe whatever you want to believe. You take the red pill; you stay // in Wonderland and I show you how deep the rabbit-hole goes. elseif($_REQUEST['module'] == 'settings') { $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) != 's')) header('Location: ' . bk_var('lib') . 'settings', TRUE, 301); echo bk_var('header') . 'Edit Library Settings | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ': Edit Library ' . 'Settings

'; $check = mysql_fetch_row(mysql_query("SELECT settings_id, theme FROM bk_settings")); $settings = mysql_fetch_assoc(mysql_query("SELECT * FROM bk_settings LIMIT 1")); if(!empty($_REQUEST['zec']) && bk_var('patron_type') == 'admin') {$hours = $_REQUEST['hours']; $phone = $_REQUEST['phone']; $email = $_REQUEST['email']; $title = $_REQUEST['title']; $db_name = $_REQUEST['db_name']; $db_username = $_REQUEST['db_username']; $db_pass = $_REQUEST['db_pass']; $db_host = $_REQUEST['db_host']; $path = $_REQUEST['path']; $subdomain = $_REQUEST['subdomain']; $covers_local_path = $_REQUEST['covers_local_path']; $covers_url_path = $_REQUEST['covers_url_path']; $theme = $_REQUEST['theme']; $home_text_top = $_REQUEST['home_text_top']; $home_text_bottom = $_REQUEST['home_text_bottom']; $footer = $_REQUEST['footer']; $amazon_associates_id = $_REQUEST['amazon_associates_id']; $worldcat_zip_code = $_REQUEST['worldcat_zip_code']; $default_checkout_limit = $_REQUEST['default_checkout_limit']; $default_renewal_limit = $_REQUEST['default_renewal_limit']; $default_max_fines = $_REQUEST['default_max_fines']; $default_checkout_period = $_REQUEST['default_checkout_period']; $default_daily_late_fee = $_REQUEST['default_daily_late_fee']; $default_value = $_REQUEST['default_value']; if(bk_var('patron_type') == 'admin') { if($check['0'] == '') $add = mysql_query("INSERT INTO bk_settings (hours, phone, email, title, path, subdomain, covers_local_path, covers_url_path, theme, home_text_top, home_text_bottom, footer, amazon_associates_id, worldcat_zip_code, default_checkout_limit, default_renewal_limit, default_max_fines, default_checkout_period, default_daily_late_fee, default_value) VALUES ('$hours', '$phone', '$email', '$title', '$path', '$covers_local_path', '$covers_url_path', '$theme', '$home_text_top', '$home_text_bottom', '$footer', '$amazon_associates_id', '$worldcat_zip_code', '$default_checkout_limit', '$default_renewal_limit', '$default_max_fines', '$default_checkout_period', '$default_daily_late_fee', '$default_value')"); else $add = mysql_query("UPDATE bk_settings SET hours = '$hours', phone = '$phone', email = '$email', title = '$title', path = '$path', subdomain = '$subdomain', covers_local_path = '$covers_local_path', covers_url_path = '$covers_url_path', theme = '$theme', home_text_top = '$home_text_top', home_text_bottom = '$home_text_bottom', footer = '$footer', amazon_associates_id = '$amazon_associates_id', worldcat_zip_code = '$worldcat_zip_code', default_checkout_limit = '$default_checkout_limit', default_renewal_limit = '$default_renewal_limit', default_max_fines = '$default_max_fines', default_checkout_period = '$default_checkout_period', default_daily_late_fee = '$default_daily_late_fee', default_value = '$default_value'"); echo '

Settings edited successfully.

' . '';}} elseif(empty($_REQUEST['zec']) && bk_var('patron_type') == 'admin') { echo '
Library Title:
' . '
' . 'Library Path (including prefix, trailing slash, and
' . 'subdirectory, i.e. "http://lib.bookley.org/catalog/"):' . '


' . 'Library Subdomain (No periods or slashes, not www, i.e. "lib".' . '
If Bookley is installed on a third-level subdomain' . '
like catalog.lib.bookley.org, just enter "catalog"):' . '


' . 'Local Path to Cover Images (including preceding and trailing ' . 'slashes,
i.e. "/home/thripp/public_html/projects/lib/' . 'bk-content/covers/"):

' . '
' . 'URL Path to Cover Images (including prefix and trailing slash,' . '
i.e. "http://lib.bookley.org/bk-content/covers/"):' . '

' . 'Library Theme:
Library Hours:
' . '
' . 'Library Phone : ' . ' | ' . 'Library Email : ' . '
' . 'Amazon Associates ID: ' . ' | ' . 'WorldCat ZIP Code: ' . '
' . 'Default Checkout Limit: ' . ' | ' . 'Default Renewal Limit: ' . '' . '
Default Checkout Period: ' . ' ' . 'Days | Default Item Value: $ ' . '
Default Max Fines: $ ' . ' | ' . 'Default Daily Late Fee: $ ' . '' . '
Home Text Top:
' . '' . '
Home Text Bottom:
' . '
' . 'Footer:
' . '
' . '' . '

';} elseif(bk_var('patron_type') != 'admin') echo '

You may not edit the library\'s ' . 'settings.

'; bk_lib_footer(); echo '
';} // ************************ // // Neo... nobody has ever done this before. // That's why it's going to work. // Search will be added in a future version. elseif($_REQUEST['module'] == 'search') {$q = $_REQUEST['q']; $mode = $_REQUEST['mode']; $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'search/' . $mode . '/' . $q, TRUE, 301); echo bk_var('header') . 'Search: ' . $q . ' | ' . bk_var('lib_name') . '
'; bk_header(); bk_var('logo'); bk_var('profile'); if($_REQUEST['mode'] == 'all') {$query = mysql_query("SELECT * FROM bk_records WHERE material LIKE '%$q%' || collection LIKE '%$q%' || call_number LIKE '%$q$' || title LIKE '%$q%' || title_remainder LIKE '%$q%' || author LIKE '%$q%' || statement_of_responsibility LIKE '%$q%' || edition_statement LIKE '%$q%' || series LIKE '%$q%' || description LIKE '%$q%' || pub_location LIKE '%$q%' || publisher LIKE '%$q%' || pub_date LIKE '%$q%' || isbn LIKE '%$q%' || extent LIKE '%$q%' || other_details LIKE '%$q%' || dimensions LIKE '%$q%' || note LIKE '%$q%' || value LIKE '%$q%' || format LIKE '%$q%' || excerpt LIKE '%$q%' || subjects LIKE '%$q%' ORDER BY record_date_gmt DESC LIMIT 100"); while($search = mysql_fetch_assoc($query)) { echo bk_lib_search($search);}} elseif($_REQUEST['mode'] == 'author') {$query = mysql_query("SELECT * FROM bk_records WHERE author LIKE '%$q%' || statement_of_responsibility LIKE '%$q%' ORDER BY record_date_gmt DESC LIMIT 100"); while($search = mysql_fetch_assoc($query)) { echo bk_lib_search($search);}} elseif($_REQUEST['mode'] == 'call') {$query = mysql_query("SELECT * FROM bk_records WHERE call_number LIKE '%$q%' ORDER BY record_date_gmt DESC LIMIT 100"); while($search = mysql_fetch_assoc($query)) { echo bk_lib_search($search);}} elseif($_REQUEST['mode'] == 'subjects') {$query = mysql_query("SELECT * FROM bk_records WHERE subjects LIKE '%$q%' ORDER BY record_date_gmt DESC LIMIT 100"); while($search = mysql_fetch_assoc($query)) { echo bk_lib_search($search);}} elseif($_REQUEST['mode'] == 'title') {$query = mysql_query("SELECT * FROM bk_records WHERE title LIKE '%$q%' || title_remainder LIKE '%$q%' ORDER BY record_date_gmt DESC LIMIT 100"); while($search = mysql_fetch_assoc($query)) { echo bk_lib_search($search);}} bk_lib_footer(); echo '
';} // ************************ // // You've been living in a dream world, Neo. elseif($_REQUEST['module'] == 'browse') { $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib'), TRUE, 301); echo bk_var('header') . 'Browse Catalog'; if($_REQUEST['p'] != '' && $_REQUEST['p'] != '1') echo ': Page ' . $_REQUEST['p']; echo ' | ' . bk_var('lib_name') . '
'; bk_header(); if(!is_numeric($_REQUEST['p'])) $_REQUEST['p'] = '1'; $perpage = 50; $startat = (mysql_real_escape_string($_REQUEST['p']) * $perpage); if($_REQUEST['p'] != '') $startat = $startat - $perpage; $row = mysql_fetch_row(mysql_query("SELECT COUNT(record_id) FROM bk_records WHERE record_status = 'publish'")); $pages = ($row['0'] + $perpage) / $perpage; if($_REQUEST['p'] == '') $_REQUEST['p'] = '1'; bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ': Browse Catalog'; if($_REQUEST['p'] != '' && $_REQUEST['p'] != '1') echo ': Page ' . $_REQUEST['p']; if(bk_var('patron_type') == 'admin') echo ' [Create Record]'; echo '

'; $query = mysql_query("SELECT * FROM bk_records WHERE record_status = 'publish' ORDER BY record_date_gmt DESC LIMIT $startat, $perpage"); while($search = mysql_fetch_assoc($query)) {echo bk_lib_search($search);} for ($k = 1; $k < $pages; $k++) {if($k == '1') $page = ''; else $page = '/page/' . $k; if($k != $_REQUEST['p']) { $lynx .= ' Page ' . $k . '';} else $lynx .= ' Page ' . $k . '';} echo '
' . $lynx . '
'; bk_lib_footer(); echo '
';} // ************************ // // What is "real"? How do you define "real"? elseif($_REQUEST['module'] == 'browsepatrons') { $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if((bk_var('lib_sub') != '' && $subd != bk_var('lib_sub') || substr(bk_get_page_url(), -1) == '/')) header('Location: ' . bk_var('lib') . 'browse/patrons', TRUE, 301); echo bk_var('header') . 'Browse Patrons'; if($_REQUEST['p'] != '' && $_REQUEST['p'] != '1') echo ': Page ' . $_REQUEST['p']; echo ' | ' . bk_var('lib_name') . '
'; bk_header(); if(!is_numeric($_REQUEST['p'])) $_REQUEST['p'] = '1'; $perpage = 50; $startat = (mysql_real_escape_string($_REQUEST['p']) * $perpage); if($_REQUEST['p'] != '') $startat = $startat - $perpage; $row = mysql_fetch_row(mysql_query("SELECT COUNT(patron_id) FROM bk_patrons WHERE patron_status = 'active'")); $pages = ($row['0'] + $perpage) / $perpage; if($_REQUEST['p'] == '') $_REQUEST['p'] = '1'; bk_var('logo'); bk_var('profile'); echo '

' . bk_var('lib_name') . ': Browse Patrons'; if($_REQUEST['p'] != '' && $_REQUEST['p'] != '1') echo ': Page ' . $_REQUEST['p']; echo ' [Create Patron]

'; if(bk_var('patron_type') == 'admin') { $query = mysql_query("SELECT * FROM bk_patrons WHERE patron_status = 'active' ORDER BY patron_registered DESC LIMIT $startat, $perpage"); while($patrons = mysql_fetch_assoc($query)) { echo bk_lib_patrons($patrons);}} elseif(bk_var('patron_type') != 'admin') echo '

You may ' . 'not browse the library\'s patrons.

'; for ($k = 1; $k < $pages; $k++) {if($k == '1') $page = ''; else $page = '/page/' . $k; if($k != $_REQUEST['p']) { $lynx .= ' Page ' . $k . '';} else $lynx .= ' ' . 'Page ' . $k . '';} echo '
' . $lynx . '
'; bk_lib_footer(); echo '
';}}} // ************************ // // There is no spoon. elseif(bk_installed() != 'true' || (bk_version() != '1.0' && bk_version() != '1.0.1')) { echo bk_var('header') . 'Install Bookley
' . '

Install Bookley

Asterisk indicates required field.

'; $urlParts = explode('.', $_SERVER['HTTP_HOST']); if($urlParts['0'] == 'www') $subd = $urlParts['1']; else $subd = $urlParts['0']; if($urlParts['2'] == '') $subd = ''; if(!empty($_REQUEST['zec'])) {$db_name = $_REQUEST['db_name']; $db_username = $_REQUEST['db_username']; $db_pass = $_REQUEST['db_pass']; $db_host = $_REQUEST['db_host']; $admin_barcode = $_REQUEST['admin_barcode']; $admin_pass = md5($_REQUEST['admin_pass']); $admin_name = $_REQUEST['admin_name']; $admin_email = $_REQUEST['admin_email']; $title = $_REQUEST['title']; $path = $_REQUEST['path']; if(is_writable('bk-config.php') && file_exists('bk.sql')) { $f = fopen('bk-config.php', 'w'); fwrite($f, ''); fclose($f);} elseif(is_writable('bk-config.php') && file_exists('bk.sql') == false) echo '

Installation failed ' . 'because bk.sql does not exist. Please download Bookley again and extract the file' . ' to Bookley\'s directory.

'; elseif(is_writable('bk-config.php') == false && file_exists('bk.sql')) echo '

Installation failed because ' . 'bk-config.php is not writable or does not exist. Chmod this' . ' directory and bk-config.php to 777 and return here, or ' . 'enter your details into bk-config.php manually, leaving ' . 'bk_installed() as false, and return. If you have deleted ' . 'bk-config.php, rename bk-config-sample.php to bk-config.php' . ' or download Bookley ' . 'again.

'; else echo '

Installation failed because ' . 'bk-config.php is not writable or does not exist and bk.sql ' . 'does not exist. Chmod this directory and bk-config.php to ' . '777, or enter your details into bk-config.php manually, ' . 'leaving bk_installed() as false. If you have deleted ' . 'bk-config.php, rename bk-config-sample.php to bk-config.php' . ' or download Bookley ' . 'again. Also: download Bookley and extract bk.sql to ' . 'Bookley\'s directory.

'; if($db_name == '' || $db_username == '' || $db_pass == '' || $db_host == '' || $admin_barcode == '' || $_REQUEST['admin_pass'] == '' || $admin_email == '' || $admin_name == '') echo '

You must fill in every field marked ' . 'with an asterisk.

'; if(is_writable('bk-config.php') && file_exists('bk.sql') && $db_name != '' && $db_username != '' && $db_pass != '' && $db_host != '' && $admin_barcode != '' && $_REQUEST['admin_pass'] != '' && $admin_email != '' && $admin_name != '') { mysql_connect($db_host, $db_username, $db_pass); mysql_select_db($db_name); if(bk_sql_file('bk.sql') != 'true') echo '

Installation failed because database ' . 'could not be populated.

'; else {bk_sql_file('bk.sql'); $irsubjects = 'a:50:{i:1;s:11:' . '\"Photography\";i:2;s:10:\"Creativity\";i:3;s:3:\"Art\";i:4' . ';s:0:\"\";i:5;s:0:\"\";i:6;s:0:\"\";i:7;s:0:\"\";i:8;s:0:\"' . '\";i:9;s:0:\"\";i:10;s:0:\"\";i:11;N;i:12;N;i:13;N;i:14;N;i' . ':15;N;i:16;N;i:17;N;i:18;N;i:19;N;i:20;N;i:21;N;i:22;N;i:23' . ';N;i:24;N;i:25;N;i:26;N;i:27;N;i:28;N;i:29;N;i:30;N;i:31;N;' . 'i:32;N;i:33;N;i:34;N;i:35;N;i:36;N;i:37;N;i:38;N;i:39;N;i:' . '40;N;i:41;N;i:42;N;i:43;N;i:44;N;i:45;N;i:46;N;i:47;N;i:48;' . 'N;i:49;N;i:50;N;}'; $irupdate = mysql_query("UPDATE bk_records SET subjects = '$irsubjects' LIMIT 1"); $def_footer_text = '' . $title . ', powered by Bookley.'; $hours = $_REQUEST['hours']; $phone = $_REQUEST['phone']; $email = $_REQUEST['email']; $subdomain = $_REQUEST['subdomain']; $covers_local_path = $_REQUEST['covers_local_path']; $covers_url_path = $_REQUEST['covers_url_path']; $theme = $_REQUEST['theme']; $home_text_top = $_REQUEST['home_text_top']; $home_text_bottom = $_REQUEST['home_text_bottom']; $footer = $_REQUEST['footer']; $amazon_associates_id = $_REQUEST['amazon_associates_id']; $worldcat_zip_code = $_REQUEST['worldcat_zip_code']; $default_checkout_limit = $_REQUEST['default_checkout_limit']; $default_renewal_limit = $_REQUEST['default_renewal_limit']; $default_max_fines = $_REQUEST['default_max_fines']; $default_checkout_period = $_REQUEST['default_checkout_period']; $default_daily_late_fee = $_REQUEST['default_daily_late_fee']; $default_value = $_REQUEST['default_value']; $check = mysql_fetch_row(mysql_query("SELECT settings_id FROM bk_settings")); if($check['0'] == '') $add = mysql_query("INSERT INTO bk_settings (hours, phone, email, title, path, subdomain, covers_local_path, covers_url_path, theme, home_text_top, home_text_bottom, footer, amazon_associates_id, worldcat_zip_code, default_checkout_limit, default_renewal_limit, default_max_fines, default_checkout_period, default_daily_late_fee, default_value) VALUES ('$hours', '$phone', '$email', '$title', '$path', '$subdomain', '$covers_local_path', '$covers_url_path', '$theme', '$home_text_top', '$home_text_bottom', '$footer', '$amazon_associates_id', '$worldcat_zip_code', '$default_checkout_limit', '$default_renewal_limit', '$default_max_fines', '$default_checkout_period', '$default_daily_late_fee', '$default_value')"); else $add = mysql_query("UPDATE bk_settings SET hours = '$hours', phone = '$phone', email = '$email', title = '$title', path = '$path', subdomain = '$subdomain', covers_local_path = '$covers_local_path', covers_url_path = '$covers_url_path', theme = '$theme', home_text_top = '$home_text_top', home_text_bottom = '$home_text_bottom', footer = '$footer', amazon_associates_id = '$amazon_associates_id', worldcat_zip_code = '$worldcat_zip_code', default_checkout_limit = '$default_checkout_limit', default_renewal_limit = '$default_renewal_limit', default_max_fines = '$default_max_fines', default_checkout_period = '$default_checkout_period', default_daily_late_fee = '$default_daily_late_fee', default_value = '$default_value'"); $def_footer = mysql_query("UPDATE bk_settings SET footer = '$def_footer_text' LIMIT 1"); $patron = mysql_query("INSERT INTO bk_patrons (patron_barcode, patron_type, patron_pass, email, name, patron_registered, fines_flag) VALUES ('$admin_barcode', 'admin', '$admin_pass', '$admin_email', '$admin_name', NOW(), 'N')"); echo '

Bookley installed successfully.

' . '
'; $success = 'true';}}} if($success != 'true') {echo '
' . '* Library Title:
' . '
* Library Path (including prefix, trailing ' . 'slash, and
  subdirectory, i.e. "http://lib.' . 'bookley.org/catalog/"):

' . '' . '
* Library Subdomain (No periods or slashes, not www, i.e. "' . 'lib".
  If Bookley is to be installed on a third' . '-level subdomain
  like catalog.lib.bookley.org,' . ' just enter "catalog"):

' . '
' . '* Database Name:
' . '' . '
* Database Username:
' . '
* Database Password:
' . '' . '
* Database Host:
' . '
* Admin Barcode:
' . '
' . '* Admin Password:
' . '
* Admin Name:
' . '
' . '* Admin Email:
' . '
' . 'Local Path to Cover Images (including preceding and trailing ' . 'slashes,
i.e. "/home/thripp/public_html/projects/lib/' . 'bk-content/covers/"):

' . '
' . 'URL Path to Cover Images (including prefix and trailing slash,' . '
i.e. "http://lib.bookley.org/bk-content/covers/"):' . '


Library Theme: ' . '
Library Hours:
' . '
Library Phone : ' . ' | ' . 'Library Email : ' . '
' . 'Amazon Associates ID: ' . ' | WorldCat ZIP Code: ' . '
' . 'Default Checkout Limit: ' . ' | ' . 'Default Renewal Limit: ' . '
' . 'Default Checkout Period: ' . ' Days | ' . 'Default Item Value: $ ' . '
' . 'Default Max Fines: $ ' . ' | ' . 'Default Daily Late Fee: $ ' . '
' . '

';}} // I know you're out there. I can feel you now. I know that you're afraid. // You're afraid of us. You're afraid of change. I don't know the future. // I didn't come here to tell you how this is going to end. // I came here to tell you how it's going to begin. // I'm going to hang up this phone, and then I'm going to // show these people what you don't want them to see. // I'm going to show them a world . . . without you. // A world without rules and controls, without borders or boundaries. // A world where anything is possible. // Where we go from there is a choice I leave to you. // The end. ?>