|
calendar - syntax error
PHP Code:
<?php
my.calender <month> <year> [color="Red"][/color] This where the problem is. Parse error: syntax error, unexpected '>' in /home/ogl10b7/public_html/EricsCarRepairs/bookings.php on line 134 - need some help.
//This Command Will Display Calender for Requested month from year 1 AD onwards.
//Try Its Your Self ..... Comment/Support/Question: [email]mindforce83@yahoo.com[/email] - BiskutMeri - Mascovy - © 2004
//Full credit to Mascovy. Modified 2005 by splatted
alias my.calender {
//Change / edit this script if you like.... :)
//Checking Validation input
var %month = January Febuary March April May June July August September October November December , %mont = $1
if ($1 isalpha) var %mont = $findtok(%month,$1,32)
if ($2 < 1) { echo 12*** Year Must Be From 1 AD Onwards | halt }
if ($2 !isnum) || (!%mont) || (%mont > 12) { echo 12*** Invalid Input:/my.calender Month Years | halt }
//Create Active Window
var %win = $+(@,Calender,$chr(160),$gettok(%month,%mont,32),$chr(160),$2)
if (!$window(%win)) window -aBkpRd +elz %win 150 150 180 180
//Creating Template
var %sday = Mon Tue Wed Thu Fri Sat Sun ,%tnum = 0 , %cmap = 30 , %xgb = 14009920 12886011 12441728 16051111 14995685 13558433 11389371
while (%tnum < $numtok(%sday,32)) { inc %tnum | drawrect -fr %win $gettok(%xgb,%tnum,32) 5 1 %cmap 170 15 | drawtext -o %win 12 "Times New Roman" 12 5 %cmap $gettok(%sday,%tnum,32) | inc %cmap 15 }
drawtext -o %win 6 "Comic Sans Ms" 12 25 5 $+([,$gettok(%month,%mont,32) $2,]) | drawtext %win 1 "Comic Sans Ms" 10 80 140 $decode(LU1hc2NvdnktrjIwMDQ=,m)
//Calculation
var %dayz = 31 28 31 30 31 30 31 31 30 31 30 31, %loop = 1
var %x = $int($calc($calc($2 - 1) / 4)), %y = $calc($calc(%x * 366) + $calc($calc($2 - 1 - %x) * 365))
while (%loop != %mont) { inc %y $gettok(%dayz,%loop,32) | inc %loop }
if (%mont > 2) && (4 // $2) { inc %y 1 }
var %z = $calc($int($calc(%y / 7)) * 7)
var %a = $calc(%y - %z - 1 )
while (%a >= 7) { dec %a 7 }
while (%a <= -1) { inc %a 7 }
var %lajur = 45, %setting = 30 45 60 75 90 105 120, %day = Mon Tue Wed Thu Fri Sat Sun, %min = 1, %p = $gettok(%dayz,%mont,32)
if (%mont = 2) && (4 // $2) { %p = 29 }
while (%min <= %p) {
var %code = $gettok(%day,$calc(%min + %a),32)
if $istok(%day,%code,32) { drawtext -o %win 1 "Times New Roman" 12 %lajur $gettok(%setting,$findtok(%day,%code,32),32) $iif(%min < 10,$+(0,%min),%min) }
;Change To New Vertical Position
if (%code == sun) { inc %lajur 20 | dec %a 7 }
inc %min
}
}
menu @calender* {
&Save:{ var %mfiles = $sfile($logdir,Select Filename,&Save) | if (%mfiles) { drawsave -q100 $active $iif(!$numtok(%mfiles,46) == 0,$+(",%mfiles,.jpg"),$+(",%mfiles,")) | echo 12*** File Save $iif(!$numtok(%mfiles,46) == 0,$+(",%mfiles,.jpg"),$+(",%mfiles,")) } }
}
menu status,menubar,channel,query {
-
&My Calender:my.calender $input(In order to view the calender please state Month And Year $crlf $str($chr(160),5) Example. October 2004 $str($chr(160),5) or $str($chr(160),5) 10 2004,ieo,Require Month And Year)
}
?>
Thanx Ian
PS does anyone know where I can get a script for a graph that displays interactive data. I mean someone can enter data in boxes then it goes to a MySQL database, and puts the result into the graph???? I have looked at applets but seem complicated..
Last edited by LuciWiz : 29-Apr-2008 at 08:31.
Reason: Please insert your Php code between [php] & [/php] tags
|