This commit is contained in:
Olu Amey
2023-02-13 14:16:44 -05:00
parent 2477672638
commit 35cfb9edd3
5 changed files with 190 additions and 17 deletions
+33 -1
View File
@@ -74,6 +74,13 @@ $pathName = '';
case WRENCHBOARD_MOBILE_ACTIVEJOB:
$pathName = 'activejoblist';
break;
case WRENCHBOARD_ACCOUNT_WALLETS:
$pathName ='getwallets';
break;
case WRENCHBOARD_START_JOBLIST:
$pathName="startjoblist";
break;
}
return $pathName;
@@ -104,7 +111,7 @@ return $pathName;
curl_close($curl);
$response = json_decode($json_response, true);
$this->showResult($url, $in, $response);
$this->showResult($url, $in, $response);
$out = $response;
return $response["internal_return"];
}
@@ -119,6 +126,31 @@ return $pathName;
<td></td>
</tr>
</table>";
//$response['result_list']
if ( isset($out['result_list']) && is_array($out['result_list']) && count($out['result_list']) > 0 ){
$arr = $out['result_list'];
$myHeaders = array_keys($arr[0]);
var_dump( $myHeaders);
$tableHead = '<tr>';
foreach ($myHeaders as $hd){
$tableHead .= "<th>".$hd."</th>";
}
$tableHead .= '</tr>';
$tableBody = '';
foreach ($arr as $item) {
$tableBody .= '<tr>';
$backColor ='white';
foreach ($myHeaders as $hd){
$backColor = ($backColor=='aliceblue')?'white': 'aliceblue';
$tableBody .= "<td style='background-color:$backColor'>".$item[$hd]."</td>";
}
$tableBody .= '</tr>';
}
echo "<table>".$tableHead.$tableBody."</table>";
}
}
}