= 1 ? intval($_GET['page_curr']):1; $param_curr = ''; $sql = 'SELECT adm_membership.* ,item_list.* FROM `item_list` LEFT JOIN adm_membership ON adm_membership.membershipid=item_list.membershipid WHERE item_list.item_id = \''.$id.'\' AND item_list.item_suspend=0 LIMIT 1'; $res = mysql_query($sql); $num = @mysql_num_rows($res); if($num) { $item = mysql_fetch_assoc($res); $rating = get_rating($item['membershipid']); if($item['sale_method'] == 1) { $q = 'SELECT COUNT(bid_id) as bc, MAX(current_offer) as co FROM item_biding WHERE item_id=\''. $id .'\' '; $check_bid = @mysql_fetch_assoc(mysql_query($q)); if( is_array($check_bid) ) { $end_price = is_null($check_bid['co']) ? $item['item_price'] : intval($check_bid['co']); $item['end_price'] = $end_price; $item['bid_count'] = $check_bid['bc']; } } $image = $item['mainimagename'] != '' && is_file('./upload/thumb_'.$item['mainimagename']) ? ''.$item['mainimagename'].'' : ' '; $thetime = time(); $sale_end = strtotime($item['sale_end']); if($sale_end > $thetime ) { $is_end = false; } if($item['endstat'] == 1 ) { $is_end = true; } if($is_end === false) { $timer = timeDiff($sale_end); if( ($sale_end - $thetime) < 3600 ) { $count_down = $sale_end; } } $thetime = time(); $sale_end = strtotime($item['sale_end']); if($sale_end > $thetime ) { if(isset($_GET['maxoffer']) ) { if($_SESSION['is_login'] === true) { if($item['membershipid'] != $_SESSION['membership_session']['membershipid']) { $maxoffer = intval($_GET['maxoffer']); $newoffer_stat = 0; $bid_exist = false; $bid_added=0; if($item['end_price'] >= $maxoffer ) { $err_msg .= 'Harga tawaran Anda tidak boleh lebih rendah atau sama dari harga sekarang.
'; } else { $sql = 'SELECT * FROM item_biding WHERE `item_id` =\''.$id.'\' ORDER BY maxoffer DESC LIMIT 1 '; $res = mysql_query($sql); $num = @mysql_num_rows($res); if($num) { $bid_exist = true; $max = mysql_fetch_assoc($res); if($max['maxoffer'] > $maxoffer) { $newoffer_stat = 1; } elseif($max['maxoffer'] == $maxoffer) { $newoffer_stat = 2; } if($max['membershipid'] == $_SESSION['membership_session']['membershipid'] ) { $newoffer_stat = 19; } } if($newoffer_stat === 19) { $err_msg .= 'Maaf Anda sudah menjadi penawar tertinggi.
'; } elseif($newoffer_stat === 2) { $current_offer = ($item['end_price']+$sale_cost_config[0]); $sql = 'INSERT INTO item_biding SET `item_id` =\''.$id.'\' , `membershipid` =\''.$_SESSION['membership_session']['membershipid'].'\' , maxoffer=\''.$maxoffer.'\' , current_offer=\''.$current_offer.'\' '; $res = mysql_query($sql); $current_offer = $max['maxoffer']; $sql = 'INSERT INTO item_biding SET `item_id` =\''.$id.'\' , `membershipid` =\''.$max['membershipid'].'\' , maxoffer=\''.$max['maxoffer'].'\' , current_offer=\''.$current_offer.'\' '; $res = mysql_query($sql); $bid_added = 2; $consumerid = $max['membershipid']; } elseif($newoffer_stat === 1) { $sql = 'INSERT INTO item_biding SET `item_id` =\''.$id.'\' , `membershipid` =\''.$_SESSION['membership_session']['membershipid'].'\' , maxoffer=\''.$maxoffer.'\' , current_offer=\''.$maxoffer.'\' '; $res = mysql_query($sql); $current_offer = ( $maxoffer + $sale_cost_config[0] ) < $max['maxoffer'] ? ( $maxoffer + $sale_cost_config[0] ) : $max['maxoffer']; $sql = 'INSERT INTO item_biding SET `item_id` =\''.$id.'\' , `membershipid` =\''.$max['membershipid'].'\' , maxoffer=\''.$max['maxoffer'].'\' , current_offer=\''.$current_offer.'\' '; $res = mysql_query($sql); $bid_added = 2; $consumerid = $max['membershipid']; } else { $current_offer = $bid_exist === true ? ( ( $max['maxoffer'] + $sale_cost_config[0] ) < $maxoffer ? ( $max['maxoffer'] + $sale_cost_config[0] ) : $maxoffer ) : ( ( $item['end_price'] + $sale_cost_config[0] ) < $maxoffer ? ( $item['end_price'] + $sale_cost_config[0] ) : $maxoffer ) ; $sql = 'INSERT INTO item_biding SET `item_id` =\''.$id.'\' , `membershipid` =\''.$_SESSION['membership_session']['membershipid'].'\' , maxoffer=\''.$maxoffer.'\' , current_offer=\''.$current_offer.'\' '; $res = mysql_query($sql); $bid_added = 1; $consumerid = $_SESSION['membership_session']['membershipid']; } if($bid_added > 0) { @mysql_query('UPDATE item_list SET consumerid=\''.$consumerid.'\' WHERE item_id=\''.$item['item_id'].'\' '); $err_msg .= 'Tawaran Anda berhasil dimasukkan.
'; } else { $err_msg .= 'Maaf, tawaran Anda gagal dimasukkan.
'; } } } else { $err_msg .= 'Anda tidak boleh menawar barang Anda sendiri.
'; } } else { $err_msg .= 'Anda harus login untuk bisa menawar.
'; } } } else { if(isset($_GET['maxoffer']) ) { $err_msg .= 'Lelang telah berakhir.
'; } } $sql = 'SELECT bid_id FROM `item_biding` WHERE `item_id` =\''.$id.'\' ORDER BY bid_id DESC '; $res = mysql_query($sql); $num = @mysql_num_rows($res); $pagination = paging($perpage, $num, $page_curr, $param_curr, 'page_curr'); $sql = 'SELECT * FROM `item_biding` LEFT JOIN adm_membership ON adm_membership.membershipid=item_biding.membershipid WHERE `item_id` =\''.$id.'\' ORDER BY bid_id DESC limit '.$pagination['from'].', '.$perpage.' '; $res = mysql_query($sql); $num = @mysql_num_rows($res); if($num) { $content_valid .= ''; $content_valid .= ' '; $no = $pagination['from']+1; while($row= mysql_fetch_assoc($res)) { $encname = substr($row['membershipusername'], 1, 2).'***'.substr($row['membershipusername'], 1, -1); $row['membershipusername'] = $_SESSION['membership_session']['membershipid'] == $row['membershipid'] ? $row['membershipusername'] : $encname; $bgcolor = $bgcolor == 'style1' ? 'style2' : 'style1'; $content_valid .= ' '; $no++; } $content_valid .= '
Waktu tawar Nama Penawar Harga tawar
'.date('d-m-Y H:i:s', strtotime($row['timestamp'])).' '.$row['membershipusername'].' Rp. '.format_uang($row['current_offer']).'
'; $content_valid .= '

'.$pagination['first'].$pagination['prev'].''.$pagination['page'].''.$pagination['next'].$pagination['last'].'

'; } else { $content_valid .= '

Maaf, belum ada yang menawar produk ini.

'; } } if($err_msg != '') { $_SESSION['err_msg'] = $err_msg; header('location: _item_bid.html?id='.intval($_GET['id']).''); exit(); } $opt_array_condition = array(1 => 'Baru', 2 => 'Bekas', 3 => 'Antik'); ?> Rajalelang.com - Portal Lelang Online dan Jual Beli Barang Terbesar di Indonesia - Online Auction and Online Shopping Portal
 
 
Sejarah Lelang  
 
 
'.$_SESSION['err_msg'].'

'; unset($_SESSION['err_msg']); } echo $content_valid; ?>