49 lines
1.4 KiB
PHP
49 lines
1.4 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('includes/functions.php');
|
|
$noOfRows = $_POST['count_items'];
|
|
|
|
$dis_agncy = $_POST['dis_agncy'];
|
|
|
|
error_log("#_REQ" . print_r($_POST, true));
|
|
|
|
for ($i = 0; $i < $noOfRows; $i++) {
|
|
|
|
$checkup_section_id_str = "section_id" . $i;
|
|
$checkup_section_id = $_POST[$checkup_section_id_str];
|
|
|
|
$rule = $_REQUEST['rule'];
|
|
$rule_ids = implode(',', $rule);
|
|
|
|
$status = $_POST['Status'];
|
|
|
|
$notes = $_REQUEST['notes'];
|
|
$comments = $_REQUEST['comments'];
|
|
|
|
$dis_order = $_REQUEST['dis_order'];
|
|
|
|
$is_interpretation = $_POST['is_interpretation'];
|
|
|
|
$query_initial = "";
|
|
$endquery = "";
|
|
//begin();
|
|
if (!empty($checkup_section_id)) {
|
|
$query_initial = "update ";
|
|
$endquery = " where section_id = '" . $checkup_section_id . "' ";
|
|
} else {
|
|
$query_initial = "insert into ";
|
|
}
|
|
|
|
|
|
error_log("messgeeeee");
|
|
$query = $query_initial . " checkup_form_section set section_name = '" . ${"section_name$i"} . "', section_desc='" . ${"section_desc$i"} . "' ,Status='$status',rule_ids = '$rule_ids',notes='" . ${"notes$i"} . "',comments='" . ${"comments$i"} . "',display_order='" . $dis_order . "',interpretation ='" . $is_interpretation . "' ,modified_by = '" . $_SESSION['user_id'] . "' " . $endquery;
|
|
error_log("query:" . $query);
|
|
|
|
if (!$result = mysqli_query($conn, $query)) {
|
|
error_log("error in making a new section:" . mysqli_error($conn));
|
|
rollback();
|
|
exit();
|
|
}
|
|
}
|
|
commit();
|