diff --git a/admin/remote.php b/admin/remote.php index 61bf51f9..53bbfffe 100644 --- a/admin/remote.php +++ b/admin/remote.php @@ -91,9 +91,19 @@ if (isset($_POST['description'])) $username = $db->qstr($_POST['username']); $password = $db->qstr($_POST['password']); $entry_url = $db->qstr($_POST['entry_url']); - - $sql = "INSERT INTO `remote` (description,rpc_url,username,password,entry_url) - VALUES ($description,$rpc_url,$username,$password,$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 { @@ -111,7 +121,7 @@ $sql = "SELECT id, rpc_url, username, description, print "
" . T_("Questionnaire services available. Services include Limesurvey remote control.") . "
"; if ($error !== false) { - print "
" . T_("Service not added. Error: ") . $error . "
"; + print "
" . T_("Service not added/updated. Error: ") . $error . "
"; } @@ -124,16 +134,42 @@ else{ } //add a service +// +if (isset($_GET['id'])) { + $id = intval($id); + + $sql = "SELECT * + FROM remote + WHERE id = $id"; + + $rs = $db->GetRow($sql); +?> +
+

+

+

+

+

+

+

"/>

+ +
+ +

-

"/>

-

"/>

+

"/>

+

"/>

"/>

"/>

-

"/>

+

"/>

"/>