<?php
    include_once('../config.php');    
             

             
            if($_POST['GetProviderId']) 
            {  
                $mobile_no = $_POST['mobile_no'];
                $RechargeAccess_token = "93|7rnAbBltnffBU4653qHtvwcDkB3eqlKyjnJqkET34526ec84";   
                $data_string = '{"service_id":"1","number":"'.$mobile_no.'"}';   
                
                
                $ch = curl_init('https://api.mobileapi.in/api/v1/plan/operator_info');                                             
                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
                curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
                curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
                'x-tera-tenant-region: IN', 
                'Content-Type: application/json', 
                $headers[] = "Authorization: Bearer ".$RechargeAccess_token,
                'Content-Length: ' . strlen($data_string))                                                                       
                );       																		 
                $response = curl_exec($ch);  
                $Result = json_decode($response); 
                
                    
                $stmt= $conn->prepare("select PlanId   from rechargPlanCircle  where PlnaNme=:PlnaNme");  
                $stmt->bindValue(':PlnaNme', $Result->data->circle_name , PDO::PARAM_STR);  
                $stmt->execute();
                $Cname = $stmt->fetch(PDO::FETCH_OBJ);  
                
                $provideId = $Result->data->provider_id;
                 
                $providename = $Result->data->provider_name;      
                $circle_name = $Result->data->circle_name;
                echo $provideId.",".$circle_name;
                die;
            }