@@ -136,54 +173,95 @@
';
}
+
+
function editManager() {
+
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 FormPromotion();
- $cine->processesForm($_POST['id'],null,null,null,null,"del");
+ $cine = new FormManager();
+ $cine->processesForm($_POST['id'], null,"del");
$_SESSION['message'] = $cine->getReply();
- header('Location: ../panel_admin/index.php?state=mp');
+ header('Location: ../panel_admin/index.php?state=mg');
}
function confirmEdit() {
- $cine = new FormPromotion();
- $cine->processesForm($_POST['id'], $_POST['username'], $_POST['email'], $_POST['pass'],"manager","edit");
- $_SESSION['message']= $cine->getReply();
- header('Location: ../panel_admin/index.php?state=mp');
+ $manager = new FormManager();
+ $manager->processesForm($_POST['id'], $_POST['idcinema'],"edit");
+ $_SESSION['message']= $manager->getReply();
+ header('Location: ../panel_admin/index.php?state=mg');
}
function confirmAdd() {
- $cine = new FormPromotion();
- $cine->processesForm(null,$_POST['username'], $_POST['email'], $_POST['pass'],"manager","new");
- $_SESSION['message'] = $cine->getReply();
- header('Location: ../panel_admin/index.php?state=mp');
+ $manager = new FormManager();
+ $manager->processesForm($_POST['iduser'], $_POST['idcinema'],"new");
+ $_SESSION['message'] = $manager->getReply();
+ header('Location: ../panel_admin/index.php?state=mg');
}
diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php
index c8f3c0b..d1a86c2 100644
--- a/panel_admin/panelAdmin.php
+++ b/panel_admin/panelAdmin.php
@@ -34,6 +34,9 @@
};
break;
case 'mf': require_once('manage_films.php');
+ //echo $_SERVER['DOCUMENT_ROOT']."/../img";
+ echo TMP_DIR;
+ //echo $_SERVER['PHP_SELF'];
if(isset($_POST['edit_film'])) {
editFilm();
}
@@ -83,9 +86,16 @@
else if(isset($_POST['delete_manager'])) {
deleteManager();
}
+ else if(isset($_POST['select_user'])) {
+ selectUser();
+ }
+ else if(isset($_POST['select_cinema'])) {
+ selectCinema();
+ }
else if(isset($_POST['add_manager'])) {
confirmAdd();
}
+
else if(isset($_POST['confirm_delete_manager'])) {
confirmDelete();
}