'; $information .= "\n"; //teacher $information .= "\n"; $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"; $information .= "\n"; $information .= "$id"; $information .= "\n"; $information .= "\n"; $information .= "$idx"; $information .= "\n"; $information .= "\n"; $information .= "$prefixname"; $information .= "\n"; $information .= "\n"; $information .= "$name"; $information .= "\n"; $information .= "\n"; $information .= "$surname"; $information .= "\n"; $information .= "\n"; $information .= "$position"; $information .= "\n"; $information .= "\n"; $information .= "$cnow"; $information .= "\n"; $information .= "\n"; } // ¨º loop //$num1 = $num1-$count_people_8; $num1 = $num1-$count_people_8; $information .= "\n"; $information .= "\n"; $information .= "$num1"; $information .= "\n"; $information .= "\n"; return $information; } //--------------------------------------------------------Projects_of_outservice function projects_of_outservice($search_projects_of_outservice,$search_term_date_start,$search_term_date_end) { $information = ''; $information .= "\n"; //project $information .= "\n"; $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"; $information .= "\n"; $information .= "$TProject_id"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_NameT"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_NameE"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_Type_id"; $information .= "\n"; $information .= "\n"; $information .= "$TTypeProject_name"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_TypeSub_id"; $information .= "\n"; $information .= "\n"; $information .= "$TTypeProjectSub_name"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_sdate"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_edate"; $information .= "\n"; $information .= "\n"; $information .= "$search_term_date_start,$search_term_date_end"; $information .= "\n"; $information .= "\n"; } } //end_selece_database_project $information .= "\n"; //project $information .= "\n"; $information .= "$num1"; $information .= "\n"; $information .= "\n"; return $information; } //-----------------------------------------------------Committees_of_teacher function committees_of_teacher($search_Committees_of_teacher) { $information = ''; //Committees_of_teacher $information .= "\n"; //committees $information .= "\n"; $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"; $information .= "\n"; $information .= "$TEmployee_id"; $information .= "\n"; $information .= "\n"; $information .= "$TEmployee_fname"; $information .= "\n"; $information .= "\n"; $information .= "$TEmployee_lname"; $information .= "\n"; $information .= "\n"; $information .= "$TFileCommittee_order_no"; $information .= "\n"; $information .= "\n"; $information .= "$TFileCommittee_ttile"; $information .= "\n"; $information .= "\n"; } //end_selece_database_project $information .= "\n"; //end_committee $information .= "\n"; $information .= "$num1"; $information .= "\n"; $information .= "\n"; $information .= "$num2"; $information .= "\n"; $information .= "\n"; 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 = ''; //Project_budget $information .= "\n"; //project $information .= "\n"; $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"; $information .= "\n"; $information .= "$TProject_id"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_NameT"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_NameE"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_Type_id"; $information .= "\n"; $information .= "\n"; $information .= "$TTypeProject_name"; $information .= "\n"; /* $information .= "\n"; $information .= "$TProject_sdate1"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_edate1"; $information .= "\n"; $information .= "\n"; $information .= "$search_term_date_start,$search_term_date_end"; $information .= "\n"; */ $information .= "\n"; $information .= "$TProject_budget2"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_budget3"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_budget4"; $information .= "\n"; $information .= "\n"; $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"; //sum_Project_budget $information .= "\n"; $information .= "$TProject_budget2_sum"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_budget3_sum"; $information .= "\n"; $information .= "\n"; $information .= "$TProject_budget4_sum"; $information .= "\n"; $information .= "\n"; 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 = ''; //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)"; $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"; $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_amount"; $information .= "\n"; $information .= "\n"; $information .= "$TTypecate_id"; $information .= "\n"; $information .= "\n"; 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"; //sum_asset_permanent $information .= "\n"; $information .= "$sum100"; $information .= "\n"; $information .= "\n"; $information .= "$sum101"; $information .= "\n"; $information .= "\n"; $information .= "$sum102"; $information .= "\n"; $information .= "\n"; $information .= "$sum"; $information .= "\n"; $information .= "\n"; return $information; } //------------------------------------------- $server = new soap_server; $server->configureWSDL('standard_3_wsdl', 'urn:standard_3_wsdl'); $server->register('teachers_now', array('search_teachers_now' => 'xsd:string'), array('information' => 'xsd:string'), 'http://localhost/ws_standard_on_mis/', 'http://localhost/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://localhost/ws_standard_on_mis/', 'http://localhost/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://localhost/ws_standard_on_mis/', 'http://localhost/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://localhost/ws_standard_on_mis/', 'http://localhost/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://localhost/ws_standard_on_mis/', 'http://localhost/ws_standard_on_mis/', 'rpc', 'encoded', 'Search_For_asset_permanent'); $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server->service($HTTP_RAW_POST_DATA); ?>