Advertisement
Guest User

Untitled

a guest
Jun 26th, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.16 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. include( 'config/config.php' );
  15. include( 'config/functions.php' );
  16. include( 'mainvariables.php' );
  17. $pageName = 'productdetails';
  18. $smarty->assign( 'pageName', $pageName );
  19. $smarty->registerPlugin( 'modifier', 'ss', 'stripslashes' );
  20. $aucid = $_REQUEST['aid'];
  21. $prid = $_REQUEST['pid'];
  22. $smarty->assign( 'aucid', $aucid );
  23. $smarty->assign( 'prid', $prid );
  24. $front_min_price = getminbidprice( );
  25. $smarty->assign( 'front_min_price', $front_min_price );
  26.  
  27. if ($aucid == '') {
  28. header( 'location: index.php' );
  29. }
  30.  
  31. $qryauc = db_safe( 'select p.productID as pid,p.' . $lng_prefix . 'name as name,auctionID,picture1,auc_due_time,a.productID,offauction,fixedpriceauction,pennyauction,nightauction,beginnerauction,buynow_flag from auction a left join products p on a.productID=p.productID left join auc_due_table adt on a.auctionID=adt.auction_id left join registration r on a.buy_user=r.id where adt.auction_id not in (\'%1\') and adt.auc_due_time!=0 and a.auc_status=\'2\' and a.auction_delete_flag!=\'1\' order by adt.auc_due_time limit 0,3', $aucid );
  32. $resauc = mysql_query( $qryauc );
  33. $totalauc = mysql_num_rows( $resauc );
  34.  
  35. if (0 < $totalauc) {
  36. $logincontentarr = array( );
  37. $logincounter = 0;
  38. $a = 1;
  39. $i = 1;
  40. $cl = 1;
  41.  
  42. while ($objauc = mysql_fetch_array( $resauc )) {
  43. if (( $a == 1 && $objauc['auc_status'] == 2 )) {
  44. $co = '\'' . $objauc['auctionID'] . '\'';
  45. } else {
  46. if ($objauc['auc_status'] == 2) {
  47. $co .= ',\'' . $objauc['auctionID'] . '\'';
  48. }
  49. }
  50.  
  51. $productUrl = 'productdetails.php?aid=' . $objauc['auctionID'];
  52. $logincontentarr[$logincounter]['producturl'] = $productUrl;
  53. $logincontentarr[$logincounter]['name'] = stripslashes( $objauc['name'] );
  54. $logincontentarr[$logincounter]['picture1'] = $objauc['picture1'];
  55. $logincontentarr[$logincounter]['auctionID'] = $objauc['auctionID'];
  56. $logincontentarr[$logincounter]['productID'] = $objauc['productID'];
  57. $t = 0;
  58.  
  59. while ($t < $totalicon) {
  60. $logincontentarr[$logincounter][$iconarr[$t][0]] = $objauc[$iconarr[$t][0]];
  61. ++$t;
  62. }
  63.  
  64. $logincontentarr[$logincounter]['buynowstatus'] = $buynowstatus;
  65. $logincontentarr[$logincounter]['auc_due_time'] = $objauc['auc_due_time'];
  66. ++$a;
  67. ++$i;
  68. ++$cl;
  69. ++$logincounter;
  70. }
  71. }
  72.  
  73. $smarty->assign( 'totalauc', $totalauc );
  74. $smarty->assign( 'logincounter', $logincounter );
  75. $smarty->assign( 'logincontentarr', $logincontentarr );
  76. $smarty->assign( 'LoginTitle', $smarty->getTemplateVars( 'lng_bidnow' ) );
  77. $qrysel = db_safe( 'select p.' . $lng_prefix . 'name as name,' . $lng_prefix . 'short_desc as short_desc,' . $lng_prefix . 'long_desc as long_desc , auc_status,picture1,picture2,picture3,picture4,auctionID,auc_due_price,price,auc_fixed_price,auc_due_time,a.productID,pennyauction,beginnerauction,auction_plus_price,auc_end_date,auc_end_time,auc_start_price,buy_user,auc_final_price,username,auc_final_end_date,offauction,fixedpriceauction,nightauction,nailbiterauction,a.categoryID,shipping_title,shippingcharge,buynow_flag,auc_plus_time from products p left join auction a on p.productID=a.productID left join auc_due_table adt on a.auctionID=adt.auction_id left join registration r on a.buy_user=r.id left join shipping s on a.shipping_id=s.id left join auction_management am on am.auc_manage=a.time_duration where a.auctionID=\'%1\' and a.auction_delete_flag!=\'1\'', $aucid );
  78. $ressel = mysql_query( $qrysel );
  79. $total = mysql_num_rows( $ressel );
  80.  
  81. if ($total <= 0) {
  82. header( 'location: index.php' );
  83. }
  84.  
  85. $obj = mysql_fetch_array( $ressel );
  86. $obj['auc_plus_time'];
  87. $smarty->assign( 'obj', $obj );
  88. $duration = $obj['auc_plus_time'];
  89. $smarty->assign( 'duration', $duration );
  90.  
  91. if ($obj['auc_status'] == 2) {
  92. if (( $obj['buynow_flag'] == 1 && $buynowstatus == 0 )) {
  93. $add .= ',\'' . $objauc['auctionID'] . '\'';
  94. $but = $obj['auctionID'];
  95. $arr .= ',' . $obj['auctionID'];
  96. $prr .= ',' . $obj['auc_due_price'];
  97. $price = $obj['price'];
  98. $fprice = $obj['auc_fixed_price'];
  99.  
  100. if ($uid != '') {
  101. $qrybid = db_safe( 'select sum(bid_count) as bidcount from bid_account where bid_flag=\'d\' and auction_id=\'%1\' and user_id=\'%2\' group by auction_id', $aucid, $uid );
  102. $resbid = mysql_query( $qrybid );
  103. $total = mysql_num_rows( $resbid );
  104. $objbid = mysql_fetch_object( $resbid );
  105. $totbid = $objbid->bidcount;
  106.  
  107. if ($totbid == '') {
  108. $totbid = 0;
  109. }
  110.  
  111. $totbidprice = $totbid * $front_min_price;
  112. $smarty->assign( 'totbid', $totbid );
  113. $smarty->assign( 'totbidprice', changepriceformatwithoutcurrency( $totbidprice, 2 ) );
  114. $smarty->assign( 'totbidprice1', number_format( $totbidprice, 2 ) );
  115. }
  116.  
  117. $smarty->assign( 'fixedprice', changepriceformat( $obj['auc_fixed_price'], 2 ) );
  118. $smarty->assign( 'saving', changepriceformatwithoutcurrency( $price - $fprice - $totbidprice, 2 ) );
  119. $smarty->assign( 'saving1', $price - $fprice - $totbidprice );
  120. $smarty->assign( 'worthupto', changepriceformat( $obj['price'], 2 ) );
  121. $bidsrebateamount = $totbidprice;
  122.  
  123. if ($bidsrebateamount == '') {
  124. $bidsrebateamount = '0.00';
  125. }
  126.  
  127. $smarty->assign( 'bidsrebateamount', changepriceformatwithoutcurrency( $bidsrebateamount, 2 ) );
  128. $smarty->assign( 'buynowpricesaving', changepriceformatwithoutcurrency( $obj['price'] - $bidsrebateamount, 2 ) );
  129. $totalbuynow = gettotalbuynow( $obj['auctionID'], $uid );
  130.  
  131. if (0 < gettotalbuynow( $obj['auctionID'], $uid )) {
  132. $qrybuynow = db_safe( 'select payment_date from auction_buynow where auction_id=\'%1\' and user_id=\'%2\'', $obj['auctionID'], $uid );
  133. $resbuynow = mysql_query( $qrybuynow );
  134. $objbuynow = mysql_fetch_array( $resbuynow );
  135. $smarty->assign( 'objbuynow', $objbuynow );
  136. }
  137.  
  138. $smarty->assign( 'totalbuynow', $totalbuynow );
  139. } else {
  140. $add .= ',\'' . $objauc['auctionID'] . '\'';
  141. $but = $obj['auctionID'];
  142. $arr .= ',' . $obj['auctionID'];
  143. $prr .= ',' . $obj['auc_due_price'];
  144. $price = $obj['price'];
  145. $fprice = $obj['auc_fixed_price'];
  146. $qrybid = db_safe( 'select sum(bid_count) as bidcount from bid_account where bid_flag=\'d\' and auction_id=\'%1\' and user_id=\'%2\' group by auction_id', $aucid, $uid );
  147. $resbid = mysql_query( $qrybid );
  148. $total = mysql_num_rows( $resbid );
  149. $objbid = mysql_fetch_array( $resbid );
  150. $totbid = $objbid['bidcount'];
  151.  
  152. if ($totbid == '') {
  153. $totbid = 0;
  154. }
  155.  
  156. $totbidprice = $totbid * $front_min_price;
  157. $smarty->assign( 'totbid', $totbid );
  158. $smarty->assign( 'totbidprice', changepriceformatwithoutcurrency( $totbidprice, 2 ) );
  159. $smarty->assign( 'totbidprice1', number_format( $totbidprice, 2 ) );
  160. $smarty->assign( 'fixedprice', changepriceformat( $obj['auc_fixed_price'], 2 ) );
  161. $smarty->assign( 'saving', changepriceformatwithoutcurrency( $price - $fprice - $totbidprice, 2 ) );
  162. $smarty->assign( 'saving1', $price - $fprice - $totbidprice );
  163. $smarty->assign( 'worthupto', changepriceformat( $obj['price'], 2 ) );
  164. }
  165. } else {
  166. if ($obj['auc_status'] == 1) {
  167. if (( $obj['buynow_flag'] == 1 && $buynowstatus == 0 )) {
  168. $proprice = $obj['price'];
  169. $aucprice = $obj['auc_fixed_price'];
  170.  
  171. if ($uid != '') {
  172. $qrybid = db_safe( 'select sum(bid_count) as bidcount from bid_account where bid_flag=\'d\' and auction_id=\'%1\' and user_id=\'%2\' group by auction_id', $aucid, $uid );
  173. $resbid = mysql_query( $qrybid );
  174. $total = mysql_num_rows( $resbid );
  175. $objbid = mysql_fetch_object( $resbid );
  176. $totbid = $objbid->bidcount;
  177.  
  178. if ($totbid == '') {
  179. $totbid = 0;
  180. }
  181.  
  182. $totbidprice = $totbid * $front_min_price;
  183. $smarty->assign( 'totbid', $totbid );
  184. $smarty->assign( 'totbidprice', changepriceformatwithoutcurrency( $totbidprice, 2 ) );
  185. $smarty->assign( 'totbidprice1', number_format( $totbidprice, 2 ) );
  186. }
  187.  
  188. $smarty->assign( 'fixedprice', changepriceformat( $obj['auc_fixed_price'], 2 ) );
  189. $smarty->assign( 'saving', changepriceformatwithoutcurrency( $price - $fprice - $totbidprice, 2 ) );
  190. $smarty->assign( 'saving1', $price - $fprice - $totbidprice );
  191. $smarty->assign( 'worthupto', changepriceformat( $obj['price'], 2 ) );
  192. $bidsrebateamount = $totbidprice;
  193.  
  194. if ($bidsrebateamount == '') {
  195. $bidsrebateamount = '0.00';
  196. }
  197.  
  198. $smarty->assign( 'bidsrebateamount', changepriceformatwithoutcurrency( $bidsrebateamount, 2 ) );
  199. $smarty->assign( 'buynowpricesaving', changepriceformatwithoutcurrency( $obj['price'] - $bidsrebateamount, 2 ) );
  200. $totalbuynow = gettotalbuynow( $obj['auctionID'], $uid );
  201.  
  202. if (0 < gettotalbuynow( $obj['auctionID'], $uid )) {
  203. $qrybuynow = db_safe( 'select payment_date from auction_buynow where auction_id=\'%1\' and user_id=\'%2\'', $obj['auctionID'], $uid );
  204. $resbuynow = mysql_query( $qrybuynow );
  205. $objbuynow = mysql_fetch_array( $resbuynow );
  206. $smarty->assign( 'objbuynow', $objbuynow );
  207. }
  208.  
  209. $smarty->assign( 'totalbuynow', $totalbuynow );
  210. } else {
  211. $add .= ',\'' . $objauc['auctionID'] . '\'';
  212. $but = $obj['auctionID'];
  213. $arr .= ',' . $obj['auctionID'];
  214. $prr .= ',' . $obj['auc_due_price'];
  215. $price = $obj['price'];
  216. $fprice = $obj['auc_fixed_price'];
  217. $proprice = $obj['price'];
  218. $aucprice = $obj['auc_fixed_price'];
  219. $qrybid = db_safe( 'select sum(bid_count) as bidcount from bid_account where bid_flag=\'d\' and auction_id=\'%1\' and user_id=\'%2\' group by auction_id', $aucid, $uid );
  220. $resbid = mysql_query( $qrybid );
  221. $total = mysql_num_rows( $resbid );
  222. $objbid = mysql_fetch_array( $resbid );
  223. $totbid = $objbid['bidcount'];
  224.  
  225. if ($totbid == '') {
  226. $totbid = 0;
  227. }
  228.  
  229. $totbidprice = $totbid * $front_min_price;
  230. $smarty->assign( 'totbid', $totbid );
  231. $smarty->assign( 'totbidprice', changepriceformatwithoutcurrency( $totbidprice, 2 ) );
  232. $smarty->assign( 'totbidprice1', number_format( $totbidprice, 2 ) );
  233. $smarty->assign( 'fixedprice', changepriceformat( $obj['auc_fixed_price'], 2 ) );
  234. $smarty->assign( 'saving', changepriceformat( $proprice - $aucprice, 2 ) );
  235. $smarty->assign( 'worthupto', changepriceformat( $obj['price'], 2 ) );
  236. }
  237. } else {
  238. if ($obj['auc_status'] == 3) {
  239. if ($add == '') {
  240. $add = '\'' . $obj['auctionID'] . '\'';
  241. } else {
  242. $add .= ',\'' . $obj['auctionID'] . '\'';
  243. }
  244.  
  245. $qrybid = db_safe( 'select sum(bid_count) as bidcount from bid_account where bid_flag=\'d\' and auction_id=\'%1\' and user_id=\'%2\' group by auction_id', $aucid, $obj['buy_user'] );
  246. $resbid = mysql_query( $qrybid );
  247. $total = mysql_num_rows( $resbid );
  248. $objbid = mysql_fetch_array( $resbid );
  249. $totbid = $objbid['bidcount'];
  250. $totbidprice = $totbid * $front_min_price;
  251.  
  252. if ($totbid != '') {
  253. $totbid = $totbid;
  254. } else {
  255. $totbid = 0;
  256. }
  257.  
  258. $price = $obj['price'];
  259.  
  260. if ($obj['fixedpriceauction'] == '1') {
  261. $fprice = $obj['auc_fixed_price'];
  262. } else {
  263. if ($obj['offauction'] == '1') {
  264. $fprice = '0.00';
  265. } else {
  266. $fprice = $obj['auc_final_price'];
  267. }
  268. }
  269.  
  270. $saving_price = $price - $totbidprice - $fprice;
  271. $saving_percent = $saving_price * 100 / $price;
  272. $smarty->assign( 'totbid', $totbid );
  273. $smarty->assign( 'totbidprice', changepriceformat( $totbidprice, 2 ) );
  274. $smarty->assign( 'fprice', changepriceformat( $fprice, 2 ) );
  275. $smarty->assign( 'worthupto', changepriceformat( $obj['price'], 2 ) );
  276. $smarty->assign( 'saving_price', changepriceformat( $saving_price, 2 ) );
  277. $smarty->assign( 'savingpercent', number_format( $saving_percent, 2 ) );
  278. $smarty->assign( 'aucfinalprice', changepriceformat( $obj['auc_final_price'], 2 ) );
  279. $smarty->assign( 'aucfinalenddate', arrangedate( substr( $obj['auc_final_end_date'], 0, 10 ) ) );
  280. $smarty->assign( 'aucfinalendtime', substr( $obj['auc_final_end_date'], 10 ) );
  281. }
  282. }
  283. }
  284.  
  285. ..................................................
  286. ............................
  287. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement