private function Execute() { $this->Connect(); try { $this->Delete->execute($this->Places); $this->Result = TRUE; } catch (PDOException $e) { $this->Result = NULL; WSError("<b>Erro ao Excluir:</b> {$e->getMessage()}", $e->getCode()); } }
private function Execute() { $this->Connect(); try { $this->Delete->execute($this->Places); $this->Result = true; } catch (PDOException $e) { $this->Result = null; WSError("<b>Erro ao deletar:</b> {$e->getMessage()}", $e->getCode()); } }
/** * Get the connetion and the syntax, and executes the query. */ private function Execute() { $this->Connect(); try { $this->Create->execute($this->Data); $this->Result = $this->Conn->lastInsertId(); } catch (PDOException $e) { $this->Result = null; WSError("<b>Erro ao cadastrar:</b> {$e->getMessage()}", $e->getCode()); } }
private function Execute() { $this->Connect(); try { $this->Update->execute(array_merge($this->Data, $this->Places)); $this->Result = true; } catch (PDOException $e) { $this->Result = null; WSError("<b>Erro ao atualizar:</b> {$e->getMessage()}", $e->getCode()); } }
private function Execute() { $this->Connect(); try { $this->getSyntax(); $this->Read->execute(); $this->Result = $this->Read->fetchAll(); } catch (PDOException $e) { $this->Result = null; WSError("<b>Erro ao ler:</b> {$e->getMessage()}", $e->getCode()); } }
<article> <header> <h1>Atualizar Clipe:</h1> </header> <?php $data = filter_input_array(INPUT_POST, FILTER_DEFAULT); $audioclipid = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); if (!empty($data['SendPostForm'])) { unset($data['SendPostForm']); //require('_models/AdminCategory.class.php'); $update = new Audioclip(); $update->ExeUpdate($audioclipid, $data); WSError($update->getError()[0], $update->getError()[1]); } else { $read = new Read(); $read->ExeRead("audioclip", "WHERE id = :id", "id={$audioclipid}"); if (!$read->getResult()) { header('Location: panel.php?exe=audioclip/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; $bands = new Read();
<a href="panel.php?logoff=true">Log off</a> <a href="panel.php?exe=audioclip/index">Clips</a> <a href="panel.php?exe=band/index">Bands</a> <div id="painel"> <?php //QUERY STRING if (!empty($getexe)) { $includepatch = __DIR__ . '/system/' . strip_tags(trim($getexe) . '.php'); } else { $includepatch = __DIR__ . '/system/home.php'; } if (file_exists($includepatch)) { require_once $includepatch; } else { echo "<div class=\"content notfound\">"; WSError("<b>Erro ao incluir tela:</b> Erro ao incluir o controller /{$getexe}.php!", WS_ERROR); echo "</div>"; } ?> </div> <!-- painel --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', <?php echo "'" . UA . "'"; ?> , 'auto'); ga('send', 'pageview');
<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>
} $dataLogin = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($dataLogin['adminLogin'])) { $login->ExeLogin($dataLogin); if (!$login->getResult()) { WSError($login->getError()[0], $login->getError()[1]); } else { header('Location: panel.php'); } } $get = filter_input(INPUT_GET, 'exe', FILTER_DEFAULT); if (!empty($get)) { if ($get == 'restricted') { WSError("Access Denied! Log In first!", WS_ALERT); } elseif ($get == 'logoff') { WSError("Logged off", WS_INFO); } } ?> <form name="adminLoginForm" action="" method="POST"> <label> <span>Email:</span> <input type="email" name="user"> </label> <label> <span>Pass</span> <input type="password" name="pass"> </label> <input type="submit" value="Login" name="adminLogin" class="btn blue" />
echo ':('; echo '<hr>'; $eu = null; if (!$eu) { $a = new Exception("Eu é null", E_USER_NOTICE); } var_dump($a); echo '<hr>'; try { if (!$eu) { throw new Exception("Eu é null de novo", E_USER_NOTICE); } } catch (Exception $e) { echo "<p>Erro #{$e->getCode()}: {$e->getMessage()}<br>"; echo "<small>{$e->getFile()} na linha {$e->getLine()}</small>"; echo '<hr>'; echo $e->xdebug_message; } echo '<hr>'; trigger_error('Esta é uma NOTICE', E_USER_NOTICE); trigger_error('Esta é uma WARNING', E_USER_WARNING); //trigger_error('Esta é um ERROR', E_USER_ERROR); echo '<hr>'; WSError("Este é um ACCEPT", WS_ACCEPT); WSError("Este é um INFO", WS_INFO); WSError("Este é um ALERT", WS_ALERT); WSError("Este é um ERROR", WS_ERROR); phpinfo(); ?> </body> </html>