=")? " OR dates = DATE('0000-00-00')":"") .(($sign == "<")? " AND dates != DATE('0000-00-00')":"") .")" ." ORDER BY dates;"; } //echo $query,"

"; if ($result = @mysql_query ($query, $db)) { if ($rows = @mysql_num_rows ($result)) { $i =0; while ($row = @mysql_fetch_object ($result)) { $R['f_id'] = $row->event_id; $R['f_title'] = $row->title; $R['f_instruments'] = $row->instrumentation; $R['f_comp_year'] = $row->year; $R['f_premiere'] = $row->premiere; $R['f_performers'] = $row->performers; $R['f_dates'] = $row->fecha; $R['f_place'] = $row->place; $R['f_address'] = $row->address; $R['f_city'] = $row->city; $R['f_state'] = $row->state; $R['f_country'] = $row->country; $R['f_country_name']= $row->country!="0"?$GLOBALS["country_name"][$row->country]:""; $R['f_zip'] = $row->zip_code; $R['f_URL'] = $row->directions; $R['f_phone'] = $row->phone; $R['f_other'] = $row->other; $R['f_day'] = $row->e_day; $R['f_month'] = $row->e_month; $R['f_year'] = $row->e_year; $A[$i] = $R; //utf8_decoder($R); $i++; } return $A; } else { return null; } } else echo "ERROR: ",mysql_errno ().' '.mysql_error (),"
"; } function delete_event ($db, $id) { $query = "delete from event where event_id = $id "; //echo "$query
"; if ($resultado = mysql_query ($query, $db)) { echo ''; } else { echo "NO BORRE NADA
"; } } function html_decoder ($data) { $data['f_title'] = html_entity_decode($data['f_title'], ENT_QUOTES); $data['f_instruments'] = html_entity_decode($data['f_instruments'], ENT_QUOTES); $data['f_comp_year'] = html_entity_decode($data['f_comp_year'], ENT_QUOTES); $data['f_premiere'] = html_entity_decode($data['f_premiere'], ENT_QUOTES); $data['f_performers'] = html_entity_decode($data['f_performers'], ENT_QUOTES); $data['f_place'] = html_entity_decode($data['f_place'], ENT_QUOTES); $data['f_address'] = html_entity_decode($data['f_address'], ENT_QUOTES); $data['f_city'] = html_entity_decode($data['f_city'], ENT_QUOTES); $data['f_state'] = html_entity_decode($data['f_state'], ENT_QUOTES); $data['f_zip'] = html_entity_decode($data['f_zip'], ENT_QUOTES); $data['f_country'] = html_entity_decode($data['f_country'], ENT_QUOTES); $data['f_URL'] = html_entity_decode($data['f_URL'], ENT_QUOTES); $data['f_phone'] = html_entity_decode($data['f_phone'], ENT_QUOTES); $data['f_other'] = html_entity_decode($data['f_other'], ENT_QUOTES); return $data; } function html_encoder ($data) { $data['f_title'] = htmlentities($data['f_title'], ENT_QUOTES); $data['f_instruments'] = htmlentities($data['f_instruments'], ENT_QUOTES); $data['f_comp_year'] = htmlentities($data['f_comp_year'], ENT_QUOTES); $data['f_premiere'] = htmlentities($data['f_premiere'], ENT_QUOTES); $data['f_performers'] = htmlentities($data['f_performers'], ENT_QUOTES); $data['f_place'] = htmlentities($data['f_place'], ENT_QUOTES); $data['f_address'] = htmlentities($data['f_address'], ENT_QUOTES); $data['f_city'] = htmlentities($data['f_city'], ENT_QUOTES); $data['f_state'] = htmlentities($data['f_state'], ENT_QUOTES); $data['f_zip'] = htmlentities($data['f_zip'], ENT_QUOTES); $data['f_country'] = htmlentities($data['f_country'], ENT_QUOTES); $data['f_URL'] = htmlentities($data['f_URL'], ENT_QUOTES); $data['f_phone'] = htmlentities($data['f_phone'], ENT_QUOTES); $data['f_other'] = htmlentities($data['f_other'], ENT_QUOTES); return $data; } function utf8_encoder ($data) { $data['f_title'] = utf8_encode($data['f_title']); $data['f_instruments'] = utf8_encode($data['f_instruments']); $data['f_comp_year'] = utf8_encode($data['f_comp_year']); $data['f_premiere'] = utf8_encode($data['f_premiere']); $data['f_performers'] = utf8_encode($data['f_performers']); $data['f_place'] = utf8_encode($data['f_place']); $data['f_address'] = utf8_encode($data['f_address']); $data['f_city'] = utf8_encode($data['f_city']); $data['f_state'] = utf8_encode($data['f_state']); $data['f_zip'] = utf8_encode($data['f_zip']); $data['f_URL'] = urlencode($data['f_URL']); $data['f_phone'] = utf8_encode($data['f_phone']); $data['f_other'] = utf8_encode($data['f_other']); return $data; } function utf8_decoder ($data) { $data['f_title'] = utf8_decode($data['f_title']); $data['f_instruments'] = utf8_decode($data['f_instruments']); $data['f_comp_year'] = utf8_decode($data['f_comp_year']); $data['f_premiere'] = utf8_decode($data['f_premiere']); $data['f_performers'] = utf8_decode($data['f_performers']); $data['f_place'] = utf8_decode($data['f_place']); $data['f_address'] = utf8_decode($data['f_address']); $data['f_city'] = utf8_decode($data['f_city']); $data['f_state'] = utf8_decode($data['f_state']); $data['f_zip'] = utf8_decode($data['f_zip']); $data['f_URL'] = urldecode($data['f_URL']); $data['f_phone'] = utf8_decode($data['f_phone']); $data['f_other'] = utf8_decode($data['f_other']); return $data; } function slash_encoder ($data) { $data['f_title'] = addslashes($data['f_title']); $data['f_instruments'] = addslashes($data['f_instruments']); $data['f_comp_year'] = addslashes($data['f_comp_year']); $data['f_premiere'] = addslashes($data['f_premiere']); $data['f_performers'] = addslashes($data['f_performers']); $data['f_place'] = addslashes($data['f_place']); $data['f_address'] = addslashes($data['f_address']); $data['f_city'] = addslashes($data['f_city']); $data['f_state'] = addslashes($data['f_state']); $data['f_zip'] = addslashes($data['f_zip']); // $data['f_URL'] = urlencode($data['f_URL']); $data['f_phone'] = addslashes($data['f_phone']); $data['f_other'] = addslashes($data['f_other']); //echo "REQUEST: ",$data['f_title'], "

