plugins/reports/registrants/RegistrantReportDAO.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00017 // $Id$
00018 
00019 
00020 import('db.DBRowIterator');
00021 
00022 class RegistrantReportDAO extends DAO {
00029    function getRegistrantReport($conferenceId, $schedConfId) {
00030       $primaryLocale = AppLocale::getPrimaryLocale();
00031       $locale = AppLocale::getLocale();
00032 
00033       $result =& $this->retrieve(
00034          'SELECT
00035             r.registration_id AS registration_id,
00036             r.user_id AS userid,
00037             u.username AS uname,
00038             u.first_name AS fname,
00039             u.middle_name AS mname,
00040             u.last_name AS lname,
00041             u.affiliation AS affiliation,
00042             u.url AS url,
00043             u.email AS email,
00044             u.phone AS phone,
00045             u.fax AS fax,
00046             u.mailing_address AS address,
00047             u.country AS country,
00048             COALESCE(rtsl.setting_value, rtspl.setting_value) AS type,
00049             r.date_registered AS regdate,
00050             r.date_paid AS paiddate,
00051             r.special_requests AS specialreq
00052          FROM
00053             registrations r
00054                LEFT JOIN users u ON r.user_id=u.user_id
00055                LEFT JOIN registration_type_settings rtsl ON (r.type_id=rtsl.type_id AND rtsl.locale=? AND rtsl.setting_name=?)
00056                LEFT JOIN registration_type_settings rtspl ON (r.type_id=rtspl.type_id AND rtsl.locale=? AND rtspl.setting_name=?)
00057          WHERE
00058             r.sched_conf_id = ?
00059          ORDER BY
00060             lname',
00061          array(
00062             $locale,
00063             'name',
00064             $primaryLocale,
00065             'name',
00066             (int) $schedConfId
00067          )
00068       );
00069 
00070       // prepare an iterator of all the registration information
00071       $registrationReturner = new DBRowIterator($result);
00072 
00073       $result =& $this->retrieve(
00074          'SELECT 
00075             r.registration_id as registration_id,
00076             roa.option_id as option_id
00077          FROM
00078             registrations r 
00079                LEFT JOIN registration_option_assoc roa ON (r.registration_id = roa.registration_id)
00080          WHERE 
00081             r.sched_conf_id = ?',
00082          (int) $schedConfId
00083       );
00084       
00085       // Prepare an array of registration Options by registration Id
00086       $registrationOptionDAO =& DAORegistry::getDAO('RegistrationOptionDAO');
00087       $iterator = new DBRowIterator($result);
00088       $registrationOptionReturner = array();
00089       while ($row =& $iterator->next()) {
00090          $registrationId = $row['registration_id'];
00091          $registrationOptionReturner[$registrationId] =& $registrationOptionDAO->getRegistrationOptions($registrationId);
00092       }
00093 
00094       return array($registrationReturner, $registrationOptionReturner);
00095    }
00096 }
00097 
00098 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7