Sento values from calendar to another calendar - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Sento values from calendar to another calendar

thaypanthaypan Posts: 3Member
Hello everybody, I would make sure that the numeric values ??included in the file "index.php" will be sent to "report.php" and then can not be changed.


Thanks



index.php

[code]
function somma_valori(form) {
var elementi = form.elements.length;
var somma = 0;
for(var i = 0; i < elementi; i++){
if(form.elements[i].name != "invia") {
var valore = parseInt(form.elements[i].value);
if(isNaN(valore))
valore = 0;
somma = somma + valore;
}
}
document.getElementById('somma').innerHTML = somma
}


table{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
background-color:#F1F1F1;
}
.dom{
background-color:#FF6600;
}
.sab{
background-color: #FFFFCC;
}
.oggi{
border-width:2px;
border-color: #009900;
border-style:solid;
font-weight:bold;
}
.me{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-weight:bold;
}

<?php
$month = date('m');
$year = date('Y');
$oggi = date("d") + 0;
$giorni_settimana = array(1, "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom");
$mese = array('Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre');
$time_primo_del_mese = mktime(0, 0, 0, $month, 1, $year);
$primo_del_mese = date('w', $time_primo_del_mese);
$giorni_nel_mese = cal_days_in_month(CAL_GREGORIAN, $month, $year);
echo "<span class="me">" . $mese[($month - 1)] . "";


echo "";
echo "";
echo "";
$g = $primo_del_mese;
for ($i = 1; $i <= $giorni_nel_mese; $i++) {
$classe = "";
if ($giorni_settimana[$g] == "Dom") {
$classe = " class="dom"";
} elseif ($giorni_settimana[$g] == "Sab") {
$classe = " class="sab"";
}
echo "<td $classe>" . $giorni_settimana[$g] . "";
if ($g == 7) {
$g = 1;
} else {
$g++;
}
}
echo "";
echo "";
for ($i = 1; $i <= $giorni_nel_mese; $i++) {
$classe = "";
if ($i == $oggi) {
$classe = " class="oggi"";
}
echo "<td $classe>$i";
}
echo "";
echo "";
for ($i = 1; $i <= $giorni_nel_mese; $i++) {
echo "<td>
";
}
echo "";
echo "";
echo "";
echo "";
echo "";
echo "
";
echo "Totale : 0  ";
echo " ";
echo "
";
?>[/code]

reports.php


[code]<?php

$month = date('m');
$year = date('Y');

$giorni_settimana = array(1, "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom");

$time_primo_del_mese = mktime(0, 0, 0, $month, 1, $year);
$primo_del_mese = date('w', $time_primo_del_mese);

$giorni_nel_mese = cal_days_in_month(CAL_GREGORIAN, $month, $year);

echo "<table border='1'>";
echo "";
$g = $primo_del_mese;
for ($i = 1; $i <= $giorni_nel_mese; $i++) {
echo "<td>" . $giorni_settimana[$g] . "";
if ($g == 7) {
$g = 1;
} else {
$g++;
}
}
echo "";
echo "";
for ($i = 1; $i <= $giorni_nel_mese; $i++) {
echo "<td>$i";
}
echo "";
echo "";

unset($_POST['invia']);
foreach ($_POST as $key => $value) {
(int) $value;

if ($value != 0) {
echo $key . "->" . $value . "
";
}
}
?>[/code]
Sign In or Register to comment.