function _getCLMPunkte(&$options)
 {
     $sid = JRequest::getInt('saison', '1');
     $liga = JRequest::getInt('liga', '1');
     $db = JFactory::getDBO();
     $rnd_dg = CLMModelAktuell_Runde::Runden();
     $runde = $rnd_dg[0];
     $dg = $rnd_dg[1];
     $id = @$options['id'];
     // ordering für Rangliste -> Ersatz für direkten Vergleich
     $query = "SELECT a.order, a.runden, a.durchgang, a.b_wertung FROM #__clm_liga as a" . " WHERE id = " . $liga . " AND sid = " . $sid;
     $db->setQuery($query);
     $order = $db->loadObjectList();
     if ($order[0]->order == 1) {
         $ordering = " , m.ordering ASC";
     } else {
         $ordering = ', a.tln_nr ASC ';
     }
     $query = " SELECT a.tln_nr as tln_nr,m.name as name, SUM(a.manpunkte) as mp, " . " SUM(a.brettpunkte) as bp, SUM(a.wertpunkte) as wp, m.published, m.man_nr, COUNT(DISTINCT a.runde) as spiele" . " FROM #__clm_rnd_man as a " . " LEFT JOIN #__clm_mannschaften as m ON m.liga = {$liga} AND m.tln_nr = a.tln_nr " . " WHERE a.lid = " . $liga . " AND a.sid = " . $sid . " AND m.man_nr <> 0 " . " AND gemeldet > 0 ";
     if ($runde != "" && $dg == 1) {
         $query = $query . " AND runde < " . ($runde + 1) . " AND dg = 1";
     }
     if ($runde != "" && $dg > 1) {
         $query = $query . " AND ( runde < " . ($runde + 1) . " OR dg = 1)";
     }
     $query = $query . " GROUP BY a.tln_nr ";
     if ($order[0]->b_wertung == 0) {
         $query = $query . " ORDER BY mp DESC, bp DESC" . $ordering;
     }
     if ($order[0]->b_wertung == 3) {
         $query = $query . " ORDER BY mp DESC, bp DESC, wp DESC" . $ordering;
     }
     if ($order[0]->b_wertung == 4) {
         $query = $query . " ORDER BY mp DESC, bp DESC, " . $ordering . ", wp DESC";
     }
     return $query;
 }
Beispiel #2
0
 } else {
     $array[3][1] = 1;
 }
 $array[3][2][] = array("option", "com_clm");
 $array[3][2][] = array("view", "paarungsliste");
 $array[3][2][] = array("saison", $sid);
 $array[3][2][] = array("liga", $lid);
 if ($itemid != '') {
     $array[3][2][] = array("Itemid", $itemid);
 }
 $array[3][3] = array();
 // Aktuelle Runde
 if (count($sub_runden) > 0) {
     $array[3][3][0][0] = JText::_('ROUND_CURRENT');
     require_once JPATH_COMPONENT . DS . 'models' . DS . 'aktuell_runde.php';
     $rnd_dg = CLMModelAktuell_Runde::Runden();
     if (JRequest::getVar('view', -1) != "runde" || JRequest::getVar('runde', -1) != $rnd_dg[0] || JRequest::getVar('dg', -1) != $rnd_dg[1]) {
         $array[3][3][0][1] = 0;
     } else {
         $array[3][3][0][1] = 1;
     }
     $array[3][3][0][2][] = array("option", "com_clm");
     $array[3][3][0][2][] = array("view", "aktuell_runde");
     $array[3][3][0][2][] = array("saison", $sid);
     $array[3][3][0][2][] = array("liga", $lid);
     if ($itemid != '') {
         $array[3][3][0][2][] = array("Itemid", $itemid);
     }
     // Alle Runden
     for ($i = 0; $i < count($sub_runden); $i++) {
         /*			if ($sub_runden[$i]->nr > $sub_runden[$i]->runden) { //klkl