アットウィキロゴ

syuusei 14

<?php
require("calldata.php");

$p = 0.01;
$g = 0.025;  
$r=  0.041;


$sql = "SELECT * FROM eli10";
$result = mysql_query($sql, $link);
$n=1;
while( $row = mysql_fetch_row( $result ) ){
$matrix[$n][1] = $row[0];
$matrix[$n][2]  =$row[1];
$matrix[$n][3]  =$row[2];  
$matrix[$n][4]  =$row[3];  
$n=$n+1;
}
$maxn=$n;
for ($n=1;$n<$maxn;$n++){
$year=$matrix[$n][1];
$age=$matrix[$n][2];
$m2[$year][$age]=$matrix[$n][3];
$f2[$year][$age]=$matrix[$n][4];
}

$sql = "SELECT * FROM data14";
$result = mysql_query($sql, $link);
$n=1;
while( $row = mysql_fetch_row( $result ) ){
$matrix[$n][1] = $row[0];
$matrix[$n][2]  =$row[1];
$matrix[$n][3]  =$row[2];    
$n=$n+1;
}
$maxn=$n;
for ($n=1;$n<$maxn;$n++){
$age=$matrix[$n][1];
$mw[$age]=$matrix[$n][2];
$fw[$age]=$matrix[$n][3];
}

$sql = "SELECT * FROM eli57";
$result = mysql_query($sql, $link);
$n=1;
while( $row = mysql_fetch_row( $result ) ){
$matrix[$n][1] = $row[0];
$matrix[$n][2]  =$row[1];  
$n=$n+1;
}
$maxn=$n;
for ($n=1;$n<$maxn;$n++){
$year=$matrix[$n][1];
$rate[$year]=$matrix[$n][2];
}

for ($age=15; $age <70; $age++) {
$mwage[10][$age]=$mw[$age];
$fwage[10][$age]=$fw[$age];
}

for ($year=11; $year<100;$year++) {
for ($age=15; $age <70; $age++) {
$mwage[$year][$age]=(1+$g)*$mwage[$year-1][$age];
$fwage[$year][$age]=(1+$g)*$fwage[$year-1][$age];
}
}

for ($year=10; $year<100;$year++) {
$re=0;
for ($age=15; $age <70; $age++) {
$re=$re+320*$mwage[$year][$age]*$m2[$year][$age];
$re=$re+280*$fwage[$year][$age]*$f2[$year][$age];
}
$rev[$year]=0.01*$rate[$year]*$re/10000;  
}

$sql = "truncate eli14";
$exe= mysql_query($sql,$link);

for ($year=10;$year<100;$year++){
$x=$rev[$year];
$sql = "insert into eli14 values($year,$x)";
$exe= mysql_query($sql,$link);
}
$close_flag = mysql_close($link);
print("14 支払保険料 計算終了");
?>
最終更新:2011年01月28日 10:15