allPromotionData(); $ids = array(); $tittles = array(); $descriptions = array(); $codes = array(); $actives = array(); if(is_array($promos)){ foreach($promos as $key => $value){ $ids[$key] = $value->getId(); $tittles[$key] = $value->getTittle(); $descriptions[$key] = $value->getDescription(); $codes[$key] = $value->getCode(); $actives[$key] = $value->getActive(); } } echo "
"; if(is_array($promos)){ for($i = 0; $i < count($promos); $i++){ echo ' '; } } echo'
Id Título Descripcion Código Activo
'. $ids[$i] .' '. $tittles[$i] .' '. $descriptions[$i] .' '. $codes[$i] .' '. $actives[$i] .'
'; } function addPromotion(){ echo'

Añadir promoción

Datos dela Promoción
'; } function deletePromotion() { echo'

Editar Promoción

¿Estás seguro de que quieres eliminar esta promoción?

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

Título: '.$_POST['tittle'].'

Descripción: '.$_POST['description'].'

Código: '.$_POST['code'].'

Activa: '.$_POST['active'].'

'; } function editPromotion() { echo'

Editar promoción

Datos de la promoción
'; } // Logic Functions function confirmDelete() { $cine = new FormPromotion(); $cine->processesForm($_POST['id'],null,null,null,null,"del"); $_SESSION['message'] = $cine->getReply(); header('Location: ../panel_admin/index.php?state=mp'); } function confirmEdit() { $cine = new FormPromotion(); $cine->processesForm($_POST['id'], $_POST['tittle'], $_POST['description'], $_POST['code'],$_POST['active'],"edit"); $_SESSION['message']= $cine->getReply(); header('Location: ../panel_admin/index.php?state=mp'); } function confirmAdd() { $cine = new FormPromotion(); $cine->processesForm(null,$_POST['tittle'], $_POST['description'], $_POST['code'],$_POST['active'],"new"); $_SESSION['message'] = $cine->getReply(); header('Location: ../panel_admin/index.php?state=mp'); } ?>