예제 #1
0
<?php

require "config.php";
require "itemView.php";
$stdEMail = getDbText("itemvote_stdEmail");
$stdComment = getDbText("itemvote_stdComment");
$cap_noNameError = getDbText("error_noName");
$cap_noTextError = getDbText("error_noText");
$cap_noLinksError = getDbText("error_noLinks");
$noLinksNeedle = "<a href";
if (!($nameFamName = getItemNameFamName($ID))) {
    die("Der Mostbauer mit der ID='{$ID}' ist nicht oder nicht mehr im System.");
}
$name = getItemName($ID);
// Bewertung
if (isset($nurbewertung) || isset($beides)) {
    for ($i = 1; $i <= 3; $i++) {
        $bewname = "vote_{$i}";
        if (isset(${$bewname}) && ${$bewname} > 0) {
            userVote($ID, $i, ${$bewname});
        }
    }
}
// Kommentar
$commentInserted = false;
if (isset($nurkommentar) || isset($beides)) {
    $commentError = "";
    if (!isset($email) || $email == "" || $email == $stdEMail) {
        $commentError = $cap_noNameError;
    } else {
        if (!isset($kommentar) || $kommentar == "" || $kommentar == $stdComment) {
예제 #2
0
function display_weekday_selection($wochentag, $type)
{
    // type = schmalzbrot, gmap
    global $weekdayStringArray, $weekdayShortStringArray, $CmsLinkOverview;
    $weekDayTodayCode = date("w", getCETDateTime());
    // 0 is sunday ... 6 is saturday
    $cap_showBauer3 = getDbText("bauer_showBauer3");
    if ($wochentag == 'heute') {
        $wochentag = $weekDayTodayCode;
    }
    if (isset($wochentag) && $wochentag != "alle") {
        $wochentagCode = $wochentag % 7;
        if ($wochentagCode == $weekDayTodayCode) {
            $weekDayTodaySelected = " selected";
        }
        if ($wochentagCode == ($weekDayTodayCode + 1) % 7) {
            $weekDayTomorrowSelected = " selected";
        }
    } else {
        $wochentag = "alle";
    }
    // no or wrong parameter given
    $weekdaySelectStyle = $type == "gmap" ? " style='height:20px;margin-bottom:5px;'" : "";
    ?>

<!-- WEEKDAY - SELECT - Start -->

  <div id="weekdaySelect"<?php 
    echo $weekdaySelectStyle;
    ?>
>
  <center>
  <div id="weekdaySelectDays">

<?php 
    echo '<a target="_parent" id="weekdaySelect_alle" href="' . $CmsLinkOverview . '&wochentag=alle"' . ($wochentag == 'alle' ? ' class="active"' : '') . ($type == 'gmap' ? ' onclick="mbgm_fetchBauern(\'alle\'); return false;"' : '') . '>' . $cap_showBauer3 . '</a>';
    echo "<span>&nbsp;&nbsp;Offen:&nbsp;&nbsp;</span>";
    echo '<a target="_parent" id="weekdaySelect_' . $weekDayTodayCode . '" href="' . $CmsLinkOverview . '"' . ($wochentagCode == $weekDayTodayCode ? ' class="active"' : '') . ($type == 'gmap' ? ' onclick="mbgm_fetchBauern(\'' . $weekDayTodayCode . '\'); return false;"' : '') . '>heute</a>';
    $codeTomorrow = ($weekDayTodayCode + 1) % 7;
    echo '<a target="_parent" id="weekdaySelect_' . $codeTomorrow . '" href="' . $CmsLinkOverview . '&wochentag=' . $codeTomorrow . '"' . ($wochentagCode === $codeTomorrow ? ' class="active"' : '') . ($type == 'gmap' ? ' onclick="mbgm_fetchBauern(\'' . $codeTomorrow . '\'); return false;"' : '') . '>morgen</a>';
    for ($i = 1; $i < 6; $i++) {
        $todayCode = ($weekDayTodayCode + 1 + $i) % 7;
        echo '<a target="_parent" id="weekdaySelect_' . $todayCode . '" href="' . $CmsLinkOverview . '&wochentag=' . $todayCode . '"' . ($wochentagCode === $todayCode ? ' class="active"' : '') . ($type == 'gmap' ? ' onclick="mbgm_fetchBauern(\'' . $todayCode . '\'); return false;"' : '') . '>' . $weekdayStringArray[$todayCode] . '</a>';
    }
    //for
    ?>

  </div> <!-- <div id="weekdaySelectDays"> -->
  <?php 
    if ($type == "schmalzbrot") {
        /*
          echo(tageswetter("0"));// heute
          echo(tageswetter("1"));//morgen
          echo(tageswetter("2"));//�bermorgen
          echo(tageswetter("3"));//��morgen
          echo(tageswetter("4"));//���morgen
        */
        echo "<div id='bauernListe'>";
        //  echo"<span>Auf dieser Seite zu folgendem Bauern springen:&nbsp;</span>";
        $itemsListArray = fetch_bauern_region_list($wochentagCode);
        echo createMostbauernDropdownList("betriebeInUebersicht", "jo", FALSE, $itemsListArray);
        echo "</div>";
    }
    ?>
  </center>
  </div> <!-- <div id="weekdaySelect"> -->

  <div id="weekdaySelectReset">
  </div>

<!-- WEEKDAY - SELECT - End -->
	<?php 
    return $wochentagCode;
}