Пример #1
0
 public function findYears($current_age = 15, $end_age = 70, $least_count_days = 45)
 {
     $this->set_duration($current_age, $end_age);
     $output = array();
     $least_count = $least_count_days * MarriageGuru::DAY_DIFF;
     $res = array(0, 0, 0, 0, 0, 0, 0, 0);
     $output = array();
     $time = $this->_start_time;
     $end_time = $this->_end_time;
     $iter = 0;
     while ($time <= $this->_end_time) {
         $iter++;
         $date = explode(":", date(MarriageGuru::DATE_FORMAT, $time));
         $data = $this->_start_data;
         $data['month'] = intval($date[1]);
         $data['year'] = intval($date[0]);
         $data['day'] = intval($date[2]);
         $data['hour'] = 7;
         $data['min'] = 30;
         $data['am_pm'] = 'am';
         $report = new AstroReport($data);
         $time_planets = $report->getPlanets();
         $time_houses = $report->getHouses();
         $res[2] = $this->executeRuleThree($time_planets["Jupiter"][MarriageGuru::FULLDEGREE_STRING]);
         $res[3] = $this->executeRuleFour($time_planets["Jupiter"], $time_planets["Saturn"]);
         $res[5] = $this->executeRuleSix($time_planets["Jupiter"][MarriageGuru::FULLDEGREE_STRING]);
         $res[6] = $this->executeRuleNine($time_planets);
         $res[7] = $this->executeRuleTen($time_planets);
         $success = 0;
         for ($i = 0; $i < 9; $i++) {
             if ($res[$i] == 1) {
                 $success++;
             }
         }
         $count = count($output);
         if ($success >= 4) {
             $count = count($output);
             $output[$count] = array(date(MarriageGuru::DATE_FORMAT, $time), $success, $res[0], $res[2], $res[3], $res[4], $res[5], $res[6], $res[7], $res[8]);
         }
         $time += $least_count;
     }
     $years = array();
     foreach ($output as $o) {
         $date = explode(":", $o[0]);
         $y = intval($date[0]);
         if (!isset($years[$y])) {
             $years[$y] = 1;
         } else {
             $years[$y] += 1;
         }
     }
     arsort($years);
     $resultCount = count($years);
     $resultCount = (int) ($resultCount / 3);
     $startCount = 1;
     $statYears = $years;
     foreach ($statYears as $y => $frequency) {
         $age = $y - $this->_birth_data['year'];
         $p = $this->getProbabilityByAge($age);
         $statYears[$y] *= $p;
     }
     arsort($statYears);
     $ageList = array();
     foreach ($statYears as $y => $frequency) {
         $age = $y - $this->_birth_data['year'];
         $ageList[] = $age;
         if ($startCount <= $resultCount) {
             $startCount++;
         } else {
             break;
         }
     }
     $finalOutput = array($statYears, $ageList);
     return $finalOutput;
 }
