674,14 → 674,7 |
// Формируем sections |
$query = "SELECT * FROM ".$this->prefix."section s "; |
$query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id "; |
$query .= "WHERE r.rep_id='".$base["rep_id"]."' AND ("; |
for($i=0;$i<count($data["section"]);$i++) { |
$query .= "s.sect_id='".$data["section"][$i]."' "; |
if ($i<count($data["section"])-1) { |
$query .= " OR "; |
} |
} |
$query .= ")"; |
$query .= "WHERE r.rep_id='".$base["rep_id"]."'"; |
$rq =& $this->db->query($query); |
while ($rq->fetchInto($sections)) { |
$show .= $sections["secname"]." "; |