|X|"; } else { $out = " |X|"; } return $out; } function html_post_value($field_name) { if (!isset($_POST[$field_name]) || trim($_POST[$field_name]) == "") { $out = ""; } else { $out = preg_replace("/\~\|\~/", "\n", $_POST[$field_name]); } return $out; } function html_post_value_select($field_name, $options) { for($i=0; $i$val\n"; } } function html_radio_checked($field_name, $field_value) { if (isset($_POST[$field_name]) && trim($_POST[$field_name]) == $field_value) { $out = "checked"; } else { $out = ""; } return $out; } function save_reg() { $servername = "localhost"; $username = "unapa_IST2015"; $password = "qJxu147@"; $db = "unapar300042hr2926_ISTERH2015"; $mysqli = new mysqli($servername, $username, $password, $db); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* for($i=0; $iprepare($query); $stmt->bind_param("sssssssssssssssssssssssssss", $_POST["i_title"], $_POST["i_name_first_middle"] , $_POST["i_name_last"], $_POST["i_institution"], $_POST["i_department"] , $_POST["i_address"], $_POST["i_city"], $_POST["i_zip"], $_POST["i_country"] , $_POST["i_phone"], $_POST["i_email"], $_POST["i_isterh_member"], $_POST["i_type_of_reg"] , $_POST["i_welcome_reception"], $_POST["i_guided_tour"], $_POST["i_conference_dinner"] , $_POST["i_opt_conf_tour"], $_POST["i_opt_post_conf_tour"], $_POST["i_message"] , $_SERVER["HTTP_USER_AGENT"], $_SERVER["HTTP_REFERER"], $_SERVER["REMOTE_ADDR"] , $_SERVER["REQUEST_TIME"], $_POST["i_accommodation"], $_POST["i_accomodation_superior"] , $_POST["i_check_in_day"], $_POST["i_check_out_day"]); $stmt->execute(); $id = $mysqli->insert_id; $mysqli->close(); return $id; } function save_acco($DATA) { $servername = "localhost"; $username = "unapa_IST2015"; $password = "qJxu147@"; $db = "unapar300042hr2926_ISTERH2015"; $mysqli = new mysqli($servername, $username, $password, $db); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* for($i=0; $iprepare($query); $stmt->execute(); $id = $mysqli->insert_id; $mysqli->close(); return $id; } function del_reg($id, $param) { $servername = "localhost"; $username = "unapa_IST2015"; $password = "qJxu147@"; $db = "unapar300042hr2926_ISTERH2015"; $mysqli = new mysqli($servername, $username, $password, $db); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "UPDATE registration_data set acc_person='$param' where id=$id"; $stmt = $mysqli->prepare($query); $stmt->execute(); $id = $mysqli->insert_id; $mysqli->close(); return $id; } function get_reg_data($id, $pass) { $servername = "localhost"; $username = "unapa_IST2015"; $password = "qJxu147@"; $db = "unapar300042hr2926_ISTERH2015"; $mysqli = new mysqli($servername, $username, $password, $db); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "select * from registration_data where concat('P',lpad(CONVERT(id, CHAR(50)), 4, '0')) = '$id' and right(server_timestamp, 5)='$pass'"; $result = $mysqli->query($query); $row = $result->fetch_array(MYSQLI_ASSOC); $result->free(); $mysqli->close(); return $row; } function get_reg_data2($id) { $servername = "localhost"; $username = "unapa_IST2015"; $password = "qJxu147@"; $db = "unapar300042hr2926_ISTERH2015"; $mysqli = new mysqli($servername, $username, $password, $db); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (strlen($id) == 5) { $query = "select * from registration_data where concat('P',lpad(CONVERT(id, CHAR(50)), 4, '0')) = '$id'"; } else { $query = "select * from registration_data where md5(concat('P',lpad(CONVERT(id, CHAR(50)), 4, '0'))) = '$id'"; } $result = $mysqli->query($query); $row = $result->fetch_array(MYSQLI_ASSOC); $result->free(); $mysqli->close(); return $row; } function get_all_reg_data() { $servername = "localhost"; $username = "unapa_IST2015"; $password = "qJxu147@"; $db = "unapar300042hr2926_ISTERH2015"; $out = array(); $mysqli = new mysqli($servername, $username, $password, $db); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "select distinct * from registration_data where id>21 and id not in (29,40)"; $query = "select distinct * from registration_data"; $result = $mysqli->query($query); while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $out[] = $row; //print_r($row); } $result->free(); $mysqli->close(); return $out; } function get_all_uploaded_files() { $files = array(); if ($handle = opendir('./uploads')) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $_file["name"] = $entry; $_file["ctime"] = strftime("%Y.%m.%d %H:%M:%S\n", filectime('./uploads/'.$entry)); $files[] = $_file; } } closedir($handle); } return $files; } /* INSERT INTO `registration_data`(`id`, `unique_id`, `title`, `fname_mname`, `lname`, `institution`, `department`, `address`, `city`, `zip`, `country`, `phone`, `email`, `member`, `reg_type`, `opt1`, `opt2`, `opt3`, `opt4`, `opt5`, `note`, `abstract_submit_date`, `server_user_agent`, `server_http_referer`, `server_remote_addr`, `server_timestamp`, `ctime`, `mtime`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8],[value-9],[value-10],[value-11],[value-12],[value-13],[value-14],[value-15],[value-16],[value-17],[value-18],[value-19],[value-20],[value-21],[value-22],[value-23],[value-24],[value-25],[value-26],[value-27],[value-28]) */ ?> ISTERH 2015 registration
"; if (!isset($_POST[$_field_name]) || trim($_POST[$_field_name]) == $_field_err_value) { $error = 1; break; } } } else { $error = -1; } if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST["Submit_BACK"])) { $error = -1; } if ($error == 0) { if (isset($_POST["Submit_OK"])) { include("thank_you.php"); } else { include("user_confirm_data.php"); } /* echo "
";
    	print_r($_POST);
    	print_r($_SERVER);
     	echo "
"; */ } else { ?>
|X| ALL marked fields should be completed!