<h2><?php echo $getexe; ?> </h2> <?php $data = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($data['SendPostForm'])) { unset($data['SendPostForm']); $create = new Band(); $create->ExeCreate($data); if ($create->getResult()) { $phpServer = filter_input(INPUT_SERVER, 'PHP_SELF'); header('Location: ' . basename($phpServer) . '?exe=band/create&id=' . $create->getResult()); } else { WSError($create->getError()[0], $create->getError()[1]); } } ?> <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> </script> <form name="PostForm" action="" method="post" enctype="multipart/form-data"> <label>Name:</label> <input type="text" name="name" value="<?php if (isset($data)) { echo $data['name']; } ?> "> <br><br>
<article> <header> <h1>Atualizar Banda:</h1> </header> <?php $data = filter_input_array(INPUT_POST, FILTER_DEFAULT); $bandid = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); if (!empty($data['SendPostForm'])) { unset($data['SendPostForm']); //require('_models/AdminCategory.class.php'); $update = new Band(); $update->ExeUpdate($bandid, $data); WSError($update->getError()[0], $update->getError()[1]); } else { $read = new Read(); $read->ExeRead("band", "WHERE id = :id", "id={$bandid}"); if (!$read->getResult()) { header('Location: panel.php?exe=band/index'); } else { $data = $read->getResult()[0]; } } //$checkCreate = filter_input(INPUT_GET, 'create', FILTER_VALIDATE_BOOLEAN); //if($checkCreate && empty($cadastra)): // $tipo = ( empty($data['category_parent']) ? 'seção' : 'categoria'); // WSErro("A {$tipo} <b>{$data['category_title']}</b> foi cadastrada com sucesso no sistema! Continue atualizando a mesma!", WS_ACCEPT); //endif; ?>