getRow("SELECT p_stock FROM product WHERE p_id = '$pid' LIMIT 1"); // ürün stokta var mı if ( $row ) { if ( $_SESSION['session_basketnouser'] ) $basketnouser = json_decode($_SESSION['session_basketnouser'],true); else $basketnouser = array(); $b_option = $db->secure($_POST['b_option']); $price = $b_option ? $db->secure($_POST['b_price']) : $row->p_price; $basketnouser[][$pid] = array($b_count, 'K'.$pid.' / '.$b_option, $price); $_SESSION['session_basketnouser'] = json_encode($basketnouser); $total = 0; foreach($basketnouser as $k => $c) { foreach($c as $x) $total += $x[0]; } $_SESSION['session_basketcount'] = $total; echo $l[16]; echo ' '; } else { echo $l[18]; } exit; } $pid = (int)$_GET['pid']; // ürün id if ( !$pid ) die($l[15]); $row = $db->getRow("SELECT p_stock,p_price FROM product WHERE p_id = '$pid' LIMIT 1"); // ürün stokta var mı if ( $row ) { $uid = (int)$_SESSION['session_userid']; $b_count = (int)$_POST['b_count']; $b_option = $db->secure($_POST['b_option']); $price = $b_option ? $db->secure($_POST['b_price']) : $row->p_price; $row = $db->getRow("SELECT b_id FROM basket WHERE b_uid = '$uid' && b_pid = '$pid' && b_status = '0' LIMIT 1"); // ürün kişinin sepetinde var mı $db->query("INSERT INTO basket (b_uid,b_pid,b_price,b_option,b_count,b_status) VALUES ('$uid','$pid','$price','$b_option','$b_count','0')"); // sepetinde yok, ekle. if ( $db->_insert_id ) { $db->query("UPDATE user SET u_basket = u_basket + '$b_count' WHERE u_id = '$uid' LIMIT 1"); // kullanıcı sepetini güncelle $_SESSION['session_basketcount'] = (int)$_SESSION['session_basketcount'] + $b_count; echo $l[16]; // ürün sepete eklendi echo ' '; } else { echo $l[15]; // hata meydana geldi } } else { echo $l[18]; // stokta yok } exit; } // yorum ekle if ( $_POST['c_name'] && $_POST['c_text'] && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ) { $c_name = $db->secure( $_POST['c_name'] ); $c_text = $db->secure( $_POST['c_text'] ); $time = time(); $db->query("INSERT INTO comment (c_pid,c_name,c_text,c_date) VALUES ('$id','$c_name','$c_text','$time')"); if ( $db->_insert_id ) echo '

'.$l[19].'

'; else echo '

'.$l[15].'

'; exit; } // ürün detayları $product = $db->getRow("SELECT * FROM product WHERE p_id = '$id' && p_active = '1' LIMIT 1"); $cat = $db->getRow("SELECT c_parent,c_title,c_seo,c_formula FROM category WHERE c_id = '$product->p_cid' LIMIT 1"); if($product->p_stock<1) { $stock_color = 0; $stock = $l[18]; } elseif($product->p_stock && $product->p_stock < 10) { $stock_color = 1; $stock = $l[20]; } else { $stock_color = 2; $stock = $l[21]; } if ( !$product ) // ürün yoksa index'e yönlen { header('Location: ./'); exit; } $comments = $db->getResults("SELECT * FROM comment WHERE c_pid = '$id' ORDER BY c_id DESC"); if(in_array($product->p_cid, array(11,22,23,24,25,26,27,28,29,30,31,32,33,34))) { include('product-meterware.php'); exit; } if(in_array($product->p_cid, array(12,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,60))) { include('product-kreissageblatter.php'); exit; } ?> -

K

readyproduct) { if($product->p_priceold) echo '

'.$product->p_price.' euro

'; } else { echo'
Länge:
mm
Breite:
mm
Stärken +
Zahnteilung:
'.( in_array($product->p_cid,array(13,14,15,16,17,24,64)) ? 'ZpZ' : 'mm' ).'
Stk.
'; echo ' '; } ?>
'.$c->c_name.' '.format_date(@date('Y-m-d',$c->c_date)).'
'.nl2br($c->c_text).'

'; } } ?>