$currentTask['status'] = 1;
$courseList = array(
array("Type"=>0,"Name"=>'准备出发',"Value"=>"1"),
array("Type"=>0,"Name"=>'途中',"Value"=>"2"),
array("Type"=>1,"Name"=>'到达',"Value"=>"3"),
array("Type"=>0,"Name"=>'进入现场准备',"Value"=>"4"),
array("Type"=>2,"Name"=>'工前会',"Value"=>"5"),
array("Type"=>0,"Name"=>'开工作票',"Value"=>"6"),
array("Type"=>0,"Name"=>'现场许可',"Value"=>"7"),
array("Type"=>0,"Name"=>'现场安设及危险源交底',"Value"=>"8"),
array("Type"=>0,"Name"=>'开始工作',"Value"=>"9"),
array("Type"=>2,"Name"=>'工后会',"Value"=>"12"),
array("Type"=>1,"Name"=>'返程',"Value"=>"13")
);
for($i=0;$i<count($courseList);$i++){
if($i==$currentTask['status']){
$courseList[$i]['status'] = 1;
}
else{
$courseList[$i]['status'] = 0;
}
}
#######################################################
foreach($courseList as $key=>&$val){
if($currentTask['status']==$key){
$val['status'] = 1;
}
else{
$val['status'] = 0;
}
}