Beispiel #1
0
    function SWT(&$rows, &$lists, &$pageNav)
    {
        // Konfigurationsparameter auslesen
        $config =& JComponentHelper::getParams('com_clm');
        $upload = $config->get('upload_swt', 0);
        $execute = $config->get('execute_swt', 0);
        $lv = $config->get('lv', 705);
        CLMViewSWT::setSWTToolbar($execute, $upload);
        ?>
<div>
<div class="col width-50">
	<fieldset>
	<legend><?php 
        echo JText::_('SWT_TIP_LINE40');
        ?>
</legend>
	<font color="#ff0000"><b><?php 
        echo JText::_('SWT_TIP_LINE41');
        ?>
</b></font><br>
	<?php 
        echo JText::_('SWT_TIP_LINE42');
        ?>
<br><?php 
        echo JText::_('SWT_TIP_LINE43');
        ?>
	</fieldset>

<form action="index.php" name="adminForm" method="post" enctype="multipart/form-data" >
	<fieldset>
	<legend><?php 
        echo JText::_('SWT_TIP_LINE50');
        ?>
</legend>
	<b><?php 
        echo JText::_('SWT_TIP_LINE51') . ' ';
        ?>
 <?php 
        if ($upload == 1) {
            ?>
<font color="#00ff00"><?php 
            echo JText::_('SWT_ACTIVE');
        } else {
            ?>
<font color="#ff0000"><?php 
            echo JText::_('SWT_DEACTIVE');
        }
        ?>
</font>
	
	<?php 
        echo " , " . JText::_('SWT_TIP_LINE52') . ' ';
        if ($execute == 1) {
            ?>
<font color="#00ff00"><?php 
            echo JText::_('SWT_ACTIVE');
        } else {
            ?>
<font color="#ff0000"><?php 
            echo JText::_('SWT_DEACTIVE');
        }
        ?>
</font></b>
	</fieldset>

	<fieldset>
	<legend><?php 
        echo JText::_('SWT_TIPS');
        ?>
</legend>
	<b><font color="#ff0000"><?php 
        echo JText::_('SWT_TIP_LINE40');
        ?>
</font><?php 
        echo JText::_('SWT_TIP_LINE61');
        ?>
</b>
	<br><?php 
        echo JText::_('SWT_TIP_LINE62');
        ?>
	<br><?php 
        echo JText::_('SWT_TIP_LINE63');
        ?>
	<br><b><?php 
        echo JText::_('SWT_TIP_LINE64');
        ?>
</b>
	<br><br><b><?php 
        echo JText::_('SWT_TIP_LINE65');
        ?>
</b>
	<?php 
        echo JText::_('SWT_TIP_LINE66');
        ?>
	<br><br><?php 
        echo JText::_('SWT_TIP_LINE67') . ' ';
        ?>
 <b><?php 
        echo JText::_('SWT_TIP_LINE68');
        ?>
</b> <?php 
        echo JText::_('SWT_TIP_LINE69');
        ?>
	<br>
	<br><b><?php 
        echo JText::_('SWT_TIP_LINE70');
        ?>
</b>
	<br><?php 
        echo JText::_('SWT_TIP_LINE71');
        ?>
	<br><?php 
        echo JText::_('SWT_TIP_LINE72');
        ?>
	<br><?php 
        echo JText::_('SWT_TIP_LINE73');
        ?>
	<br><?php 
        echo JText::_('SWT_TIP_LINE74');
        ?>
	</fieldset>
</div>


<div class="col width-50">

<?php 
        if ($execute == 1) {
            ?>
	<?php 
            $liga_import = CLMControllerSWT::liga();
            ?>
	<?php 
            $datei = CLMControllerSWT::files();
            ?>
	<fieldset>
	<legend><?php 
            echo JText::_('SWT_TIP_LINE80');
            ?>
</legend>
	<table>
	<tr>
	<td class="key" nowrap="nowrap">
	  <select size="1" name="sql_datei">
		<option value="0"><?php 
            echo JText::_('SWT_TIP_LINE81');
            ?>
</option>
		<?php 
            for ($x = 0; $x < count($datei); $x++) {
                ?>
		 <option value="<?php 
                echo $datei[$x];
                ?>
"><?php 
                echo $datei[$x];
                ?>
</option> 
		<?php 
            }
            ?>
	  </select>
	</td>
	<td>&nbsp;&nbsp;&nbsp;<b><?php 
            echo JText::_('SWT_TIP_LINE82');
            ?>
</b></td>
	</tr>
<!--	<tr>
	<td class="key" nowrap="nowrap">
	  <select size="1" name="liga_import">
		<option value="0">-- Liga wählen --</option>
		<option value="new">-- Keine, neu erstellen --</option>
		<?php 
            /*for ($x=0; $x < count($liga_import); $x++) { */
            ?>
		 <option value="<?php 
            /*echo $liga_import[$x]->id; */
            ?>
"><?php 
            /*echo $liga_import[$x]->name; */
            ?>
</option>
		<?php 
            /*} */
            ?>
	  </select><br><br><br>
	</td>
	<td><b>W&auml;hlen Sie die Liga aus in die importiert werden soll</b>
		<br>- "Keine Auswahl" erstellt eine neue Liga
		<br>- Bei Auswahl werden alle Daten gel&ouml;scht wenn Sie im n&auml;chsten Menue kein Update ausw&auml;hlen !
		<br><br>
	</td>
	</tr>
	<tr>
		<td class="key" nowrap="nowrap">
	  <select size="1" name="liga_import">
		<option value="0">-- Update w&auml;hlen --</option>
		<?php 
            /*for ($x=0; $x < count($liga_export); $x++) { */
            ?>
		 <option value="<?php 
            /*echo $liga_export[$x]->id; */
            ?>
"><?php 
            /*echo $liga_export[$x]->name; */
            ?>
</option>
		<?php 
            /*} */
            ?>
	  </select><br><br><br>
	</td>
	<td><b>Hier k&ouml;nnen Sie ein Update aus bereits importierten Daten w&auml;hlen</b>
		<br>- Es werden die Grunddaten der Liga sowie Mannschaftsnamen, ZPS etc. &uuml;bernommen.
		<br>- Die Rundendaten werden komplett neu eingelesen und alte &uuml;berschrieben.
		<br>- Dieser Import beginnt mit dem 2. Importschritt.
	</td>
	</tr>

	<tr>
	<td>
		<input type="checkbox" id="override" name="override" value="1" />Sicherheitswarnungen ignorieren</td>
		<td>Auf eigene Gefahr : Ermöglicht das ignorieren von Sicherheitswarnungen beim Import ! (Wenn z.B. die Importdatei manipuliert / geändert wurde)</td>
	</tr>
-->

	</table>
	</fieldset>
<?php 
        }
        ?>
	<input type="hidden" name="section" value="swt" />
	<input type="hidden" name="option" value="com_clm" />
	<?php 
        echo JHTML::_('form.token');
        ?>

	
	<?php 
        $data = CLMControllerSWT::delete_data();
        ?>
	<fieldset>
	<legend><?php 
        echo JText::_('SWT_TIP_LINE90');
        ?>
</legend>
	<table>
	<tr>
	<td class="key" nowrap="nowrap">
	  <select size="1" name="swt_delete">
		<option value="0"><?php 
        echo JText::_('SWT_TIP_LINE91');
        ?>
</option>
		<?php 
        for ($x = 0; $x < count($data); $x++) {
            ?>
		 <option value="<?php 
            echo $data[$x]->swt_id;
            ?>
"><?php 
            echo $data[$x]->Liga;
            ?>
</option> 
		<?php 
        }
        ?>
	  </select>
	</td>
	<td>&nbsp;&nbsp;&nbsp;<b><?php 
        echo JText::_('SWT_TIP_LINE92');
        ?>
</b>
	<br>&nbsp;&nbsp;&nbsp;<?php 
        echo JText::_('SWT_TIP_LINE93');
        ?>
	<br>&nbsp;&nbsp;&nbsp;<?php 
        echo JText::_('SWT_TIP_LINE94');
        ?>
</td>
	</tr>
	</table>
	</fieldset>


<?php 
        if ($upload == 1) {
            ?>

		<fieldset>
		<legend><?php 
            echo JText::_('SWT_TIP_LINE100');
            ?>
</legend>
			 <input type="file" name="datei" />
		</fieldset>
<?php 
        }
        ?>




<form action="<?php 
        echo JURI::base();
        ?>
index.php?option=com_clm&amp;task=sql_db" id="execute" method="post" name="sql_execute">
	<fieldset>
	<legend><?php 
        echo JText::_('SWT_TIP_LINE101');
        ?>
</legend>

	<table >
<?php 
        for ($x = 0; $x < count($datei); $x++) {
            ?>
	<tr><td><?php 
            echo $datei[$x];
            ?>
</td></tr>
<?php 
        }
        ?>
	</table>
	</fieldset>

</div>
</div>
		<input type="hidden" name="section" value="swt" />
		<input type="hidden" name="option" value="com_clm" />
		<input type="hidden" name="task" value="" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		<div class="clr"></div>
	</form>
<?php 
    }
