Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- dateIndaysoff($_GET['date']);
- function dateIndaysoff($mydate){
- if(!$mydate)return false;
- $host = "localhost";
- $user = "user";
- $pass = "pass";
- $databaseName = "db";
- $con = new mysqli($host,$user,$pass,$databaseName);
- if ($con->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $query = "SELECT date FROM table WHERE date = '$mydate'";
- $result = $con->query($query);
- if ($result->num_rows < 1) {$exists = "FALSE";} else {$exists = "TRUE";}
- return $exists;
- }
- ?>
- jQuery(".datepicker").change(function() {
- var val = jQuery(this).datepicker().val();
- var finalval = jQuery.get("url-to-phpfile/daysoff.php",{date:val});
- if (finalval) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement