This commit is contained in:
Karl Burkhart
2011-04-13 07:22:47 +00:00
parent e17db2683c
commit 4b7133e985
4 changed files with 517 additions and 0 deletions
+170
View File
@@ -0,0 +1,170 @@
<?php
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
class stip extends basis_db
{
public $Semester;
public $Studienjahr;
public $PersKz;
public $SVNR;
public $Familienname;
public $Vorname;
public $Typ;
public $PersKz_Antwort;
public $SVNR_Antwort;
public $Familienname_Antwort;
public $Vorname_Antwort;
public $Ausbildungssemester;
public $StudStatusCode;
public $BeendigungsDatum;
public $VonNachPersKz;
public $Studienbeitrag;
public $Inskribiert;
public $Erfolg;
public $OrgFormTeilCode;
public $AntwortStatusCode;
/**
*
* Enter description here ...
* @param unknown_type $PersonKz
*/
function searchPersonKz($PersonKz)
{
$qry = "Select prestudent_id, vorname, nachname, svnr, matrikelnr from public.tbl_student student
join public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid)
join public.tbl_person person using(person_id)
where student.matrikelnr = '".addslashes($PersonKz)."';";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->Vorname_Antwort = $row->vorname;
$this->Familienname_Antwort = $row->nachname;
$this->SVNR_Antwort = $row->svnr;
$this->PersKz_Antwort = $row->matrikelnr;
$this->AntwortStatusCode = 1;
return $row->prestudent_id;
}
else
{
$this->AntwortStatusCode =2;
return false;
}
}
else
{
return false;
}
}
/**
*
* Enter description here ...
* @param unknown_type $Svnr
*/
function searchSvnr($Svnr)
{
$qry = "Select prestudent_id, vorname, nachname, svnr, matrikelnr from public.tbl_student student
join public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid)
join public.tbl_person person using(person_id)
where person.svnr = '".addslashes($Svnr)."';";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->Vorname_Antwort = $row->vorname;
$this->Familienname_Antwort = $row->nachname;
$this->SVNR_Antwort = $row->svnr;
$this->PersKz_Antwort = $row->matrikelnr;
$this->AntwortStatusCode = 1;
return $row->prestudent_id;
}
else
{
$this->AntwortStatusCode =2;
return false;
}
}
else
{
return false;
}
return true;
}
/**
*
* Enter description here ...
* @param unknown_type $Svnr
*/
function searchVorNachname($Vorname, $Nachname)
{
$qry = "Select prestudent_id, vorname, nachname, svnr, matrikelnr from public.tbl_student student
join public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid)
join public.tbl_person person using(person_id)
where person.vorname = '".addslashes($Vorname)."'
and person.nachname = '".addslashes($Nachname)."';";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->Vorname_Antwort = $row->vorname;
$this->Familienname_Antwort = $row->nachname;
$this->SVNR_Antwort = $row->svnr;
$this->PersKz_Antwort = $row->matrikelnr;
$this->AntwortStatusCode = 1;
return $row->prestudent_id;
}
else
{
$this->AntwortStatusCode =2;
return false;
}
}
else
{
return false;
}
return true;
}
/**
*
* Enter description here ...
*/
function getErhalterKz()
{
$qry = "Select erhalter_kz from public.tbl_erhalter where kurzbz = 'TW';";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
return $row->erhalter_kz;
}
else
return false;
}
else
return false;
}
}
class error
{
public $ErrorNumbe;
public $KeyAttribute;
public $KeyValues;
public $CheckAttribute;
public $CheckValue;
public $ErrorText;
}
?>
+129
View File
@@ -0,0 +1,129 @@
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <burkhart@technikum-wien.at>.
*/
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/prestudent.class.php');
require_once('../include/student.class.php');
require_once('../include/konto.class.php');
require_once('stip.class.php');
$SOAPServer = new SoapServer("stip.soap.wsdl");
$SOAPServer->addFunction(array("getStipDaten", "getErrorCode"));
$SOAPServer->handle();
function getStipDaten($ErhKz, $AnfragedatenID, $Bezieher)
{
$prestudentID;
$studentUID;
$StipBezieher = new stip();
if(validateStipDaten($ErhKz, $AnfragedatenID, $Bezieher))
{
$StipBezieher->Semester = $Bezieher->Semester;
$StipBezieher->Studienjahr = $Bezieher->Studienjahr;
$StipBezieher->PersKz = $Bezieher->PersKz;
$StipBezieher->SVNR = $Bezieher->SVNR;
$StipBezieher->Familienname = $Bezieher->Familienname;
$StipBezieher->Vorname = $Bezieher->Vorname;
$StipBezieher->Typ = $Bezieher->Typ;
if(!$prestudentID = $StipBezieher->searchPersonKz($Bezieher->PersKz))
if(!$prestudentID = $StipBezieher->searchSvnr($Bezieher->SVNR))
$prestudentID = $StipBezieher->searchVorNachname($Bezieher->Vorname, $Bezieher->Familienname);
$prestudent = new prestudent();
$prestudent->load($prestudentID);
$prestudent->getLastStatus($prestudentID);
$student = new student();
$studentUID = $student->getUID($prestudentID);
$student->load($studentUID);
$konto = new konto();
// Student wurde gefunden
if($StipBezieher->AntwortStatusCode == 1)
{
if($Bezieher->Typ == "as" || $Bezieher->Typ == "AS")
{
$StipBezieher->Inskribiert ="j";
$StipBezieher->Ausbildungssemester = $prestudent->ausbildungssemester;
$StipBezieher->StudStatusCode = $prestudent->status_kurzbz;
if($konto->checkStudienbeitrag($studentUID, 'SS2009'))
$StipBezieher->Studienbeitrag = 300;
}
elseif($Bezieher->Typ ="ag" || $Bezieher->Typ == "AG")
{
}
}
$Erhalter = sprintf("%03d",$StipBezieher->getErhalterKz());
$new = array($Erhalter,$AnfragedatenID, $StipBezieher);
return $new;
}
}
function validateStipDaten($ErhKz, $Anfragedaten, $Bezieher)
{
if(strlen($ErhKz)!=3 || !is_numeric($ErhKz))
return false;
if(strlen($Bezieher->Semester)!=2 || ($Bezieher->Semester != "ws" && $Bezieher->Semester != "ss" && $Bezieher->Semster != "WS" && $Bezieher->Semester != "SS"))
return false;
if(strlen($Bezieher->Studienjahr) != 7)
return false;
// kein Mussfeld
if($Bezieher->PersKz != null && strlen($Bezieher->PersKz) != 10)
return false;
if(mb_strlen($Bezieher->SVNR) != 10 || !is_numeric($Bezieher->SVNR))
return false;
// preg_match funktioniert noch nicht
if(mb_strlen($Bezieher->Familienname) > 255 || preg_match_all('[^0-9]*',$Bezieher->Familienname)>0 || $Bezieher->Familienname == null || mb_strlen($Bezieher->Familienname)<2)
return false;
if(mb_strlen($Bezieher->Vorname) > 255 || $Bezieher->Familienname == null || mb_strlen($Bezieher->Vorname) <2)
return false;
if(mb_strlen($Bezieher->Typ) != 2 || ($Bezieher->Typ != "ag" && $Bezieher->Typ != "as" && $Bezieher->Typ != "AG" && $Bezieher->Typ != "AS"))
return false;
return true;
}
function getErrorCode($ErhKz, $StateCode, $StateMessage, $ErrorStatusCode, $JobId, $ErrorContent)
{
return "$ErhKz, $StateCode";
}
?>
+137
View File
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions name="StipWebservice"
targetNamespace="http://localhost/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://localhost/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://localhost/soap/stip.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<schema targetNamespace="http://localhost/soap/stip.xsd"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="Stipendiumsbezieher">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="Semester" type="string" />
<element minOccurs="1" maxOccurs="1" name="Studienjahr" type="string" />
<element minOccurs="1" maxOccurs="1" name="PersKz" type="string" />
<element minOccurs="1" maxOccurs="1" name="SVNR" type="string" />
<element minOccurs="1" maxOccurs="1" name="Familienname" type="string" />
<element minOccurs="1" maxOccurs="1" name="Vorname" type="string" />
<element minOccurs="1" maxOccurs="1" name="Typ" type="string" />
</sequence>
</complexType>
</element>
<element name="ErrorContent">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="ErrorNumber" type="string" />
<element minOccurs="1" maxOccurs="1" name="KeyAttribute" type="string" />
<element minOccurs="1" maxOccurs="1" name="KeyValues" type="string" />
<element minOccurs="1" maxOccurs="1" name="CheckAttribute" type="string" />
<element minOccurs="1" maxOccurs="1" name="CheckValue" type="string" />
<element minOccurs="1" maxOccurs="1" name="ErrorText" type="string" />
</sequence>
</complexType>
</element>
<element name="StipBezieher">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="Semester" type="string" />
<element minOccurs="1" maxOccurs="1" name="Studienjahr" type="string" />
<element minOccurs="1" maxOccurs="1" name="PersKz" type="string" />
<element minOccurs="1" maxOccurs="1" name="SVNR" type="string" />
<element minOccurs="1" maxOccurs="1" name="Familienname" type="string" />
<element minOccurs="1" maxOccurs="1" name="Vorname" type="string" />
<element minOccurs="1" maxOccurs="1" name="Typ" type="string" />
<element minOccurs="0" maxOccurs="1" name="PersKz_Antwort" type="string" />
<element minOccurs="0" maxOccurs="1" name="SVNR_Antwort" type="string" />
<element minOccurs="0" maxOccurs="1" name="Familienname_Antwort" type="string" />
<element minOccurs="0" maxOccurs="1" name="Vorname_Antwort" type="string" />
<element minOccurs="0" maxOccurs="1" name="Ausbildungssemester" type="positiveInteger" />
<element minOccurs="0" maxOccurs="1" name="StudStatusCode" type="positiveInteger" />
<element minOccurs="0" maxOccurs="1" name="BeendigungsDatum" type="string" />
<element minOccurs="0" maxOccurs="1" name="VonNachPersKz" type="string" />
<element minOccurs="0" maxOccurs="1" name="Studienbeitrag" type="float" />
<element minOccurs="0" maxOccurs="1" name="Inskribiert" type="string" />
<element minOccurs="0" maxOccurs="1" name="Erfolg" type="float" />
<element minOccurs="0" maxOccurs="1" name="OrgFormTeilCode" type="positiveInteger" />
<element minOccurs="1" maxOccurs="1" name="AntwortStatusCode" type="positiveInteger" />
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="GetStipRequest">
<wsdl:part name="ErhKz" type="xsd:string"></wsdl:part>
<wsdl:part name="AnfragedatenID" type="xsd:string"></wsdl:part>
<wsdl:part name="Bezieher" element="xsd1:Stipendiumsbezieher" ></wsdl:part>
</wsdl:message>
<wsdl:message name="GetStipResponse">
<wsdl:part name="ErhKz" type="xsd:string"></wsdl:part>
<wsdl:part name="AnfragedatenID" type="xsd:string"></wsdl:part>
<wsdl:part name="StipBezieher" element="xsd1:StipBezieher" ></wsdl:part>
</wsdl:message>
<wsdl:message name="getErrorCodeRequest">
<wsdl:part name="ErhKz" type="xsd:string"></wsdl:part>
<wsdl:part name="StateCode" type="xsd:string"></wsdl:part>
<wsdl:part name="StateMessage" type="xsd:string"></wsdl:part>
<wsdl:part name="ErrorStatusCode" type="xsd:string"></wsdl:part>
<wsdl:part name="JobID" type="xsd:string"></wsdl:part>
<wsdl:part name="EContent" element="xsd1:ErrorContent" ></wsdl:part>
</wsdl:message>
<wsdl:message name="getErrorCodeResponse">
<wsdl:part name="Value" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ConfigPortType" >
<wsdl:operation name="getStipDaten">
<wsdl:input message="tns:GetStipRequest"></wsdl:input>
<wsdl:output message="tns:GetStipResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="getErrorCode">
<wsdl:input message="tns:getErrorCodeRequest"></wsdl:input>
<wsdl:output message="tns:getErrorCodeResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConfigBinding" type="tns:ConfigPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getStipDaten">
<soap:operation soapAction="http://calva.technikum-wien.at/burkhart/fhcomplete/trunk/soap/getStipDaten" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getErrorCode">
<soap:operation soapAction="http://calva.technikum-wien.at/burkhart/fhcomplete/trunk/soap/getErrorCode" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StipWebservice">
<wsdl:port name="ConfigWebservicePort" binding="tns:ConfigBinding">
<soap:address location="http://calva.technikum-wien.at/burkhart/fhcomplete/trunk/soap/stip.soap.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
+81
View File
@@ -0,0 +1,81 @@
<?php
require_once('stip.class.php');
?>
<html>
<head>
<title>STIP-Client</title>
</head>
<body>
<form action="stip_client.php" method="post">
<table border="0" cellpadding="5" cellspacing="0" bgcolor="#E0E0E0">
<tr>
<td align="right">ErhKz:</td>
<td><input name="ErhKz" type="text" size="30" maxlength="3" <?php echo "value=".$_REQUEST['ErhKz']; ?>></td>
</tr>
<tr>
<td align="right">AnfragedatenID:</td>
<td><input name="AnfragedatenID" type="text" size="30" maxlength="40" <?php echo "value=".$_REQUEST['AnfragedatenID']; ?>></td>
</tr>
<tr>
<td align="right">Semester:</td>
<td><input name="Semester" type="text" size="30" maxlength="2" <?php echo "value=".$_REQUEST['Semester']; ?>></td>
</tr>
<tr>
<td align="right">Studienjahr:</td>
<td><input name="Studienjahr" type="text" size="30" maxlength="7" <?php echo "value=".$_REQUEST['Studienjahr']; ?>></td>
</tr>
<tr>
<td align="right">PersKz:</td>
<td><input name="PersKz" type="text" size="30" maxlength="11" <?php echo "value=".$_REQUEST['PersKz']; ?>></td>
</tr>
<tr>
<td align="right">SVNR:</td>
<td><input name="Svnr" type="text" size="30" maxlength="10" <?php echo "value=".$_REQUEST['Svnr']; ?>></td>
</tr>
<tr>
<td align="right">Familienname:</td>
<td><input name="Familienname" type="text" size="30" maxlength="255" <?php echo "value=".$_REQUEST['Familienname']; ?>></td>
</tr>
<tr>
<td align="right">Vorname:</td>
<td><input name="Vorname" type="text" size="30" maxlength="255" <?php echo "value=".$_REQUEST['Vorname']; ?>></td>
</tr>
<tr>
<td align="right">Typ:</td>
<td><input name="Typ" type="text" size="30" maxlength="2" <?php echo "value=".$_REQUEST['Typ']; ?>></td>
</tr>
<tr>
<td align="right"></td>
<td>
<input type="submit" value=" Absenden " name="submit">
</td>
</tr>
</table>
</form>
<?php
if(isset($_REQUEST['submit']))
{
$client = new SoapClient("http://calva.technikum-wien.at/burkhart/fhcomplete/trunk/soap/stip.soap.wsdl");
$ErhKz = $_REQUEST['ErhKz'];
$AnfragedatenID = $_REQUEST['AnfragedatenID'];
$bezieher = new stip();
$bezieher->Semester = $_REQUEST['Semester'];
$bezieher->Studienjahr = $_REQUEST['Studienjahr'];
$bezieher->PersKz= $_REQUEST['PersKz'];
$bezieher->SVNR= $_REQUEST['Svnr'];
$bezieher->Familienname= $_REQUEST['Familienname'];
$bezieher->Vorname= $_REQUEST['Vorname'];
$bezieher->Typ = $_REQUEST['Typ'];
$response = $client->getStipDaten($ErhKz, $AnfragedatenID, $bezieher);
echo var_dump($response);
}
?>