当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::getFields方法代码示例

本文整理汇总了PHP中Location::getFields方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::getFields方法的具体用法?PHP Location::getFields怎么用?PHP Location::getFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Location的用法示例。


在下文中一共展示了Location::getFields方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRelationshipDetails

 function getRelationshipDetails(&$search)
 {
     global $tblprefix, $err_spouse, $currentRequest;
     $partner = $search->relation->person_id;
     $res = array();
     $search->numResults = 0;
     if (!($search->person->person_id > 0)) {
         return;
     }
     $query = "SELECT " . PersonDetail::getFields() . "," . PersonDetail::getFields("sp", "ns", "bs", "ds") . ", p.gender, DATE_ADD(b.date1, INTERVAL 40 YEAR) AS child_snatcher, " . " relation.event_id," . Event::getFields("e") . "," . Location::getFields("l") . ", relation.dissolve_date, relation.dissolve_reason," . " DATE_FORMAT(relation.dissolve_date, " . $currentRequest->datefmt . ") AS DOD " . "FROM " . $tblprefix . "people p ";
     $query .= " LEFT JOIN " . $tblprefix . "spouses relation ON ";
     if ($search->event->event_id > 0) {
         $query .= " relation.event_id = " . $search->event->event_id;
     } else {
         $query .= "((relation.groom_id =  " . $search->person->person_id . ") OR (relation.bride_id =  " . $search->person->person_id . "))";
     }
     $query .= " LEFT JOIN " . $tblprefix . "people sp ON (relation.groom_id = sp.person_id OR relation.bride_id = sp.person_id)" . " AND sp.person_id <> p.person_id " . " LEFT JOIN " . $tblprefix . "event e ON e.event_id = relation.event_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = e.location_id " . PersonDetail::getJoins("LEFT") . PersonDetail::getJoins("LEFT", "sp", "ns", "bs", "ds");
     $query .= " AND sp.person_id <> p.person_id";
     $query .= " WHERE p.person_id = " . $search->person->person_id;
     $query .= $this->addPersonRestriction(" AND ");
     $query .= $this->addPersonRestriction(" AND ", "bs", "ds");
     $query .= " ORDER BY e.date1";
     $result = $this->runQuery($query, $err_spouse);
     $search->numResults = 0;
     while ($row = $this->getNextRow($result)) {
         $rel = new Relationship();
         $rel->person->loadFields($row, L_HEADER, "p_");
         $rel->person->name->loadFields($row, "n_");
         $rel->relation->loadFields($row, L_HEADER, "sp_");
         $rel->relation->name->loadFields($row, "ns_");
         $rel->loadFields($row);
         $rel->event = new Event();
         $rel->event->loadFields($row, "e_");
         $rel->event->location->loadFields($row, "l_");
         $rel->marriage_date = $rel->event->date1;
         $rel->dom = $rel->event->fdate1;
         $rel->marriage_place = $rel->event->location;
         $rel->restrictDate = $row["child_snatcher"];
         //Should sort out the SQL instead of this but for now...
         if ($rel->person->person_id != $rel->relation->person_id) {
             $search->numResults++;
             $res[] = $rel;
         }
     }
     $this->freeResultSet($result);
     $search->results = $res;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:47,代码来源:RelationsDAO.php

示例2: getAttendees

 function getAttendees(&$event)
 {
     global $tblprefix;
     $query = "SELECT " . Attendee::getFields('a') . "," . PersonDetail::getFields('p') . "," . Location::getFields('l') . " FROM " . $tblprefix . "attendee a" . " JOIN " . $tblprefix . "people p ON a.person_id = p.person_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = a.location_id" . PersonDetail::getJoins();
     $query .= " WHERE a.event_id = " . $event->event_id;
     $query .= $this->addPersonRestriction(" AND ");
     //TODO error message
     $result = $this->runQuery($query, '');
     $res = array();
     while ($row = $this->getNextRow($result)) {
         $e = new Attendee();
         $e->loadFields($row, "a_");
         $per = new PersonDetail();
         $per->loadFields($row, L_HEADER, "p_");
         $per->name->loadFields($row, "n_");
         $per->name->person_id = $per->person_id;
         $e->person = $per;
         $e->location->loadFields($row, "l_");
         $res[] = $e;
     }
     $this->freeResultSet($result);
     $event->attendees = $res;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:23,代码来源:EventDAO.php

示例3: getCensusDetails

 function getCensusDetails(&$input)
 {
     global $tblprefix, $err_census_ret;
     $res = array();
     $input->results = $res;
     $edquery = "SELECT cen.census_id, cen.census, schedule, year, census_date, cy.country, " . Event::getFields('e') . "," . PersonDetail::getFields() . "," . Attendee::getFields('a') . "," . Location::getFields('l') . "," . Location::getFields('al') . " FROM " . $tblprefix . "attendee a" . " JOIN " . $tblprefix . "event e ON a.event_id = e.event_id" . " JOIN " . $tblprefix . "census cen ON cen.event_id = e.event_id" . " JOIN " . $tblprefix . "people p ON a.person_id = p.person_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = e.location_id" . " LEFT JOIN " . $tblprefix . "locations al ON al.location_id = a.location_id" . " LEFT JOIN " . $tblprefix . "census_years cy ON cen.census = cy.census_id" . PersonDetail::getJoins();
     switch ($input->queryType) {
         case Q_TYPE:
             $where = "";
             if (isset($input->schedule)) {
                 $where = " WHERE e.reference =" . $input->schedule;
             }
             break;
         case Q_FAMILY:
             $where = " WHERE e.event_id = " . $input->event->event_id;
             if (!isset($input->event->event_id) || $input->event->event_id == '') {
                 return;
             }
             break;
         default:
             $where = " WHERE p.person_id = " . $input->person->person_id;
             break;
     }
     $where .= $this->addPersonRestriction(" AND ");
     $orderby = " ORDER BY e.date1, b.date1";
     $edquery .= $where . $orderby;
     if ($edresult = $this->runQuery($edquery, $err_census_ret)) {
         $input->numResults = 0;
         $events = array();
         while ($edrow = $this->getNextRow($edresult)) {
             $cen = new CensusDetail();
             $cen->loadFields($edrow);
             $e = new Event();
             $e->loadFields($edrow, "e_");
             $e->location->loadFields($edrow, "l_");
             $new = false;
             if (isset($events[$e->event_id])) {
                 $event = $events[$e->event_id];
             } else {
                 $new = true;
                 $e->attendees = array();
                 $events[$e->event_id] = $e;
                 $event = $e;
             }
             $a = new Attendee();
             $a->person->loadFields($edrow, L_HEADER, "p_");
             $a->person->name->loadFields($edrow, "n_");
             if ($a->person->person_id == $event->person->person_id) {
                 $event->person = $a->person;
             }
             $a->loadFields($edrow, "a_");
             $a->location->loadFields($edrow, "al_");
             $event->attendees[] = $a;
             //This is needed for php 4
             $events[$event->event_id] = $event;
             if ($new) {
                 $cen->event = $event;
                 $input->numResults++;
                 $res[] = $cen;
             }
             //This is also needed for php 4
             for ($i = 0; $i < count($res); $i++) {
                 if ($res[$i]->event->event_id == $event->event_id) {
                     $c = $res[$i];
                     $c->event = $event;
                     $res[$i] = $c;
                 }
             }
         }
         $this->freeResultSet($edresult);
     }
     $input->results = $res;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:73,代码来源:CensusDAO.php

示例4: getAttendeePlaces

 function getAttendeePlaces(&$locations, $person = null)
 {
     global $tblprefix, $strEvent, $datefmt;
     global $strBirthPlace, $strAddress;
     $query = "SELECT " . Attendee::getFields('a') . "," . PersonDetail::getFields('p') . ", " . Event::getFields("e") . "," . Location::getFields("l") . "," . Location::getFields("el") . " FROM " . $tblprefix . "attendee a" . " JOIN " . $tblprefix . "people p ON a.person_id = p.person_id" . " JOIN " . $tblprefix . "event e ON a.event_id = e.event_id" . " LEFT JOIN " . $tblprefix . "locations el ON el.location_id = e.location_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = a.location_id" . PersonDetail::getJoins() . " WHERE (a.location_id is not null OR e.location_id is not null)" . " AND (NOT (e.etype = " . BANNS_EVENT . " OR e.etype=" . MARRIAGE_EVENT . "))";
     $query .= $this->addPersonRestriction(" AND ");
     if ($locations->location_id > 0) {
         $query .= " AND (a.location_id = " . $locations->location_id . " OR e.location_id = " . $locations->location_id . ")";
     }
     $presult = $this->runQuery($query, "");
     while ($prow = $this->getNextRow($presult)) {
         $per = new PersonDetail();
         $per->loadFields($prow, L_HEADER, 'p_');
         $per->name->loadFields($prow, 'n_');
         $per->setPermissions();
         $e = new Event();
         $e->loadFields($prow, "e_");
         $loc = new Location();
         $loc->loadFields($prow, "l_");
         $loc->setPermissions();
         if ($per->isViewable() && $loc->hasData()) {
             $text = $per->getLink() . ' ';
             switch ($e->type) {
                 case CENSUS_EVENT:
                     $text .= $strEvent[$e->type] . " " . $strBirthPlace;
                     break;
                 default:
                     $text .= $strAddress;
                     break;
             }
             $text .= ' ' . $e->getDate1();
             if ($locations->location_id > 0 && $loc->location_id == $locations->location_id || $locations->location_id <= 0) {
                 $p = $this->createPlace($locations, $loc, $text);
             }
         }
         $e->location->loadFields($prow, "el_");
         $e->location->setPermissions();
         if ($per->isViewable() && $e->location->hasData()) {
             $text = $per->getLink() . ' ' . $strEvent[$e->type] . ' ' . $e->getDate1();
             if ($locations->location_id > 0 && $e->location->location_id == $locations->location_id || $locations->location_id <= 0) {
                 $p = $this->createPlace($locations, $e->location, $text);
             }
         }
     }
     $this->freeResultSet($presult);
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:46,代码来源:LocationDAO.php


注:本文中的Location::getFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。