Ejemplo n.º 1
0
 function _getGuildEvents()
 {
     global $roster, $addon;
     $query = "SELECT ";
     $query .= "asevent.id ";
     $query .= "FROM `" . $roster->db->table('event', 'assessment') . "` AS asevent ";
     $query .= "LEFT JOIN `" . $roster->db->table('groupmembers', 'assessment') . "` AS asmembers ";
     $query .= "ON asmembers.eventId = asevent.id ";
     $query .= "LEFT JOIN `" . $roster->db->table('members') . "` AS members ";
     $query .= "ON asmembers.name = members.name ";
     $query .= "WHERE members.guild_id = " . $roster->data['guild_id'] . " ";
     $query .= "GROUP BY asevent.id ";
     $query .= "ORDER BY asevent.eventName";
     if ($result = $roster->db->query($query)) {
         $ret = array();
         if ($roster->db->num_rows($result) > 0) {
             $array = $roster->db->fetch_all();
             require_once $addon['dir'] . 'inc/assessment.event.class.php';
             foreach ($array as $set) {
                 $event = new AssessmentEvent();
                 $event->get($set['id']);
                 $event->getEventListDetails();
                 $ret[] = $event;
             }
             $roster->db->free_result($result);
         }
         return $ret;
     } else {
         die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
     }
 }
Ejemplo n.º 2
0
 function _updateEvent(&$name = false, &$data = false)
 {
     global $roster;
     require_once ROSTER_BASE . 'addons' . DIR_SEP . 'assessment' . DIR_SEP . 'inc' . DIR_SEP . 'assessment.event.class.php';
     $this->mem($name);
     $assEvent = new AssessmentEvent();
     $assEvent->get(0, $name);
     $assEvent->set();
     $this->messages .= '<li>' . $name;
     $this->messages .= '<ul>';
     foreach ($data as $detailName => &$detailData) {
         $this->_updateEventDetail($assEvent->id, $detailName, $detailData);
     }
     unset($assEvent, $name, $data);
     $this->messages .= '</ul></li>';
 }