{!-- ra:0000000039f428e60000000019cfef35 --}{embed='_global/header' bodyid='ratgeber' bodyclass='' title='Wettbewerbe' lb='ratgeber'} art= mysql_real_escape_string($infos['eventart']); $this->titel=mysql_real_escape_string($infos['eventname']); $this->datum=mysql_real_escape_string($infos['eventdate']); $this->doors=mysql_real_escape_string($infos['eventzeit']); $this->enddatum=mysql_real_escape_string($infos['eventenddate']); $this->curfew=mysql_real_escape_string($infos['eventendzeit']); $this->location=mysql_real_escape_string($infos['eventlocation']); $this->preis=mysql_real_escape_string($infos['eventpreis']); $this->website=mysql_real_escape_string($infos['eventwebsite']); $this->intro=mysql_real_escape_string($infos['eventabstract']); $this->body=mysql_real_escape_string($infos['eventbeschreibung']); $this->flyer = $this->uploadFlyer($files); } public function loadEvent($id){ $result = mysql_query("SELECT *, TIME_FORMAT(zeit, '%H:%i') as zeit, TIME_FORMAT(endzeit, '%H:%i') as endzeit FROM mod_events e WHERE e.event_id=$id"); $row = mysql_fetch_array($result); $this->id=$row['event_id']; $this->art=$row['art']; $this->titel=$row['eventname']; $this->datum=$row['datum']; $this->doors=$row['zeit']; $this->enddatum=$row['enddatum']; $this->curfew=$row['endzeit']; $this->location=$row['ort']; $this->preis=$row['preis']; $this->intro=$row['intro']; $this->body=$row['beschreibung']; $this->website=$row['website']; $this->flyer = $row['flyer']; $this->featuredflyer = $row['featureflyer']; } public function uploadFlyer($files){ if ($files['eventflyer']['tmp_name']!='') { //check type, if wrong return 1 if($files["eventflyer"]["type"] != "image/jpeg"&&$files["eventflyer"]["type"] != "image/gif"&&$files["eventflyer"]["type"] != "image/png"){ echo "TYP of Flyer is incorrect"; return 1; } //check size, if to big return 2 if($files['eventflyer']['size'] > 838860){ echo "Size of Flyer is to big"; return 2; } //upload flyer if ($files['eventflyer']['tmp_name']!=''){ $timestamp = time(); $type = $files["eventflyer"]["type"]; $type = substr($type,6,strlen($type)); $dateiname = $timestamp.".".$type; if(move_uploaded_file($files['eventflyer']['tmp_name'], "./images/agenda_flyer/$dateiname")){ return $dateiname; }else{ echo "Upload Fail"; return 3; } } }else{ //kein neuer Flyer return 0; } } public function generateLink() { $seoname = preg_replace('/\%/',' percentage',$this->titel); $seoname = preg_replace('/\@/',' at ',$seoname); $seoname = preg_replace('/\&/',' and ',$seoname); $seoname = preg_replace('/\s[\s]+/','-',$seoname); // Strip off multiple spaces $seoname = preg_replace('/[\s\W]+/','-',$seoname); // Strip off spaces and non-alpha-numeric $seoname = preg_replace('/^[\-]+/','',$seoname); // Strip off the starting hyphens $seoname = preg_replace('/[\-]+$/','',$seoname); // // Strip off the ending hyphens $seoname = strtolower($seoname); $seoname = $seoname."/".$this->id; return "{path='agenda/info/$seoname'}"; } public function getArt() { $art=""; $art = ($this->art==1) ? "Party" : $art; $art = ($this->art==2) ? "Konzert" : $art; $art = ($this->art==3) ? "Kultur" : $art; $art = ($this->art==4) ? "Wissen " : $art; return $art; } /** * Get all WinObjects for this Event */ public function getWins() { $winStack = array(); $sql = "SELECT w.win_id as winid FROM mod_events_win w WHERE w.event_fk = $this->id"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ $winid = $row['winid']; $win = new Win(); $win->loadWin($winid); array_push($winStack,$win); } return $winStack; } public function updateEvent($id) { require_once 'agendamodul/util/database.php'; //WissensFelder to check $w_fachbereich = (empty($this->w_fachbereich)) ? "" : $this->w_fachbereich; $w_anmeldung = (empty($this->w_anmeldung))? "" : $this->w_anmeldung; //PartyFelder to check $p_age = (empty($this->age)) ? "" : $this->age; $p_stil = (empty($this->stil)) ? "" : $this->stil; $p_acts = (empty($this->acts)) ? "" : $this->acts; if($this->flyer==0){ $result = mysql_query("SELECT * FROM mod_events e WHERE e.event_id=$id"); $row = mysql_fetch_array($result); $this->flyer=$row['flyer']; } $updateEvent="UPDATE `ee2dev`.`mod_events` SET `art` = '$this->art', `eventname` = '$this->titel', `datum` = '$this->datum', `zeit` = '$this->doors', `enddatum` = '$this->enddatum', `endzeit` = '$this->curfew', `ort` = '$this->location', `preis` = '$this->preis', `intro` = '$this->intro', `beschreibung` = '$this->body', `website` = '$this->website', `flyer` = '$this->flyer', `p_alter` = '$p_age', `p_stil` = '$p_stil', `p_artist` = '$p_acts', `w_fachbereich` = '$w_fachbereich', `w_anmeldung` = '$w_anmeldung' WHERE `mod_events`.`event_id` = $id LIMIT 1"; mysql_query($updateEvent); } public function saveEvent() { require_once 'agendamodul/util/database.php'; //WissensFelder to check $w_fachbereich = (empty($this->w_fachbereich)) ? "" : $this->w_fachbereich; $w_anmeldung = (empty($this->w_anmeldung))? "" : $this->w_anmeldung; //PartyFelder to check $p_age = (empty($this->age)) ? "" : $this->age; $p_stil = (empty($this->stil)) ? "" : $this->stil; $p_acts = (empty($this->acts)) ? "" : $this->acts; $sqlEvent="INSERT INTO `ee2dev`.`mod_events` ( `event_id` , `art` , `eventname` , `datum` , `zeit` , `enddatum` , `endzeit` , `ort` , `preis` , `intro` , `beschreibung` , `website` , `flyer` , `p_alter` , `p_stil` , `p_artist` , `w_fachbereich` , `w_anmeldung` ) VALUES ( NULL , '$this->art', '$this->titel', '$this->datum', '$this->doors', '$this->enddatum', '$this->curfew', '$this->location', '$this->preis', '$this->intro', '$this->body', '$this->website', '$this->flyer', '$p_age', '$p_stil', '$p_acts', '$w_fachbereich', '$w_anmeldung' );"; mysql_query($sqlEvent); return mysql_insert_id(); } /* * */ public function deleteEvent() { //delete wins //delete event } }
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/www-data/semestra.ch/agendamodul/frontend/fabrik.php:113 Stack trace: #0 /home/www-data/semestra.ch/system/expressionengine/libraries/Functions.php(689) : eval()'d code(9): EventFabrik->getAllWins() #1 /home/www-data/semestra.ch/system/expressionengine/libraries/Functions.php(689): eval() #2 /home/www-data/semestra.ch/system/expressionengine/libraries/Template.php(1827): EE_Functions->evaluate('{!-- ra:0000000...') #3 /home/www-data/semestra.ch/system/expressionengine/libraries/Template.php(470): EE_Template->parse_template_php('{!-- ra:0000000...') #4 /home/www-data/semestra.ch/system/expressionengine/libraries/Template.php(226): EE_Template->parse('{!-- ra:0000000...', false, '1', false) #5 /home/www-data/semestra.ch/system/expressionengine/libraries/Template.php(164): EE_Template->fetch_and_parse('', '', false) #6 /home/www-data/semestra.ch/system/expressionengine/libraries/Core.php(721): EE_Template->run_template_engine('', '') #7 /home/www in /home/www-data/semestra.ch/agendamodul/frontend/fabrik.php on line 113