PageRenderTime 87ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/user_account/deposit/deposit_history.php

https://github.com/webegg/Zencart-CMS
PHP | 206 lines | 164 code | 34 blank | 8 comment | 10 complexity | db81e10238d5d9ed1b1d09c5d31caf31 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. #### INCLUDE CONFIGURATION FILE IF NOT ALLREADY DONE#
  3. //if you allready have a configuration file comment next line
  4. require("/var/www/html/myegg/settings.php");
  5. checkLogin('1 2');
  6. #INCLUDE CONFIGURATION FILE IF NOT ALLREADY DONE,####
  7. require('classes/fpdf.php');
  8. include("siteinfo.php");
  9. if(isset($user_id))
  10. {
  11. //paypal or sandbox?
  12. if(siteinfo('paypal') == "sandbox")
  13. {
  14. $paypalaction = "https://www.sandbox.paypal.com/cgi-bin/webscr";
  15. }
  16. elseif(siteinfo('paypal') == "paypal")
  17. {
  18. $paypalaction = "https://www.paypal.com/cgi-bin/webscr";
  19. }
  20. //check if cancelled
  21. $feedback="";
  22. if(isset($_GET['action']))
  23. {
  24. $action = mysql_real_escape_string($_GET['action']);
  25. if($action == "cancel")
  26. {
  27. $feedback = "<p class='error'>".$depositcancel."</p>";
  28. }
  29. elseif($action == "success")
  30. {
  31. $feedback = "<p class='succes'>".$depositsucces."</p>";
  32. }
  33. }
  34. //query current balance
  35. //$cb=mysqli_fetch_object(mysqli_query($link, "SELECT deposit FROM ".$usertable." WHERE ".$userid." = ".$useridentify.""));
  36. $cb=mysql_fetch_object(mysql_query("SELECT deposit FROM users WHERE id = '$user_id'"));
  37. //select all the history of the user
  38. $sql = mysql_query("SELECT * FROM deposit_history WHERE user_id = '$user_id'");
  39. ?>
  40. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  41. <html xmlns="http://www.w3.org/1999/xhtml">
  42. <head>
  43. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  44. <meta http-equiv="imagetoolbar" content="no" />
  45. <title>Administration Panel</title>
  46. <link media="screen" rel="stylesheet" type="text/css" href="../../../css/admin.css" />
  47. <!--[if lte IE 6]><link media="screen" rel="stylesheet" type="text/css" href="css/admin-ie.css" /><![endif]-->
  48. <script type="text/javascript" src="../../../js/behaviour.js"></script>
  49. <script type="text/javascript" src="../../../js/jquery.js"></script>
  50. </head>
  51. <body>
  52. <!--[if !IE]>start wrapper<![endif]-->
  53. <div id="wrapper">
  54. <?php include "../../../includes/header.php" ?>
  55. <!--[if !IE]>start content<![endif]-->
  56. <div id="content">
  57. <!--[if !IE]>start page<![endif]-->
  58. <div id="page">
  59. <div class="inner">
  60. <!--[if !IE]>start section<![endif]-->
  61. <div class="title_wrapper">
  62. <h2>Deposit History</h2>
  63. <span class="title_wrapper_left"></span>
  64. <span class="title_wrapper_right"></span>
  65. </div>
  66. <div class="section_content">
  67. <!--[if !IE]>start section content top<![endif]-->
  68. <div class="sct">
  69. <div class="sct_left">
  70. <div class="sct_right">
  71. <div class="sct_left">
  72. <div class="sct_right">
  73. <fieldset style="border:none">
  74. <!--[if !IE]>start table_wrapper<![endif]-->
  75. <div class="table_wrapper">
  76. <div class="table_wrapper_inner">
  77. <?php
  78. if(mysql_num_rows($sql) != 0)
  79. {
  80. ?>
  81. <!--<p><a href="<?php echo $site_http; ?>modules/user_account/deposit/pdfgenerator.php?user_id=<?php echo $user_id; ?>" target="_blank">Generate complete deposit history in PDF</a></p>-->
  82. <table cellpadding="0" cellspacing="0" width="100%">
  83. <tbody><tr>
  84. <th>Invoice #.</th>
  85. <th width="80%">Amount</th>
  86. <th style="width: 96px;">Actions</th>
  87. </tr>
  88. <?php
  89. while($result = mysql_fetch_object($sql))
  90. {
  91. ?>
  92. <tr class="first">
  93. <td><?php echo $result->unique_code; ?></td>
  94. <td><?php echo $result->amount; ?></td>
  95. <td>
  96. <div class="actions">
  97. <a href="<?php echo $site_http; ?>modules/user_account/deposit/pdfgenerator.php?deposit=<?php echo $result->id; ?>" target="_blank">Generate PDF</a></li>
  98. </div>
  99. </td>
  100. </tr>
  101. <?php
  102. }//end of while any history
  103. ?>
  104. </table>
  105. <?php
  106. }//end of if any history of that user
  107. else
  108. {
  109. ?>
  110. <p>You have no deposit history.</p>
  111. <?php
  112. }//end of else if any history of that user
  113. ?>
  114. </fieldset>
  115. <?php
  116. }
  117. else
  118. {
  119. ?>
  120. <span class="notlogin">You are not logged in, please login or register</span>
  121. <?php } ?>
  122. </div>
  123. </div></div></div></div></div>
  124. <!--[if !IE]>start section content bottom<![endif]-->
  125. <span class="scb"><span class="scb_left"></span><span class="scb_right"></span></span>
  126. <!--[if !IE]>end section content bottom<![endif]-->
  127. </div>
  128. </div>
  129. <!--[if !IE]>end page<![endif]-->
  130. <!--[if !IE]>start sidebar<![endif]-->
  131. <div id="sidebar">
  132. <div class="inner">
  133. <div class="quick_info">
  134. <div class="quick_info_top">
  135. <h2>Account Overview</h2>
  136. </div>
  137. <form name="depositform" id="depositform" method="post" action="<? echo $paypalaction; ?>">
  138. <input type="hidden" name="rm" value="2"/>
  139. <input type="hidden" name="cmd" value="_xclick"/>
  140. <input type="hidden" name="business" value="<?php echo $paypal_email; ?>"/>
  141. <input type="hidden" name="item_name" value="Deposit cash"/>
  142. <input type="hidden" name="no_shipping" value="1"/>
  143. <input type="hidden" name="return" value="http://www.webegg.com.au/myegg/modules/user_account/deposit/deposit_history.php?action=success"/>
  144. <input type="hidden" name="notify_url" value="http://www.webegg.com.au/myegg/modules/user_account/deposit/depositipn.php"/>
  145. <input type="hidden" name="cancel_return" value="http://www.webegg.com.au/myegg/modules/user_account/deposit/deposit_history.php?action=cancel"/>
  146. <input type="hidden" name="custom" value="<?php echo $user_id; ?>" />
  147. <input type="hidden" name="currency_code" value="<?php echo $paypal_currency_code; ?>">
  148. <input type="hidden" name="lc" value="<?php echo $paypal_location;?>">
  149. <div class="quick_info_content" align="center">
  150. Your account balance is<br />
  151. <span style="font-size:20px; font-weight:bold">$<?php echo $cb->deposit; ?></span>
  152. <br /><Br />
  153. <span style="color:#FF0000; font-weight:bold; font-style:italic"><?php echo $feedback; ?></span><br />
  154. Make a Deposit<br />
  155. <b>Deposit Value ($):</b><br /><input type="text" name="amount" size="10" /><br />
  156. <br />
  157. <input type="image" src="https://www.paypal.com/en_US/BE/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  158. </form>
  159. </div>
  160. <span class="quick_info_bottom"></span>
  161. </div>
  162. <!--[if !IE]>end quick info<![endif]-->
  163. </div>
  164. </div>
  165. <!--[if !IE]>end sidebar<![endif]-->
  166. </div>
  167. <!--[if !IE]>end content<![endif]-->
  168. </div>
  169. <!--[if !IE]>end wrapper<![endif]-->
  170. <?php include "../../../includes/footer.php" ?>
  171. </body>
  172. </html>