Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #----------------------------------------#
- #----------Webshop gunny3.0 v2.6---------#
- #---Create by cty_h@anganh - bachugacon122--#
- #----------------------------------------#
- //if(!defined('cty_h@anganh')) die('cty_h@anganh');
- include('knp/#config.php');
- $text = null;
- #kiem tra xem da login chua
- if(!isset($_SESSION['dnss_userid'])) {
- thongbao('Vui lòng đăng nhập');
- echo 'Vui lòng đăng nhập';
- chuyentrang(linkserver.'login.kyl');
- }
- if(isset($_POST['napthe'])) {
- $oncheck = $data->query("SELECT UserID FROM Sys_Users_Detail Where UserID = '".$_SESSION['dnss_userid']."' AND State = '1'");
- $pin = $_POST['txtmathe']; // string
- $seri = $_POST['txtserial']; // string
- $f = rand(1, 4);
- $card_type = $_POST['txttype']; // interger
- $ma_bao_mat = $_POST['txtcode'];
- #kiem tra thong tin onl
- if ($data->query_num($oncheck) != 0) {
- thongbao('Tính năng này yêu cầu bạn phải thoát nhân vật trong game!');
- echo 'Tính năng này yêu cầu bạn phải thoát nhân vật trong game!';
- chuyentrang(linkserver.'napthe.kyl');
- exit ();
- }
- #Kiem tra thong tin
- if ($pin == null || $seri == null) {
- $text .= '<br>Số serial hoặc mã thẻ không được để trống!';
- }
- #Kiem tra code bao ve
- if ($ma_bao_mat != $_SESSION['dnss_code']) {
- $text .= '<br>Mã bảo vệ không chính xác!';
- }
- //echo $text;
- if($text==null)
- {
- ///nap bang bao kim
- //-------config bao kim
- define('CORE_API_HTTP_USR', 'merchant_19219');
- define('CORE_API_HTTP_PWD', '19219xNSFMy6KJ9l1XgZs4aj8cbRVePYqHv');
- $bk = 'https://www.baokim.vn/the-cao/restFul/send';
- //Loai the cao (VINA, MOBI, VIETEL, VTC, GATE)
- switch($card_type)
- {
- case '1':
- $mang = 'VIETEL';
- $ten = "Viettel";
- break;
- case '2':
- $mang = 'MOBI';
- $ten = "Mobifone";
- break;
- case '3':
- $mang = 'VINA';
- $ten ="Vinaphone";
- break;
- case '4':
- $mang = 'GATE';
- $ten ="Gate";
- break;
- case '5':
- $mang = 'VTC';
- $ten ="VTC";
- break;
- }
- switch ($card_type) {
- case 1:
- $CardName = 'Viettel';
- break;
- case 2:
- $CardName = 'Mobiphone';
- break;
- case 3:
- $CardName = 'Vinaphone';
- break;
- case 4:
- $CardName = 'Gate';
- break;
- case 5:
- $CardName = 'VTC';
- break;
- default:
- die('Mã loại thẻ không hợp lệ hoặc không hỗ trợ!');
- break;
- }
- //log the
- if(!insertLogCard($_SESSION['dnss_username'],$CardName,0,0,'waiting',$pin,$seri))
- die('khong log dc the');
- $id=mysql_insert_id();
- //echo $id;die;
- # Gửi thẻ lên máy chủ BaoKim
- if($f==4){
- //Mã MerchantID dang kí trên Bảo Kim
- $merchant_id = '19219';
- //Api username
- $api_username = 'hotgunnynet';
- //Api Pwd d
- $api_password = 'hotgunnynet098ausgAYSF';
- //Mã TransactionId
- $transaction_id = time();
- //mat khau di kem ma website dang kí trên B?o Kim
- $secure_code = '2a02ad508523650e';
- ///----- end config baokim
- $arrayPost = array(
- 'merchant_id'=>$merchant_id,
- 'api_username'=>$api_username,
- 'api_password'=>$api_password,
- 'transaction_id'=>$transaction_id,
- 'card_id'=>$mang,
- 'pin_field'=>$pin,
- 'seri_field'=>$seri,
- 'algo_mode'=>'hmac'
- );
- ksort($arrayPost);
- $data_sign = hash_hmac('SHA1',implode('',$arrayPost),$secure_code);
- $arrayPost['data_sign'] = $data_sign;
- $curl = curl_init($bk);
- curl_setopt_array($curl, array(
- CURLOPT_POST=>true,
- CURLOPT_HEADER=>false,
- CURLINFO_HEADER_OUT=>true,
- CURLOPT_TIMEOUT=>30,
- CURLOPT_RETURNTRANSFER=>true,
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_HTTPAUTH=>CURLAUTH_DIGEST|CURLAUTH_BASIC,
- CURLOPT_USERPWD=>CORE_API_HTTP_USR.':'.CORE_API_HTTP_PWD,
- CURLOPT_POSTFIELDS=>http_build_query($arrayPost)
- ));
- $data_rs = curl_exec($curl);
- $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- $result = json_decode($data_rs,true);
- date_default_timezone_set('Asia/Ho_Chi_Minh');
- $time = time();
- /*
- $status=200;
- $result = array ("errorMessage"=>"Nạp thẻ thành công với mệnh giá: 20000", "transaction_id"=>"1442891031","binding_field"=>"V2CL52F253E179","amount"=> "20000");*/
- }else{
- $arrayPost = array(
- 'card_type_id' => $card_type ,
- 'pin' => $pin,
- 'seri' => $seri,
- 'id' => '7322'
- );
- $url = 'http://sv.gamebank.vn/ajax/card.php';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch,CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, count($arrayPost));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $arrayPost);
- $result = curl_exec($ch);
- curl_close($ch);
- $result = json_decode($result);
- $status = $result->code;
- $result['amount']=$result->msg;
- $result['amount']=str_replace('.', '', trim(substr($result['amount'],-7)));
- $result['errorMessage']=$result->msg;
- }
- if(empty($pin)){
- $text .= 'Loi ket noi ben nha mang';
- }else{
- //echo $_SESSION['dnss_userid'];die;
- /*
- if($_SESSION['dnss_username']=='hjhjhg')
- {
- $response='RESULT:10@200000';
- }
- */
- if($status==200 or $status==0)
- {
- $TxtMenhGia = $result['amount'];
- //if($code == 0) {
- include "config_card.php";
- $menhgia = $TxtMenhGia;
- //$menhgia = 50000;
- $cash = $cCard[$CardName][$menhgia];
- $xu = $xu[$menhgia];
- $username = $_SESSION['dnss_username'];
- if(true)
- {
- //$response='RESULT:10@200000';
- if(checkFirstCard($_SESSION['dnss_username']))
- {
- $tem_menh_gia=100000;
- //$tem_cash=$cCard[$CardName][$tem_menh_gia];
- //$tem_xu = $xu[$tem_menh_gia];
- //$menhgia=$menhgia+$tem_menh_gia;
- $cash=$cash+$tem_menh_gia;
- //$xu=$xu;
- }
- }
- //var_dump($status);
- //var_dump($result);
- $data->query("execute Webshop_napthe '".$username ."',".$menhgia.",".$cash.",".$xu.",".$seri.",".$pin.",'".$CardName."'");
- //echo "execute Webshop_napthe '".$username ."',".$menhgia.",".$cash.",".$xu.",".$seri.",".$pin.",'".$CardName."'";
- ///update trang thai the
- if(!updateLog($id,'ok',$menhgia,$menhgia))
- die('khong update log dc the');
- 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);
- 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);
- }else{
- $error = $result['errorMessage'];
- $text .= '<div class="mesthongbao">'.$error.':'.$status.'</div>';
- if(!updateLog($id,strip_tags($text)))
- die('khong update log dc the');
- }
- }
- }
- }
- ?>
- <script type="text/javascript">
- function popupCash() {
- window.open( "http://shop.hotgunny.net:81/danh-sach-the-nap.php", "cashtype",
- "status = 1,top = 100,left = 400, height = 630, width = 750, resizable = 0" )
- }
- </script>
- <div>
- <div id='hienthi'><!-- Title -->
- <div class="title_bg">
- <style>
- .mesthongbao{
- position:relative;
- text-align: center;
- color: red;
- padding:10px;
- }
- </style>
- <img src="image/logo.png"align="left">
- <div class="title"><b>NẠP THẺ</div>
- </div>
- <div class="pad10">
- <fieldset><legend>Hướng dẫn</legend>
- <font color="0400ff"><b><font size="10">Hướng Dẫn Nạp Thẻ.</font></font></fieldset><br>
- <br>
- 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>
- <br>
- 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>
- <br>
- 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>
- <br>
- 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>
- <br>
- <br>
- 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>
- <br>
- BQT GAME hotgunny.net™.
- <hr>
- </fieldset>
- <form action="" method="post" >
- <p style="text-align:center"><?php echo $text; ?></p>
- <TABLE width="100%" border=0 cellPadding=0 cellSpacing=10>
- <TBODY>
- <TR>
- <TD align=right valign="top" width="40%">Tài khoản *</TD>
- <TD align="left" valign="top">
- <INPUT name=txtusername type=text disabled="disabled" id="ps_person_id" value='<?=$_SESSION['dnss_username'];?>' size=30 maxLength=50>
- <div id="user_check_info"></div></TD>
- </TR>
- <TR>
- <TD align=right valign="top">Loại thẻ nạp *</TD>
- <TD align="left" valign="top">
- <select name="txttype" id="txttype">
- <option value="1" selected="selected">Viettel</option>
- <option value="2">Mobifone</option>
- <option value="3">Vinaphone</option>
- <!--<option value="5">Vcoin</option> -->
- </select></TD>
- </TR>
- <TR>
- <TD align=right valign="top">Số Seri thẻ *</TD>
- <TD align="left" valign="top">
- <input name="txtserial" type="text" size="30" maxlength="15" id="txtserial"></TD>
- </TR>
- <TR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement