示例#1
0
 /**
  * Gets the events for the given month +-2 weeks
  * @return array The array contains event
  */
 function getEvents($year_month = null, $user_id = null, $attendants = false)
 {
     $db = JFactory::getDBO();
     if (!$user_id) {
         $user = JFactory::getUser();
     } else {
         $user = JUser::getInstance(intval($user_id));
     }
     if ($year_month == null) {
         $year_month = date("Y-m-") . "01";
     }
     if ($year_month == 'all') {
         $query = "SELECT raid_id,location,description,icon_name,status,raid_leader,start_time,(DATE_ADD(start_time,INTERVAL duration_mins MINUTE)) AS end_time\n\t    \t\t\t\tFROM #__raidplanner_raid\n\t    \t\t\t\tGROUP BY raid_id\n\t    \t\t\t\tORDER BY start_time ASC, location ASC";
     } else {
         if ($year_month == 'own') {
             $query = "SELECT r.raid_id,r.location,r.description,r.icon_name,r.status,r.raid_leader,r.start_time,(DATE_ADD(r.start_time,INTERVAL r.duration_mins MINUTE)) AS end_time,r.description,r.invite_time\n\t    \t\t\t\tFROM #__raidplanner_signups AS s\n\t    \t\t\t\tLEFT JOIN #__raidplanner_raid AS r ON r.raid_id=s.raid_id\n\t    \t\t\t\tLEFT JOIN #__raidplanner_character AS c ON c.character_id=s.character_id\n\t    \t\t\t\tWHERE c.profile_id = " . $user->id . "\n\t    \t\t\t\tGROUP BY r.raid_id\n\t    \t\t\t\tORDER BY r.start_time ASC, r.location ASC";
         } else {
             $query = "SELECT r.raid_id,r.location,r.description,r.icon_name,r.status,r.raid_leader,r.start_time,(DATE_ADD(r.start_time,INTERVAL r.duration_mins MINUTE)) AS end_time,s.queue\n\t    \t\t\t\tFROM #__raidplanner_raid AS r\n\t    \t\t\t\tLEFT JOIN (#__raidplanner_signups AS s, #__raidplanner_character AS c) ON (s.raid_id=r.raid_id AND c.character_id=s.character_id AND c.profile_id=" . $user->id . ") \n\t    \t\t\t\tWHERE r.start_time>=DATE_SUB(" . $db->Quote($year_month) . ",interval 2 week) AND r.start_time<=DATE_ADD(" . $db->Quote($year_month) . ",interval 7 week)\n\t    \t\t\t\tGROUP BY r.raid_id\n\t    \t\t\t\tORDER BY r.start_time ASC, r.location ASC";
         }
     }
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $result = array();
     foreach ($rows as $row) {
         $date = JHTML::_('date', $row->start_time, RaidPlannerHelper::sqlDateFormat());
         /* get the attendants if requested */
         if ($attendants) {
             $query = "SELECT c.char_name\n\t\t\t\t\t\tFROM #__raidplanner_signups AS s\n\t\t\t\t\t\tLEFT JOIN #__raidplanner_character AS c ON c.character_id=s.character_id\n\t\t\t\t\t\tWHERE s.raid_id=" . intval($row->raid_id) . " AND s.queue=1\n\t\t\t\t\t\tORDER BY s.confirmed DESC, c.char_name ASC";
             $db->setQuery($query);
             $row->attendants = $db->loadColumn();
         }
         $result[$date][] = $row;
     }
     return $result;
 }
示例#2
0
	getStats();
});
</script>
<div id="filter-bar" class="btn-toolbar">
	<div class="filter-search btn-group pull-left">
		<label for="start_time_min" class="element-invisible"><?php 
echo JText::_('JDATE');
?>
</label>
		<div class="input-append input-prepend">
			<?php 
echo JHTML::_('calendar', RaidPlannerHelper::getDate(strtotime('-3 month'), null, RaidPlannerHelper::sqlDateFormat()), 'start_time', 'start_time', '%Y-%m-%d', array('class' => 'input-small'));
?>
			<span class="add-on">-</span>
			<?php 
echo JHTML::_('calendar', RaidPlannerHelper::getDate('now', null, RaidPlannerHelper::sqlDateFormat()), 'end_time', 'end_time', '%Y-%m-%d', array('class' => 'input-small'));
?>
		</div>
	</div>
	<div class="filter-search btn-group pull-left">
		<?php 
if ($this->by_chars == 1) {
    ?>
		<label for="character_id" class="element-invisible"><?php 
    echo JText::_('COM_RAIDPLANNER_CHARACTER');
    ?>
</label>
		<select name="character_id" id="character_id" class="input-normal">
			<option></option>
			<?php 
    foreach ($this->characters as $character_id => $character) {
示例#3
0
<?php

/*------------------------------------------------------------------------
# Raid Form Template for RaidPlanner Component
# com_raidplanner - RaidPlanner Component
# ------------------------------------------------------------------------
# author    Taracque
# copyright Copyright (C) 2011 Taracque. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Website: http://www.taracque.hu/raidplanner
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
$dateformat = RaidPlannerHelper::sqlDateFormat(true);
if (RaidPlannerHelper::getJVersion() < '3.0') {
    RaidPlannerHelper::fixBootstrap();
}
?>
<form action="index.php" method="post" name="adminForm" id="adminForm" class="form-horizontal">
	<fieldset class="adminform">
		<legend><?php 
echo JText::_('JDETAILS');
?>
</legend>
		<div class="control-group">
			<label class="control-label" for="location"><?php 
echo JText::_('COM_RAIDPLANNER_LOCATION');
?>
</label>
			<div class="controls">
				<input class="text_area" type="text" name="location" id="location" size="32" maxlength="250" value="<?php