Пример #2
0
 public function find_aspects($start_date, $end_date)
 {
     //print "inside aspect finder";
     $date = explode(":", $start_date);
     $this->_start_data = $this->_birth_data;
     $this->_start_data['day'] = intval($date[2]);
     $this->_start_data['month'] = intval($date[1]);
     $this->_start_data['year'] = intval($date[0]);
     $this->_start_data['hour'] = intval($date[3]);
     $this->_start_data['min'] = intval($date[4]);
     $this->_start_data['am_pm'] = $date[5];
     $date = explode(":", $end_date);
     $this->_end_data = $this->_birth_data;
     $this->_end_data['day'] = intval($date[2]);
     $this->_end_data['month'] = intval($date[1]);
     $this->_end_data['year'] = intval($date[0]);
     $this->_end_data['hour'] = intval($date[3]);
     $this->_end_data['min'] = intval($date[4]);
     $this->_end_data['am_pm'] = $date[5];
     if (strcmp($this->_start_data['am_pm'], 'am') == 0) {
         $this->_start_time = mktime($this->_start_data['hour'], $this->_start_data['min'], 0, $this->_start_data['month'], $this->_start_data['day'], $this->_start_data['year']);
     } else {
         $this->_start_time = mktime($this->_start_data['hour'] + 12, $this->_start_data['min'], 0, $this->_start_data['month'], $this->_start_data['day'], $this->_start_data['year']);
     }
     if (strcmp($this->_end_data['am_pm'], 'am') == 0) {
         $this->_end_time = mktime($this->_end_data['hour'], $this->_end_data['min'], 0, $this->_end_data['month'], $this->_end_data['day'], $this->_end_data['year']);
     } else {
         $this->_end_time = mktime($this->_end_data['hour'] + 12, $this->_end_data['min'], 0, $this->_end_data['month'], $this->_end_data['day'], $this->_end_data['year']);
     }
     $birth_report = new AstroReport($this->_birth_data);
     $start_report = new AstroReport($this->_start_data);
     $this->_birth_planets = $birth_report->getPlanets();
     $birthHouses = $birth_report->getHouses();
     $this->_birth_planets['ASC'] = $birthHouses['ASC'];
     $this->_birth_houses = $birthHouses;
     $this->_start_planets = $start_report->getPlanets();
     //	var_dump($this->_start_planets);
     $output = array();
     $res = array();
     $output = $this->start();
     return $output;
 }
Пример #3
0
<?php

