"; $strSelect .= ""; foreach ($alltasktypes as $type) { $sel = ""; if ($tasktypeId == $type->id) $sel = "selected"; $strSelect .= ""; } $strSelect .= ''; return $strSelect; } if (isset($editjobs)) { $jobtype = Jobtype::Find($jobid); $companyID = $jobtype->getCompany(); $retarr = array(); $retarr["jobid"] = $jobid; if ($jobtype) { $alltasktypes = GrabTasktypes("subs"); //массив id $ttypes = $jobtype->getTaskTypes(); $index = 0; foreach ($ttypes as $ttype) { $strSelect = formAllTaskTypes($index, $jobid, $ttype->id); $retarr["tasktypes"][] = array("id" => $ttype->id, "html"=> $strSelect); $index++; } } $json = json_encode($retarr, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); echo $json; }