<?php
	include_once('../config.php');  
	include_once('../recharges/recharge_api.php');  
    include_once(ABS_PATH.'/custom_function/default.php');    
     

	
        
        $stmt=$conn->prepare("select eml,nm,phm,utilities from UI__Rgst    where cuurentId=:cuurentId     ");   
        $stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_INT);  
        $stmt->execute(); 
        $UI__Rgst = $stmt->fetch(PDO::FETCH_OBJ);            
        $Email  = $UI__Rgst->eml; 
        
        $PAYWAllet =  GetBalance();     
	 
	  
    if($UI__Rgst->utilities=="")
         $utili = 0;
    else{
        $expln =  explode(",",$UI__Rgst->utilities); 
        $utili = $expln[3];
    }   
        
	if( (!isset($_SESSION['userId'])) || ($utili!=1) )
	{ 
		 header("Location: ../");
		 die;
	}    
	
                    //echo '<pre>'; print_r($_POST);
                    if( (isset($_POST['Recharge'])) && (($PAYWAllet)>=$_POST['amount']) ) 
                    {
                    
                    } 


                $stmt=$conn->prepare("select id,service_id,provider_id,provider_name,status from recharge_operators where service_id=5 and is_available=1"); // for Electricity
                $stmt->execute();   
                $electricity_rows = $stmt->rowCount();
                if($electricity_rows > 0)
                    $electricity_result=$stmt->fetchAll(PDO::FETCH_OBJ);
			         
include_once("../view/dashboard/electricity.php");
?>