/** * @deprecated * @return array */ function kln_getlist() { if (is_director($_SESSION["user"]["data"]["id"])) { $clients = Client::findAll(); } else { $clients = Client::findBy(array('filial_id' => $_SESSION["user"]["data"]["filial_id"])); } $ret = array(); foreach ($clients as $v) { $ret[$v["id"]] = $v["id"] . ". " . $v["fio"] . " (тел. " . $v["telnum"] . "; email: " . $v["email"] . ")"; } return $ret; }
if (isset($_REQUEST["a"]) && strlen($_REQUEST["a"])) { $a = explode(";", $_REQUEST["a"]); $u = 0; $k = 0; foreach ($a as $v) { if (strtolower(substr($v, 0, 1)) == "u") { $script[] = "selected_users[" . $u++ . "]=" . intval(substr($v, 1)) . ";"; } if (strtolower(substr($v, 0, 1)) == "k") { $script[] = "selected_clients[" . $k++ . "]=" . intval(substr($v, 1)) . ";"; } } } if ($to_kln) { if (is_director($_SESSION["user"]["data"]["id"])) { $clients = Client::findAll(); } else { $clients = Client::findBy(array('filial_id' => $_SESSION["user"]["data"]["filial_id"])); } $k = 0; foreach ($clients as $v) { $script[] = "clients_list[" . $k++ . "]={id:" . $v["id"] . ",name:'" . $v["fio"] . "'};"; } } $script[] = "</script>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>