예제 #1
0
     $marriage[$i]["ged_fam_ref"] = substr($family[$i][$c], 3, strlen($family[$i][$c]) - 8);
 }
 switch (substr($family[$i][$c], 0, 6)) {
     case "1 HUSB":
         $temp = substr($family[$i][$c], 8, strlen($family[$i][$c]) - 9);
         $marriage[$i]["groom_id"] = $pref[$temp];
         $marriage[$i]["ged_husb_ref"] = $temp;
         break;
     case "1 WIFE":
         $temp = substr($family[$i][$c], 8, strlen($family[$i][$c]) - 9);
         $marriage[$i]["bride_id"] = $pref[$temp];
         $marriage[$i]["ged_wife_ref"] = $temp;
         break;
     case "2 DATE":
         if ($previous == "1 MARR") {
             DateUtil::make_date(substr($family[$i][$c], 6, strlen($family[$i][$c]) - 6), $e);
         }
         break;
     case "2 PLAC":
         if ($previous == "1 MARR") {
             $e->location->place = trim(substr($family[$i][$c], 6, strlen($family[$i][$c]) - 6));
         }
         break;
     default:
         break;
 }
 if (substr($family[$i][$c], 0, 1) == "1") {
     $previous = substr($family[$i][$c], 0, 6);
     $e = new MiniEvent();
     $marriage[$i]["event"] = $e;
 }
예제 #2
0
 static function resolveDate($date)
 {
     global $currentRequest;
     $retval = "0000-00-00";
     if (preg_match("#([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})#", $date)) {
         $retval = $date;
     } else {
         if (preg_match("#([0-9]{1,2}) ([a-zA-Z]{3}) ([0-9]{4})#", $date)) {
             $event = new MiniEvent();
             $upper = strtoupper($date);
             $retval = DateUtil::make_date($upper, $event);
         } else {
             $query = 'SELECT STR_TO_DATE(' . quote_smart($date) . ',' . $currentRequest->datefmt . ');';
             if (!($result = mysql_query($query))) {
                 error_log($query);
                 error_log(mysql_error());
             } else {
                 $row = mysql_fetch_row($result);
                 $retval = $row[0];
                 mysql_free_result($result);
             }
         }
     }
     return $retval;
 }