Пример #1
0
    function verein(&$row, $lists, $option)
    {
        $url = $_SERVER["REQUEST_URI"];
        $ipos = strpos($url, 'administrator');
        $rurl = substr($url, 0, $ipos);
        $surl = $_SERVER["SERVER_NAME"];
        JToolBarHelper::preview('http://' . $surl . $rurl . 'index.php?option=com_clm&view=verein&saison=' . $row->sid . '&zps=' . $row->zps);
        CLMViewVereine::setVereinToolbar();
        JRequest::setVar('hidemainmenu', 1);
        JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'extrainfo');
        ?>
	<script language="javascript" type="text/javascript">
		<!--
		function Tausch (x)
		{
			var w = document.getElementById(x).selectedIndex;
			var selected_text = document.getElementById(x).options[w].text;

			//document.getElementById('name').innerHTML=selected_text;
			document.getElementById('name').value=selected_text;
		}

		function VSTausch (x)
		{
			var w = document.getElementById(x).selectedIndex;
			var selected_text = document.getElementById(x).options[w].text;

			//document.getElementById('name').innerHTML=selected_text;
			document.getElementById('vs').value=selected_text;
		}

		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			// do field validation
			if (form.name.value == "") {
				alert( "<?php 
        echo JText::_('VEREIN_NAME_ANGEBEN', true);
        ?>
" );
			} else if ( getSelectedValue('adminForm','zps') == 0 ) {
				alert( "<?php 
        echo JText::_('VEREIN_ZPS_AUSWAEHLEN', true);
        ?>
" );
			} else if ( getSelectedValue('adminForm','sid') == 0 ) {
				alert( "<?php 
        echo JText::_('VEREIN_SAISON_AUSWAEHLEN', true);
        ?>
" );
			} else {
				submitform( pressbutton );
			}
		}
		//-->
		</script>

		<form action="index.php" method="post" name="adminForm">

		<div class="col width-50">
		<fieldset class="adminform">
		<legend><?php 
        echo JText::_('VEREIN_DETAILS');
        ?>
</legend>

		<table class="admintable">
		<tr>
			<td class="key" width="20%" nowrap="nowrap">
			<label for="zps"><?php 
        echo JText::_('VEREIN_ZPS') . ' : ';
        ?>
</label>
			</td>
			<td>
			<?php 
        echo $lists['verein'];
        ?>
			</td>
		</tr>
		<tr>
			<td class="key" width="20%" nowrap="nowrap">
			<label for="name"><?php 
        echo JText::_('VEREIN') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="name" id="name" size="50" maxlength="60" value="<?php 
        echo $row->name;
        ?>
" />
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap"><label for="sid"><?php 
        echo JText::_('SAISON') . ' : ';
        ?>
</label>
			</td>
			<td>
			<?php 
        echo $lists['saison'];
        ?>
			</td>
		</tr>
        
		<tr>
			<td class="key" nowrap="nowrap"><label for="published"><?php 
        echo JText::_('PUBLISHED') . ' : ';
        ?>
</label>
			</td>
			<td>
			<?php 
        echo $lists['published'];
        ?>
			</td>
		</tr>


<tr><td colspan="2"><hr></td></tr>

		<tr>
			<td class="key" nowrap="nowrap"><label for="lokal"><?php 
        echo JText::_('VEREIN_SPIELLOKAL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<?php 
        echo JText::_('CLM_KOMMA') . "<br><br>";
        ?>
			<textarea class="inputbox" name="lokal" id="lokal" cols="40" rows="2" style="width:100%"><?php 
        echo $row->lokal;
        ?>
</textarea>
			<br><?php 
        echo JText::_('VEREIN_3_LINES');
        ?>
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="lokal"><?php 
        echo JText::_('VEREIN_ADRESSE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<textarea class="inputbox" name="adresse" id="adresse" cols="40" rows="2" style="width:100%"><?php 
        echo $row->adresse;
        ?>
</textarea>
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="lokal"><?php 
        echo JText::_('VEREIN_TERMINE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<textarea class="inputbox" name="termine" id="termine" cols="40" rows="4" style="width:99%"><?php 
        echo $row->termine;
        ?>
</textarea>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="lokal"><?php 
        echo JText::_('VEREIN_HOMEPAGE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="homepage" id="homepage"  size="50" value="<?php 
        echo $row->homepage;
        ?>
" />
		</tr>

        <tr><td colspan="2"><hr></td></tr>

		<tr>
			<td class="key" nowrap="nowrap"><label for="vs"><?php 
        echo JText::_('VEREIN_MANAGER') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="vs" id="vs" size="50" maxlength="100" value="<?php 
        echo $row->vs;
        ?>
" />
			<?php 
        echo $lists['vl'];
        ?>
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="vs_mail"><?php 
        echo JText::_('VEREIN_MAIL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="vs_mail" id="vs_mail" size="50" maxlength="100" value="<?php 
        echo $row->vs_mail;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="vs_tel"><?php 
        echo JText::_('VEREIN_PHONE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="vs_tel" id="vs_tel" size="50" maxlength="100" value="<?php 
        echo $row->vs_tel;
        ?>
" />
			</td>
		</tr>
<tr><td colspan="2"><hr></td></tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="tl"><?php 
        echo JText::_('VEREIN_DIRECTOR') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="tl" id="tl" size="50" maxlength="100" value="<?php 
        echo $row->tl;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="tl_mail"><?php 
        echo JText::_('VEREIN_MAIL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="tl_mail" id="tl_mail" size="50" maxlength="100" value="<?php 
        echo $row->tl_mail;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="tl_tel"><?php 
        echo JText::_('VEREIN_PHONE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="tl_tel" id="tl_tel" size="50" maxlength="100" value="<?php 
        echo $row->tl_tel;
        ?>
" />
			</td>
		</tr>
<tr><td colspan="2"><hr></td></tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="jw"><?php 
        echo JText::_('VEREIN_JUNIOR') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="jw" id="jw" size="50" maxlength="100" value="<?php 
        echo $row->jw;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="jw_mail"><?php 
        echo JText::_('VEREIN_MAIL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="jw_mail" id="jw_mail" size="50" maxlength="100" value="<?php 
        echo $row->jw_mail;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="jw_tel"><?php 
        echo JText::_('VEREIN_PHONE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="jw_tel" id="jw_tel" size="50" maxlength="100" value="<?php 
        echo $row->jw_tel;
        ?>
" />
			</td>
		</tr>
<tr><td colspan="2"><hr></td></tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="pw"><?php 
        echo JText::_('VEREIN_SPOKESMAN') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="pw" id="pw" size="50" maxlength="100" value="<?php 
        echo $row->pw;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="pw_mail"><?php 
        echo JText::_('VEREIN_MAIL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="pw_mail" id="pw_mail" size="50" maxlength="100" value="<?php 
        echo $row->pw_mail;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="pw_tel"><?php 
        echo JText::_('VEREIN_PHONE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="pw_tel" id="pw_tel" size="50" maxlength="100" value="<?php 
        echo $row->pw_tel;
        ?>
" />
			</td>
		</tr>
<tr><td colspan="2"><hr></td></tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="kw"><?php 
        echo JText::_('VEREIN_TREASURER') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="kw" id="kw" size="50" maxlength="100" value="<?php 
        echo $row->kw;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="kw_mail"><?php 
        echo JText::_('VEREIN_MAIL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="kw_mail" id="kw_mail" size="50" maxlength="100" value="<?php 
        echo $row->kw_mail;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="kw_tel"><?php 
        echo JText::_('VEREIN_PHONE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="kw_tel" id="kw_tel" size="50" maxlength="100" value="<?php 
        echo $row->kw_tel;
        ?>
" />
			</td>
		</tr>
<tr><td colspan="2"><hr></td></tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="sw"><?php 
        echo JText::_('VEREIN_SENIOR') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="sw" id="sw" size="50" maxlength="100" value="<?php 
        echo $row->sw;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="sw_mail"><?php 
        echo JText::_('VEREIN_MAIL') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="sw_mail" id="sw_mail" size="50" maxlength="100" value="<?php 
        echo $row->sw_mail;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="sw_tel"><?php 
        echo JText::_('VEREIN_PHONE') . ' : ';
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="sw_tel" id="sw_tel" size="50" maxlength="100" value="<?php 
        echo $row->sw_tel;
        ?>
" />
			</td>
		</tr>


		</table>
		</fieldset>
		</div>

 <div class="col width-50">
  <fieldset class="adminform">
   <legend><?php 
        echo JText::_('VEREIN_BEMERKUNGEN');
        ?>
</legend>
	<table class="adminlist">
	<legend><?php 
        echo JText::_('VEREIN_OEFFENTLICH');
        ?>
</legend>
	<br>
	<tr>
	<td width="100%" valign="top">
	<textarea class="inputbox" name="bemerkungen" id="bemerkungen" cols="40" rows="5" style="width:90%"><?php 
        echo str_replace('&', '&amp;', $row->bemerkungen);
        ?>
</textarea>
	</td>
	</tr>
	</table>

	<table class="adminlist">
	<tr><legend><?php 
        echo JText::_('VEREIN_INTERN');
        ?>
</legend>
	<br>
	<td width="100%" valign="top">
	<textarea class="inputbox" name="bem_int" id="bem_int" cols="40" rows="5" style="width:90%"><?php 
        echo str_replace('&', '&amp;', $row->bem_int);
        ?>
</textarea>
	</td>
	</tr>
	</table>
  </fieldset>
  </div>
		<div class="clr"></div>

		<input type="hidden" name="section" value="vereine" />
		<input type="hidden" name="option" value="com_clm" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="cid" value="<?php 
        echo $row->cid;
        ?>
" />
		<input type="hidden" name="client_id" value="<?php 
        echo $row->cid;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Пример #2
0
 function edit()
 {
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $task = JRequest::getVar('task');
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     $option = JRequest::getCmd('option');
     $section = JRequest::getVar('section');
     JArrayHelper::toInteger($cid, array(0));
     $row = JTable::getInstance('vereine', 'TableCLM');
     // load the row from the db table
     $row->load($cid[0]);
     $sid = $row->sid;
     // Userberechtigung abfragen
     $clmAccess = clm_core::$access;
     if ($clmAccess->access('BE_club_create') === false and $task == 'add') {
         //if (clm_core::$access->getType() !== 'admin' AND $task =='add') {
         JError::raiseWarning(500, JText::_('VEREINE_ADMIN'));
         $mainframe->redirect('index.php?option=' . $option . '&section=' . $section, $msg, "message");
     }
     if ($task == 'edit') {
         // illegaler Einbruchversuch über URL !
         // evtl. mitschneiden !?!
         $saison = JTable::getInstance('saisons', 'TableCLM');
         $saison->load($sid);
         if ($saison->archiv == "1") {
             //AND clm_core::$access->getType() !== 'admin') {
             JError::raiseWarning(500, JText::_('VEREINE_NO_ARCHIV'));
             $mainframe->redirect('index.php?option=' . $option . '&section=' . $section, $msg, "message");
         }
         if ($cid[0] == "") {
             // AND $task =='edit') {
             JError::raiseWarning(500, JText::_('VEREINE_FALSCH'));
             $mainframe->redirect('index.php?option=' . $option . '&section=' . $section, $msg, "message");
         }
         // do stuff for existing records
         $row->checkout($user->get('id'));
     } else {
         // do stuff for new records
         $row->published = 0;
     }
     if ($clmAccess->access('BE_club_create') === false) {
         //if ( clm_core::$access->getType() !== 'sl' AND clm_core::$access->getType() !== 'admin' AND clm_core::$access->getType() !== 'dv' AND clm_core::$access->getType() !== 'dwz') {
         JError::raiseWarning(500, JText::_('VEREINE_NO_BEARBEITEN'));
         $link = 'index.php?option=' . $option . '&section=' . $section;
         $mainframe->redirect($link);
     }
     $sql = 'SELECT id FROM #__clm_saison WHERE archiv = 0 and published = 1';
     $db->setQuery($sql);
     $sid = $db->loadResult();
     // Vereinefilter laden
     // 1 = Auswahl DB obwohl manuell aktiviert wurde !
     $vereinlist = CLMFilterVerein::vereine_filter(1);
     $lists['verein'] = JHTML::_('select.genericlist', $vereinlist, 'zps', 'class="inputbox" size="1" onchange="Tausch(this.id)"', 'zps', 'name', $row->zps);
     // Vereinsleiterliste
     if ($task == 'edit') {
         $where = "WHERE ZPS = '" . $row->zps . "'";
     } else {
         $where = 'WHERE ZPS IS NULL';
     }
     $sql = 'SELECT Spielername as name, Mgl_Nr as vl' . ' FROM #__clm_dwz_spieler ' . $where . ' AND sid =' . $sid;
     $db->setQuery($sql);
     if (!$db->query()) {
         $this->setRedirect('index.php?option=' . $option . '&section=' . $section);
         return JError::raiseWarning(500, $db->getErrorMsg());
     }
     $vllist[] = JHTML::_('select.option', '0', JText::_('VEREINE_VEREINSLEITER'), 'vl', 'name');
     $vllist = array_merge($vllist, $db->loadObjectList());
     $lists['vl'] = JHTML::_('select.genericlist', $vllist, 'vl', 'class="inputbox" size="1" onchange="VSTausch(this.id)"', 'vl', 'name', $row->vl);
     // Saisonliste
     if ($task == "edit") {
         $sql = 'SELECT id as sid, name FROM #__clm_saison WHERE id=' . $sid;
     } else {
         $sql = 'SELECT id as sid, name FROM #__clm_saison WHERE archiv =0';
     }
     $db->setQuery($sql);
     if (!$db->query()) {
         $this->setRedirect('index.php?option=' . $option . '&section=' . $section);
         return JError::raiseWarning(500, $db->getErrorMsg());
     }
     if ($task != "edit") {
         $saisonlist[] = JHTML::_('select.option', '0', JText::_('VEREINE_SAISON'), 'sid', 'name');
         $saisonlist = array_merge($saisonlist, $db->loadObjectList());
     } else {
         $saisonlist = $db->loadObjectList();
     }
     $lists['saison'] = JHTML::_('select.genericlist', $saisonlist, 'sid', 'class="inputbox" size="1"', 'sid', 'name', $row->sid);
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published);
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'vereine.php';
     CLMViewVereine::verein($row, $lists, $option);
 }