Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
gilour
/
assessment
/
cl-admin
/
monitor
:
load_behavioral_indicators.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php require_once "../include/config.php"; // Create a database connection $conn = new mysqli($host, $username, $password, $database); // Check the connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Fetch behavioral indicators based on selected competency if(isset($_POST['competency'])) { $selectedCompetency = $_POST['competency']; // Simulated behavioral indicators data // GET BIs DATA $sql = "SELECT bi.id, bi.name as mybi, c.name as competency, c.nama as kompetensi FROM behavioral_indicator as bi INNER JOIN competency as c ON bi.competency_id = c.id where c.id =" .$selectedCompetency ; $result = $conn->query($sql); $behavioralIndicators = array(); // Array to store behavioral indicators if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $behavioralIndicators[] = $row['mybi']; } } //var_dump($behavioralIndicators); echo json_encode($behavioralIndicators); } ?>