<?php
ob_start();
session_start();
include("config.php");



  
   $userid= $_SESSION['frontuserid'];
   $amount_1= $_POST['deposit'];
   $utr_no= $_POST['refrence'];
   $phone=$_POST['phone'];
   
   
   $sqlyt = mysqli_query($com,"select * from walletsummery where utr_no='$utr_no'");
   $count = mysqli_num_rows($sqlyt);
   if($count == '0')
   {
  $sql = "INSERT INTO walletsummery (phone,userid,orderid,amount,amount_1,utr_no,type,actiontype,status)
                                 VALUES ('$phone','$userid','$refcode', '$amount_1', '$amount_1','$utr_no','credit','recharge','0')";
   if(mysqli_query($com, $sql)){  

    echo "<script>
alert('Amount Recharge Request sucessfully');
window.location.href='myaccount.php';
</script>";  

    }else{  

    echo "<script>
alert('Amount Recharge Request not sucessfully');
window.location.href='recharge.php';
</script>";  

    }  
   }else{  

    echo "<script>
alert('UTR no already exists');
window.location.href='recharge.php';
</script>";  

    }  

?>