public function index() { $member = Member::currentUserID(); if (Permission::checkMember($member, 'CMS_ACCESS')) { $Documentation = Documentation::get(); $list = new ArrayList(); foreach ($Documentation as $Document) { $list->push($Document); } return $this->customise(array('Documentation' => $list))->renderWith(array('Documentation', 'Page')); } else { // Debug::dump('no access'); // die(); return $this->redirect('/Security/login'); } }
$patient = new Patient($db); $filtros = array(); if (isset($data['paciente'])) { add_filter($filtros, 'id_patient', $data['paciente']); } else { if ($_SESSION['user']['type'] == PATIENT) { add_filter($filtros, 'id_patient', $_SESSION['user']['id']); } } if ($_SESSION['user']['type'] == PATIENT) { add_filter($filtros, 'eliminado_paciente', 0); } else { add_filter($filtros, 'eliminado_admin', 0); } if (isset($data['limit'])) { $result = $documentation->get($filtros, '*', null, 'LIMIT ' . $data['limit']); } else { $result = $documentation->get($filtros); } if ($result->resultado) { $encode = array(); for ($i = 0; $i < count($result->datos); $i++) { $result->datos[$i]['url'] = '/common/dwfs.php?key=' . encrypt(UPLOAD_DIR . BARRA_SERVIDOR . $result->datos[$i]['url'] . '@@' . $result->datos[$i]['nombre']); $resultP = $patient->getPatient('info', $result->datos[$i]['id_patient']); if ($resultP->resultado) { $result->datos[$i]['remitente'] = $resultP->datos[0]['nombre'] . " " . $resultP->datos[0]['apellidos']; } $encode[] = $result->datos[$i]; } echo json_encode($encode); } else {