Viewing file: xml_asset_permanent__12222.php (4.21 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
';
//asset_permanent
$information .= "\n";
//asset_permanent
$information .= "\n";
$dsn_name = "asset";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//selece_database_asset
$sql = "SELECT TBase_budget.id as a, TBase.name, TBase.bye_year, TBase.pirce, TBase_budget.budgetyear ,TBase_budget.amount , TBase.TTypecate_id , TTypeCatagory.id FROM TBase, TBase_budget, TTypeCatagory WHERE (TBase.id = TBase_budget.id) and (TBase.TTypecate_id = TTypeCatagory.id) and ( (TBase.TTypecate_id = '100') or (TBase.TTypecate_id = '101') )and (TBase_budget.budgetyear = 2550)";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é $sql");
$i=1;
$num1=0;
while($row = odbc_fetch_array($execute))
{
$TBase_id=$row['a'];
$TBase_name=$row["name"];
$TBase_bye_year=$row["bye_year"];
$TBase_pirce=$row["pirce"];
$TBase_amont1=$row["amount"];
//$TBase_amont1=$row["budget2"];
//$TProject_budget3=$row["budget3"];
//$TProject_budget4=$row["budget4"];
//selece_database_TTypeProject
// $sql2 = "SELECT * FROM TTypeProject WHERE (id='$TProject_Type_id')";
// $execute2 = odbc_exec($connect, $sql2) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
// while($row2 = odbc_fetch_array($execute2))
// {
// $TTypeProject_id=$row2["id"];
// $TTypeProject_name=$row2["name"];
// }
//selece_database_TTypeProjectSub
// $sql3 = "SELECT * FROM TTypeProjectSub WHERE (id='$TProject_TypeSub_id')";
//$sql = "SELECT * FROM TProject";
// $execute3 = odbc_exec($connect, $sql3) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
// while($row3 = odbc_fetch_array($execute3))
// {
// $TTypeProjectSub_id=$row3["id"];
// $TTypeProjectSub_name=$row3["name"];
// }
$num1++;
$information .= "\n";
$information .= "\n";
$information .= "$TBase_id";
$information .= "\n";
$information .= "\n";
$information .= "$TBase_name";
$information .= "\n";
$information .= "\n";
$information .= "$TBase_bye_year";
$information .= "\n";
$information .= "\n";
$information .= "$TBase_pirce";
$information .= "\n";
$information .= "\n";
$information .= "$TBase_amount1";
$information .= "\n";
$information .= "\n";
//$TBase_amont1_sum=$TProject_budget2_sum+$TProject_budget2;
//$TProject_budget3_sum=$TProject_budget3_sum+$TProject_budget3;
//$TProject_budget4_sum=$TProject_budget4_sum+$TProject_budget4;
}
//end_selece_database_project
$information .= "\n";
//sum_Project_budget
$information .= "\n";
$information .= "$TBase_amount1_sum";
$information .= "\n";
$information .= "\n";
$information .= "$TBase_amount2_sum";
$information .= "\n";
$information .= "\n";
$information .= "$TBase_amount3_sum";
$information .= "\n";
$information .= "\n";
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//echo "$information";
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
echo " ";
echo "";
echo "No. | ";
echo "TBase_id | ";
echo "TBase_name | ";
echo "TBase_bye_year | ";
echo "TBase_pirce | ";
echo "TBase_amount1 | ";
echo "TBase.TTypecate_id | ";
echo " ";
$x=1;
$sum100 = "";
$sum101 = "";
$execute2 = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é $sql");
while($row2 = odbc_fetch_array($execute2))
{
$TBase_id=$row2['a'];
$TBase_name=$row2["name"];
$TBase_bye_year=$row2["bye_year"];
$TBase_pirce=$row2["pirce"];
$TBase_amont1=$row2["amount"];
$TTypecate_id=$row2["TTypecate_id"];
echo "";
echo "".$x." | ";
echo "".$TBase_id." | ";
echo "".$TBase_name." | ";
echo "".$TBase_bye_year." | ";
echo "".$TBase_pirce." | ";
echo "".$TBase_amont1." | ";
echo "".$TTypecate_id." | ";
echo " ";
$x++;
if ($TTypecate_id == '100') {
$sum100 = $sum100 + $TBase_amont1;
}
if ($TTypecate_id == '101') {
$sum101 = $sum101 + $TBase_amont1;
}
}
echo " ";
echo " ";
echo " â¤Ã§ÊÃéÒ§¾×é¹°Ò¹ = ".$sum100." ";
echo "ÍÒ¤ÒÃ = ".$sum101." ";
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
?>
bool(false)
|