Beispiel #2
0
 function import_11($liga_id, $update, $sid)
 {
     global $mainframe;
     // Check for request forgeries
     JRequest::checkToken() or die('Invalid Token');
     $option = JRequest::getCmd('option');
     $section = JRequest::getVar('section');
     $db =& JFactory::getDBO();
     $liga_swt = JRequest::getInt('liga_swt');
     // Import wurde schon einmal durchgef�hrt
     if ($update == 1) {
         $sql = " DELETE FROM #__clm_rnd_spl WHERE sid = {$sid} AND lid = {$liga_id} ";
         $db->setQuery($sql);
         $db->query();
     }
     $sql = " INSERT INTO #__clm_rnd_spl ( sid, lid, runde, paar, dg, tln_nr, brett, heim, weiss " . ", spieler, zps, gegner, gzps, ergebnis, kampflos, punkte ) " . " SELECT c.sid, l.clm_id as lid, a.Runde as runde, m.paar, a.DG as dg, m.tln_nr, a.Brett as brett " . ", m.heim, a.Weiss as weiss, s.mgl_nr as spieler, s.clm_zps as zps, t.mgl_nr as gegner " . ", t.clm_zps as gzps, a.clm_ergebnis as ergebnis, a.kampflos, a.Ergebnis as Punkte " . " FROM #__clm_swt_rnd_spl AS a " . " LEFT JOIN #__clm_swt_liga AS l ON l.swt_id= a.swt_id " . " LEFT JOIN #__clm_liga AS c ON c.id= l.clm_id " . " LEFT JOIN #__clm_swt_spl AS s ON s.liga_swt= a.swt_id AND s.Nr = a.Nr " . " LEFT JOIN #__clm_swt_spl AS t ON t.liga_swt= a.swt_id AND t.Nr = a.Gegner " . " LEFT JOIN #__clm_swt_rnd_man AS m ON m.liga_swt=a.swt_id AND m.dg=a.DG AND m.runde =a.Runde AND m.tln_nr=s.mnr " . " WHERE a.swt_id= {$liga_swt} " . " ORDER BY a.DG ASC, a.Runde ASC, m.paar ASC, a.Brett ASC, m.heim DESC ";
     $db->setQuery($sql);
     $db->query();
     // MP und BP aktualisieren
     CLMControllerSWT::bp_mp($liga_id);
     $msg = "Import erfolgreich durchgef&uuml;hrt ! Liga hat die ID #{$liga_id}.";
     JError::raiseNotice(6000, JText::_('SWT_DATEN_HAND'));
     JError::raiseNotice(6000, JText::_('SWT_DATEN_PRUEFEN'));
     JError::raiseNotice(6000, JText::_('SWT_ERGEBNISMANAGER'));
     $mainframe->redirect('index.php?option=' . $option . '&section=' . $section, $msg);
 }