<?php

$ad_id=$_SESSION['LOGINID'];
$selecAdminQry = "SELECT * FROM users WHERE id = $ad_id";
$result = mysqli_query($connection, $selecAdminQry);
$row = mysqli_fetch_object($result);
$u_name=$row->name;

 $user_type=$row->role;
 
 
 function IND_money_format($number){        
        $decimal = (string)($number - floor($number));
        $money = floor($number);
        $length = strlen($money);
        $delimiter = '';
        $money = strrev($money);
 
        for($i=0;$i<$length;$i++){
            if(( $i==3 || ($i>3 && ($i-1)%2==0) )&& $i!=$length){
                $delimiter .=',';
            }
            $delimiter .=$money[$i];
        }
 
        $result = strrev($delimiter);
        $decimal = preg_replace("/0\./i", ".", $decimal);
        $decimal = substr($decimal, 0, 3);
 
        if( $decimal != '0'){
            $result = $result.$decimal;
        }
 
        return $result;
    }
?>