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 "
            
            
                
                
                
                    | Id | 
                    IdCinema | 
                    Nombre | 
                    Email | 
                    password | 
                    Rol | 
                
                
                
                "; 
        if(is_array($managers)){         
            for($i = 0; $i < count($managers); $i++){
                echo '
                        | '. $ids[$i] .' | 
                        '. $idscinemas[$i] .' | 
                        '. $usernames[$i] .' | 
                        '. $email[$i] .' | 
                        '. $rol[$i] .' | 
                        
                             
                         |  
                         
                             
                         |  
                    
                    '; 
            } 
        }
        echo'
                
             
            
        ';
        
            
    }
    function addManager(){
        echo'   
                
                
             
            ';
    }
   
    function selectUser() {
        echo'
        
            Selecciona el usuario al que quieres dar privilegios.
            
         
        
        ';
    }
    function selectCinema() {
        echo'
        
            Selecciona el cine asociado al nuevo manager.
            
         
        
        ';
    }
    function deleteManager() {
        echo'
            
            
            ';
    }
  
    function editManager() {
       
        echo'
        
            Editar gerente ID: '.$_POST['id'].'
            
         
        
        ';
                   
    }
    // 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');
    }
?>