AstrologyClass.org | Vishv sahdev

Planet info class

Demo
GrahVakRashiLongPadaNakRashi_swamiLordSubSub_sub
Lagan494.8818MoSaSaRa
Sun7196.73415VeRaVeSa
Moon9269.64121JuSuRaJu
Mercury7188.78115VeRaJuJu
Venus8233.65318MaMeMaSa
Mars6155.30312MeSuMeMe
Jupiter245.4824VeMoJuRa
Saturn234.9633VeSuSaJu
Rahu384.9627MeJuMeRa
Ketu9264.96420JuVeMeMa
Example
/*
file required
--------------
1. base-class
2. sub-lord
*/

$chart=$cc[0]; //-------- $cc[0] value -> file base-class

$data = grah_detail($chart);
$th= [
'grah','vak','rashi','long','pada','nak','rashi_swami','lord','sub','sub_sub'
]; 
echo  ttable($th,$data);
Php script
<?php

function grah_detail($chart,$p){
$jh1=['','Ma','Ve','Me','Mo','Su','Me','Ve','Ma','Ju','Sa','Sa','Ju'];
$nakshatra_size 13+1/3;        
$grah_detail=[];
$nak2grah=[];
foreach(
$chart as $k=>$v){
    
        
    
$grah_detail[$v->x]['grah']=$v->t;
    if(
$v->speed 0)
    
$grah_detail[$v->x]['vak']='&#11148;';
else
    
$grah_detail[$v->x]['vak']='';
    
$grah_detail[$v->x]['rashi']=ceil($v->l/30);    
    
$grah_detail[$v->x]['long']=toFi($v->l);
    
$grah_detail[$v->x]['pada']=getPada($v->l);
    
$grah_detail[$v->x]['nak']=ceil($v->l/$nakshatra_size);
        
$p=gsub($v->l); //------- gsub function -> file sub-lord 
    
$grah_detail[$v->x]['rashi_swami']=$jh1[ceil($v->l/30)];
    
$grah_detail[$v->x]['lord']=$p[0]['nk'];
    
$grah_detail[$v->x]['sub']=$p[0]['nk_s'];
    
$grah_detail[$v->x]['sub_sub']=$p[0]['nk_ss'];

}    

return 
$grah_detail;



function 
getPada($long)
{
$nakshatra_size 13+1/3;
$nakshatra_cur fmod($long,$nakshatra_size);
return 
ceil($nakshatra_cur 3.33333333);
}

function 
toFi($item,$value=2){
return 
number_format((float)$item$value'.''');
}

function 
ttable($th,$data){
$mt ='<table class="table table-bordered table-hover table-sm text-center"><thead class="table-danger"><tr>';
foreach(
$th as $k=>$v)
$mt .='<th scope="col">'.ucfirst($v).'</th>';
$mt .='</tr></thead>';
$mt .='<tbody>';
foreach(
$data as $kk=>$vv){
$mt .='<tr>';
foreach(
$vv as $k2=>$v2){
$mt .='<td>'.$v2.'</td>'
}
$mt .='</tr>';
}
$mt .='</tbody></table>';
return 
$mt;

Birth Info Edit
DoB2022-08-08
ToB01:36:46
PoBDelhi, IN
Lat|Lon28.36, 77.12
Transit Info Edit
Date2022-08-08
Time01:36:46
PlaceDelhi, IN
Lat|Lon28.36, 77.12
::