connect_error) { die(json_encode(["error" => "Connection failed: " . $conn->connect_error])); } $stmt = $conn->prepare("SELECT * from company"); $stmt->execute(); $result = $stmt->get_result(); $logoname = $result->fetch_all(MYSQLI_ASSOC); $stmt = $conn->prepare("DELETE from reportsections"); $stmt->execute(); $stmt = $conn->prepare("INSERT INTO reportsections ( cover_title, cover_subtitle, instructionsdetails_title, instructiondetails_text, overviewstatistic_title, overviewstatistic_text, supplieristatistic_title, supplieristatistic_text, analysisstatistic_title, analysisstatistic_text, analytscompounds_title, analytscompounds_text, finalevaluation_title, finalevaluation_text ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); if ($stmt === false) { die(json_encode(["error" => "Prepare statement failed: " . $conn->error])); } $stmt->bind_param( 'ssssssssssssss', $title[0], $content[0], $title[1], $content[1], $title[2], $content[2], $title[3], $content[3], $title[4], $content[4], $title[5], $content[5], $title[6], $content[6] ); if (!$stmt->execute()) { die(json_encode(["error" => "Execute statement failed: " . $stmt->error])); } $stmt->close(); $conn->close(); $chartdata0 = file_get_contents('../../../resources/charts/chart0.ch'); $chartdata1 = file_get_contents('../../../resources/charts/chart1.ch'); $chartdata2 = file_get_contents('../../../resources/charts/chart2.ch'); $chartdata3 = file_get_contents('../../../resources/charts/chart3.ch'); $chartdata4 = file_get_contents('../../../resources/charts/chart4.ch'); $chartdata5 = file_get_contents('../../../resources/charts/chart5.ch'); $tmplogo = file_get_contents('../uploadlogo/' . $logoname[0]['logocompany']); $base64logo = base64_encode($tmplogo); $logodata = 'data:image/jpeg;base64,' . $base64logo; $page = '
' . $content[1] . '
FILTERS APPLIED
From Date ' . $filterStart . ' to Date ' . $filterEnd . '
Other Filters
' . $content[2] . '
' . $content[3] . '
' . $content[4] . '
' . $content[5] . '
' . $content[6] . '