Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- $( function() {
- $( "#datepicker" ).datepicker();
- } );
- </script>
- </head>
- <body>
- </body>
- </html>
- <?php
- if (isset($_POST['submit']) && $_POST['submit']=="invia")
- {
- $titolo = addslashes($_POST['titolo']);
- $testo = addslashes($_POST['testo']);
- $str_data = strtotime($_POST['data']);
- include 'config.php';
- $sql = "INSERT INTO appuntamenti (titolo,testo,str_data ) VALUES ('$titolo', '$testo', '$str_data')";
- if($result = pg_query($sql))
- {
- echo "Inserimento avvenuto con successo.<br>
- Vai al <a href="index.php">Calendario</a>";
- }
- }else{
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- Titolo:<br>
- <input name="titolo" type="text"><br>
- Testo:<br>
- <textarea name="testo" cols="30" rows="8"></textarea><br>
- Date:<br>
- <input name="datepicker" type="text" ><br>
- Time:<br>
- <input name="hour" type="time" ><br>
- <input name="submit" type="submit" value="invia">
- </form>
- </body>
- <?php
- }
- ?>
- <html>
- <head>
- <script>
- $(function() {
- $("#datepicker").datepicker();
- $('.timepicker').timepicker({
- timeFormat: 'h:mm p',
- interval: 60,
- minTime: '8',
- maxTime: '08:00pm',
- defaultTime: '11',
- startTime: '08:00',
- dynamic: false,
- dropdown: true,
- scrollbar: true
- });
- });
- </script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
- <link rel="stylesheet" href="/resources/demos/style.css">
- <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
- <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css">
- <script src="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js"></script>
- </head>
- <body>
- </body>
- </html>
- <?php
- if (isset($_POST['submit']) && $_POST['submit']=="invia")
- {
- $titolo = addslashes($_POST['titolo']);
- $testo = addslashes($_POST['testo']);
- $str_data = strtotime($_POST['data']);
- include 'config.php';
- $sql = "INSERT INTO appuntamenti (titolo,testo,str_data ) VALUES ('$titolo', '$testo', '$str_data')";
- if($result = pg_query($sql))
- {
- echo "Inserimento avvenuto con successo.<br>
- Vai al <a href="index.php">Calendario</a>";
- }
- }else{
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- Titolo:<br>
- <input name="titolo" type="text"><br>
- Testo:<br>
- <textarea name="testo" cols="30" rows="8"></textarea><br>
- <!--Data:<br>
- <input name="datepicker" type="text" ><br>
- Orario:<br>
- <input name="hour" type="time" ><br>
- -->
- Date:<br>
- <input name="datepicker" id="datepicker" type="text"><br> Orario:
- <br>
- <input name="hour" type="text" class="timepicker"><br>
- <input name="submit" type="submit" value="invia">
- </form>
- </body>
- <?php
- }
- ?>
Add Comment
Please, Sign In to add comment