prepare($_POST['sid']); } else { $iVid=''; $testclient->prepare(); } /** * set user and password */ //$testclient->user = 'admin'; //$testclient->pass = 'hisuser'; /** * set the path2wsdl to what ever is set by the user */ //if(isset($_POST['wsdl'])) // $testclient->path2wsdl = $_POST['wsdl']; $sReturn = ''; /** call the desired function */ reset($_POST); while (list($key, $value) = each($_POST)) { switch ($key) { case "sendStatistic": try { $sReturn = $testclient->sendStatistics($_REQUEST['type'], $_REQUEST['email'], $_REQUEST['graph']); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "delsurvey": try { $sReturn = $testclient->deleteSurvey(); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "sendMail": $sType = $_REQUEST['type']; $maxemails = $_REQUEST['maxemails']; $subject = $_REQUEST['subject']; $mailText = $_REQUEST['mailText']; try { $sReturn = $testclient->sendMail($sType, $maxemails, $subject, $mailText); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "getField": try { $sReturn = $testclient->getFieldmap(); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "delsurvey": try { $sReturn = $testclient->deleteSurvey(); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "impMatrix": $qText = $_REQUEST['quest']; $mandatory = $_REQUEST['mandatory']; for ($n = 1; $n < 10; ++$n) { if ($_REQUEST['item' . $n] != '') { if ($n == 1) { $items = $_REQUEST['item' . $n]; } else { $items .= "," . $_REQUEST['item' . $n]; } } } $qHelp = $_REQUEST['help']; try { $sReturn = $testclient->importMatrix($qTitle, $qText, $qHelp, $items, "Matrix5", $mandatory); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "impFree": $qTitle = $_REQUEST['title']; $qText = $_REQUEST['quest']; $qHelp = $_REQUEST['help']; $mandatory = $_REQUEST['mandatory']; try { $sReturn = $testclient->sImportFreetext($qTitle, $qText, $qHelp, "Freitext", $mandatory); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "impQuest": $sMod = $_REQUEST['mod']; $mandatory = $_REQUEST['mandatory']; try { $sReturn = $testclient->importQuestion($sMod, $mandatory); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "impGroup": $sMod = $_REQUEST['mod']; $sGroupName = $_REQUEST['groupName']; $sGroupDescription = $_REQUEST['groupDescription']; try { $sReturn = $client->sImportGroup($sMod, $sGroupName, $sGroupDescription); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "activate": $dStart = $_REQUEST['start']; $dEnd = $_REQUEST['end']; try { $sReturn = $testclient->activateSurvey($dStart, $dEnd); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "createSurvey": $sVbes = $_REQUEST['sdes']; $sVtit = $_REQUEST['stit']; $sVwel = $_REQUEST['sVwel']; $sVend = $_REQUEST['sVend']; $sMail = $_REQUEST['sEmail']; $sName = $_REQUEST['sName']; $sUrl = $_REQUEST['sUrl']; $sUbes = $_REQUEST['sUdes']; $sVtyp = $_REQUEST['core']; try { $sReturn = $testclient->createSurvey($sVtit, $sVbes, $sVwel, $sVend, $sMail, $sName, $sUrl, $sUbes, $sVtyp); } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing $sOutput .= "

Return: " . $sReturn; break; case "change": $table = $_REQUEST['table']; $key = $_REQUEST['key']; $value = $_REQUEST['value']; $where = $_REQUEST['whereKey']; $mode = $_REQUEST['mode']; //$whereValue = $_REQUEST['whereValue']; try { $sReturn = $testclient->changeSurvey($table, $key, $value, $where, $mode); $sOutput .= "

Return: " . $sReturn; } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } break; case "tokens": $sToken = $_REQUEST['token']; try { $sReturn = $testclient->insertToken($sToken); $sOutput .= "

Return: " . $sReturn; } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } break; case "tokRet": try { $sReturn = $testclient->tokenReturn(); $sOutput .= "

Return: " . $sReturn; } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } break; case "insPar": $sParticipantData = $_REQUEST['sParticipantData']; try { $sReturn = $testclient->insertParticipants($sParticipantData); $sOutput .= "

Return: " . $sReturn; } catch (SoapFault $fault) { $sOutput .= "

SOAP Error: " . $fault->faultcode . " : " . $fault->faultstring . ""; } //these are just outputs for testing break; } } ## ##################################################################### /** * begin with output (some css first) */ ?> LimeSurvey RC Testclient soapCheck(); /** * if there is an return, output request and response for debugging */ if (isset($sReturn) && $sReturn != '') { echo $testclient->getResponse(); } // we dump the client object functions (which are functions of the server defined in the wsdl) if (!isset($sReturn) || $sReturn == '') { echo $testclient->getServerFunctions(); } if (isset($sOutput)) { echo '
'; echo '

