<?php   
	include_once("../view/header-footer/header.php");  
?>   

<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";
    }
        
</script>
       

  <br><br>
   <!-- Features -->
   <div class="fearturesSection">
      <div class="container">
         <h3 class="mainHeading">Bill Payments</h3>
         <div class="row">
             
            
            
            <?php 
                    
                    $Remail =  "dailypay2024@gmail.com";
                    $Rd =  "gp6ZiH";  
                    $access_token = '{"email":"'.$Remail.'","password":"'.$Rd.'"}';  
                    
                    
                    $ch = curl_init('https://erp.pay2all.in/api/token');                                             
                    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
                    curl_setopt($ch, CURLOPT_POSTFIELDS, $access_token);                                                                  
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
                    curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
                    'x-tera-tenant-region: IN', 
                    'Content-Type: application/json', 
                    'Content-Length: ' . strlen($access_token))                                                                       
                    );       																		 
                    $response = curl_exec($ch);  
                    $json_response = json_decode($response);   
                    $RechargeAccess_token = $json_response->token;  
                    
                    
                    $ch = curl_init();
                    curl_setopt($ch, CURLOPT_URL,'https://erp.pay2all.in/api/bbps/category');  
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
                    $headers = array();
                    $headers[] = "Accept: application/json";
                    $headers[] = "Authorization: Bearer ".$RechargeAccess_token;
                    $headers[] = "Content-Type: application/json";
                    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                    $result = curl_exec($ch);  
                    $UI__redirecturl = json_decode($result);   
                     
	
                $sr=1;
                foreach($UI__redirecturl->categories as $mob) 
                { 
            ?>
             
            <div class="col-4">
               <div class="featureThumb" style="background:#fff">
                  <a href="elenexct.php?Urlslug=<?php echo $mob->biller_slug;?>&nm=<?php echo $mob->name?>">
                  <img src="<?php echo $mob->icon;?>" width="80" >
                  <h4><?php echo $mob->name;?></h4> 
                  </a>
               </div>
            </div> 
            <?php $sr++;} ?>   
            
         </div>
     </div>    
   </div>

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