"; return $data; } function insert_event ($db, $R) { $R = slash_encoder ($R); $R = utf8_encoder ($R); $query = "insert into event ("; $query.= "title, "; $query.= "instrumentation, "; $query.= "year, "; $query.= "premiere, "; $query.= "performers, "; $query.= "dates, "; $query.= "place, "; $query.= "address, "; $query.= "city, "; $query.= "state, "; $query.= "country, "; $query.= "zip_code, "; $query.= "directions, "; $query.= "phone, "; $query.= "other "; $query.= ") values ("; $query.= $R['f_title']==""? "null,": "'".$R['f_title']."',"; $query.= $R['f_instruments']==""?"null,":"'".$R['f_instruments']."',"; $query.= $R['f_comp_year']==""? "null,":$R['f_comp_year'].","; $query.= $R['f_premiere']==""? "null,":"'".$R['f_premiere']."',"; $query.= $R['f_performers']==""? "null,":"'".$R['f_performers']."',"; $query.= $R['f_day']&&$R['f_month']&&$R['f_year']? sprintf ("'%04d-%02d-%02d',",$R['f_year'],$R['f_month'],$R['f_day']):"'0000-00-00',"; $query.= $R['f_place']==""? "null,":"'".$R['f_place']."',"; $query.= $R['f_address']==""? "null,":"'".$R['f_address']."',"; $query.= $R['f_city']==""? "null,":"'".$R['f_city']."',"; $query.= $R['f_state']==""? "null,":"'".$R['f_state']."',"; $query.= $R['f_country']==""? "null,":"'".$R['f_country']."',"; $query.= $R['f_zip']==""? "null,":"'".$R['f_zip']."',"; $query.= $R['f_URL']==""? "null,":"'".$R['f_URL']."',"; $query.= $R['f_phone']==""? "null,":"'".$R['f_phone']."',"; $query.= $R['f_other']==""? "null)":"'".$R['f_other']."')"; if ($resultado = mysql_query ($query, $db)) { echo "\n"; } else { echo ''; echo "Insert Failure for: ", $R['f_title'], ', ', $R['f_instruments'], ', ', $R['f_comp_year'],', ', $R['f_performers'],mysql_errno ().' '.mysql_error ().'
'; //echo "QUERY = $query

