allManagersData(); $ids = array(); $idscinemas = array(); $usernames = array(); $email = array(); $rol = array(); if(is_array($managers)){ foreach($managers as $key => $value){ $ids[$key] = $value->getId(); $idscinemas[$key] = $value->getIdcinema(); $usernames[$key] = $value->getUsername(); $email[$key] = $value->getEmail(); $rol[$key] = $value->getRoll(); } } echo "
"; if(is_array($managers)){ for($i = 0; $i < count($managers); $i++){ echo ' '; } } echo'
Id IdCinema Nombre Email password Rol
'. $ids[$i] .' '. $idscinemas[$i] .' '. $usernames[$i] .' '. $email[$i] .' '. $rol[$i] .'
'; } function addManager(){ echo'

Añadir gerente

'; } function selectUser() { echo'

Selecciona el usuario al que quieres dar privilegios.

Selecciona usuario.'; showUsers(); echo '
'; } function selectCinema() { echo'

Selecciona el cine asociado al nuevo manager.

Selecciona cine.'; showCinemas(); echo '
'; } function deleteManager() { echo'

Borrar gerente

¿Estás seguro de que quieres eliminar este gerente?

Id: '.$_POST['id'].'

IdCinema: '.$_POST['idcinema'].'

Nombre: '.$_POST['username'].'

Email: '.$_POST['email'].'

Rol: '.$_POST['rol'].'

'; } function editManager() { echo'

Editar gerente ID: '.$_POST['id'].'

Selecciona su cine.'; showCinemas(); echo '
'; } // Show cinemas and users functions function showCinemas() { $cine = new Cinema_DAO("complucine"); $cinemas = $cine->allCinemaData(); $ids = array(); $names = array(); $directions = array(); $phones = array(); foreach($cinemas as $key => $value){ $ids[$key] = $value->getId(); $names[$key] = $value->getName(); $directions[$key] = $value->getDirection(); $phones[$key] = $value->getPhone(); } for($i = 0; $i < count($cinemas); $i++){ echo ' '; } } function showUsers() { $user = new UserDAO("complucine"); $users = $user->allUsersNotM(); $ids = array(); $usernames = array(); $emails = array(); $roles = array(); foreach($users as $key => $value){ $ids[$key] = $value->getId(); $usernames[$key] = $value->getName(); $emails[$key] = $value->getEmail(); $roles[$key] = $value->getRol(); } for($i = 0; $i < count($users); $i++){ echo ' '; } } // Logic Functions function confirmDelete() { $cine = new FormManager(); $cine->processesForm($_POST['id'], null,"del"); $_SESSION['message'] = $cine->getReply(); header('Location: ../panel_admin/index.php?state=mg'); } function confirmEdit() { $manager = new FormManager(); $manager->processesForm($_POST['id'], $_POST['idcinema'],"edit"); $_SESSION['message']= $manager->getReply(); header('Location: ../panel_admin/index.php?state=mg'); } function confirmAdd() { $manager = new FormManager(); $manager->processesForm($_POST['iduser'], $_POST['idcinema'],"new"); $_SESSION['message'] = $manager->getReply(); header('Location: ../panel_admin/index.php?state=mg'); } ?>