connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$yearstart = date("Y");
$yearend = date("Y")+100;
$planettoshow = ucfirst(strtolower($_REQUEST['planet']));
$signtoshow = ucfirst(strtolower($_REQUEST['sign']));
$yearstart = intval($_REQUEST['start']);
$yearend = intval($_REQUEST['end']);
$planettoshow = preg_replace('/[^a-zA-Z]/','', $planettoshow);
$signtoshow = preg_replace('/[^a-zA-Z]/','', $signtoshow);
if(isset($yearstart) && $yearstart == 0) {
$yearstart = date("Y");
}
if(isset($yearend) && $yearend == 0) {
$yearend = date("Y")+100;
}
$options = preg_replace('/[^a-zA-Z]/','', $_REQUEST['opt']);
function format_year($str) {
$era = ' CE';
return str_replace('-'.str_replace('-','',$str),str_replace('-','',$str.$era),$str);
}
$planets = array(
'',
'Sun', # 0
'Moon', # 1
'Mercury', # 2
'Venus', # 3
'Mars', # 4
'Jupiter', # 5
'Saturn', # 6
'Uranus', # 7
'Neptune', # 8
'Pluto', # 9
'Chiron', # 10
'Lilith' # 11
);
$signs = array ('','Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces');
$planetslist = array(
0 => 'Sun',
1=> 'Moon',
2=> 'Mercury',
3=> 'Venus',
4=> 'Mars',
5=> 'Jupiter',
6=>'Saturn',
7=> 'Uranus',
8=> 'Neptune',
9=> 'Pluto',
10=> 'Chiron',
11=> 'Lilith'
);
$signslist = array (
0=>'',
1=> 'Aries',
2=> 'Taurus',
3=> 'Gemini',
4=> 'Cancer',
5=> 'Leo',
6=> 'Virgo',
7=> 'Libra',
8=> 'Scorpio',
9=> 'Sagittarius',
10=> 'Capricorn',
11=> 'Aquarius',
12=> 'Pisces'
);
function getplanetlist($planet,$sign,$yearstart,$yearend,$signslist,$planetslist,$options,$conn) {
$glyphs = array(
'',
'♈',
'♉',
'♊',
'♋',
'♌',
'♍',
'♎',
'♏',
'♐',
'♑',
'♒',
'♓');
$sortyear = $yearstart;
$endyear = $yearend;
$pl = array_search($planet,$planetslist,true);
$si = array_search($sign,$signslist,true);
$i=1;
$sql = "SELECT * FROM astrology_months where planet = '".$pl."' and sign = '".$sign."' and year >= '".$sortyear."' and year <= '".$endyear."' group by year";
//echo $sql;
$result = $conn->query($sql) or die(mysqli_error($conn));
//var_dump($result);
if ($result->num_rows > 0) {
if($options == 'graphs') {
$list = '';
} else {
$list = "
| ".$glyphs[$row['sign']]." | ".$row['year']." | ".$rg." |