require_once 'orbit.php';
require_once 'planet.php';
require_once 'transit.php';
require_once 'astroreport.php';
require_once 'functions.php';
require_once 'ashtakvarg.php';
$birth_data = array('timezone' => array('hours' => 5, 'min' => 30, 'direction' => 'E'), 'longitude' => array('degrees' => 75, 'min' => 49, 'direction' => 'E'), 'latitude' => array('degrees' => 26, 'min' => 55, 'direction' => 'N'), 'month' => 7, 'day' => 7, 'year' => 1986, 'hour' => 8, 'min' => 53, 'report_name' => 'Arpit Tambi', 'city' => 'Jaipur', 'country' => 'IN', 'am_pm' => 'am', 'has_all_info' => true);
$aa = new AstroReport($birth_data);
$birthTS = getBirthTS($birth_data);
$houses = $aa->getHouses();
$planets = $aa->getPlanets();
$my = new AshtakVarg($planets, $houses['ASC']['sign_number']);
$houses = $my->getHouseRating($houses);
$br = '<br />';
echo 'House Evaluation' . $br;
echo '----------------' . $br;
for ($i = 1; $i < 13; $i++) {
    echo 'House ' . $i . ' - ' . $houses[$i]['Points'][0] . ' - ' . $houses[$i]['Points'][1] . $br;
}
var_dump($houses);
Пример #4
0
 public function findMarriageDates()
 {
     $this->set_duration(18, 45);
     $output = array();
     $least_count = MarriageGuru::LEAST_COUNT_COEFF * AspectsGenerator::DAY_DIFF;
     $res = array(0, 0, 0, 0, 0, 0, 0, 0);
     $output = array();
     $time = $this->_start_time;
     $end_time = $this->_end_time;
     $iter = 0;
     while ($time <= $this->_end_time) {
         $iter++;
         //	$date = date(AspectsGenerator::DATE_FORMAT,$time);
         //				print "\n\ndate = $date";
         $date = explode(":", date(AspectsGenerator::DATE_FORMAT, $time));
         //		$date = explode(":","1975:10:11");
         $data = $this->_start_data;
         $data['month'] = intval($date[1]);
         $data['year'] = intval($date[0]);
         $data['day'] = intval($date[2]);
         $data['hour'] = intval($date[3]);
         $data['min'] = intval($date[4]);
         $data['am_pm'] = $date[5];
         //		$time = mktime($data['hour'],$data['min'],0,$data['month'],$data['day'],$data['year']);
         $report = new AstroReport($data);
         $time_planets = $report->getPlanets();
         $time_houses = $report->getHouses();
         //				$res[0] = 	$this->executeRuleOne($time,$time_planets);
         $res[2] = $this->executeRuleThree($time_planets["Jupiter"][MarriageGuru::FULLDEGREE_STRING]);
         $res[3] = $this->executeRuleFour($time_planets["Jupiter"], $time_planets["Saturn"]);
         //				$res[4] = $this->executeRuleFive($time_planets[$this->_lagna_lord][MarriageGuru::FULLDEGREE_STRING],$time_planets[$this->_seventh_lord][MarriageGuru::FULLDEGREE_STRING]);
         $res[5] = $this->executeRuleSix($time_planets["Jupiter"][MarriageGuru::FULLDEGREE_STRING]);
         $res[6] = $this->executeRuleNine($time_planets);
         $res[7] = $this->executeRuleTen($time_planets);
         //				$res[8] = $this->executeRuleSeven($time_planets);
         //		$resEight = $this->executeRuleEight();
         $success = 0;
         //	var_dump($res);
         for ($i = 0; $i < 9; $i++) {
             if ($res[$i] == 1) {
                 $success++;
             }
         }
         $count = count($output);
         if ($success >= 4) {
             $count = count($output);
             $output[$count] = array(date(AspectsGenerator::DATE_FORMAT, $time), $success, $res[0], $res[2], $res[3], $res[4], $res[5], $res[6], $res[7], $res[8]);
         }
         $time += $least_count;
     }
     $years = array();
     foreach ($output as $o) {
         $date = explode(":", $o[0]);
         $y = intval($date[0]);
         if (!isset($years[$y])) {
             $years[$y] = 1;
         } else {
             $years[$y] += 1;
         }
     }
     arsort($years);
     $resultCount = count($years);
     $resultCount = (int) ($resultCount / 3);
     $startCount = 1;
     var_dump($years);
     foreach ($years as $y => $frequency) {
         $age = $y - $this->_birth_data['year'];
         echo "{$age} ( {$y} ) <br />";
         if ($startCount <= $resultCount) {
             $startCount++;
         } else {
             break;
         }
     }
     print "\noutput is ";
     //			var_dump($output);
     /*				$out = array();
     				foreach($output as $result_data)
     				{
     
     					$date = explode(":",$result_data[0]);
     					$data = $this->_start_data;
     				
     					$data['month'] = intval($date[1]);
     					$data['year'] = intval($date[0]);
     					$data['day'] = intval($date[2]);
     					$data['hour'] = intval($date[3]);
     					$data['min'] = intval($date[4]);
     					$data['am_pm'] = $date[5];
     				//	if($data['year'] == 1984)
     					{
     					$report = new AstroReport( $data );
     					$time_planets = $report->getPlanets();
     					$time_houses = $report->getHouses();
     					$time = mktime($data['hour'],$data['min'],0,$data['month'],$data['day'],$data['year']);
     					$res[0] = 	$this->executeRuleOne($time,$time_planets);
     					$res[5] = $this->executeRuleSix($time_planets["Jupiter"][MarriageGuru::FULLDEGREE_STRING]);
     					$res[6] = $this->executeRuleSeven($time_houses);
     	
     					$success = 0;
     
     					if($res[0] == 1)
     						$success++;
     					if($res[5] == 1)
     						$success++;
     					if($res[6] >= 8)
     						$success++;
     						*/
     //print "time planets are = ";
     //				var_dump($time_planets);
     //					if($success >= 1)
     //					{
     //						$count = count($out);
     //						$out[$count] = array($result_data[0],$success,$res[0],/*$result_data[2],$result_data[3],$result_data[4]*/$res[5],$res[6]);
     //					}
     //					}
     //				}
     //	var_dump($output);
     return $output;
 }