From c849f31681eb997df50f887968ba0909de0ede9f Mon Sep 17 00:00:00 2001 From: marian1010 <79144276+marian1010@users.noreply.github.com> Date: Tue, 1 Jun 2021 11:24:37 +0200 Subject: [PATCH] tablas a listas --- assets/css/admin.css | 96 +++++++++++++++++++++++++++++++ assets/php/template.php | 105 ++++++++++++++++------------------ panel_admin/panelAdmin.php | 114 ++++++++++++++++++------------------- 3 files changed, 202 insertions(+), 113 deletions(-) create mode 100644 assets/css/admin.css diff --git a/assets/css/admin.css b/assets/css/admin.css new file mode 100644 index 0000000..d96d1c5 --- /dev/null +++ b/assets/css/admin.css @@ -0,0 +1,96 @@ +.tablelist{ + display: grid; + list-style-type: none; + } + + .tablelist li { + border-bottom: 1px solid black; + padding: 10px; + font-size: 20px; + text-align: center; + } + .tablelist a { + color: #000000; + } + + .tablelist a:hover li{ + color: rgb(211, 235, 255); + background: rgba(31, 44, 61, 1); + } + + .tablelist li.title{ + font-weight: bold; + } + +.col7{ + grid-template-columns: repeat(7,1fr); + } + + .col7 .odd{ + background: green; + display: grid; + grid-column-start: 1; + grid-column-end: 8; + grid-template-columns: repeat(5,auto); + } + + .col7 .even{ + background: pink; + display: grid; + grid-column-start: 1; + grid-column-end: 8; + grid-template-columns: repeat(5,auto); + } + + .tablelist.col7 a.h4long + { + display: grid; + grid-column-start: 1; + grid-column-end: 7; + grid-template-columns: repeat(4,auto); + } + + .tablelist.col7 a + { + display: grid; + grid-column-start: 5; + grid-column-end: 8; + grid-template-columns: auto; + } + + .col6{ + grid-template-columns: repeat(6,1fr); + } + + .col6 .odd{ + background: green; + display: grid; + grid-column-start: 1; + grid-column-end: 7; + grid-template-columns: repeat(5,auto); + } + + .col6 .even{ + background: pink; + display: grid; + grid-column-start: 1; + grid-column-end: 7; + grid-template-columns: repeat(5,auto); + } + + .tablelist.col6 a.h4long + { + display: grid; + grid-column-start: 1; + grid-column-end: 6; + grid-template-columns: repeat(4,auto); + } + + .tablelist.col6 a + { + display: grid; + grid-column-start: 5; + grid-column-end: 7; + grid-template-columns: auto; + } + \ No newline at end of file diff --git a/assets/php/template.php b/assets/php/template.php index 7051192..fe63c3f 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -484,18 +484,20 @@ $directions = array(); $phones = array(); - if(is_array($cinemas)){ + if(!is_array($cinemas)){ + $reply = "

No hay cines actualmentes

"; + } + else{ foreach($cinemas as $key => $value){ $ids[$key] = $value->getId(); $names[$key] = $value->getName(); $directions[$key] = $value->getDirection(); $phones[$key] = $value->getPhone(); } - } - + switch($this->page){ case "Nuestros Cines": - if(is_array($cinemas)){ + for($i = 0; $i < count($cinemas); $i++){ if($i%2 === 0){ if($i != 0) $reply .= " @@ -524,64 +526,57 @@ "; } $reply .= "\n"; - } break; case "Panel de Administrador": - $reply .= "
-
-
- - - - - - - - - - - "; - if(is_array($cinemas)){ - for($i = 0; $i < count($cinemas); $i++){ - $reply .= ' - - - - - - - - '; - } - } - $reply .=' -
IdNombreDireccionTelefono
'. $ids[$i] .''. $names[$i] .''. $directions[$i] .''. $phones[$i] .' -
- - - - - -
-
-
- - - - - -
-
-
-
- '; + $reply .= "
+
+
+
    +
  • Id
  • +
  • Nombre
  • +
  • Dirección
  • +
  • Teléfono
  • +
  • Editar
  • +
  • Eliminar
  • + "; + + for($i = 0; $i < count($cinemas); $i++){ + $reply .= ' +
  • '. $ids[$i] .'
  • +
  • '. $names[$i] .'
  • +
  • '. $directions[$i] .'
  • +
  • '. $phones[$i] .'
  • +
  • +
    + + + + + +
    +
  • +
  • +
    + + + + + +
    +
  • + + '; + } + $reply .='
+
+
+ '; break; default: break; - + } } - return $reply; } diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php index ee8ad3b..7e63596 100644 --- a/panel_admin/panelAdmin.php +++ b/panel_admin/panelAdmin.php @@ -98,7 +98,10 @@ $usernames = array(); $email = array(); $rol = array(); - if(is_array($managers)){ + if(!is_array($managers)){ + $reply = "

No hay ningun manager

"; + } + else{ foreach($managers as $key => $value){ $ids[$key] = $value->getId(); $idscinemas[$key] = $value->getIdcinema(); @@ -106,38 +109,35 @@ $email[$key] = $value->getEmail(); $rol[$key] = $value->getRoll(); } - } + $reply= "
- - - - - - - - - - - +
    +
  • Id
  • +
  • IdCinema
  • +
  • Nombre
  • +
  • Email
  • +
  • Rol
  • +
  • Editar
  • +
  • Eliminar
  • "; - if(is_array($managers)){ + for($i = 0; $i < count($managers); $i++){ - $reply.= '
- - - - - - - - + '; } - } - $reply.=' -
IdIdCinemaNombreEmailRol
'. $ids[$i] .''. $idscinemas[$i] .''. $usernames[$i] .''. $email[$i] .''. $rol[$i] .' + $reply.= ' +
  • '. $ids[$i] .'
  • +
  • '. $idscinemas[$i] .'
  • +
  • '. $usernames[$i] .'
  • +
  • '. $email[$i] .'
  • +
  • '. $rol[$i] .'
  • +
  • -
  • + +
  • @@ -146,17 +146,16 @@
    -
  • + + $reply.='
    '; + } return $reply; } static function showAddBotton() { @@ -260,7 +259,10 @@ $codes = array(); $actives = array(); - if(is_array($promos)){ + if(!is_array($promos)){ + $reply = "

    No hay promociones

    "; + } + else{ foreach($promos as $key => $value){ $ids[$key] = $value->getId(); $tittles[$key] = $value->getTittle(); @@ -268,32 +270,27 @@ $codes[$key] = $value->getCode(); $actives[$key] = $value->getActive(); } - } $reply= "
    - -
    - - - - - - - - - - - +
    +
      +
    • Id
    • +
    • Título
    • +
    • Descripcion
    • +
    • Código
    • +
    • Activo
    • +
    • Editar
    • +
    • Eliminar
    • "; - if(is_array($promos)){ + for($i = 0; $i < count($promos); $i++){ - $reply.= '
    - - - - - - - - + + '; } - } - $reply.=' -
    IdTítuloDescripcionCódigoActivo
    '. $ids[$i] .''. $tittles[$i] .''. $descriptions[$i] .''. $codes[$i] .''. $actives[$i] .' + $reply.= ' +
  • '. $ids[$i] .'
  • +
  • '. $tittles[$i] .'
  • +
  • '. $descriptions[$i] .'
  • +
  • '. $codes[$i] .'
  • +
  • '. $actives[$i] .'
  • +
  • @@ -302,8 +299,8 @@
    -
  • + +
  • @@ -312,17 +309,18 @@
    -
  • + + $reply.=' +
    '; + } return $reply ; }