"; echo '
'; } } function update_event ($db, $R) { $R = html_decoder ($R); $R = slash_encoder ($R); // echo "SLASH: ",$R['f_title'],"
"; $R = utf8_encoder ($R); // echo "UTF8: ",$R['f_title'],"
"; $query = "update event set "; $query.= "title = "; $query.= $R['f_title']==""? "null,": "'".$R['f_title']."',"; $query.= "instrumentation = "; $query.= $R['f_instruments']==""?"null,":"'".$R['f_instruments']."',"; $query.= "year = "; $query.= $R['f_comp_year']==""? "null,":$R['f_comp_year'].","; $query.= "premiere = "; $query.= $R['f_premiere']==""? "null,":"'".$R['f_premiere']."',"; $query.= "performers = "; $query.= $R['f_performers']==""? "null,":"'".$R['f_performers']."',"; $query.= "dates = "; $query.= $R['f_day']&&$R['f_month']&&$R['f_year']? sprintf ("'%04d-%02d-%02d',",$R['f_year'],$R['f_month'],$R['f_day']):"'0000--00-00',"; $query.= "place = "; $query.= $R['f_place']==""? "null,":"'".$R['f_place']."',"; $query.= "address = "; $query.= $R['f_address']==""? "null,":"'".$R['f_address']."',"; $query.= "city = "; $query.= $R['f_city']==""? "null,":"'".$R['f_city']."',"; $query.= "state = "; $query.= $R['f_state']==""? "null,":"'".$R['f_state']."',"; $query.= "country = "; $query.= $R['f_country']==""? "null,":"'".$R['f_country']."',"; $query.= "zip_code = "; $query.= $R['f_zip']==""? "null,":"'".$R['f_zip']."',"; $query.= "directions = "; $query.= $R['f_URL']==""? "null,":"'".$R['f_URL']."',"; $query.= "phone = "; $query.= $R['f_phone']==""? "null,":"'".$R['f_phone']."',"; $query.= "other = "; $query.= $R['f_other']==""? "null ":"'".$R['f_other']."' "; $query.= "where event_id = ".$R['f_id']; //echo "QUERY of update: $query
"; if ($resultado = mysql_query ($query, $db)) { echo ""; } else { echo ''; echo "Update Failure: {$R['f_title']}, {$R['f_instruments']}, {$R['f_comp_year']}, {$R['f_performers']}, ", mysql_errno ().' - '.mysql_error ().'
'; echo '
'; echo ''; } } // ------------------- HERE IT MAKES THE EVENTS DISPLAY ------------------- function make_div ($db_ptr, $sign, $visible, $div_name, $country_name) { $status = array("N"=>"None","L"=>"Local Premiere","M"=>"Mundial Premiere"); $A = read_events ($db_ptr, 0, $sign); $size = sizeof($A); if ($size > 0) { printf ("

\n"); printf (" \n"); printf (" \n"); printf (" %s Events\n", ucwords ($div_name)); printf (" \n"); if ($div_name == "Past") { printf (" \n"); printf (" turn on\n"); printf (" \n"); printf (" \n"); } printf (" \n"); printf ("


\n"); printf ("
\n", $div_name, $visible); $i=0; while ($i < $size) { $R = utf8_decoder($A[$i]); //$R = $A[$i]; //echo "

"; echo "

"; // style='mso-bidi-font-weight:normal; font-family:Arial echo "
\n"; printf("
\n", $R["f_id"]); printf(" \n", $R["f_id"]); printf(" \n", $R["f_id"]); echo " Delete event\n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; printf(" \n",$R["f_id"]); echo " Update event\n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " \n"; echo $R['f_title']; echo strlen($R['f_instruments'])? " for ".$R['f_instruments']."\n" : "","
"; echo $R['f_comp_year']? "(".$R['f_comp_year'].")
\n" : ""; // echo strlen($R['f_performers'])? str_replace(chr(13).chr(10),"
",$R['f_performers'])."
\n":""; echo strlen($R['f_performers'])? nl2br($R['f_performers'])."
\n":""; echo $R['f_premiere']!="N"&&$R['f_premiere']!=""? $status[($R['f_premiere'])]. "
\n": ""; echo strlen($R['f_place'])? $R['f_place']."
\n" : ""; echo strlen($R['f_address'])? nl2br($R['f_address'])."
\n" : ""; echo strlen($R['f_city'])? $R['f_city']."\n" : ""; echo strlen($R['f_city'])&&strlen($R['f_state'])? ", ".$R['f_state']."\n" : strlen($R['f_state'])? $R['f_state']."\n" : ""; echo strlen($R['f_zip'])? ", ".$R['f_zip']."\n" : ""; echo strlen($R['f_city'])||strlen($R['f_state'])||strlen($R['f_zip'])? "
\n" : ""; echo strlen($R['f_country_name'])? $R['f_country_name']."
\n" : ""; echo strlen($R['f_URL'])? "".$R['f_URL']."
\n" : ""; echo strlen($R['f_phone'])? $R['f_phone']."
\n" : ""; if ($R['f_dates']) echo $R['f_dates'], "
\n"; else echo "dates to be disclosed
\n"; echo strlen($R['f_other'])? $R['f_other']."
\n" : ""; echo "
\n"; echo "


\n"; $i++; } printf ("
\n"); } else { echo "No data for ", ucwords ($div_name), " Events

"; //%s, } } // ---------------- ROUTINE TO RECOVER COUNTRIES' NAMES -------------------- function get_countries ($db) { $query = "SELECT country_code, country_name FROM country ORDER BY country_name;"; $result = @mysql_query ($query, $db); if ($rows = @mysql_num_rows ($result)) { while ($row = @mysql_fetch_object ($result)) { $code = $row->country_code; $name = $row->country_name; $country_name[$code] = $name; } } return $country_name; } //------------------THE FORM TO ENTER NEW EVENT OR CHANGE ONE ----------------- function print_form($db, $id) { $month_name = array("0"=>"","1"=>"January","2"=>"February","3"=>"March","4"=>"April", "5"=>"May", "6"=>"Jun","7"=>"July","8"=>"August","9"=>"September","10"=>"October", "11"=>"November","12"=>"December"); $days_of_month = array(0,31,28,31,30,31,30,31,31,30,31,30,31); $days = array("","1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th","17th","18th","19th","20th","21st","22nd","23rd","24th","25th","26th","27th","28th","29th","30th","31st"); $sel = "selected='selected'"; $A = read_events ($db, $id, ""); $R = $A[0]; $R = utf8_decoder($R); $R = html_encoder($R); ?>
Event
Please insert an event title (mandatory) and any other relevant fields (optional).
Title of work:
Instrumentation (will appear preceded by "for"):
Year of Creation:
Status of work:
Performers (type Enter for new line):
Date (Select Month, Day and Year):         (Leap day only in leap year)
Venue:
Address (type Enter for new line):
City:  
State:
ZIP Code:
Country:
URL or Directions:
Phone:
Time and/or any other details:   
     
Dana Richardson ..
dana

dana richardson
Upcoming events

strip-end
strip
"; $db_ptr = @mysql_connect ("localhost",USER,PASS); //"root",""); // if(!$db_ptr){ echo "ERROR","Database is not available",'Exit',"FInish"; } else { //echo "


ME CONECTE!!!!!!!!!!!!

"; if (mysql_select_db (DATABASE, $db_ptr)) { $country_name = get_countries ($db_ptr); // Here the form comes to life weather a new or old record is requested to be printed if (isset($_REQUEST['update_data']) && $_REQUEST['update_data'] == -666) { $_SESSION['ses_auto'] = 0; } else if (isset($_REQUEST['update_data']) && $_REQUEST['update_data'] !== null) { print_form($db_ptr, $_REQUEST['update_data']); return; // if } else if (isset($_REQUEST)) { /* foreach ($_REQUEST as $code => $value){ echo "
ANTES : $value
"; $_REQUEST[$code] = htmlspecialchars ($value, ENT_QUOTES); echo "

DESPUES : "; print_r ($_REQUEST[$code]); echo "

"; } */ } print_headers(); if ((isset($_REQUEST["usercode"]) && $_REQUEST["usercode"] == USER && isset($_REQUEST["passMD5"]) && $_REQUEST["passMD5"] == ENC_PASS) || (isset($_SESSION['ses_auto']) && $_SESSION['ses_auto'] == 1)) { $_SESSION['ses_auto'] = 1; if (isset($_REQUEST['del_data'])) { delete_event ($db_ptr, $_REQUEST["del_data"]); } if (isset($_REQUEST['f_id']) && $_REQUEST['f_id']==0) { //echo "ENTER NEW DATA
"; insert_event ($db_ptr, $_REQUEST); } else if (isset($_REQUEST['f_id']) && $_REQUEST['f_id']!=0) { //echo "ENTER OLD DATA
"; update_event ($db_ptr, $_REQUEST); } //else // echo "NOR UPDATE NOR INPUT

\n"; } else if (isset($_REQUEST["usercode"])) { $_SESSION['ses_auto'] = 0; echo ''; } else if (!isset($_SESSION['ses_auto'])) $_SESSION['ses_auto'] = 0; make_div ($db_ptr, "<", "none", "Past", $country_name); make_div ($db_ptr, ">=", "block", "Upcoming", $country_name); } } ?>

 

html by aria artists

Form

Exit
Quilt