I need help doing this. i cant figure out how to retu the boolean, and it seems that my condition's not working.
<?php
$xml=simplexml_load_file("Details.xml") or die("Error: Caot create object");
function SearchSu($Su1 , $Su2)
{
//boolean
$av1 = false; //false => the supervisor is not in the list (AVAILABLE)
$av2 = false;
//set the supervisor
$Su1 = "591006125411"; //Bruno
$Su2 = "571121125351"; //Dayana
foreach($xml_array as $Employee) //problem occur here though
{
if($Su1 == $Employee->EmployeeNewIC) // true=>supervisor is out
{
//if supervisor1 is out, procees check with supervisor2
if($Su2 == $Employee->EmployeeNewIC )
{
retu $av1 = false; //true=>supervisor is out
}
else if($Su2 !== $Employee->EmployeeNewIC) // false=>supervisor is available
{
retu $av2;
}
}
else
retu $av1;
}
SearchSu("591006125411","571121125351");
?>
i would very much appreciate the help.
