';
}
} else {
echo "Your Wishlist is empty.";
}
}
function book_add($mysqli,$title,$authors,$language,$isbn) {
if($title==='' && $isbn==='') {
echo('');
return false;
};
require_once('recaptchalib.php');
$privatekey = "6Lcaf_ASAAAAAN7INSG0Ie7DZqPLjqyb0Yjz89PT";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
//die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
echo('');
} else {
if ($stmt= $mysqli) {
if ($stmt->query('INSERT INTO Books (Title, Authors, Language, ISBN13, Pending4Approval) VALUES (\''.$title.'\',\''.$authors.'\',\''.$language.'\','.(int)$isbn.',1)')) {
echo('');
return true;
} else {
echo('');
return false;
};
} else return NULL;
};
return NULL;
}
function change_wish($mysqli, $user, $bookid) {
if ($stmt = $mysqli) {
if (check_wish($mysqli, $user, $bookid)){
$stmt->query('DELETE FROM Wishlist WHERE UID = '.$user.' AND BID = '.$bookid);
echo('');
return true;
} else {
$stmt->query('INSERT INTO Wishlist (UID, BID) VALUES ('.$user.','.$bookid.')');
echo('');
return true;
}
} else {
echo('');
return false;
}
return NULL;
}
function check_owned($mysqli, $user, $bid) {
if ($stmt = $mysqli) {
if ($result = $stmt->query('SELECT BookID FROM BookInstances WHERE UserID = '.$user)) {
while ($row = $result->fetch_assoc()) {
if ($row['BookID']==$bid) {
return true;
}
}
return false;
}
}
return NULL;
}
function check_wish($mysqli, $user, $bid) {
if ($stmt = $mysqli) {
($result = $stmt->query('SELECT BID FROM Wishlist WHERE UID = '.$user.' AND BID='.$bid));
if ($result&&$result->num_rows) {
return true;
} else {
return false;
}
}
return NULL;
}
function delete_button($mysqli, $biid){
$result = ''; //
return $result;
}
function delete_book($mysqli, $biid) {
if ($stmt = $mysqli) {
$stmt->query('DELETE FROM BookInstances WHERE BIID = '.$biid);
}
}
function print_binfo($mysqli, $bid) {
if($stmt = $mysqli) {
$result = $stmt->query('SELECT * FROM Books WHERE BookID = '.$bid);
if ($result) {
echo '
';
while($row = $result->fetch_assoc()) {
echo ('
');
echo '
Title:
'.$row['Title'].'
';
if ($row['Subtitle']) {
echo '
Subtitle:
'.$row['Subtitle'].'
';
}
echo '
Authors:
'.$row['Authors'].'
';
if ($row['Publisher']) {
echo '
Publisher:
'.$row['Publisher'].'
';
}
if ($row['PrintDate']) {
echo '
Date of Print:
'.date('d-m-Y', strtotime($row['PrintDate']) ).'
';
}
echo '
Language:
'.$row['Language'].'
';
if ($row['ISBN10']) {
echo '
ISBN10:
'.$row['ISBN10'].'
';
}
if ($row['ISBN13']) {
echo '
ISBN13:
'.$row['ISBN13'].'
';
}
if ($row['Format']) {
echo '
Format:
'.$row['Format'].'
';
}
if ($row['Edition']) {
echo '
Edition:
'.$row['Edition'].'
';
}
if ($row['SeriesCollection']) {
echo '
Series or Collection:
'.$row['SeriesCollection'].'
';
}
if ($row['Category']) {
echo '
Category:
'.$row['Category'].'
';
}
}
echo '
';
}
}
}
Libri Vermis - Loginpage Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /var/www/librivermis.projects.metropolia.fi/public_html/includes/functions.php on line 17
Warning: Cannot modify header information - headers already sent by (output started at /var/www/librivermis.projects.metropolia.fi/public_html/includes/badger.php:1) in /var/www/librivermis.projects.metropolia.fi/public_html/includes/functions.php on line 18