Пример #1
0
 public function match($data1, $data2)
 {
     $Kundali = new Library_Kundali();
     $fromDate = getDateTime($data1['dob']);
     $toDate = getDateTime($data2['dob']);
     $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $data1['zone_h'], $data1['zone_m'], $data1['lon_h'], $data1['lon_m'], $data1['lat_h'], $data1['lat_m'], $data1['dst'], $data1['lon_e'], $data1['lat_s']);
     $returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $data2['zone_h'], $data2['zone_m'], $data2['lon_h'], $data2['lon_m'], $data2['lat_h'], $data2['lat_m'], $data2['dst'], $data2['lon_e'], $data2['lat_s']);
     $pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
     $finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
     return array($returnArrFrom, $returnArrTo, $finalPoints);
 }
Пример #2
0
<?php

//check_login();
//include(SITEDIR.'/libraries/addresses/nearby.php');
$uid = '';
$uid = !empty($_GET['uid']) ? $_GET['uid'] : (!empty($_SESSION['user']['id']) ? $_SESSION['user']['id'] : '');
if (empty($uid)) {
    check_login();
}
currentActivity('horo_page', $_SERVER['REQUEST_URI'], null, 'User has browsed the Horo Match page.');
$Models_Googleauth = new Models_Googleauth();
$userDetails = $Models_Googleauth->getUser($uid);
$userSql = $Models_Googleauth->sql;
//matching naks
$Kundali = new Library_Kundali();
$horo = new Models_Horo();
$userHoroInfo = findHoroInfo($userDetails);
if (!empty($userHoroInfo)) {
    $points = $Kundali->points();
    $specific_points = $points[$userHoroInfo[9]];
    arsort($specific_points);
    $matchingNaks = array();
    foreach ($specific_points as $k => $v) {
        $matchingNaks[$k]['number'] = $k;
        $matchingNaks[$k]['nakshatra'] = $Kundali->getnaksfromnumber($k);
        $matchingNaks[$k]['points'] = $v;
    }
}
//matching naks ends
$horo_cities = array();
if (!empty($userDetails['horo_cities'])) {
Пример #3
0
function updatePoints($id, $id2)
{
    if (empty($id) || empty($id2)) {
        return false;
    }
    if ($id == $id2) {
        //return false;
    }
    //$modelGeneral = new Models_General();
    global $modelGeneral;
    $return = array();
    $params = array();
    $t = 60 * 60 * 24 * 365 * 5;
    $params['where'] = sprintf(" AND ((user1 = %s AND user2 = %s) OR (user1 = %s AND user2 = %s))", $modelGeneral->qstr($id), $modelGeneral->qstr($id2), $modelGeneral->qstr($id2), $modelGeneral->qstr($id), $t);
    $check = $modelGeneral->getDetails('user_points', 1, $params);
    if (empty($check)) {
        $modelGeneral->clearCache($modelGeneral->sql);
    }
    if (!empty($check)) {
        foreach ($check as $k => $v) {
            $return[$v['user1']][$v['user2']]['points'] = $v['points'];
            $return[$v['user1']][$v['user2']]['results'] = $v['results'];
        }
        return $return;
    }
    //getting points from api
    $params = array();
    $params['where'] = sprintf(" AND (settings.uid = %s OR settings.uid = %s)", $modelGeneral->qstr($id), $modelGeneral->qstr($id2));
    $settingsDetail = $modelGeneral->getDetails('settings LEFT JOIN geo_cities ON settings.birth_city_id = geo_cities.cty_id', 1, $params, $t);
    if (count($settingsDetail) == 1) {
        $settingsDetail[1] = $settingsDetail[0];
    }
    if (count($settingsDetail) == 2) {
        $sql = $modelGeneral->sql;
        if (empty($settingsDetail[0]['extraDetails'])) {
            $tmp = findCity($settingsDetail[0]['cty_id']);
            $settingsDetail[0] = array_merge($settingsDetail[0], $tmp);
        }
        if (empty($settingsDetail[1]['extraDetails'])) {
            $tmp = findCity($settingsDetail[1]['cty_id']);
            $settingsDetail[1] = array_merge($settingsDetail[1], $tmp);
        }
        if (!empty($settingsDetail[0]['dob']) && !empty($settingsDetail[1]['dob']) && !empty($settingsDetail[0]['birth_city_id']) && !empty($settingsDetail[1]['birth_city_id'])) {
            $Kundali = new Library_Kundali();
            //fetching for first user
            $fromDate = getDateTime($settingsDetail[0]['dob']);
            $toDate = getDateTime($settingsDetail[1]['dob']);
            $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $settingsDetail[0]['zone_h'], $settingsDetail[0]['zone_m'], $settingsDetail[0]['lon_h'], $settingsDetail[0]['lon_m'], $settingsDetail[0]['lat_h'], $settingsDetail[0]['lat_m'], $settingsDetail[0]['dst'], $settingsDetail[0]['lon_e'], $settingsDetail[0]['lat_s']);
            $returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $settingsDetail[0]['zone_h'], $settingsDetail[1]['zone_m'], $settingsDetail[1]['lon_h'], $settingsDetail[1]['lon_m'], $settingsDetail[1]['lat_h'], $settingsDetail[1]['lat_m'], $settingsDetail[1]['dst'], $settingsDetail[1]['lon_e'], $settingsDetail[1]['lat_s']);
            $pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
            $finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
            $d = array();
            $d['user1'] = $settingsDetail[0]['uid'];
            $d['user2'] = $settingsDetail[1]['uid'];
            $d['points'] = $finalPoints['points'];
            $d['results'] = $finalPoints['result'];
            $v = array('from' => $returnArrFrom, 'to' => $returnArrTo, 'pts' => $pts, 'result' => $finalPoints);
            $d['details'] = json_encode($v);
            $modelGeneral->addDetails('user_points', $d);
            $return[$d['user1']][$d['user2']]['points'] = $d['points'];
            $return[$d['user1']][$d['user2']]['results'] = $d['results'];
            //fetching for second user
            $fromDate = getDateTime($settingsDetail[1]['dob']);
            $toDate = getDateTime($settingsDetail[0]['dob']);
            $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $settingsDetail[1]['zone_h'], $settingsDetail[1]['zone_m'], $settingsDetail[1]['lon_h'], $settingsDetail[1]['lon_m'], $settingsDetail[1]['lat_h'], $settingsDetail[1]['lat_m'], $settingsDetail[1]['dst'], $settingsDetail[1]['lon_e'], $settingsDetail[1]['lat_s']);
            $returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $settingsDetail[0]['zone_h'], $settingsDetail[0]['zone_m'], $settingsDetail[0]['lon_h'], $settingsDetail[0]['lon_m'], $settingsDetail[0]['lat_h'], $settingsDetail[0]['lat_m'], $settingsDetail[0]['dst'], $settingsDetail[0]['lon_e'], $settingsDetail[0]['lat_s']);
            $pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
            $finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
            $d = array();
            $d['user1'] = $settingsDetail[1]['uid'];
            $d['user2'] = $settingsDetail[0]['uid'];
            $d['points'] = $finalPoints['points'];
            $d['results'] = $finalPoints['result'];
            $v = array('from' => $returnArrFrom, 'to' => $returnArrTo, 'pts' => $pts, 'result' => $finalPoints);
            $d['details'] = json_encode($v);
            $modelGeneral->addDetails('user_points', $d);
            $return[$d['user1']][$d['user2']]['points'] = $d['points'];
            $return[$d['user1']][$d['user2']]['results'] = $d['results'];
            $modelGeneral->clearCache($sql);
        }
    }
    return $return;
}
Пример #4
0
 function match($from, $to)
 {
     $d = array();
     $d['from'] = findHoroInfo($from);
     $d['to'] = findHoroInfo($to);
     $Kundali = new Library_Kundali();
     $d['points'] = $Kundali->getpoints($d['from'][9], $d['to'][9]);
     $d['results'] = $Kundali->interpret($d['points']);
     return $d;
 }
Пример #5
0
function getPoints($naks1, $naks2)
{
    $d = array();
    $Kundali = new Library_Kundali();
    $d['points'] = $Kundali->getpoints($naks1, $naks2);
    $d['results'] = $Kundali->interpret($d['points']);
    return $d;
}