{if $action == ''}
<html>
  <head>
    <link type="text/css" rel="stylesheet" href="templates/{$global_template}/css/styles_refill.css">
    <link rel="stylesheet" href="jquery/jquery-ui.css">
    <script src="jquery/jquery-1.12.4.js"></script>
    <script src="jquery/jquery-ui.js"></script>
    <script src="jquery/globalize.js"></script>
    <script src="jquery/globalize.culture.de-DE.js"></script>
    <script src="jquery/jquery.mousewheel.js"></script>
    <style type="text/css">
      .spinner {
      width: 200px;
      height: 15px;
      font-size: 12px !important;
      }
    </style>
    <script>
      $( function() {
           $( ".spinner" ).spinner({
          change: function (event, ui) {
           if(this.name == 'basislvsgemlv'){
             gesvol_calc();
           }
          },
          spin: function (event, ui) {
           if(this.name == 'basislvsgemlv'){
             gesvol_calc();
           }
          },
          start: function (event, ui) {
           if(this.name == 'basislvsgemlv'){
	         gesvol_calc();
	       }
	      },
	      stop: function (event, ui) {
	        if(this.name == 'basislvsgemlv'){
	         gesvol_calc();
	        }
	      },

          step: 0.1,
          numberFormat: "i",
          min:0,
          decimals:0
        });
        Globalize.culture( "de-DE" );
      } );

         function trackKeys(evnt,regEx) {
         	var keyCode = evnt.keyCode ? evnt.keyCode : evnt.which;
       	return !!String.fromCharCode(keyCode).match(regEx);
         }
       //-->
    </script>
    <script type="text/javascript">
      $(function() {
          $(".datepicker").datepicker({
          prevText: '&#x3c; zur&uuml;ck', prevStatus: '',
          prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '',
          changeMonth: true,
          changeYear: true,
          nextText: 'Vor &#x3e;', nextStatus: '',
          nextJumpText: '&#x3e;&#x3e;', nextJumpStatus: '',
          currentText: 'Heute', currentStatus: '',
          todayText: 'Heute', todayStatus: '',
          clearText: '-', clearStatus: '',
          closeText: 'schlie&szlig;en', closeStatus: '',
          monthNames: ['Januar','Februar','M&auml;rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],
          monthNamesShort: ['Jan','Feb','M&auml;r','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],
          dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
          dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
          dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
          weekHeader: 'Wo',
          weekStatus: 'Woche des Monats',
          showMonthAfterYear: false,
          showOn: 'focus',
          firstDay: 1,
          numberOfMonths : 1,
          showButtonPanel : true,
          altField : "#datepicker_input",
          dateFormat : "dd.mm.yy",
          showWeek: true
          });
          $.datepicker._gotoToday = function(id) {
		  $(id).datepicker('setDate', new Date()).datepicker('hide').blur();
          }

      });
    </script>
    <script type="text/javascript" src="erfassen_eingabe.js"></script>
    <style>
      .StandardTable thead th{
      background: lightgray;
      border: 1px solid #656565;
      font-size:12px;
      font-family:Arial;
      padding-top:5px;
      padding-bottom:5px;
      padding-left:5px;
      padding-right:5px;
      }
      textarea{
      border: 1px solid #888;
      height: 6.7em;
      width: 48.5em;
      }
      select{
      width:630px;
      }
    </style>
  </head>
  <body onload="show('{$erf_value_gemlv}','{$erf_value_art}', '{$erf_value_exk_tage}');">
    <br />
    <br />
    <div class="header">
      <div>
        <div>{$erf_titel}</div>
      </div>
    </div>
    <form action="?action=register" method='post' name='erfassen'>
      <div class="pat_list_box">
        {if $erf_error == '1'}
        <table width="70%" class="errorTable" align="center">
          <tr>
            <td>
              <img src="templates/{$global_template}/images/pflichtfelder/achtung_gross.gif">
            </td>
            <td><b>Achtung!</b><br>
              {$erf_error_text}
            </td>
          </tr>
        </table>
        <br />
        {/if}
        {if $erf_abschluss == '0'}
        <fieldset>
          <legend>
            <b>Lehrveranstaltung erfassen</b>
          </legend>
          <br />
          <br />
          <table cellspacing="0" cellpadding="0" width="100%" border="0" class="StandardTable">
            <tr>
              <td width="30%">
                {if $erf_studiengang_hig == 1}<font color="red">* {/if}Studiengang{if $erf_studiengang_hig == 1}</font>{/if}
              </td>
              <td>
                <select name="studiengang" id="studiengang" size=5 onchange="fetch_select();">
                {section name=table_data0 loop=$table_data0}
                <option value="{$table_data0[table_data0].dsgid}" {if $erf_value_studiengang == $table_data0[table_data0].dsgid} selected {/if} >{$table_data0[table_data0].bezeichnung}</option>
                {/section}
                </select>
              </td>
            </tr>
            <tr>
              <td width="30%">&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
            <tr>
              <td width="30%">
                {if $erf_art_hig == 1}<font color="red">* {/if}Art der LV{if $erf_art_hig == 1}</font>{/if}
              </td>
              <td valign="top">
                <select name="art" id="art" size=5 onchange="einblenden();">
                {section name=table_data1 loop=$table_data1}
                <option value="{$table_data1[table_data1].verid}" {if $erf_value_art == $table_data1[table_data1].verid} selected {/if} >{$table_data1[table_data1].bezeichnung}</option>
                {/section}
                </select>
                <!-- Bei Master soll nur Vorlesung zur Auswahl angeboten werden-->
                <select name="art" id="art2" size=5 onchange="einblenden();">
                <option value="1" {if $erf_value_art == 1} selected {/if} >Vorlesung</option>
                </select>
              </td>
            </tr>
            <tr>
              <td width="30%">&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
            <tr>
              <td width="30%">
                {if $erf_titel_hig == 1}<font color="red">* {/if}Titel der Lehrveranstaltung (LV){if $erf_titel_hig == 1}</font>{/if}
              </td>
              <td valign="top">
                <!--<textarea name="titel" id="titel" size="60">{$erf_value_titel}</textarea>-->
                <input type="text" name="titel"  id="titel"  size="101" value="{$erf_value_titel}">
                <select id='module' name='module' onchange="fetch_select2();"></select>
                <select id='schwerpunkt' name='schwerpunkt' onchange="fetch_schwerpunkt2();"></select>
              </td>
            </tr>
            <tr>
              <td width="30%">&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
            <tr id="anz_agtage">
              <td width="30%">
                Anzahl der Arbeitsgemeinschaften (AG)
              </td>
              <td valign="top">
                <!--<textarea name="titel" id="titel" size="60">{$erf_value_titel}</textarea>-->
                <select id='anz_ag' name='anz_ag' onchange="fetch_anzahl();">
                <option value='1' {if $erf_value_anz_ag == '1'} selected {/if}>1</option>
                <option value='2' {if $erf_value_anz_ag == '2'} selected {/if}>2</option>
                <option value='3' {if $erf_value_anz_ag == '3'} selected {/if}>3</option>
                <option value='4' {if $erf_value_anz_ag == '4'} selected {/if}>4</option>
                <option value='5' {if $erf_value_anz_ag == '5'} selected {/if}>5</option>
                <option value='6' {if $erf_value_anz_ag == '6'} selected {/if}>6</option>
                <option value='7' {if $erf_value_anz_ag == '7'} selected {/if}>7</option>
                <option value='8' {if $erf_value_anz_ag == '8'} selected {/if}>8</option>
                <option value='9' {if $erf_value_anz_ag == '9'} selected {/if}>9</option>
                <option value='10' {if $erf_value_anz_ag == '10'} selected {/if}>10</option>
                </select>
              </td>
            </tr>
            <tr>
              <td width="30%">&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
            <tr id="extracurr">
              <td width="30%">
                &nbsp;
              </td>
              <td valign="top">
                <table width="70%" class="errorTable">
                  <tr>
                    <td>
                      <b>Extracurricularer Klausurenkurs</b><br>
                      <ul>
                        <li>Es dürfen höchstens {$abschluss_value_max_extracur} Lehrstunden (LVS) pro {$abschluss_einheit_max_extracur} erfasst werden.</li>
                      </ul>
                    </td>
                  </tr>
                </table>
                <br>
              </td>
            </tr>
            <tr>
              <td width="30%">Krankheitsbedingte Merkmale
              </td>
              <td><label for="krankheit1"><input type="radio" name="krankheit" id="krankheit1" value="0" {if $erf_value_krankheit == 0} checked {/if} onclick="func_krankheit(1);"> keine</label><br>
                  <label for="krankheit2"><input type="radio" name="krankheit" id="krankheit2" value="1" {if $erf_value_krankheit == 1} checked {/if} onclick="func_krankheit(2);"> Lehrveranstaltung übernommen</label><br>
                  <label for="krankheit3"><input type="radio" name="krankheit" id="krankheit3" value="2" {if $erf_value_krankheit == 2} checked {/if} onclick="func_krankheit(3);"> Lehrveranstaltung nachgeholt</label>
              </td>
            </tr>
            <tr>
              <td>&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
          </table>
          <fieldset id="teachingblock_field">
            <legend>Teamteaching</legend>
            <table cellspacing="0" cellpadding="0" width="100%" border="0" class="StandardTable">
              <tr id="teachingblock0">
                <td width="30%">
                  gemeinsame&nbsp;LV
                </td>
                <td valign="top">
                  <select name="gemlv" id="gemlv" onchange='felder_aktiv(0);' size=2>
                  <option value="N" {if $erf_value_gemlv == "N"} selected {/if} {if $erf_value_gemlv == ""} selected {/if}>Nein</option>
                  <option value="J" {if $erf_value_gemlv == "J"} selected {/if}>Ja</option>
                  </select>
                </td>
              </tr>
              <tr id="teachingblock1">
                <td width="30%">
                  fachübergreifende&nbsp;LV
                </td>
                <td valign="top">
                  <select name="fachlv" id="fachlv" disabled size=2 onchange='felder_aktiv(1);'>
                  <option value="N" {if $erf_value_fachlv == "N"} selected {/if} {if $erf_value_fachlv == ""} selected {/if}>Nein</option>
                  <option value="J" {if $erf_value_fachlv == "J"} selected {/if}>Ja</option>
                  </select>
                </td>
              </tr>
              <tr id="teachingblock2">
                <td width="30%">
                  {if $erf_anzgemlv_hig == 1}<font color="red">* {/if}Anzahl der Lehrenden{if $erf_anzgemlv_hig == 1}</font>{/if}
                </td>
                <td valign="top">
                  <select name="anzgemlv" id="anzgemlv" disabled>
                    <option value="">Anzahl der Lehrenden</option>
                    <option value="1" {if $erf_value_anzgemlv == "1"} selected {/if}>1</option>
                    <option value="2" {if $erf_value_anzgemlv == "2"} selected {/if}>2</option>
                    <option value="3" {if $erf_value_anzgemlv == "3"} selected {/if}>3</option>
                    <option value="4" {if $erf_value_anzgemlv == "4"} selected {/if}>4</option>
                    <option value="5" {if $erf_value_anzgemlv == "5"} selected {/if}>5</option>
                    <option value="6" {if $erf_value_anzgemlv == "6"} selected {/if}>6</option>
                    <option value="7" {if $erf_value_anzgemlv == "7"} selected {/if}>7</option>
                    <option value="8" {if $erf_value_anzgemlv == "8"} selected {/if}>8</option>
                    <option value="9" {if $erf_value_anzgemlv == "9"} selected {/if}>9</option>
                    <option value="10" {if $erf_value_anzgemlv == "10"} selected {/if}>10</option>
                  </select>
                </td>
              </tr>
              <tr id="teachingblock3">
                <td width="30%">
                 {if $erf_namegemlv_hig == 1}<font color="red">* {/if}Namen der Lehrenden{if $erf_namegemlv_hig == 1}</font>{/if}
                </td>
                <td valign="top">
                  <textarea name="namegemlv" id="namegemlv" disabled>{$erf_value_namegemlv}</textarea>
                </td>
              </tr>
              <tr id="teachingblock5">
                <td width="30%">
                  {if $erf_basislvsgemlv_hig == 1}<font color="red">* {/if}Basiswert (LVS) der LV{if $erf_basislvsgemlv_hig == 1}</font>{/if}
                </td>
                <td valign="top">
                  <!--<input type="number" step="0.1" name="basislvsgemlv" disabled id="basislvsgemlv" size="101" value="{$erf_value_std}" onchange='gesvol_calc();'>-->
                  <!-- onchange='gesvol_calc();' funktioniert bei Spinner nicht. Das muss oben in das javascript rein-->
                  <input type="text" class="spinner" name="basislvsgemlv" disabled id="basislvsgemlv" size="101" value="{$erf_value_std}" onKeypress="return trackKeys(event,/[0-9,]/);">
                </td>
              </tr>
              <tr id="teachingblock4">
                <td width="30%">
                  {if $erf_teamteaching_hig == 1}<font color="red">* {/if}Teachingfaktor{if $erf_teamteaching_hig == 1}</font>{/if}
                </td>
                <td valign="top">
                  <select name="teamteaching" id="teamteaching" disabled size="5" onchange='gesvol_calc();'>
                  {section name=table_data3 loop=$table_data3}
                  <option value="{$table_data3[table_data3].tid}" {if $erf_value_teamteaching == $table_data3[table_data3].tid} selected {/if} >{$table_data3[table_data3].bezeichnung}</option>
                  {/section}
                  </select>
                </td>
              </tr>
              <tr>
                <td width="30%">
                  &nbsp;
                </td>
                <td>
                  &nbsp;
                </td>
              </tr>
              <tr id="teachingblock_hinw">
                <td width="30%">
                  &nbsp;
                </td>
                <td valign="top">
                  <table width="70%" class="errorTable">
                    <tr>
                      <td>
                        <b>Gesamtvolumen</b><br>
                        <ul>
                          <li>Der Teachingfaktor gibt vor, zu wieviel Prozent einer Lehrveranstaltung Lehrende gemeinsam lehren dürfen.</li>
                          <li>Bei einem Faktor von 0,5 dürfen also bis zu 50 % einer Veranstaltung von zwei Lehrenden miteinander gestaltet werden.</li>
                          <li>Bsp: Sind für ein Fachprojekt 56 LVS vorgesehen, gilt der Faktor 0,5.<br>
                            Das bedeutet, dass höchstens 28 LVS gemeinsam gestaltet werden dürfen.<br>
                            Daraus resultiert ein Gesamtvolumen von 56 LVS + (0,5 Faktor x 56 LVS) = 84 LVS.<br>
                            Das Gesamtvolumen steht den beiden Dozierenden zur Aufteilung (nach eigenem Ermessen) zu.<br>
                            Der einzelne Dozent darf sich aber nicht mehr als 56 LVS zurechnen
                          </li>
                          <li>Der Basiswert dient nur zur Berechnung des Gesamtvolumens.<br>Die tatsächliche LVS bitte in das Feld "Summe eigene Lehrstunden" eintragen!</li>
                        </ul>
                        <div style="float: left;">Aktuelles Gesamtvolumen:&nbsp;</div>
                        <div style="float: left;" id="gesamtvolumen_count"></div>
                      </td>
                    </tr>
                  </table>
                  <br>
                </td>
              </tr>
            </table>
          </fieldset>
          <table cellspacing="0" cellpadding="0" width="100%" border="0" class="StandardTable">
            <tr>
              <td width="30%">&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
            <tr id="exkursion1">
              <td width="30%">
                {if $erf_tage_exkursion_hig == 1}<font color="red">* {/if}Exkursionsstunden{if $erf_tage_exkursion_hig == 1}</font>{/if}
              </td>
              <td valign="top">
                <label for="tage_exkursion1"><input type="radio" name="tage_exkursion" id="tage_exkursion1"value="1" checked onclick="senden_aktiv();"> Eintägig</label><br>
                <table>
                  <tr>
                    <td width=200><b>Datum:</b></td>
                    <td><input type="text" class="datepicker" name="exk_datumvon" id="exk_datumvon1"value="{$erf_value_exk_datumvon}"></td>
                  </tr>
                  <tr>
                    <td width=200><b>Beschreibung/Ort:</b></td>
                    <td><input type="text" name="exk_beschreibung" id="exk_beschreibung1"  value="{$erf_value_exk_beschreibung}" size="67"></td>
                  </tr>
                  <tr>
                    <td width=200><b>Stunden:</b></td>
                    <!--<td><input type="number" step="0.1" name="exk_stdanreise" id="exk_stdanreise1" value="{$erf_value_exk_stdanreise}"></td>-->
                    <td><input type="text" class="spinner" name="exk_stdanreise" id="exk_stdanreise1" value="{$erf_value_exk_stdanreise}" onKeypress="return trackKeys(event,/[0-9,]/);"></td>
                  </tr>
                </table>
                <br><br>
                <label for="tage_exkursion2"><input type="radio" name="tage_exkursion"  id="tage_exkursion2" value="2" onclick="senden_aktiv();"> Mehrtägig</label><br>
                <table>
                  <tr>
                    <td width=200><b>Datum von:</b></td>
                    <td><input type="text" class="datepicker" name="exk_datumvon" id="exk_datumvon2" value="{$erf_value_exk_datumvon}"></td>
                  </tr>
                  <tr>
                    <td width=200><b>Datum bis:</b></td>
                    <td><input type="text" class="datepicker" name="exk_datumbis" id="exk_datumbis2" value="{$erf_value_exk_datumbis}"></td>
                  </tr>
                  <tr>
                    <td width=200><b>Beschreibung/Ort:</b></td>
                    <td><input type="text" name="exk_beschreibung" id="exk_beschreibung2" value="{$erf_value_exk_beschreibung}" size="67"></td>
                  </tr>
                  <tr>
                    <td width=200><b>Stunden Anreisetag:</b></td>
                    <!--<td><input type="number" step="0.1" name="exk_stdanreise" id="exk_stdanreise2" value="{$erf_value_exk_stdanreise}"></td>-->
                    <td><input type="text" class="spinner" name="exk_stdanreise" id="exk_stdanreise2" value="{$erf_value_exk_stdanreise}" onKeypress="return trackKeys(event,/[0-9,]/);"></td>
                  </tr>
                  <tr>
                    <td width=200><b>Stunden Abreisetag:</b></td>
                    <!--<td><input type="number" step="0.1" name="exk_stdabreise" id="exk_stdabreise2" value="{$erf_value_exk_stdabreise}"></td>-->
                    <td><input type="text" class="spinner" name="exk_stdabreise" id="exk_stdabreise2" value="{$erf_value_exk_stdabreise}" onKeypress="return trackKeys(event,/[0-9,]/);"></td>
                  </tr>
                </table>
                <br>
                <table width="80%" class="errorTable">
                  <tr>
                    <td>
                      <b>Informationen</b><br>
                      <ul>
                        <li>Die Stunden werden mit dem Faktor {$erf_value_exk_faktor} multipliziert, um die LVS zu erhalten.</li>
                        <li>Tageshöchstsatz liegt bei 10 Std. Das entspricht {$erf_value_exk_max_tag} LVS.</li>
                        <li>Ganze Tage werden mit dem Höchstsatz {$erf_value_exk_max_tag} LVS berechnet.</li>
                        <li>Bei mehrtägigen Exkursionen: Geben Sie immer die Stunden am Anreise- und Abreisetag an, <font color="red"<b>sonst werden diese Tage nicht berechnet!</b></font></li>
                      </ul>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr id="lehrstd1">
              <td width="30%">
                {if $erf_std_hig == 1}<font color="red">* {/if}Summe eigene Lehrstunden (LVS){if $erf_std_hig == 1}</font>{/if}
              </td>
              <td valign="top">
                <!--<input type="number" step="0.1" name="std" id="std" size="101" value="{$erf_value_std}">-->
                <input type="text" class="spinner" name="std" id="std" size="101" value="{$erf_value_std}" onKeypress="return trackKeys(event,/[0-9,]/);">
                <input type="hidden" name="std_default" id="std_default" size="101">
              </td>
            </tr>
            <tr>
              <td>&nbsp;
              </td>
              <td>&nbsp;
              </td>
            </tr>
            <tr>
              <td width="30%">
                Hinweise
              </td>
              <td valign="top">
                <textarea name="hinweise">{$erf_value_hinweise}</textarea>
              </td>
            </tr>
          </table>
          <br />
          <p align='center'>
            <input type='submit' name='senden' value="Speichern">
          </p>
          <br />
        </fieldset>
    </form>
    <br />
    <br />
    <fieldset>
    <legend>
    <b>Erfasste Lehrveranstaltungen</b>
    </legend>
    <table cellspacing="0" cellpadding="2" width="100%" border="1">
    <tr>
    <td>
    <b>lfd.Nr.</b>
    </td>
    <td width=15%>
    <b>Studiengang (LV)</b>
    </td>
    <td>
    <b>Art der LV</b>
    </td>
    <td width=20%>
    <b>Titel der Lehrveranstaltung (LV)</b>
    </td>
    <td>
    <b>Krankheitsbedingte Merkmale</b>
    </td>
    <td>
    <b>gemeinsame&nbsp;LV</b>
    </td>
    <!--
      <td>
      <b>Anzahl der Lehrenden</b>
      </td>
      <td>
      <b>Maß der<br>Lehrbeteiligung (%)</b>
      </td>
      <td>
      <b>Namen der Lehrenden</b>
      </td>
      <td>
      <b>Teachingfaktor</b>
      </td>
      -->
    <td align="right">
    <b>Summe eigene<br>Lehrstunden (LVS)</b>
    </td>
    <td>
    <b>Hinweise</b>
    </td>
    <td align="center">
    <b>Edit</b>
    </td>
    <tr>
    {section name=table_data2 loop=$table_data2}
    {if $smarty.section.table_data2.rownum != ''}
    <tr>
    <td>
    {$smarty.section.table_data2.rownum}
    </td>
    <td>
    {$table_data2[table_data2].studiengang}
    </td>
    <td>
    {$table_data2[table_data2].veranstaltung}
    </td>
    <td>
    {$table_data2[table_data2].titel}
    </td>
    <td>
    {$table_data2[table_data2].krankheitsmerkmal}
    </td>
    <td>
    {$table_data2[table_data2].gemlv_form}
    </td>
    <!--
      <td>
      {$table_data2[table_data2].anzgemlv}
      </td>
      <td>
      {$table_data2[table_data2].massgemlv}%
      </td>
      <td>
      {$table_data2[table_data2].namegemlv}
      </td>
      <td>
      {$table_data2[table_data2].teamteaching_form}
      </td>
      -->
    <td align="right">
    {$table_data2[table_data2].std}
    </td>
    <td>
    {$table_data2[table_data2].hinweise}
    </td>
    <td align="center">
    <a href=?edit={$table_data2[table_data2].did}><img title = "Lehrveranstaltung bearbeiten" border="0" height=10 src="templates/{$global_template}/images/edit.png"></a>&nbsp;<a href="?action=del&did={$table_data2[table_data2].did}"><img title = 'Lehrveranstaltung l&ouml;schen' border="0" height=10 src="templates/{$global_template}/images/drop.png"></a>
    </td>
    </tr>
    {/if}
    {/section}
    <tr>
    <td colspan="6">&nbsp;</td>
    <td align="right"><b>Summe: {$erf_value_summe_jahr}</b></td>
    <td colspan="2">&nbsp;</td>
    </tr>
    </table>
    </fieldset>
    {/if}
    <br />
    <br />
    </div>
  </body>
</html>
{/if}