testing output:

'; if (isset($testclient->sid)) { echo "test Survey"; } echo $sOutput; echo '
'; } ?>

sCreateSurvey function

' method='post'>* VeranstaltungsTyp:

* VeranstaltungsID / SurveyID (have to be Integer):

* Veranstaltungs Titel / Survey Title (used as part of the welcome message, if welcome Message is left blank):

* VeranstaltungsBeschreibung / SurveyDescription (used as part of the welcome message, if welcome Message is left blank):

Willkommenstext / Welcome Message:

Endtext / endtext:

Admin Name:

Admin Email:

End Url:

Url Description:

" ?>

sActivateSurvey function

' method='post'>* VeranstaltungsID / SurveyID:

Startdate (YYYY-MM-DD):

Enddate (YYYY-MM-DD):

" ?>

sDeleteSurvey function

(attention: no safetyquestion is asked!)
' method='post'>* VeranstaltungsID / SurveyID:

" ?>

sImportGroup function

' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):

* Question group to add (INF,BIO,BWL is there for testing):

Name of the group:

groupDescription:

" ?>

sImportFreetext

' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):

Mandatory
* Question Title :

* Question:

Helptext:

" ?>

sImportQuestion

' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):

Mandatory
* Question csv to import:

" ?>

sImportMatrix

' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):

Mandatory
* Question :

Item {$n} :
", "", "
"; } ?> Helptext:

" ?>

sChangeSurvey function

( this is not part of the lsrc, it just shows the power of it,
it has to be activated in server.php on line ~60 )
' method='post'> update insert
Table to change

Key

Value

where Condition

"; echo "

sInsertToken function

"; echo "

Makes the Survey closed.
Means: It's only available to people who have an unused token

"; echo "
"; echo "* VeranstaltungsID / SurveyID (have to be Integer):
"; echo ""; echo "
"; echo "Tokens seperated by comma (,) :
"; echo ""; echo "
"; echo ""; echo ""; echo "
"; echo ""; echo "
"; echo "

sTokenReturn function

"; echo "
"; echo "* VeranstaltungsID / SurveyID (have to be Integer):
"; echo "
"; echo ""; echo ""; echo "
"; echo "
"; echo "

sInsertParticipants function

"; echo "

Makes the Survey closed. Means: It's only available to people who have an unused token

"; echo "
"; echo "* VeranstaltungsID / SurveyID (have to be Integer):
"; echo ""; echo "
"; echo "* Data in this Format [params in square brackets are optional]:
\"FIRSTNAME;LASTNAME;EMAIL;LANG[;TOKEN;VALIDFROM;VALIDUNTIL;attrib1,attrib2,attrib3,attrib4,attrib5]
::FIRSTNAME;LASTNAME;EMAIL;LANG[;TOKEN;VALIDFROM;VALIDUNTIL;attrib1,attrib2,attrib3,attrib4,attrib5]\" and so on :

"; echo " "; echo "
"; echo ""; echo ""; echo "
"; echo "
"; echo "
"; echo "

sSendEmail function

"; echo "

Sends an Email to users of a specific survey. Invite, Remind and custom emails are possible

"; echo "
"; echo "* SurveyID (have to be Integer):
"; echo ""; echo "
"; echo "* Email Type:
"; echo " invite"; echo " remind"; echo " custom
"; echo "Maxemails (have to be Integer):
"; echo ""; echo "
"; //echo "* Data in this Format [params in square brackets are optional]:
\"FIRSTNAME;LASTNAME;EMAIL[;[ATTRIB1];[ATTRIB2]]::FIRSTNAME;LASTNAME;EMAIL[;[ATTRIB1];[ATTRIB2]]\" and so on :

"; echo "Subject for custom cails
"; echo "
"; echo "Mailtext for custom cails
"; echo " "; echo "
"; echo ""; echo ""; echo "
"; echo "
"; echo "
"; echo "

sGetFieldmap function

"; echo "

Gets you the fieldmap from a survey as csv

"; echo "
"; echo "* VeranstaltungsID / SurveyID (have to be Integer):
"; echo "
"; echo ""; echo ""; echo "
"; echo "
"; echo "

fSendStatistic function

"; echo "

Gets statistic from a survey and sends it to an E-Mail recipient

"; echo "
"; echo "* VeranstaltungsID / SurveyID (have to be Integer):
"; echo "
"; echo "* E-Mail Adress:
"; echo "
"; echo "Include graphs (only with pdf generation)
"; echo "PDF attachement"; echo "Excel attachement"; echo "HTML Mail
"; echo ""; echo ""; echo "
"; //phpinfo(); ?>