* @copyright Australian Consortium for Social and Political Research Inc (2011) * @package queXS * @subpackage admin * @link http://www.acspri.org.au/ queXS was writen for ACSPRI * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * * */ /** * Configuration file */ include("../config.inc.php"); /** * Database file */ include ("../db.inc.php"); /** * Authentication file */ require ("auth-admin.php"); /** * XHTML functions */ include("../functions/functions.xhtml.php"); /** * Display functions */ include("../functions/functions.display.php"); /** * Input functions */ include("../functions/functions.input.php"); /** * Limesurvey functions */ include("../functions/functions.limesurvey.php"); $css = array( "../include/bootstrap/css/bootstrap.min.css", "../css/custom.css" ); $js_head = array( ); $js_foot = array( "../js/window.js", "../js/custom.js" ); global $db; xhtml_head(T_("Questionnaire services"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js") $error = false; if (isset($_POST['description'])) { $test = limerpc_init($_POST['rpc_url'],$_POST['username'],$_POST['password']); if ($test === true) { $description = $db->qstr($_POST['description']); $rpc_url = $db->qstr($_POST['rpc_url']); $username = $db->qstr($_POST['username']); $password = $db->qstr($_POST['password']); $entry_url = $db->qstr($_POST['entry_url']); if (isset($_POST['id'])) { $id = intval($_POST['id']); $sql = "UPDATE `remote` SET description = $description, rpc_url = $rpc_url, username = $username, password = $password, entry_url = $entry_url WHERE id = '$id'"; } else { $sql = "INSERT INTO `remote` (description,rpc_url,username,password,entry_url) VALUES ($description,$rpc_url,$username,$password,$entry_url)"; } $db->Execute($sql); } else { $error = $test; } } //view groups $sql = "SELECT id, rpc_url, username, description, CONCAT('". TQ_("Modify") . "') as link FROM remote"; $rs = $db->GetAll($sql); print "
" . T_("Questionnaire services available. Services include Limesurvey remote control.") . "
"; if ($error !== false) { print "
" . T_("Service not added/updated. Error: ") . $error . "
"; } if (empty($rs)) print "
" . T_("No questionnaire services defined") . "
"; else{ print "
"; xhtml_table($rs,array("id","description","link"),array(T_("ID"),T_("Service"),T_("Modify")),"table table-hover"); print "
"; } //add a service // if (isset($_GET['id'])) { $id = intval($id); $sql = "SELECT * FROM remote WHERE id = $id"; $rs = $db->GetRow($sql); ?>

"/>

"/>

"/>

"/>

"/>

"/>

"/>