| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/survey_demo/webadmin/ |
Upload File : |
<?php
require_once('check_login.php');
/*$message = "";
if (empty($_POST["form_xml"]) || empty($_POST["form_html"])) {
$message .= "Cannot get form data. Please try again.";
}
if (!empty($message)) {
echo $message;
exit;
}*/
if (empty($_POST["form_xml"]) || empty($_POST["form_html"])) {
exit;
}
$result = fn_parse_form_data($_POST["form_xml"]);
//var_dump($result);
//deleted old question
$sql = "update question set deleted = ? where campaign_id = ?";
$parameters = array(1, (int)$_POST["campaign_id"]);
bind_pdo($sql, $parameters);
$sort = 1;
foreach ($result as $question) {
$sql = "insert into question (campaign_id, `name`, `type`, `label`, option_label, option_value, sort, createdate, createby) values (?,?,?,?,?,?,?,?,?)";
$parameters = array((int)$_POST["campaign_id"], $question["name"], $question["type"], $question["label"], implode("*", $question["option"]["label"]), implode("*", $question["option"]["value"]), $sort, $nowdate, $_SESSION['cmsloginid']);
bind_pdo($sql, $parameters);
$sort++;
}
$sql = "update campaign set form_html=?, form_xml=? where id = ?";
$parameters = array($_POST["form_html"], $_POST["form_xml"], (int)$_POST["campaign_id"]);
bind_pdo($sql, $parameters);
echo "SUCCESS";
//header("Location: campaign_index.php?msg=1");