function GetSheduleByID($id, $needObj = false) { global $DB; $err_mess = self::err_mess() . "<br>Function: Set<br>Line: "; $tableShedule = self::TABLE_SHEDULE; $id = intval($id); $strSql = "\n\t\t\tSELECT\n\t\t\t\tT.*\n\t\t\tFROM\n\t\t\t\t{$tableShedule} T\n\t\t\tWHERE\n\t\t\t\tT.TIMETABLE_ID = {$id}\n\t\t\t"; $res = $DB->Query($strSql, false, $err_mess . __LINE__); if (!$needObj) { return $res; } $f_s = new CSupportTableFields(self::$fieldsTypesShedule, CSupportTableFields::C_Table); $f_s->RemoveExistingRows(); while ($resR = $res->Fetch()) { $f_s->AddRow(); $f_s->FromArray($resR); } return $f_s; }
function GetSLAByID($id, $needObj = false) { $err_mess = self::err_mess() . "<br>Function: GetList<br>Line: "; global $DB, $USER, $APPLICATION; $table_s2h = self::table_s2h; $table_sla = self::table_sla; $id = intval($id); $strSql = "\n\t\t\tSELECT\n\t\t\t\tS2H.HOLIDAYS_ID,\n\t\t\t\tS2H.SLA_ID,\n\t\t\t\tSLA.NAME\n\t\t\tFROM\n\t\t\t\t{$table_s2h} S2H\n\t\t\t\tINNER JOIN {$table_sla} SLA\n\t\t\t\t\tON S2H.SLA_ID = SLA.ID\n\t\t\t\t\t\tAND S2H.HOLIDAYS_ID = {$id}\n\t\t\tORDER BY\n\t\t\t\tSLA.NAME\n\t\t\t"; $res = $DB->Query($strSql, false, $err_mess . __LINE__); if (!$needObj) { return $res; } $f_s = new CSupportTableFields(self::$sla2holidays, CSupportTableFields::C_Table); $f_s->RemoveExistingRows(); while ($resR = $res->Fetch()) { $f_s->AddRow(); $f_s->FromArray($resR); } return $f_s; }