<?php   
	include_once("../view/header-footer/header.php");  
?>  
<style>
  #SuccImg{
        display:none;
    }
    #submit{
        display:none;
    }
    #TxnPwdShow{
        display:none;
    }
    #MsgShow{
        display:none;
    }
    #PayAgian{
        display:none;
    } 
    #PgFail{
        display:none;
    }
</style>  
<script>
    
    
    
            
    
        function verify()
        {    
                        
            if($("#UPI").val()!='') 
            {     
                     $.ajax({	
                        type: "POST",
                        url: URL+"/ajax/validation.php",
                        data: {UpiVarify:1,Data:$("#UPI").val()},
                        beforeSend: function(){ 
                        },
                        success: function(data)
                            {     
                                 if(data!='')
                                 $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                            }
                        });   
                }       
          }
        
        
        function functionCalled1()
        {
                if($("#TxnPwd").val()!='') 
                {      
                        $.ajax({	
                        type: "POST",
                        url: URL+"/ajax/validation.php",
                        data: {FormDataSubmit:1,UPI:$("#UPI").val(),AMMT:$("#AMMT").val(),TxnPwd:$("#TxnPwd").val()},
                        beforeSend: function()
                        {
                            
                        },
                        success: function(data)
                            {       
                                $("#MsgShow").hide(300);
                                $("#submit").hide(300); 
                                $("#PayAgian").show(300) ;
                                 
                                if(data==1) 
                                { 
                                    
                                    /*var audioElement2 = document.createElement('audio');
                                    audioElement2.setAttribute('src', 'https://www.dailypayservices.in/mob/sound/paidamt.mp3'); 
                                    audioElement2.addEventListener('', function() 
                                    {
                                    //this.play();
                                    }, false);
                                    audioElement2.play();  */    
                                    
                                    ////
                                    $('.loader').css('display','block');
                                    $.ajax({	
                                    type: "POST",
                                    url: URL+"/ajax/validation.php",
                                    data: {FormDataSubmitAgn:1,UPI:$("#UPI").val(),AMMT:$("#AMMT").val(),TxnPwd:$("#TxnPwd").val()},
                                    beforeSend: function()
                                    {
                                        
                                    },
                                    success: function(data)
                                    {       
                                            $("#UPI").val('');
                                            $("#AMMT").val('');
                                            $("#TxnPwd").val(''); 
                                            $('.loader').css('display','none'); 
                                             
                                            
                                            if( (data!=2)  && (data!=0) &&  (data!=5)  &&  (data!=6) )
                                            {
                                                window.location.href  = URL+"/dashboard/viewRec.php?id="+data;   
                                                $("#SuccImg").show(300);  
                                            }else if(data==2)
                                            {
                                                $("#PgFail").html("Please complete your E-KYC & Try Again!!");  
                                                $("#AvailbleId").html("");  
                                                $("#PgFail").show();   
                                                
                                            }else if(data==3)
                                            {
                                                $("#PgFail").html("Your Daily Limit Has Been Over!!");  
                                                $("#AvailbleId").html("");  
                                                $("#PgFail").show();   
                                            }else if(data==5)
                                            {
                                                $("#PgFail").html("Please Transfer Minimum 100 Rs/-");  
                                                $("#AvailbleId").html("");  
                                                $("#PgFail").show();   
                                            }else if(data==6)
                                            {
                                                $("#PgFail").html("Please use ID TO ID Tranfer Option for this UPI");  
                                                $("#AvailbleId").html("");  
                                                $("#PgFail").show();   
                                            }else 
                                                $("#PgFail").show();                    
                                    }   
                                    }); 
                                    //   
                                    
                                }else if(data==2)
                                {
                                    alert("Error: 303");
                                }else
                                    $("#PgFail").show(300);       
                            
                            }
                        }); 
                }
        }
        
        function functionCalled()
        {
         
            if(($("#AMMT").val()!='') && (($("#UPI").val()!=''))) 
            {
                    if($("#AMMT").val()<=1000)
                    {
                        $("#proceed").hide(300);     
                        $("#submit").show(300);    
                        $("#TxnPwdShow").show(300);     
                    }else
                    {
                        
                         $.ajax({	
                            type: "POST",
                            url: URL+"/ajax/validation.php",
                            data: {CheckDpay:1,Data:$("#UPI").val()},
                            beforeSend: function(){ 
                            },
                            success: function(data)
                                {       
                                     if(data>0)
                                     {
                                        $("#proceed").hide(300);     
                                        $("#submit").show(300);    
                                        $("#TxnPwdShow").show(300); 
                                        
                                     }else
                                     {
                                        $("#AmmTPorc").html("For Above ₹1000/- Use Bank Transfer Option");   
                                     } 
                                }
                            });  
                    }
                    
            }
        }   
        
        $(document).ready(function()
        {       
            var URL = "<?php echo ROOTPATH;?>";   
            
            $(".PayOutSound").click(function()
            {       
            var audioElement = document.createElement('audio');
            audioElement.setAttribute('src', 'https://www.dailypayservices.in/mob/sound/button-16.mp3'); 
            audioElement.addEventListener('', function() 
            {
            //this.play();
            }, false);
            audioElement.play();  
            });	
             
            $( "#UPI" ).change(function() 
            {       
                       
                  /*     
              $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {userDatacheck:1,Data:$("#UPI").val()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {       
                             if(data!='')
                             $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                        }
                    });*/   
            });  
            
                
               $("#myForm").validate({
                submitHandler: function (event) 
                {
                      
                   /* form.submit();
                    event.preventDefault();
                    
                    $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {FormDataSubmit:1,Data:$("#myForm").serialize()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {       
                             alert(data);
                             
                            var audioElement1 = document.createElement('audio');
                            audioElement1.setAttribute('src', 'https://www.dailypayservices.in/mob/sound/welcome_msg.mp3'); 
                            audioElement1.addEventListener('', function() 
                            {
                            //this.play();
                            }, false);
                            audioElement1.play();  
                             
                        }
                    });   
                    */
                }
                });
     
        });    
    
     
    </script> 
    <script type="text/javascript" src="<?php echo ROOTPATH;?>/view/js/tab/profile.js"> </script>
    <script>
        //Function To Display Popup
    function div_show() 
    {
    
    document.getElementById('abc').style.display = "block";
    }
    //Function to Hide Popup
    function div_hide(){
    document.getElementById('abc').style.display = "none";
    }
        
        function onCht(va)
        {
                if(va!='')
                {
                    $("#UPI").val(va);        
                }   
        }
        
    </script>




