<?php // Controllo accesso
session_start();
if (!isset($_SESSION['utente'])){
header('location:index.php?errore=non_autenticato');
exit;}
$utente=$_SESSION['utente'];
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Rimorchi</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" media="all" href="skins/aqua/theme.css" title="Aqua" />
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="calendar-it.js"></script>
<style type="text/css">
<!--
.Stile13 {font-size: 24px}
.Stile14{
font-size: 21px;
color:#000000;
}
.Stile15{
font-size: 21px;
color:#FF0000;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
body {
background-color: #666666;
background-image: url();
}
.Stile20 {font-size: 21px; color: #999999; font-family: Verdana, Arial, Helvetica, sans-serif; }
.Stile19 {font-size: 21px;
color: #666666;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
.Stile21 {color: #FFFFFF}
.Stile22 {
font-size: 24px;
color: #FF0000;
}
-->
</style>
<script type="text/javascript">
/////CALENDARIO/////
var oldLink = null;
function setActiveStyleSheet(link, title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
if (oldLink) oldLink.style.fontWeight = 'normal';
oldLink = link;
link.style.fontWeight = 'bold';
return false;
}
// This function gets called when the end-user clicks on some date.
function selected(cal, date) {
cal.sel.value = date; // just update the date in the input field.
if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
cal.callCloseHandler();
}
function closeHandler(cal) {
cal.hide(); // hide the calendar
// cal.destroy();
_dynarch_popupCalendar = null;
}
function showCalendar(id, format, showsTime, showsOtherMonths) {
var el = document.getElementById(id);
if (_dynarch_popupCalendar != null) {
// we already have some calendar created
_dynarch_popupCalendar.hide(); // so we hide it first.
} else {
// first-time call, create the calendar.
var cal = new Calendar(1, null, selected, closeHandler);
// uncomment the following line to hide the week numbers
// cal.weekNumbers = false;
if (typeof showsTime == "string") {
cal.showsTime = true;
cal.time24 = (showsTime == "24");
}
if (showsOtherMonths) {
cal.showsOtherMonths = true;
}
_dynarch_popupCalendar = cal; // remember it in the global var
cal.setRange(1900, 2070); // min/max year allowed.
cal.create();
}
_dynarch_popupCalendar.setDateFormat(format); // set the specified date format
_dynarch_popupCalendar.parseDate(el.value); // try to parse the text in field
_dynarch_popupCalendar.sel = el; // inform it what input field we use
_dynarch_popupCalendar.showAtElement(el.nextSibling, "Br"); // show the calendar
return false;
}
var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;
function isDisabled(date) {
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}
function flatSelected(cal, date) {
var el = document.getElementById("preview");
el.innerHTML = date;
}
function showFlatCalendar() {
var parent = document.getElementById("display");
var cal = new Calendar(0, null, flatSelected);
cal.weekNumbers = false;
cal.setDisabledHandler(isDisabled);
cal.setDateFormat("%A, %B %e");
cal.create(parent);
cal.show();
}
/////CALENDARIO/////
function controlla(){
var data_inizio = document.getElementById('data_inizio');
var data_fine = document.getElementById('data_fine');
if(data_inizio.value == ""){
alert("CAMPO DATA INIZIALE NON COMPILATO")
return false;
}
else if (data_fine.value == "")
{
alert("CAMPO DATA FINALE NON COMPILATO")
return false;
}
return true;
}
</script>
</head>
<body>
<?php
////////INIZIO database////////
require("connessione_database.php");
////////FINE database////////
$dataatt = date("dmY", time());
$data_inizio_mese = strftime ("%d%m%Y",mktime (0,0,0,date(substr($dataatt,2,2))-1,1,date(substr($dataatt,4,4))));
$data_fine_mese = strftime ("%d%m%Y",mktime (23,59,59,date(substr($dataatt,2,2)),0,date(substr($dataatt,4,4))));
?>
<table width="1000" border="0" align="center" style="background-repeat:no-repeat">
<tr>
<td height="82" colspan="4"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"><span class="Stile20">DA FATTURARE </span></td>
<td colspan="2" align="right" valign="top"><span class="Stile19"><?php echo "$utente";//codice utente?></span></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td width="243" height="52" align="center" valign="top"><form name="indietro" method="post" action="fatture.php">
<input type="image" name="indietro" class="Stile14" value="INDIETRO" src="imm/bottone_indietro_0.gif" onmouseout="this.src='imm/bottone_indietro_0.gif'" onmouseover="this.src='imm/bottone_indietro_1.gif'" onMouseDown="this.src='imm/bottone_indietro_2.gif'">
</form></td>
<td width="243" height="52" align="left" valign="top"><form name="indietro" method="post" action="menu.php">
<input type="image" name="menu" class="Stile14" value="MENU" src="imm/bottone_menu_0.gif" onMouseOut="this.src='imm/bottone_menu_0.gif'" onMouseOver="this.src='imm/bottone_menu_1.gif'" onMouseDown="this.src='imm/bottone_menu_2.gif'">
</form></td>
<td width="250"> </td>
<td width="246"> </td>
</tr>
<tr>
<td height="66" colspan="2"><form name="form1" method="post" onSubmit="return controlla()" action="fatturare1.php">
<table width="447" border="0">
<tr>
<td colspan="2" class="Stile20">PERIODO DA FATTURARE</td>
</tr>
<tr>
<td width="70" class="Stile20">DAL</td>
<td width="367"><input id="data_inizio" type="text" name="data_inizio" class="Stile13" value="<?php echo $data_inizio_mese;?>"><input type="reset" class="Stile14" value="..." onClick="return showCalendar('data_inizio', '%d%m%Y');"></td>
</tr>
<tr>
<td class="Stile20">AL </td>
<td><input id="data_fine" name="data_fine" type="text" class="Stile13" value="<?php echo $data_fine_mese;?>"><input type="reset" class="Stile14" value="..." onClick="return showCalendar('data_fine', '%d%m%Y');"></td>
</tr>
<tr>
<td> </td>
<td><input type="image" name="ok" class="Stile14" value="OK" src="imm/bottone_ok_0.gif" onmouseout="this.src='imm/bottone_ok_0.gif'" onmouseover="this.src='imm/bottone_ok_1.gif'" onMouseDown="this.src='imm/bottone_ok_2.gif'"></td>
</tr>
</table>
</form></td>
<td height="66" colspan="2"> </td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
</body>
</html>
<?php //mysql_free_result($risultato); ?>