Location: PHPKode > scripts > GigKalender > calendar/functions_organizers.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 getOrganizerVarFromOrganizerVar ($FieldName, $FieldValue, $Var)
{
  global $prefix;
  $SQL = "SELECT ".$Var." FROM ".$prefix."organizers WHERE ".$FieldName."='".$FieldValue."' LIMIT 1";
  $result = mysql_query($SQL);
  if ( mysql_num_rows($result)==1)
  {
    $temp=mysql_fetch_assoc($result);
    //echo $temp[$Var].'<br />';
    return $temp[$Var];
  }
  else return false;
}

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

function isOrganizerInDatabase($OrganizerName)
{
  global $prefix;
  $string = strtolower($OrganizerName);
  $doppelteVorhanden = false;
  //$db_select = @mysql_select_db($db_name);
  $sql = 'SELECT * FROM ' .$prefix."organizers";
  $result = mysql_query($sql);
  $menge = mysql_num_rows($result);
  while($row = mysql_fetch_row($result))
    if (strtolower($row[1]) == $string) $doppelteVorhanden = true;
  if ($doppelteVorhanden) return true;
    else return false;
}

function addOrganizer ( $Organizer, $Job )
{
  global $prefix;
  global $L_042;
  $amountOrganizers = count($Organizer);
  for ($i=0; $i<$amountOrganizers; $i++)
    if ( $i!=23 ) // Notizen werden ausgeklammert
      $Organizer[$i]=strip_tags($Organizer[$i]); // Entfernt HTML- und PHP-Tags aus einer Zeichenkette
  list( $OrganizerID, $OrganizerName, $OrganizerURL) = $Organizer;
  if ( $OrganizerURL=='http://' ) $OrganizerURL='';
  if ( $OrganizerURL!="" AND !stristr( $OrganizerURL, 'http://' ) ) $OrganizerURL = 'http://'.$OrganizerURL;
  if ( $Job=="add" )
  {
    $SQL = "INSERT INTO ".$prefix."organizers ( OrganizerName, OrganizerURL ) VALUES ( '$OrganizerName',
      '$OrganizerURL')";
    $resultat = mysql_query($SQL);
    if ($resultat) return true;
    else return false;
  }
  elseif ( $Job=="edit" )
  {
    $SQL = "UPDATE ".$prefix."organizers SET OrganizerName = '$OrganizerName', OrganizerURL = '$OrganizerURL'
      WHERE OrganizerID = '$OrganizerID' LIMIT 1";
    $resultat = mysql_query($SQL);
    if ($resultat) return true;
    else return false;
  }
}

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