Salve a tutti, imparare da soli forse vuol dire imparare sbagliando?
Ho uno script in php scaricato dal web, un calendario, da solo funziona, volevo usarlo all'interno di una pagina che proviene dopo aver scelto Regione, provincia, ma in questa pagina vedo la regione, la provincia e lo sport preferiti. Fin qui tutto bene
ma il calendario, non lo vedo, eppure sicuramente funziona ( lo script da solo).
Sarà forse il posizionamento dello script all'interno di html?
Posto la parte di codice dove ho inserito lo script.
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title> PRENOTAZIONI ONLINE </title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="regioni.css" type="text/css" media="screen" />
<script src="jquery-1.3.js" type="text/javascript"></script>
<script src="regioni.js" type="text/javascript"></script>
<div id="latest-post">
<div id="container">
<center>
Regione Scelta :[b] <?PHP echo $regione;?>[/b]
Provincia : [b] <?PHP echo $provincia;?>[/b]
Selezione del campo : [b] <?PHP echo $sport;?>[/b]
</center>
<div id="colOne">
<?php
date_default_timezone_set("Europe/Helsinki");
include("calendar.class.php");
$calendar = new calendar();
if(isset($_GET['ajax_calendar']))
{
//and any other custom parameters added
//for this example it is parameter $_GET['param'] = "value"
//set start month and year which is an oldest motnh to show
# $calendar->set_start_date(1,2011);
//set end month and year which is a newest motnh to show
# $calendar->set_end_date(3,2099);
//set url pattern, for all active days to be used as links where $1 will be replaced by date, $2 replaces by month and $3 by year,
$calendar->set_url_pattern("javascript:alert('Date selected $3-$2-$1');");
//$arr = array(1 => "#beginning_of_a_month", 30 => "#end_of_a_month");
//$calendar->set_events($arr);
//if ajax request is made to the same page, make sure nothing other is outputted to browser
//you can specify request url in the file where you generate calendar
//if nothing is specified then request will be made to the same page
$calendar->process_request();
}
else
{
//defining path to jquery and style css included in package
echo '<script type="text/javascript" src="./jquery.js"></script>';
echo '<style type="text/css" media="all">@import "./style.css";</style>';
//array with custom month names
$months = array("Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic");
//applying custom month names
$calendar->set_months($months);
//array with custom days of week names
$weekdays = array( "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato" ,"Domenica");
//applying custom days of week names
$calendar->set_weekdays($weekdays);
//define with which day to start week 0 - lunedi, ..., 6 - Sabato
//here in example it is Tuesday
$calendar->set_week_start(0);
//adding request parameter name and value which will appear in ajax request
$calendar->add_request_param("param", "value");
//getting errors
$errors = $calendar->get_errors();
if(!empty($errors))
{
foreach($errors as $error)
{
echo "
".$error."</p>";
}
}
//generating calendar, you can specify date like in example
//if no date is specified, than todays date will be used
$calendar->generate_calendar();
}
?>
</div>
</div>
</div>
<div id="colTwo">
<div style="clear: both;"></div>
</div>
</body>
</html>