reply = array(); } //Methods: //Returns validation response: public function getReply() { echo "

se va a devolver una respuesta

"; if($this->correct){ if($this->option == "new"){ $this->reply = "

Operacion realizada con exito


Se ha aƱadido la sala correctamente en la base de datos.

"; }else if($this->option == "edit"){ $this->reply = "

Operacion realizada con exito


Se ha editado la sala correctamente en la base de datos.

"; }else if($this->option == "del"){ $this->reply = "

Operacion realizada con exito


Se ha eliminado la sala correctamente en la base de datos.

"; }else if($this->option == "list"){ echo "

se va a devolver la lista

"; $this->reply = $this->halls; } } else { $this->reply = "

ERROR


Ha habido un error en la operacion. Revisa los datos introducidos o ponte en contacto con el administrador de la base de datos.

"; } return $this->reply; } //Process form: public function processesForm($number, $cinema, $rows, $cols, $option) { $this->option = $option; $this->correct = true; $bd = new HallDAO('complucine'); if($bd ){ if($option == "list"){ $this->halls = $bd->getAllHalls($cinema); }else { /* TODO $start = date('H:i:s', strtotime( $start ) ); if($option == "new"){ $selectSession = $bd->selectSession($cinema, $hall, $start, $date); if($selectSession && $selectSession->num_rows >= 1) { $this->correct = false; } else{ $bd->createSession(null, $film, $hall,$cinema, $date, $start, $price, $format); } mysqli_free_result($selectSession); } else if ($option == "del"){ $bd->deleteSession($id); } else if ($option == "edit"){ $bd->editSession($id, $film, $hall, $cinema, $date, $start, $price, $format); } if($repeat > "0"){ $repeat--; $date = date('Y-m-d', strtotime( $date. ' +1 day') ); $this->processesForm($film, $hall, $cinema, $date, $start, $price, $format, $repeat); } */ } } else {$this->correct = false;} } } ?>