<?php
$new_results = array();
require "UserAdmin/super_secret_stuff.php";
$con = mysqli_connect($website,$mysqli_username,$pw,$dbase);
$user_id = get_userid($con);
$res = mysqli_query($con,"SELECT calproj_id FROM Calibro_projects WHERE shared_between like '%,{$user_id},%'");
while($row = mysqli_fetch_array($res)){
  $id = $row[0];
  $res1 = mysqli_query($con,"SELECT COUNT(result) FROM Calibro_results WHERE calproj_id = {$id}");
  $row1 = mysqli_fetch_array($res1);
  if($row1[0] > 0){
    $res1 = mysqli_query($con,"SELECT result FROM Calibro_results WHERE calproj_id = {$id}");
    $row1 = mysqli_fetch_array($res1);
    $result = $row1[0];
    array_push($new_results,"{$id}<<>>{$result}");
  }else{
    array_push($new_results,"{$id}<<>>-1");
  }
}
mysqli_close($con);
echo json_encode($new_results);
?>

































<?php ?>
