Advertisement
Crecket

Untitled

Aug 4th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. public function checkPaymentParams($uid = NULL){
  2. if($uid == NULL){
  3.  
  4. if(isset($_GET['auctionid'], $_GET['uid'])){
  5.  
  6. $auctionid = $_GET['auctionid'];
  7. $auctionauthkey = $this->getSettings($auctionid, 'authkey');
  8. if($auctionauthkey != false && $auctionauthkey == $_GET['uid']){
  9.  
  10. $post_title = $this->getSettings($auctionid, 'gettitle');
  11. $image1 = $this->get_post_meta($auctionid, 'wdm-image-1', true);
  12. $description = $this->getSettings($auctionid, 'getpost2');
  13.  
  14. $getlastbid = $this->db_connection->prepare("SELECT bid, name FROM crstube_wdm_bidders WHERE auction_id = :idvar ORDER BY bid DESC");
  15. $getlastbid->bindValue(':idvar', $auctionid, PDO::PARAM_INT);
  16. $getlastbid->execute();
  17. $result = $getlastbid->fetch(PDO::FETCH_ASSOC);
  18. if($getlastbid->rowcount() > 1){
  19.  
  20. $formdata = array("title" => $post_title
  21. , "auctionid" => $auctionid
  22. , "price" => $result['bid']
  23. , "image" => $image1
  24. , "description" => $description
  25. , "username" => $result['name']);
  26. return $formdata;
  27. }
  28. }
  29. }
  30. if(isset($_POST['auctionid'], $_POST['uid'])){
  31. $auctionid = $_POST['auctionid'];
  32. $auctionauthkey = $this->getSettings($auctionid, 'authkey');
  33. if($auctionauthkey != false && $auctionauthkey == $_POST['uid']){
  34. $getlastbid = $this->db_connection->prepare("SELECT bid, name FROM crstube_wdm_bidders WHERE auction_id = :idvar ORDER BY bid DESC");
  35. $getlastbid->bindValue(':idvar', $auctionid, PDO::PARAM_INT);
  36. $getlastbid->execute();
  37. $result = $getlastbid->fetch(PDO::FETCH_ASSOC);
  38. if($getlastbid->rowcount() > 1){
  39. return $result = array("price" => $result['bid'], "name" => $result['name']);
  40. }
  41. }
  42. }
  43. if(isset($_GET['uid'], $_GET['prod'])){
  44. $auctionid = $_GET['prod'];
  45. $auctionauthkey = $this->getSettings($auctionid, 'authkey');
  46. if($auctionauthkey != false && $auctionauthkey == $_GET['uid']){
  47. $getlastbid = $this->db_connection->prepare("SELECT bid, name FROM crstube_wdm_bidders WHERE auction_id = :idvar ORDER BY bid DESC");
  48. $getlastbid->bindValue(':idvar', $auctionid, PDO::PARAM_INT);
  49. $getlastbid->execute();
  50. $result = $getlastbid->fetch(PDO::FETCH_ASSOC);
  51. if($getlastbid->rowcount() > 1){
  52. $itemname = $this->getSettings($auctionid, 'gettitle');
  53. return $result = array("price" => $result['bid'], "name" => $result['name'], 'itemname' => $itemname);
  54. }
  55. }
  56. }
  57. }else{
  58. $auctionauthkey = $this->getSettings($uid, 'authkey');
  59. if($auctionauthkey != false){
  60. return "auctionpayment.php?auctionid=".$uid."&uid=".$auctionauthkey;
  61. }
  62. }
  63.  
  64. return false;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement