Location: PHPKode > scripts > GigKalender > calendar/functions_venues.php
<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
function getVenueVarFromVenueVar ($FieldName, $FieldValue, $Var)
{
  global $prefix;
  $SQL = "SELECT ".$Var." FROM ".$prefix."venues WHERE ".$FieldName."='".$FieldValue."' LIMIT 1";
  $result = mysql_query($SQL);
  if ( mysql_num_rows($result)==1)
  {
    $temp=mysql_fetch_assoc($result);
    return $temp[$Var];
  }
  else return false;
}

function getVenueVarFromVenueID ($VenueID, $Var)
{
  global $prefix;
  $SQL = "SELECT ".$Var." FROM ".$prefix."venues WHERE VenueID='".$VenueID."' LIMIT 1";
  $result = mysql_query($SQL);
  if ( mysql_num_rows($result)==1)
  {
    $temp=mysql_fetch_assoc($result);
    return $temp[$Var];
  }
  else return false;
}

function isVenueInDatabase($VenueName)
{
  global $prefix;
  $string = strtolower($VenueName);
  $doppelteVorhanden = false;
  //$db_select = @mysql_select_db($db_name);
  $sql = 'SELECT * FROM ' .$prefix."venues";
  $result = mysql_query($sql);
  $menge = mysql_num_rows($result);
  while($row = mysql_fetch_row($result))
    if (strtolower($row[5]) == $string) $doppelteVorhanden = true;
  if ($VenueName!='' && $doppelteVorhanden) return true;
    else return false;
}

function addVenue ( $Venue, $Job )
{
  global $prefix;
  global $L_042;
  $amountVenues = count($Venue);
  for ($i=0; $i<$amountVenues; $i++)
    if ( $i!=23 ) // Notizen werden ausgeklammert
      $Venue[$i]=strip_tags($Venue[$i]); // Entfernt HTML- und PHP-Tags aus einer Zeichenkette
  list ($VenueID, $VenueName, $VenueURL, $VenueCountry, $VenueDistrict, $VenuePostalCode, $VenueCity)
    = $Venue;
  if ( $VenueURL=='http://' ) $VenueURL='';
  if ( $VenueURL!="" AND !stristr( $VenueURL, 'http://' ) ) $VenueURL = 'http://'.$VenueURL;
  if ( $Job=="add" )
  {
    $SQL = "INSERT INTO ".$prefix."venues ( VenueName, VenueURL, VenueCountry, VenueDistrict, VenuePostalCode,
    VenueCity ) VALUES ( '$VenueName', '$VenueURL', '$VenueCountry', '$VenueDistrict', '$VenuePostalCode',
    '$VenueCity')";
    $resultat = mysql_query($SQL);
    if ($resultat) return true;
      else return false;
  }
  elseif ( $Job=="edit" )
  {
    $SQL = "UPDATE ".$prefix."venues SET VenueName = '$VenueName', VenueURL = '$VenueURL',
      VenueCountry = '$VenueCountry', VenueDistrict = '$VenueDistrict', VenuePostalCode = '$VenuePostalCode',
      VenueCity = '$VenueCity' WHERE VenueID = '$VenueID' LIMIT 1";
    $resultat = mysql_query($SQL);
    if ($resultat) return true;
      else return false;
  }
}

function AmountOfVenuesInDatabase ()
  {
    global $prefix;
    $sql = "SELECT count(*) as zahl  FROM ".$prefix."venues";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    return $row['zahl'];
  }
?>
Return current item: GigKalender