Viewing file: mis_standard.php (28.21 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require_once('nusoap.php');
//-------------------user login
function user_login($search_user_login) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
$information .= "\n<userlogin>";
//teacher
$information .= "\n<users>";
$dsn_name = "staff";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
$sql = "SELECT *,TEmployee.Id as tempid,TPrefix.name as prefixname FROM TEmployee, TPrefix WHERE TEmployee.Prefix_id=TPrefix.id";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
$i=1;
$num1=0;
while($row = odbc_fetch_array($execute))
{
$num1++;
$id=$row["tempid"];
$username=$row["UserName"];
$password=$row["Password"];
$prefixname=$row["prefixname"];
$name=$row["fname"];
$surname=$row["lname"];
$email=$row["email"];
$information .= "\n<user>";
$information .= "\n<user_id>";
$information .= "$id";
$information .= "\n</user_id>";
$information .= "\n<user_username>";
$information .= "$username";
$information .= "\n</user_username>";
$information .= "\n<user_password>";
$information .= "$password";
$information .= "\n</user_password>";
$information .= "\n<user_prefixname>";
$information .= "$prefixname";
$information .= "\n</user_prefixname>";
$information .= "\n<user_fname>";
$information .= "$name";
$information .= "\n</user_fname>";
$information .= "\n<user_lname>";
$information .= "$surname";
$information .= "\n</user_lname>";
$information .= "\n<user_email>";
$information .= "$email";
$information .= "\n</user_email>";
$information .= "\n</user>";
}
// ¨º loop
$information .= "\n</users>";
$information .= "\n<num_users>";
$information .= "$num1";
$information .= "\n</num_users>";
$information .= "\n</userlogin>";
return "$information";
}
//-----------------------------------------------------Teachers_now
function teachers_now($search_teachers_now) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
$information .= "\n<Teachers_now>";
//teacher
$information .= "\n<teachers>";
$dsn_name = "staff";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//$sql = "SELECT *,TEmployee.id as tempid,TPrefix.name as prefixname FROM TEmployee,TWorkStatus,TPosScale,TPrefix WHERE (TEmployee.work_status=TWorkStatus.id) and (TEmployee.Id=TPosScale.TEmp_id) and (TEmployee.Prefix_id=TPrefix.id) and (TWorkStatus.id = '0') and (TEmployee.id like '01%') and (TPosScale.TDep_id = '0702')";
$sql = "select count(*) as countP from( SELECT *,TEmployee.id as tempid,TPrefix.name as prefixname,TPosition.name as positionname FROM TEmployee,TWorkStatus,TPosScale,TPrefix,TPosition
WHERE (TEmployee.work_status=TWorkStatus.id) and (TEmployee.Id=TPosScale.TEmp_id) and (TEmployee.Prefix_id=TPrefix.id) and (TWorkStatus.id = '0') and (TPosScale.TPos_id=TPosition.id) and (TPosScale.TPos_id = '0014' or TPosScale.TPos_id = '0017') and (TPosScale.Duty_id='8') order by TEmployee.id)";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
$count_people_8=0;
while($row1 = odbc_fetch_array($execute))
{
$count_people_8=$row1["countP"];
}
$count_people_8 = ($count_people_8/2);
$sql = "SELECT *,TEmployee.id as tempid,TPrefix.name as prefixname,TPosition.name as positionname FROM TEmployee,TWorkStatus,TPosScale,TPrefix,TPosition WHERE (TEmployee.work_status=TWorkStatus.id) and (TEmployee.Id=TPosScale.TEmp_id) and (TEmployee.Prefix_id=TPrefix.id) and (TWorkStatus.id = '0') and (TPosScale.TPos_id=TPosition.id) and (TPosScale.TPos_id = '0014' or TPosScale.TPos_id = '0017') order by TEmployee.id";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
$i=1;
$num1=0;
while($row = odbc_fetch_array($execute))
{
$num1++;
$id=$row["tempid"];
$idx=$row["idx"];
$prefixname=$row["prefixname"];
$name=$row["fname"];
$surname=$row["lname"];
$position=$row["positionname"];
$cnow=$row["c_now"];
$information .= "\n<teacher>";
$information .= "\n<teacher_id>";
$information .= "$id";
$information .= "\n</teacher_id>";
$information .= "\n<person_id>";
$information .= "$idx";
$information .= "\n</person_id>";
$information .= "\n<teacher_prefixname>";
$information .= "$prefixname";
$information .= "\n</teacher_prefixname>";
$information .= "\n<teacher_fname>";
$information .= "$name";
$information .= "\n</teacher_fname>";
$information .= "\n<teacher_lname>";
$information .= "$surname";
$information .= "\n</teacher_lname>";
$information .= "\n<teacher_position>";
$information .= "$position";
$information .= "\n</teacher_position>";
$information .= "\n<teacher_cnow>";
$information .= "$cnow";
$information .= "\n</teacher_cnow>";
$information .= "\n</teacher>";
}
// ¨º loop
//$num1 = $num1-$count_people_8;
$num1 = $num1-$count_people_8;
$information .= "\n</teachers>";
$information .= "\n<num_teachers>";
$information .= "$num1";
$information .= "\n</num_teachers>";
$information .= "\n</Teachers_now>";
return $information;
}
//--------------------------------------------------------Projects_of_outservice
function projects_of_outservice($search_projects_of_outservice,$search_term_date_start,$search_term_date_end) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
$information .= "\n<Projects_of_outservice>";
//project
$information .= "\n<projects>";
$dsn_name = "project";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//selece_database_project
$sql = "SELECT TProject.id, TProject.NameT ,TProject.NameE ,TProject.Type_id, TProject.TypeSub_id ,TProject.sdate , TProject.edate FROM TProject, TTypeProject, TTypeProjectSub WHERE (TProject.Type_id=TTypeProject.id) and (TProject.TypeSub_id=TTypeProjectSub.id)and (TProject.Type_id='1') and (TProject.TypeSub_id='01')";
//$sql = "SELECT TProject.id, TProject.NameT ,TProject.NameE ,TProject.Type_id, TProject.TypeSub_id ,TProject.sdate , TProject.edate FROM TProject, TTypeProject, TTypeProjectSub WHERE (TProject.Type_id=TTypeProject.id) and (TProject.TypeSub_id=TTypeProjectSub.id)and (TProject.Type_id='1') and (TProject.TypeSub_id='01') and (TProject.sdate > '1%')";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
$i=1;
$num1=0;
while($row = odbc_fetch_array($execute))
{
$TProject_id=$row['id'];
$TProject_NameT=$row["NameT"];
$TProject_NameE=$row["NameE"];
$TProject_Type_id=$row["Type_id"];
$TProject_TypeSub_id=$row["TypeSub_id"];
$TProject_sdate=$row["sdate"];
$TProject_edate=$row["edate"];
//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"];
}
$TProject_sdate_c = substr($TProject_sdate, 0, 10);
//$TProject_sdate_c = sprintf("%01d", $TProject_sdate_c);
if ($TProject_sdate_c >= $search_term_date_start and $TProject_sdate_c <= $search_term_date_end) {
$num1++;
$information .= "\n<project>";
$information .= "\n<project_id>";
$information .= "$TProject_id";
$information .= "\n</project_id>";
$information .= "\n<project_tname>";
$information .= "$TProject_NameT";
$information .= "\n</project_tname>";
$information .= "\n<project_ename>";
$information .= "$TProject_NameE";
$information .= "\n</project_ename>";
$information .= "\n<project_type_id>";
$information .= "$TProject_Type_id";
$information .= "\n</project_type_id>";
$information .= "\n<project_type_name>";
$information .= "$TTypeProject_name";
$information .= "\n</project_type_name>";
$information .= "\n<project_typesub_id>";
$information .= "$TProject_TypeSub_id";
$information .= "\n</project_typesub_id>";
$information .= "\n<project_typesub_name>";
$information .= "$TTypeProjectSub_name";
$information .= "\n</project_typesub_name>";
$information .= "\n<project_sdate>";
$information .= "$TProject_sdate";
$information .= "\n</project_sdate>";
$information .= "\n<project_edate>";
$information .= "$TProject_edate";
$information .= "\n</project_edate>";
$information .= "\n<project_date>";
$information .= "$search_term_date_start,$search_term_date_end";
$information .= "\n</project_date>";
$information .= "\n</project>";
}
}
//end_selece_database_project
$information .= "\n</projects>";
//project
$information .= "\n<num_projects>";
$information .= "$num1";
$information .= "\n</num_projects>";
$information .= "\n</Projects_of_outservice>";
return $information;
}
//-----------------------------------------------------Committees_of_teacher
function committees_of_teacher($search_Committees_of_teacher) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
//Committees_of_teacher
$information .= "\n<Committees_of_teacher>";
//committees
$information .= "\n<committees>";
$dsn_name = "staff";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//selece_database_project
//$sql = "SELECT * FROM TFileCommittee, TEmployee WHERE TFileCommittee.TEmp_id=TEmployee.Id";
//$sql = "SELECT * FROM TProject";
$sql = "SELECT *,TEmployee.id as tempid FROM TFileCommittee, TEmployee,TWorkStatus,TPosScale WHERE TFileCommittee.TEmp_id=TEmployee.Id and (TEmployee.work_status=TWorkStatus.id) and (TEmployee.Id=TPosScale.TEmp_id) and (TWorkStatus.id = '0') and (TEmployee.id like '01%') and (TPosScale.TDep_id = '0702')";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
$i=1;
$num1=0;
$num2=0;
$TEmployee_id_check="";
while($row = odbc_fetch_array($execute))
{
$num2++;
$TEmployee_id=$row['tempid'];
$TEmployee_fname=$row["fname"];
$TEmployee_lname=$row["lname"];
$TFileCommittee_order_no=$row["order_no"];
$TFileCommittee_ttile=$row["TTitle"];
if($TEmployee_id!=$TEmployee_id_check)
{
$num1++;
}
$TEmployee_id_check=$TEmployee_id;
$information .= "\n<committee>";
$information .= "\n<temp_id>";
$information .= "$TEmployee_id";
$information .= "\n</temp_id>";
$information .= "\n<temp_fname>";
$information .= "$TEmployee_fname";
$information .= "\n</temp_fname>";
$information .= "\n<temp_lname>";
$information .= "$TEmployee_lname";
$information .= "\n</temp_lname>";
$information .= "\n<order_no>";
$information .= "$TFileCommittee_order_no";
$information .= "\n</order_no>";
$information .= "\n<t_title>";
$information .= "$TFileCommittee_ttile";
$information .= "\n</t_title>";
$information .= "\n</committee>";
}
//end_selece_database_project
$information .= "\n</committees>";
//end_committee
$information .= "\n<num_teacher_committees>";
$information .= "$num1";
$information .= "\n</num_teacher_committees>";
$information .= "\n<num_committees_of_teacher>";
$information .= "$num2";
$information .= "\n</num_committees_of_teacher>";
$information .= "\n</Committees_of_teacher>";
return $information;
}
//-----------------------------------------------------Project_budget
//function project_budget($search_project_budget,$search_term_date_start,$search_term_date_end) {
function project_budget($search_project_budget) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
//Project_budget
$information .= "\n<Project_budget>";
//project
$information .= "\n<projects>";
$dsn_name = "project";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//selece_database_project
//$sql = "SELECT TProject.id as a, TProject.NameT ,TProject.NameE ,TProject.Type_id, TProject.TypeSub_id ,TProject.sdate , TProject.edate , TProject.budget3 , TProject.budget4, TProject.budget2 FROM TProject, TTypeProject, TTypeProjectSub WHERE (TProject.Type_id=TTypeProject.id) and (TProject.TypeSub_id=TTypeProjectSub.id)and (TProject.Type_id='1') and (TProject.TypeSub_id='01')";
$sql = "SELECT TProject.id as a, TProject.NameT ,TProject.NameE ,TProject.Type_id, TProject.TypeSub_id, TProject.sdate , TProject.edate ,TProject.budget3 , TProject.budget4, TProject.budget2 FROM TProject, TTypeProject, TTypeProjectSub WHERE (TProject.Type_id=TTypeProject.id) and (TProject.TypeSub_id=TTypeProjectSub.id)and (TProject.Type_id='1') and (TProject.TypeSub_id='01') ";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é");
$i=1;
$num1=0;
while($row = odbc_fetch_array($execute))
{
$TProject_id=$row['a'];
$TProject_NameT=$row["NameT"];
$TProject_NameE=$row["NameE"];
$TProject_Type_id=$row["Type_id"];
$TProject_TypeSub_id=$row["TypeSub_id"];
//$TProject_sdate1=$row["sdate"];
//$TProject_edate1=$row["edate"];
$TProject_budget2=$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"];
}
$TProject_sdate_d = substr($TProject_sdate, 0, 10);
//$TProject_sdate_c = sprintf("%01d", $TProject_sdate_c);
//if ($TProject_sdate_d >= $search_term_date_start and $TProject_sdate_d <= $search_term_date_end) {
$num1++;
$information .= "\n<project>";
$information .= "\n<project_id>";
$information .= "$TProject_id";
$information .= "\n</project_id>";
$information .= "\n<project_tname>";
$information .= "$TProject_NameT";
$information .= "\n</project_tname>";
$information .= "\n<project_ename>";
$information .= "$TProject_NameE";
$information .= "\n</project_ename>";
$information .= "\n<project_type_id>";
$information .= "$TProject_Type_id";
$information .= "\n</project_type_id>";
$information .= "\n<project_type_name>";
$information .= "$TTypeProject_name";
$information .= "\n</project_type_name>";
/* $information .= "\n<project_sdate>";
$information .= "$TProject_sdate1";
$information .= "\n</project_sdate>";
$information .= "\n<project_edate>";
$information .= "$TProject_edate1";
$information .= "\n</project_edate>";
$information .= "\n<project_date>";
$information .= "$search_term_date_start,$search_term_date_end";
$information .= "\n</project_date>";
*/
$information .= "\n<budget2>";
$information .= "$TProject_budget2";
$information .= "\n</budget2>";
$information .= "\n<budget3>";
$information .= "$TProject_budget3";
$information .= "\n</budget3>";
$information .= "\n<budget4>";
$information .= "$TProject_budget4";
$information .= "\n</budget4>";
$information .= "\n</project>";
$TProject_budget2_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</projects>";
//sum_Project_budget
$information .= "\n<budget2_sum>";
$information .= "$TProject_budget2_sum";
$information .= "\n</budget2_sum>";
$information .= "\n<budget3_sum>";
$information .= "$TProject_budget3_sum";
$information .= "\n</budget3_sum>";
$information .= "\n<budget4_sum>";
$information .= "$TProject_budget4_sum";
$information .= "\n</budget4_sum>";
$information .= "\n</Project_budget>";
return $information;
}
//-----------------------------------------------------asset_permanent----------------------------------
//function projects_of_outservice($search_projects_of_outservice,$search_term_date_start,$search_term_date_end) {
function asset_permanent($search_asset_permanent) {
$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>";
return $information;
}
//-----------------------------------------------------fee_all
function fee_all($search_fee_all) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
//fee_all
$information .= "\n<feeallss>";
//fee_all
$information .= "\n<feealls>";
$dsn_name = "budget";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//selece_database_budget
$sql ="SELECT Tfee.id as idf ,Tfee.feename , Tfee.dmy , Tfee.amount , Tfee.dep_id as no, TDepartment.thai_name FROM Tfee , TDepartment WHERE (Tfee.dep_id = TDepartment.id)";
$num1=0;
$sumall ="";
$sum_manage = "";
$sum_vichakan = "";
$sum_patana = "";
$sum_kitkan = "";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é $sql");
while($row = odbc_fetch_array($execute))
{
$Tfee_all_id=$row['idf'];
$Tfee_all_name=$row["feename"];
$Tfee_all_date=$row["dmy"];
$Tfee_all_amount=$row["amount"];
$Tfee_all_depid=$row["no"];
$Tfee_all_depname=$row["thai_name"];
$num1++;
$information .= "\n<feeall>";
$information .= "\n<feeall_id>";
$information .= "$Tfee_all_id";
$information .= "\n</feeall_id>";
$information .= "\n<feeall_name>";
$information .= "$Tfee_all_name";
$information .= "\n</feeall_name>";
$information .= "\n<feeall_date>";
$information .= "$Tfee_all_date";
$information .= "\n</feeall_date>";
$information .= "\n<feeall_amount>";
$information .= "$Tfee_all_amount";
$information .= "\n</feeall_amount>";
$information .= "\n<feeall_depid>";
$information .= "$Tfee_all_depid";
$information .= "\n</feeall_depid>";
$information .= "\n<feeall_depname>";
$information .= "$Tfee_all_depname";
$information .= "\n</feeall_depname>";
$information .= "\n</feeall>";
if ($Tfee_all_depid == '0701') {
$sum_manage = $sum_manage + $Tfee_all_amount;
}
if ($Tfee_all_depid == '0702') {
$sum_vichakan = $sum_vichakan + $Tfee_all_amount;
}
if ($Tfee_all_depid == '0703') {
$sum_patana = $sum_patana + $Tfee_all_amount;
}
if ($Tfee_all_depid == '0704') {
$sum_kitkan = $sum_kitkan + $Tfee_all_amount;
}
$sumall=$sum_manage+$sum_vichakan+$sum_patana+$sum_kitkan;
}
$information .= "\n</feealls>";
//sum_fee_all
$information .= "\n<fee_all_manage>";
$information .= "$sum_manage";
$information .= "\n</fee_all_manage>";
$information .= "\n<fee_all_vichakan>";
$information .= "$sum_vichakan";
$information .= "\n</fee_all_vichakan>";
$information .= "\n<fee_all_patana>";
$information .= "$sum_patana";
$information .= "\n</fee_all_patana>";
$information .= "\n<fee_all_kitkan>";
$information .= "$sum_kitkan";
$information .= "\n</fee_all_kitkan>";
$information .= "\n<sumall>";
$information .= "$sumall";
$information .= "\n</sumall>";
$information .= "\n</feeallss>";
return $information;
}
//-----------------------------------------------------fee_it_libraly
//function fee_it_libraly($search_fee_it_libraly,$search_term_date_start,$search_term_date_end) {
function fee_it_libraly($search_fee_it_libraly) {
$information = '<?xml version="1.0" encoding="windows-874"?>';
//fee_it_libraly
$information .= "\n<fee_it_libraly>";
//fee_it_libraly
$information .= "\n<feeits>";
$dsn_name = "budget";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é");
//selece_database_budget
$sql ="SELECT Tfee.id as idf ,Tfee.feename , Tfee.dmy , Tfee.amount , Tjob.id as no, Tjob.name as namejob FROM Tfee , Tjob WHERE (Tfee.job_id = Tjob.id) and (Tfee.job_id = '070305' or '070304')";
$num1=0;
$sum ="";
$sum_it = "";
$sum_libraly = "";
// $sum102 = "";
$execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é $sql");
while($row = odbc_fetch_array($execute))
{
$Tfee_it_id=$row['idf'];
$Tfee_it_name=$row["feename"];
$Tfee_it_date=$row["dmy"];
$Tfee_it_amount=$row["amount"];
$Tfee_it_jobid=$row["no"];
$Tfee_it_jobname=$row["namejob"];
$num1++;
$information .= "\n<feeit>";
$information .= "\n<feeit_id>";
$information .= "$Tfee_it_id";
$information .= "\n</feeit_id>";
$information .= "\n<feeit_name>";
$information .= "$Tfee_it_name";
$information .= "\n</feeit_name>";
$information .= "\n<feeit_date>";
$information .= "$Tfee_it_date";
$information .= "\n</feeit_date>";
$information .= "\n<feeit_amount>";
$information .= "$Tfee_it_amount";
$information .= "\n</feeit_amount>";
$information .= "\n<feeit_jobid>";
$information .= "$Tfee_it_jobid";
$information .= "\n</feeit_jobid>";
$information .= "\n<feeit_jobname>";
$information .= "$Tfee_it_jobname";
$information .= "\n</feeit_jobname>";
$information .= "\n</feeit>";
if ($Tfee_it_jobid == '070305') {
$sum_it = $sum_it + $Tfee_it_amount;
}
if ($Tfee_it_jobid == '070304') {
$sum_libraly = $sum_libraly + $Tfee_it_amount;
}
$sum=$sum_it+$sum_libraly;
}
$information .= "\n</feeits>";
//sum_fee_it_libraly
$information .= "\n<fee_it_sum>";
$information .= "$sum_it";
$information .= "\n</fee_it_sum>";
$information .= "\n<fee_libraly_sum>";
$information .= "$sum_libraly";
$information .= "\n</fee_libraly_sum>";
$information .= "\n<sum>";
$information .= "$sum";
$information .= "\n</sum>";
$information .= "\n</fee_it_libraly>";
return $information;
}
//-------------------------------------------
$server = new soap_server;
$server->configureWSDL('mis_standard_wsdl', 'urn:mis_standard_wsdl');
$server->register('user_login',
array('search_user_login' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_user_login');
$server->register('teachers_now',
array('search_teachers_now' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_teachers_now');
//$search_term_date_start,$search_term_date_end
$server->register('projects_of_outservice',
array('search_projects_of_outservice' => 'xsd:string','search_term_date_start' => 'xsd:string','search_term_date_end' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_projects_of_outservice');
$server->register('committees_of_teacher',
array('search_committees_of_teacher' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_committees_of_teacher');
$server->register('project_budget',
array('search_project_budget' => 'xsd:string'),
// array('search_project_budget' => 'xsd:string','search_term_date_start' => 'xsd:string','search_term_date_end' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_project_budget');
$server->register('asset_permanent',
array('search_asset_permanent' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_asset_permanent');
$server->register('fee_all',
array('search_fee_all' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_fee_all');
$server->register('fee_it_libraly',
array('search_fee_it_libraly' => 'xsd:string'),
array('information' => 'xsd:string'),
'http://61.19.29.28/ws_standard_on_mis/',
'http://61.19.29.28/ws_standard_on_mis/',
'rpc',
'encoded',
'Search_For_fee_it_libraly');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
|