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 = "
"; } while($row = $result->fetch_assoc()) { if($row['retrograde'] == '1') { $rg = " R "; } else { $rg = ""; } if($options == 'graphs') { $list .= "{id: ".$i.", text: '".$glyphs[$row['sign']]."', start: new Date(".$row['year'].",".$row['month'].",".$row['day']."), type:'point'},"; } else { $list .= ""; } $i++; } if($options == 'graphs') { $list .= ''; } else { $list .= "
".$glyphs[$row['sign']]."".$row['year']."".$rg."
"; } } return $list; } ?> Planets in signs

To zoom, place mouse cursor on graph, click graph and then use the scroll wheel to zoom in and out.

".$planettoshow." in ".$signtoshow.""; echo "

".$yearstart." - ".$yearend."

"; ?>
'; } } else { $si = array_search($planettoshow,$planetslist,true); echo $glyphs[$si]; echo "

".$planettoshow."

"; echo "

".$yearstart." - ".$yearend."

"; echo "
"; // in which sign do we start? good to know. $ls = (int)$_REQUEST['loopstart']; if(isset($ls)) { $i=$ls; } else { $i=0; } for($i;$i<=count($signs)-1;$i++) { if($options == 'graphs') { ?> ".$signs[$i].""; echo getplanetlist($planettoshow,$i,$yearstart,$yearend,$signslist,$planetslist,$options,$conn).'
'; } } if(isset($ls)) { $remainder = $ls; for($k=0;$k<$remainder;$k++) { echo getplanetlist($planettoshow,$k,$yearstart,$yearend,$signslist,$planetslist,$options,$conn).'
'; } } } ?>