<div class="loader">
    <div class="loaderInn">
        <img src="<?php echo ROOTPATH;?>/images/loader.gif" alt="loading" />
    </div>
</div>

 <!-- Features -->
   <div class="innerDeader">
      <div class="container">
           
           <a href="javascript:void(0);" id="go-back" class="goBack PaySound">
           <img src="<?php echo ROOTPATH;?>/images/Arrow 1.svg" alt="back">
       </a>  
           
          <h4>DELETE UPI</h4> 
          <span>
           <?php  
                if(isset($_SESSION['Regis']))  
                    echo $_SESSION['Regis'];     
            ?>
          </span>
     </div>    
   </div>
   <br>
   
   <?php 
    
   ?>
    <!--div class="innerBody">
       <div class="container">
           <h5 style="font-size:15px;">* Kindly use bank transfer option right now </h5>
     </div>
    </div!--> 
   <?php  { ?>
       
   <div class="innerBody">
       <div class="container">
        <div class="formBox">
            <form method="post" autocomplete="off">
          
          <div class="form-outline">
            <label class="form-label" for="form12">Select UPI</label>
            
            <select  name="UpiId" id="UpiId" class="form-control"  >
                <option value="">Select UPI</option>    
                <?php 
                    foreach($UI__upi as $mpp) 
                    {
                ?>
                <option value="<?php echo $mpp->id;?>"><?php echo $mpp->upi." (".$mpp->name.")";?></option>
                <?php } ?>
            </select> 
          </div>
          
          
		 
          
          
		   <div class="form-outline">
		        <?php  
                        if(isset($_SESSION['Regis']))
                        {
                            if(!isset($_SESSION['topSuc'])) 
							{ 
                    ?> 
            <label class="form-label" for="form12" style="color:red;font-weight:bold">Payment Failed</label>
             <?php  } 
                        }
                    ?> 
                <label id="PgFail" style="color:red;font-weight:bold">Transaction Failed</label>    
          </div>
              
         
        
        <div class="form-outline" > 
            <input type="submit" class="btn btn-primary bigBtn PaySound mb-3 PaySound"    name="DelUpi"   value="Delete UPI"/>  
            <span id="AmmTPorc"></span>
        </div>
        
        
        <div class="form-outline"  id="submit">
            <a href="javascript:void(0);"   class="btn btn-primary bigBtn  PayOutSound mb-2" onclick="functionCalled1();"  />   Pay </a>
            <span id="AmmTPorc1"></span>
            
        </div>  
          
         <div class="form-outline"  id="MsgShow">
            <img src="<?php echo ROOTPATH;?>/view/images/procc.gif"  width="80"/>
        </div>
        
         <div class="form-outline"  id="SuccImg">
            <span><img src="<?php echo ROOTPATH;?>/view/images/pgdone.gif" /></span><br>
        </div>    
        
        
        
        
         
         <a href="Payout.php" id="go-backDown" class="PaySound " style="background-color: #747474;
                    border: none;
                    color: #fff;
                    padding: 5px 10px;
                    text-align: center;
                    text-decoration: none;
                    display: inline-block;
                    width:100%; 
                    border-radius:5px;
                    font-size: 15px;
                    margin: 4px 2px;
                    cursor: pointer;" >Go Back</a>
                    
                    
            

          </form>

        </div>  
       </div>
   </div>  
   <?php } ?>
   
     
</div>
 
<?php 
  include_once("../view/header-footer/footer.php");  
unset($_SESSION['Regis']);  
unset($_SESSION['topSuc']); 
unset($_SESSION['QRSET']); 