アットウィキロゴ

php66

<?php
require("calldata.php");
$sql = "SELECT * FROM eli38";
$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];
$mj[$year][$age] = $matrix[$n][3];
$fj[$year][$age] = $matrix[$n][4];
}

$sql = "SELECT * FROM eli35";
$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++) {
$byear =$matrix[$n][1];  
$mtime[$byear] = $matrix[$n][2];
$ftime[$byear] = $matrix[$n][3];
}

$sql = "SELECT * FROM eli59";
$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++) {
$byear =$matrix[$n][1];  
$age =$matrix[$n][2];  
$pslide[$byear][$age] = $matrix[$n][3];  
}

for ($year=10;$year<100;$year++){
for ($age=65;$age<100;$age++){
$byear=$year-$age+2000;
$e1=0;
$e1 =$e1+$pslide[$byear][$age]*80*$mtime[$byear]*$mj[$year][$age]/40;  
$e1 =$e1+$pslide[$byear][$age]*80*$ftime[$byear]*$fj[$year][$age]/40;  
$rou[$year][$age]=$e1/10000;
}
}

$sql = "truncate eli66";
$exe= mysql_query($sql,$link);
for ($year=10;$year<100;$year++){
for ($age=65;$age<100;$age++){
$x=$rou[$year][$age];
$sql = "insert into eli66 values($year,$age,$x)";
$exe= mysql_query($sql,$link);
}
}
$close_flag = mysql_close($link);
print("66 世代老齢基礎年金 計算終了");
?>
最終更新:2010年09月01日 04:20