$i:00"; else $timecombo1.=""; if($i==12) $timecombo2.=""; else $timecombo2.=""; } if($transkind2==2) include("calc_ustne.html"); else include("calc_pisemne.html"); include("footer.asp"); break; case "makecalc_pisemne": $this->make_calc_pisemne(); break; case "makecalc_ustne": $this->make_calc_ustne(); break; default: include("top.asp"); include("calc.html"); include("footer.asp"); break; } } ## ## function make_calc_ustne() { global $_GET,$_POST; global $cost_array; $pid=$_GET['pid']; $transkind2=2; extract($_POST); $total_cost=0; $starttime=$_POST['starttime']; $endtime=$_POST['endtime']; $rate[1]=0; $rate[2]=0; $rate[3]=0; for($i=$starttime;$i<$endtime;$i++) { if($i>=7 && $i<16) $rate[1]++; if($i>=16 && $i<20) $rate[2]++; if( ( $i>=20 && $i < 24 ) || ($i >= 1 && $i<7)) $rate[3]++; } $hour_cost=0; $hour_cost+=$cost_array[$transkind2][1] * $rate[1]; $hour_cost+=$cost_array[$transkind2][2] * $rate[2]; $hour_cost+=$cost_array[$transkind2][3] * $rate[3]; if($languagefrom > 0 && $languageto > 0) { $hour_cost=$hour_cost * 2; } $total_cost_nett=$hour_cost ; $total_cost_gross=$total_cost_nett * 1.22; $total_cost_nett=number_format($total_cost_nett, 2, ',', ' '); $total_cost_gross=number_format($total_cost_gross, 2, ',', ' '); echo "Kalkulacja: Netto ".$total_cost_nett." zl Brutto ".$total_cost_gross." zl"; } ## ## function make_calc_pisemne() { global $_GET,$_POST; global $cost_array; $pid=$_GET['pid']; extract($_POST); $total_cost=0; $transkind2=1; if($languagefrom > 0 && $languageto > 0) { $hour_cost=$cost_array[$transkind2][$transkind][$languagefrom][$transtime]; $hour_cost+=$cost_array[$transkind2][$transkind][$languageto][$transtime]; } else if($languagefrom > 0 ) $hour_cost=$cost_array[$transkind2][$transkind][$languagefrom][$transtime]; else $hour_cost=$cost_array[$transkind2][$transkind][$languageto][$transtime]; //echo $total_cost="##".$pagesnum."%".$transkind2."%".$transkind."%".$languageto."%".$languagefrom; $total_cost_nett=$hour_cost * $pagesnum; $total_cost_gross=$total_cost_nett * 1.22; $total_cost_nett=number_format($total_cost_nett, 2, ',', ' '); $total_cost_gross=number_format($total_cost_gross, 2, ',', ' '); echo "Kalkulacja: Netto ".$total_cost_nett." zl Brutto ".$total_cost_gross." zl"; } } $page = new SystemSite(); $page->show_page(); ?>