Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (!isset($_SESSION['zalogowany'])) {
- header('Location: index.php');
- exit();
- }
- require_once "connect.php";
- $polaczenie = @new mysqli($host, $db_user, $db_password, $db_name);
- $polaczenie->query("SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");
- $polaczenie->query("SET CHARSET utf8");
- ?>
- <!DOCTYPE HTML>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <title>Panel klienta</title>
- </head>
- <body>
- Witaj w systemie! [ <a href="logout.php">Wyloguj się!</a> ]<br>
- <?php
- echo $_SESSION['IMIE'].' '.$_SESSION['NAZWISKO'];
- echo '<br>';
- #tu sie robi bagno
- $row=$polaczenie->query('CALL dane_umowa('.$_SESSION['ID_PRACOWNIKA'].')' );
- if ($dane_z_umowy = $row->fetch_assoc()) {
- echo 'Stanowisko: '.$dane_z_umowy['OPIS'].'<br>';
- echo 'Stawka: '.$dane_z_umowy['STAWKA'].' PLN/h';
- }
- ?>
- <br>
- <form action="panel.php" method="post">
- <input type="hidden" name="start" value="true">
- <input type="submit" value="Start">
- </form>
- <form action="panel.php" method="post">
- <input type="hidden" name="stop" value="true">
- <input type="submit" value="Stop">
- </form>
- <?php
- if (isset($_POST['start'])) {
- $polaczenie->query('CALL wejscie_praca('.$_SESSION['ID_PRACOWNIKA'].')' );
- $_SESSION['message']= 'Rozpoczeto pracę!';
- header('Location: panel.php');
- exit();
- }
- if (isset($_POST['stop'])) {
- $polaczenie->query('CALL wyjscie_praca('.$_SESSION['ID_PRACOWNIKA'].')' );
- $_SESSION['message']= 'Zakończono pracę!';
- header('Location: panel.php');
- exit();
- }
- if (isset($_SESSION['message'])) {
- echo $_SESSION['message'];
- unset( $_SESSION['message']);
- }
- $polaczenie->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement