diff --git a/cal.php b/cal.php index ae59cb7aa..7ee5f8508 100644 --- a/cal.php +++ b/cal.php @@ -168,8 +168,6 @@ CREATE TABLE phpcal ( } function draw_cal($y,$m) { - global $a, $err; - global $ap, $aerr; global $ev, $cm, $cy; $months = months(); @@ -193,9 +191,9 @@ CREATE TABLE phpcal ( +
+ -
@@ -219,7 +217,7 @@ CREATE TABLE phpcal ( $data = ''; foreach($events[$day] as $row) { if($data) $data .= "
\n"; - $data .= "".$row['sdesc'].''; + $data .= "".$row['sdesc'].''; } } } @@ -234,15 +232,7 @@ CREATE TABLE phpcal ( ?>
->.(($a)? add event'; -else echo "$err"; -echo "\n"; -if($a) draw_add();?> - ->.(($ap)? approve events' . " ($c event(s) pending)"; -else echo "$aerr"; -if($ap) draw_app(); +\n"; } @@ -305,211 +295,6 @@ if(strlen($event['url'])) { - -
- - -\n"; - $i++; - } - echo ""; - } - -?> -
 WhenLabelDescriptionCountryURL
$e[1]$e[2]".(ini_get('magic_quotes_gpc')?stripslashes($e[3]):$e[3])."$e[5]$e[4]
  CVS Login:  CVS Password:
- -
- - -
- - - - - - - - - - - - -
Start Date -> -"> - Just one day (no end-date required) -
End Date - -"> - Multi-day event -
OR
Recurring
- - - Recurring (every month) -
Short
Description
-
Country
Event Category
URL
Long
Description
- -
-$v) { - if(!$mq) $$k = addslashes($v); - elseif(!$rg) $$k = $v; - } - $ldesc = nl2br($ldesc); - if(empty($sdesc)) { - $err = "You must provide a short description for your event - please correct this
\n"; - $a = 1; - } else - if (!$country) { - $err = "You must specify a country - please correct this
\n"; - $a = 1; - } else - if (!$category){ - $err = "You must specifiy the event category - please correct this
\n"; - $a = 1; - } else - switch($type) { - case 'single': - if(!is_numeric($syear) || !is_numeric($smonth) || !is_numeric($sday)) { - $err = "Invalid start date - please correct it
\n"; - $a=1; - } else { - - mysql_query("insert into phpcal (id,sdato,edato,recur,sdesc,url,ldesc,tipo,approved,app_by,country,category) values (0,'$syear-$smonth-$sday',NULL,NULL,'$sdesc','$url','$ldesc',1,0,NULL,'$country','$category')") or $err=mysql_error(); - - } - break; - case 'multi': - $sd = mktime(NULL,NULL,NULL,$smonth,$sday,$syear); - $ed = mktime(NULL,NULL,59,$emonth,$eday,$eyear); - if(!is_numeric($syear) || !is_numeric($smonth) || !is_numeric($sday)) { - $err = "Invalid start date - please correct it
\n"; $a=1; - } elseif(!is_numeric($eyear) || !is_numeric($emonth) || !is_numeric($eday)) { - $err = "Invalid end date - please correct it
\n"; $a=1; - } elseif($sd>$ed) { - $err = "Your end date must be after your start date - please correct this
\n"; $a=1; - } elseif($smonth==$emonth && $sday==$eday && $syear==$eyear) { - $err = "Your start and end dates are identical - please correct this
\n"; $a=1; - } else { - - mysql_query("insert into phpcal (id,sdato,edato,recur,sdesc,url,ldesc,tipo,approved,app_by,country,category) values (0,'$syear-$smonth-$sday','$eyear-$emonth-$eday',NULL,'$sdesc','$url','$ldesc',2,0,NULL,'$country','$category')") or $err=mysql_error(); - - } - break; - case 'recur': - if(!is_numeric($recur) || !is_numeric($recur_day)) { - $err = "Recurring event sequence is invalid - please correct it
\n"; $a=1; - } else { - - mysql_query("insert into phpcal (id,sdato,edato,recur,sdesc,url,ldesc,tipo,approved,app_by,country,category) values (0,NULL,NULL,'$recur:$recur_day','$sdesc','$url','$ldesc',3,0,NULL,'$country','$category')") or $err=mysql_error(); - - } - break; - } - } - - if(isset($entries)) { - if (verify_password($user,$pw)) { - if(isset($HTTP_POST_VARS['Approve_Selected_x']) || isset($HTTP_POST_VARS['Approve_Selected']) || isset($HTTP_POST_VARS['Approve_Selected_y'])) { - foreach($entries as $entry=>$val) { - $result = mysql_query("update phpcal set approved=1, app_by='$user' where id=$entry"); - if(!$result) echo mysql_error(); - } - } - if(isset($HTTP_POST_VARS['Reject_Selected_x']) || isset($HTTP_POST_VARS['Reject_Selected']) || isset($HTTP_POST_VARS['Reject_Selected_y'])) { - foreach($entries as $entry=>$val) { - $result = mysql_query("delete from phpcal where id=$entry"); - if(!$result) echo mysql_error(); - } - } - - } else { - echo "

The username or password you supplied was incorrect.

\n"; - $ap = 1; - } - } - - if(!isset($a)) { - if(isset($HTTP_GET_VARS['a'])) $a = $HTTP_GET_VARS['a']; - else $a=0; - } - if (!isset($cm)) $cm = (int)strftime('%m'); if (!isset($cy)) $cy = (int)strftime('%Y'); if (!isset($cd)) $cd = (int)strftime('%d');