Advertisement
Guest User

Untitled

a guest
May 1st, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.71 KB | None | 0 0
  1. <?php
  2. #----------------------------------------#
  3. #----------Webshop gunny3.0 v2.6---------#
  4. #---Create by cty_h@anganh - bachugacon122--#
  5. #----------------------------------------#
  6. //if(!defined('cty_h@anganh')) die('cty_h@anganh');
  7. include('knp/#config.php');
  8. $text = null;
  9. #kiem tra xem da login chua
  10. if(!isset($_SESSION['dnss_userid'])) {
  11. thongbao('Vui lòng đăng nhập');
  12. echo 'Vui lòng đăng nhập';
  13. chuyentrang(linkserver.'login.kyl');
  14. }
  15. if(isset($_POST['napthe'])) {
  16. $oncheck = $data->query("SELECT UserID FROM Sys_Users_Detail Where UserID = '".$_SESSION['dnss_userid']."' AND State = '1'");
  17. $pin = $_POST['txtmathe']; // string
  18. $seri = $_POST['txtserial']; // string
  19. $f = rand(1, 4);
  20. $card_type = $_POST['txttype']; // interger
  21. $ma_bao_mat = $_POST['txtcode'];
  22.  
  23. #kiem tra thong tin onl
  24. if ($data->query_num($oncheck) != 0) {
  25. thongbao('Tính năng này yêu cầu bạn phải thoát nhân vật trong game!');
  26. echo 'Tính năng này yêu cầu bạn phải thoát nhân vật trong game!';
  27. chuyentrang(linkserver.'napthe.kyl');
  28. exit ();
  29. }
  30. #Kiem tra thong tin
  31. if ($pin == null || $seri == null) {
  32. $text .= '<br>Số serial hoặc mã thẻ không được để trống!';
  33. }
  34. #Kiem tra code bao ve
  35. if ($ma_bao_mat != $_SESSION['dnss_code']) {
  36. $text .= '<br>Mã bảo vệ không chính xác!';
  37. }
  38. //echo $text;
  39. if($text==null)
  40. {
  41. ///nap bang bao kim
  42. //-------config bao kim
  43. define('CORE_API_HTTP_USR', 'merchant_19219');
  44. define('CORE_API_HTTP_PWD', '19219xNSFMy6KJ9l1XgZs4aj8cbRVePYqHv');
  45. $bk = 'https://www.baokim.vn/the-cao/restFul/send';
  46.  
  47.  
  48. //Loai the cao (VINA, MOBI, VIETEL, VTC, GATE)
  49. switch($card_type)
  50. {
  51. case '1':
  52. $mang = 'VIETEL';
  53. $ten = "Viettel";
  54. break;
  55. case '2':
  56. $mang = 'MOBI';
  57. $ten = "Mobifone";
  58. break;
  59. case '3':
  60. $mang = 'VINA';
  61. $ten ="Vinaphone";
  62. break;
  63. case '4':
  64. $mang = 'GATE';
  65. $ten ="Gate";
  66. break;
  67. case '5':
  68. $mang = 'VTC';
  69. $ten ="VTC";
  70. break;
  71. }
  72. switch ($card_type) {
  73. case 1:
  74. $CardName = 'Viettel';
  75. break;
  76. case 2:
  77. $CardName = 'Mobiphone';
  78. break;
  79. case 3:
  80. $CardName = 'Vinaphone';
  81. break;
  82. case 4:
  83. $CardName = 'Gate';
  84. break;
  85. case 5:
  86. $CardName = 'VTC';
  87. break;
  88. default:
  89. die('Mã loại thẻ không hợp lệ hoặc không hỗ trợ!');
  90. break;
  91. }
  92.  
  93. //log the
  94. if(!insertLogCard($_SESSION['dnss_username'],$CardName,0,0,'waiting',$pin,$seri))
  95. die('khong log dc the');
  96. $id=mysql_insert_id();
  97. //echo $id;die;
  98. # Gửi thẻ lên máy chủ BaoKim
  99.  
  100. if($f==4){
  101. //Mã MerchantID dang kí trên Bảo Kim
  102. $merchant_id = '19219';
  103. //Api username
  104. $api_username = 'hotgunnynet';
  105. //Api Pwd d
  106. $api_password = 'hotgunnynet098ausgAYSF';
  107. //Mã TransactionId
  108. $transaction_id = time();
  109. //mat khau di kem ma website dang kí trên B?o Kim
  110. $secure_code = '2a02ad508523650e';
  111. ///----- end config baokim
  112.  
  113. $arrayPost = array(
  114. 'merchant_id'=>$merchant_id,
  115. 'api_username'=>$api_username,
  116. 'api_password'=>$api_password,
  117. 'transaction_id'=>$transaction_id,
  118. 'card_id'=>$mang,
  119. 'pin_field'=>$pin,
  120. 'seri_field'=>$seri,
  121. 'algo_mode'=>'hmac'
  122. );
  123.  
  124. ksort($arrayPost);
  125.  
  126. $data_sign = hash_hmac('SHA1',implode('',$arrayPost),$secure_code);
  127.  
  128. $arrayPost['data_sign'] = $data_sign;
  129.  
  130. $curl = curl_init($bk);
  131.  
  132. curl_setopt_array($curl, array(
  133. CURLOPT_POST=>true,
  134. CURLOPT_HEADER=>false,
  135. CURLINFO_HEADER_OUT=>true,
  136. CURLOPT_TIMEOUT=>30,
  137. CURLOPT_RETURNTRANSFER=>true,
  138. CURLOPT_SSL_VERIFYPEER => false,
  139. CURLOPT_HTTPAUTH=>CURLAUTH_DIGEST|CURLAUTH_BASIC,
  140. CURLOPT_USERPWD=>CORE_API_HTTP_USR.':'.CORE_API_HTTP_PWD,
  141. CURLOPT_POSTFIELDS=>http_build_query($arrayPost)
  142. ));
  143.  
  144. $data_rs = curl_exec($curl);
  145.  
  146. $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  147.  
  148. $result = json_decode($data_rs,true);
  149. date_default_timezone_set('Asia/Ho_Chi_Minh');
  150. $time = time();
  151. /*
  152. $status=200;
  153. $result = array ("errorMessage"=>"Nạp thẻ thành công với mệnh giá: 20000", "transaction_id"=>"1442891031","binding_field"=>"V2CL52F253E179","amount"=> "20000");*/
  154. }else{
  155. $arrayPost = array(
  156. 'card_type_id' => $card_type ,
  157. 'pin' => $pin,
  158. 'seri' => $seri,
  159. 'id' => '7322'
  160. );
  161. $url = 'http://sv.gamebank.vn/ajax/card.php';
  162. $ch = curl_init();
  163. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  164. curl_setopt($ch,CURLOPT_URL, $url);
  165. curl_setopt($ch, CURLOPT_POST, count($arrayPost));
  166. curl_setopt($ch, CURLOPT_POSTFIELDS, $arrayPost);
  167. $result = curl_exec($ch);
  168. curl_close($ch);
  169. $result = json_decode($result);
  170. $status = $result->code;
  171. $result['amount']=$result->msg;
  172. $result['amount']=str_replace('.', '', trim(substr($result['amount'],-7)));
  173. $result['errorMessage']=$result->msg;
  174. }
  175. if(empty($pin)){
  176. $text .= 'Loi ket noi ben nha mang';
  177. }else{
  178. //echo $_SESSION['dnss_userid'];die;
  179. /*
  180. if($_SESSION['dnss_username']=='hjhjhg')
  181. {
  182. $response='RESULT:10@200000';
  183. }
  184. */
  185. if($status==200 or $status==0)
  186. {
  187. $TxtMenhGia = $result['amount'];
  188. //if($code == 0) {
  189. include "config_card.php";
  190. $menhgia = $TxtMenhGia;
  191. //$menhgia = 50000;
  192. $cash = $cCard[$CardName][$menhgia];
  193. $xu = $xu[$menhgia];
  194. $username = $_SESSION['dnss_username'];
  195. if(true)
  196. {
  197. //$response='RESULT:10@200000';
  198. if(checkFirstCard($_SESSION['dnss_username']))
  199. {
  200. $tem_menh_gia=100000;
  201. //$tem_cash=$cCard[$CardName][$tem_menh_gia];
  202. //$tem_xu = $xu[$tem_menh_gia];
  203. //$menhgia=$menhgia+$tem_menh_gia;
  204. $cash=$cash+$tem_menh_gia;
  205. //$xu=$xu;
  206. }
  207. }
  208. //var_dump($status);
  209. //var_dump($result);
  210. $data->query("execute Webshop_napthe '".$username ."',".$menhgia.",".$cash.",".$xu.",".$seri.",".$pin.",'".$CardName."'");
  211. //echo "execute Webshop_napthe '".$username ."',".$menhgia.",".$cash.",".$xu.",".$seri.",".$pin.",'".$CardName."'";
  212. ///update trang thai the
  213. if(!updateLog($id,'ok',$menhgia,$menhgia))
  214. die('khong update log dc the');
  215.  
  216.  
  217. thongbao('Chúc mừng bạn đã nạp thẻ thành công!\r\nLoại thẻ: <b>' . ucfirst($CardName) . '</b><br>Mệnh giá: <b>' . number_format($menhgia) . " VNĐ</b>\r\nCash nhận được: <b><font color='red'>" . number_format($cash)."\r\n".' xu nhận được : '.$xu);
  218. die('Chúc mừng bạn đã nạp thẻ thành công!<br>Loại thẻ: <b>' . ucfirst($CardName) . '</b><br>Mệnh giá: <b>' . number_format($menhgia) . " VNĐ</b><br>Cash nhận được: <b><font color='red'>" . number_format($cash) .'<br> xu nhận được : '.$xu);
  219.  
  220. }else{
  221. $error = $result['errorMessage'];
  222. $text .= '<div class="mesthongbao">'.$error.':'.$status.'</div>';
  223. if(!updateLog($id,strip_tags($text)))
  224. die('khong update log dc the');
  225. }
  226. }
  227. }
  228. }
  229.  
  230. ?>
  231. <script type="text/javascript">
  232. function popupCash() {
  233. window.open( "http://shop.hotgunny.net:81/danh-sach-the-nap.php", "cashtype",
  234. "status = 1,top = 100,left = 400, height = 630, width = 750, resizable = 0" )
  235. }
  236.  
  237. </script>
  238. <div>
  239. <div id='hienthi'><!-- Title -->
  240. <div class="title_bg">
  241.  
  242. <style>
  243. .mesthongbao{
  244. position:relative;
  245. text-align: center;
  246. color: red;
  247. padding:10px;
  248. }
  249. </style>
  250. <img src="image/logo.png"align="left">
  251. <div class="title"><b>NẠP THẺ</div>
  252. </div>
  253. <div class="pad10">
  254. <fieldset><legend>Hướng dẫn</legend>
  255. <font color="0400ff"><b><font size="10">Hướng Dẫn Nạp Thẻ.</font></font></fieldset><br>
  256. <br>
  257. 1.<font color="007f00"> Thoát games trước khi nạp thẻ(không thoát games sẽ không nhận được xu).</font><br>
  258. <br>
  259. 2. <font color="007f7f">Hiện tại chúng tôi hỗ trợ 3 loại thẻ nạp</font>: <font color="#FF0000">Viettel, Mobifone, Vinaphone</font>.<br>
  260. <br>
  261. 3. <font color="00007f">Vui lòng nhập đầy đủ thông tin yêu cầu ở dưới và chọn loại thẻ nạp phù hợp với thẻ nạp bạn định sử dụng.</font><br>
  262. <br>
  263. 4. <font color="red"><b>Tùy theo mệnh giá thẻ, số lượng Cash & Xu nhận được Bạn có thể xem <a href="javascript:popupCash()">ở đây</a></b></font>
  264. <br>
  265. <br>
  266. Chú ý: <font color="3f007f">Bạn Vui lòng đọc kỹ hướng dẫn trước khi nạp thẻ.<br>Mọi thắc mắc bạn vui lòng inbox Fanpage: <a href='https://www.facebook.com/Gunny12hnet-577802459025309/'>hotgunny.net</a> để được giải đáp. Xin Chân Thành Cảm Ơn.</font><br>
  267. <br>
  268. BQT GAME hotgunny.net™.
  269. <hr>
  270. </fieldset>
  271. <form action="" method="post" >
  272. <p style="text-align:center"><?php echo $text; ?></p>
  273. <TABLE width="100%" border=0 cellPadding=0 cellSpacing=10>
  274. <TBODY>
  275. <TR>
  276. <TD align=right valign="top" width="40%">Tài khoản *</TD>
  277. <TD align="left" valign="top">
  278. <INPUT name=txtusername type=text disabled="disabled" id="ps_person_id" value='<?=$_SESSION['dnss_username'];?>' size=30 maxLength=50>
  279. <div id="user_check_info"></div></TD>
  280. </TR>
  281. <TR>
  282. <TD align=right valign="top">Loại thẻ nạp *</TD>
  283. <TD align="left" valign="top">
  284. <select name="txttype" id="txttype">
  285. <option value="1" selected="selected">Viettel</option>
  286. <option value="2">Mobifone</option>
  287. <option value="3">Vinaphone</option>
  288. <!--<option value="5">Vcoin</option> -->
  289. </select></TD>
  290. </TR>
  291. <TR>
  292. <TD align=right valign="top">Số Seri thẻ *</TD>
  293. <TD align="left" valign="top">
  294. <input name="txtserial" type="text" size="30" maxlength="15" id="txtserial"></TD>
  295. </TR>
  296. <TR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement