Viewing file: xml_fee.php (2.49 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $information = '<?xml version="1.0" encoding="windows-874"?>'; //asset_permanent $information .= "\n<asset_permanent>";
//asset_permanent $information .= "\n<assets>"; $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)"; $num1=0; $sum =""; $sum100 = ""; $sum101 = ""; $sum102 = ""; $execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é $sql"); 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_amount=$row["amount"]; $TTypecate_id=$row["TTypecate_id"];
$num1++; $information .= "\n<asset>";
$information .= "\n<asset_id>"; $information .= "$TBase_id"; $information .= "\n</asset_id>";
$information .= "\n<asset_name>"; $information .= "$TBase_name"; $information .= "\n</asset_name>";
$information .= "\n<asset_bye_year>"; $information .= "$TBase_bye_year"; $information .= "\n</asset_bye_year>";
$information .= "\n<asset_pirce>"; $information .= "$TBase_pirce"; $information .= "\n</asset_pirce>";
$information .= "\n<amount>"; $information .= "$TBase_amount"; $information .= "\n</amount>";
$information .= "\n<Typecate>"; $information .= "$TTypecate_id"; $information .= "\n</Typecate>";
$information .= "\n</asset>";
if ($TTypecate_id == '100') { $sum100 = $sum100 + $TBase_amount; }
if ($TTypecate_id == '101') { $sum101 = $sum101 + $TBase_amount; }
if ($TTypecate_id == '102') { $sum102 = $sum102 + $TBase_amount; } $sum=$sum100+$sum101+$sum102; } $information .= "\n</assets>";
//sum_asset_permanent $information .= "\n<base_sum>"; $information .= "$sum100"; $information .= "\n</base_sum>";
$information .= "\n<build_sum>"; $information .= "$sum101"; $information .= "\n</build_sum>";
$information .= "\n<asset_sum>"; $information .= "$sum102"; $information .= "\n</asset_sum>";
$information .= "\n<sum>"; $information .= "$sum"; $information .= "\n</sum>";
$information .= "\n</asset_permanent>";
echo "$information";
?>
|