1,
'Arvamus(Review)' => 2,
'Autor' => 3
);
function generateSelect_plaanimine($name = '', $options = array()) {
$html = '';
return $html;
}
function raamatumaailm_raamaturiiul_plaanimine_block($op='list', $delta=0) {
global $user;
global $sorteeri;
if ($op == "list") {
$block = array();
$block[0]["info"] = t('Minu raamaturiiul plaanimine');
return $block;
}
else if ($op == 'view') {
function pildiSuurus($file, $max){
if($file!=''){
list($width, $height) = getimagesize($file);
}
if($width > $height && $width > $max){
$width1 = $width;
$width = $max;
$height = $height/($width1/$max);
}elseif($width < $height && $height > $max){
$height1 = $height;
$height = $max;
$width = $width/($height1/$max);
}
$mass = array('width'=>$width, 'height'=>$height);
return $mass;
}
$hetkeKasutajaRaamatuIdParing = db_query("SELECT * FROM {book_user_status} n WHERE n.user_id = %d AND n.status_id = %d", $user->uid, 1);
$block_content .= '
';
if($_POST['action']=='contact2'){
if($_POST['sorteerimine']=='1'){
}
}
if($_POST['action']=='contact'){
if($_POST['.$raamatuId->book_id.']=='1'){
}
elseif($_POST[$raamatuId->book_id]=='2'){
echo "
";
$valitudRaamatuIdParing = db_query("UPDATE book_user_status SET status_id=1 WHERE book_id=$raamatuId->book_id AND user_id=$user->uid");
}
elseif($_POST[$raamatuId->book_id]=='3'){
echo "
";
$valitudRaamatuIdParing = db_query("UPDATE book_user_status SET status_id=2 WHERE book_id=$raamatuId->book_id AND user_id=$user->uid");
}
elseif($_POST[$raamatuId->book_id]=='4'){
echo "
";
$valitudRaamatuIdParing = db_query("UPDATE book_user_status SET status_id=3 WHERE book_id=$raamatuId->book_id AND user_id=$user->uid");
}
elseif($_POST[$raamatuId->book_id]=='5'){
$valitudRaamatuteParing = db_query("SELECT * FROM book_user_status WHERE book_id=$raamatuId->book_id AND user_id=$user->uid AND status_id=4");
$leitud=mysql_num_rows($valitudRaamatuteParing);
if($leitud!=0){
$teade = '
Valitud raamat on juba teie riiulis olemas!';
} else {
echo "
";
$valitudRaamatuIdParing = db_query("INSERT INTO book_user_status (book_id, user_id, status_id) VALUES($raamatuId->book_id, $user->uid, 4)");
}
}
elseif($_POST[$raamatuId->book_id]=='6'){
$valitudRaamatuteParing = db_query("SELECT * FROM book_user_status WHERE book_id=$raamatuId->book_id AND user_id=$user->uid AND status_id=5");
$leitud=mysql_num_rows($valitudRaamatuteParing);
if($leitud!=0){
$teade = '
Valitud raamat on juba teie riiulis olemas!';
} else {
echo "
";
$valitudRaamatuIdParing = db_query("INSERT INTO book_user_status (book_id, user_id, status_id) VALUES($raamatuId->book_id, $user->uid, 5)");
}
}
elseif($_POST[$raamatuId->book_id]=='7'){
}
elseif($_POST[$raamatuId->book_id]=='12'){
echo "
";
$valitudRaamatuIdParing = db_query("DELETE FROM book_user_status WHERE book_id=$raamatuId->book_id AND user_id=$user->uid AND status_id=1");
}
}
$block_content .= '
';
}
$block_content .= '