Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include('data.php');
- include('function.php');
- head('Akcie');
- ?>
- <div id="bar"></div>
- <div id="wrapper">
- <?php
- include('menu.php');
- ?>
- <div id="content">
- <h3>Zoznam akcií</h3>
- <?php
- if (isset($_POST["agent"]) && agent_ok($_POST["agent"])
- && isset($_POST["title"]) && title_ok($_POST["title"])
- && isset($_POST["text"]) && text_ok($_POST["text"])
- && isset($_POST["status"]) && status_ok($_POST["status"])
- ) {
- $_SESSION['agent'] = $_POST["agent"];
- $_SESSION['title'] = $_POST["title"];
- $_SESSION['text'] = $_POST["text"];
- $_SESSION['status'] = $_POST["status"];
- }
- if (isset($_POST['del'])){
- session_unset();
- session_destroy();
- }
- if (isset($_SESSION['title'])) {
- echo '<table>
- <tr>
- <th>Názov akcie</th>
- <th>Popis</th>
- <th>Zúčastnení agenti</th>
- <th>Status</th>
- </tr>';
- echo '<td>' . addslashes(strip_tags(trim($_SESSION["title"]))) . '</td>';
- echo '<td>' . addslashes(strip_tags(trim($_SESSION["text"]))) . '</td>';
- echo '<td>' . agent_out($_SESSION["agent"]) . '</td>';
- echo '<td>' . status_out($_SESSION["status"]) . '</td>';
- ?>
- <p>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <p><button type="submit" name="del" id="zrus">Vymaž akciu</button></p>
- </form>
- </p>
- <?php
- } else {
- ?>
- <form action="" method="post">
- <fieldset>
- <legend><strong>Pridaj akciu</strong></legend>
- <label for="title">Názov akcie: (max 20 znakov)</label> <br />
- <input type="text" name="title" id="title" size="40" maxlength="20" value="<?php if (isset($_POST["title"])) echo $_POST["title"]; ?>"/>
- <br />
- <label for="text">Popis: (max 70 znakov)</label><br />
- <textarea name="text" id="text" rows="3" cols="35"><?php if (isset($_POST["text"])) echo $_POST["text"]; ?></textarea>
- <br />
- <label for="agent">Agent:</label> <br />
- <select name="agent" id="agent" size="1">
- <?php agent(isset($_POST['agent']) ? $_POST['agent'] : 0); ?>
- </select>
- <br/><br/>
- Status: <br />
- <input type="radio" name="status" id="dopr_kurier" value="ok"<?php if (isset($_POST['status']) && $_POST["status"]=="ok") echo ' checked="checked"'; ?> /> <label for="status_ok">Ukončená</label> <br />
- <input type="radio" name="status" id="dopr_taxi" value="in"<?php if (isset($_POST['status']) && $_POST["status"]=="in") echo ' checked="checked"'; ?> /> <label for="status_in">Prebieha</label> <br />
- <input type="radio" name="status" id="dopr_vlastna" value="up"<?php if (isset($_POST['status']) && $_POST["status"]=="up") echo ' checked="checked"'; ?> /> <label for="status_up">Plánuje sa</label> <br />
- <br />
- </fieldset>
- <p><button type="submit" name="ok">Pridaj</button></p>
- </form>
- <?php
- }
- ?>
- </div>
- </div>
- <?php
- include('footer.php');
- ?>
Add Comment
Please, Sign In to add comment