/*
* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Script name:
date2saur.php ver 1.0.0
Description :
This script is illustrates use of REST API that retrieves Saur Dinank
information from the given Gregorian date.
Written by:
27-Sep-2024 - Infotools
add PHP open tag on first line, closing tag on the last line and then save
this file as PHP Hypertext Processor file. i.e. having extension .php
Code review by:
27-Sep-2024 - Infotools
Caution:
27-Sep-2024 - Infotools ver 1.0.0
Because this script is generated using proprietory code generator,
changes in this script will need to be handled carefully.
Assumption:
27-Sep-2024 - Infotools
Remarks:
27-Sep-2024 - Infotools
* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
*/
$sfn = "date2saur.php : ";
$ans = null;
define("TODAY", date("Y-m-d"));
$dDate = $_GET['ansidate'];
$ans = $_GET['show'];
//echo $sfn.' dDate : '.$dDate.' show : '.$ans.'
';
if($dDate) {
$url = "https://infotools.in/datelib/getsaur.php?ansidate=".$dDate."&UserId=1234&show=".$ans;
} else {
$url = "https://infotools.in/datelib/getsaur.php?ansidate=".TODAY."&UserId=1234&show=".$ans;
}
//
// data is returned in json data format in the variable $response
$response = file_get_contents($url);
//
// following echo is for demo / debugging purpose only. Actual value is received in $response variable in json data format
if($ans) {
echo ' response json format :
'.$response.'
';
/*
$aDateinfo = json_decode($response, true);
echo $sfn.' aDateinfo
'; print_r($aDateinfo);
*/
echo '
Thanks for using date2saur API by infotools.in';
echo '';
echo '
to get API help visit
भारतीय सौर दिनांक API help
';
echo '
-- भारतीय सौर दिनांक आश्विन १ शके १९४६ 23 Sep 2024 ver 1.0.0';
}