PHP - Moved: Php Appointment Diary Tutorial
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=348851.0 Similar TutorialsThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=308352.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=130332.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=351363.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=330907.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=343600.0 This topic has been moved to Linux. http://www.phpfreaks.com/forums/index.php?topic=334310.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316360.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=334229.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=332907.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=351535.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321530.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342211.0 Hey everyone! Am new here but i'm hoping to get some help, I'm not the best with PHP and really could do with hopefully getting some assistance. I'm trying to make a PHP based diary for my brothers Coach Travel company, basically something to put the notes down for where each coach is and who's driving it etc. I've got the basic system there and it works but I'm trying to make it quicker to use. I so far have a page where a new diary entry can be put on, as you can see it has the date entry, time, coach and description fields. What I would idealy like to also add is a drop down list of Drivers also as 90% of the time the drivers are in the same coach maybe this be pre-selected once a Coach is chosen but with the dropdown still there to change if needed. I would also like the Coach & Details to appear on the main diary screen just before the description for each entry (as in the screenshot below) If anyone thinks they could help me with this then I would be very greatful, I am not being paid for this as it is my brother but I would happily pay someone for helping me. Below are the links to the screenshots: http://img17.imageshack.us/img17/3240/adddiary.jpg http://img703.imageshack.us/img703/3298/adddiary1.jpg This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=347977.0 I have events added to mysql on my site and wish to them also to be added to my Google Calendar. Is this possible? I have an array of appointment start times throughout a day. All appointments last 30 mins. I also have a list of times that staff are available to meet these appointment times (can be in any format, array etc.) I need to ensure the appointment times are fully covered by members of staff. E.g. Code: [Select] $appointmentStart[] = "09:30"; $appointmentStart[] = "10:00"; $appointmentStart[] = "11:00"; $appointmentStart[] = "12:30"; $appointmentStart[] = "13:30"; $appointmentStart[] = "15:00"; $appointmentStart[] = "17:00"; $staffMembers[] = "09:00*12:00"; $staffMembers[] = "13:00*16:00"; $staffMembers[] = "15:00*18:00"; In the above case, no, there are not enough staff members to cover this as nobody works from 12:00 to 13:00. I only really need a yes or no. Don't worry about staff breaks, they never work more than 3 hours each at a time. Thanks in advance for any help. Hello. I'm trying to build a site where users can book appointments with personal trainers. I want to use the free and open source jQuery Full Calendar for the look and feel of the calendar since it looks pleasant and is responsive. <link removed> I want each personal trainer to have their own calendar which will show the days that they're available. When a user clicks on an available day then they will see a list of time slots that they can book in 15 minute increments. So, for instance lets say a trainer named Mike is available on Mondays-Friday from 8am-5pm. If a user comes to his calendar they will see that certain days are not fully booked and they can click on a day. Then when they click on a day they can see time intervals like this: Mike's available time slots for Tuesday August 25, 2014: 8:00 am-9:00 am - Click here to book appointment! 8:15 am-9:15 am - Click here to book appointment! 2:00 pm - 3:00 pm - Click here to book appointment! The page above can be a separate page from the calendar, but it would need to be synced with the calendar to be able to fetch the times and days that he's available for appointments. Then when the user clicks on a day, he can book an appointment and after the trainer confirms via email then the user will receive an email confirmation that his appointment is scheduled. While it's still being confirmed though, that time slot would need to be no longer visible to other users, so that there wouldn't be multiple bookings for the same time slot, to avoid those conflicts. So, the application would need to fetch the data from MySQL and use that to display the available days. If a day is not available then the user will not be able to click on it in the calendar. Also, the trainers should be able to set their schedule which will get updated to MySQL, so the schedule is normally recurring but they should also be able to change certain days if they feel like they can or cannot work on that day. Also, the appointments will vary by time, so a training session can last 30 minutes, 1 hour, 3 hours, 1 hour and a half, etc. and that would need to be taken into account when the user books an appointment because if the trainer has a 1 hour gap between 2pm and 3pm, but the session is for 2 hours, they should not be able to book that time slot, since it wouldn't make any sense. What makes this complicated is that the appointment lengths can vary. Otherwise, if every appointment was 1 hour long I would be able to just create a table for appointment times and do a query to see if they're booked and only show the booked ones. How can I do it with variable time lengths? Any help would be greatly appreciated. Edited by mac_gyver, 16 August 2014 - 09:04 AM. removed link, not relevant to post Hello Php Freaks I am following this tutorial how to make a login for my website, the only trouble is that... It dosen't seem to work, so i wanna know if its only me who cant make it work... and if it is why XD... Tutorial can be found he http://www.knowledgesutra.com/forums/topic/7887-php-simple-login-tutorial/ Now when i get started it starts saying error at line 6: if ($_GET["op"] == "login") It says that when im about to login right above the login. Now when i put in data i get error on line 19: $r = mysql_query($q); That one, and i have no idea how to fix it. Anyone please ? I followed the tutorial at http://www.devshed.com/c/a/PHP/Building-An-Extensible-Form-Validator-Class/ because I wanted to have an easier way to build and maintain form validation. I completed the tutorial, but the form does not register the form as being filled out. Here is the class code (FormValidator.class.inc) <?php //FormValidator.class.inc //class to perform form validation class FormValidator { //---------------private variables------------------ var $_errorList; //the _ prefix is used to distinguish private variables from public variables //---------------methods (private)------------------ //functio to get the value of a variable (field) function _getValue($field) { global ${$field}; //makes the field entry a global variable return ${$field}; } //---------------methods (public)------------------- //it is a good idea to run resetErrorList() whenever the class is first initialized //PHP makes it possible to automatically execute a specific function when a new instance of a class is spawned. This function is referred to as a "constructor" and must have the same name as the class. //reset error list function FormValidator() { $this->resetErrorList(); } //begin basic validation routines //check whether input is empty //the isEmpty public method is called with 2 arguments, one for the form variable and one for the error message //the method internally calls the _getValue method and then trim()s the result to check if it is empty // if the variable is empty, a new element is added class variable $_errorList (an array) to represent the error. This new element is itself a three-element associative array, with the keys "field", "value" and "msg", representing the form variable name, the current value of that variable, and the corresponding error message // if the variable is not empty, it will pass the test and return true // this function, along with _getValue, allows the user to get both the field name and the field value //the $this prefix provides a convenient way to access variables and functions which are "local" to the class. function isEmpty($field, $msg) { $value = $this->_getValue($field); if (trim($value) == "") { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } else { return true; } } //check whether input is a string function isString($field, $msg) { $value = $this->_getValue($field); if(!is_string($value)) { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } else { return true; } } //check whether input is a number function isNumber($field, $msg) { $value = $this->_getValue($field); if(!is_numeric($value)) { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } else { return true; } } //check whether input is an integer function isInteger($field, $msg) { $value = $this->_getValue($field); if(!is_integer($value)) { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } else { return true; } } //check whether input is a float function isFloat($field, $msg) { $value = $this->_getValue($field); if(!is_float($value)) { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } else { return true; } } //check whether input is within a valid numeric range function isWithinRange($field, $msg, $min, $max) { $value = $this->_getValue($field); if(!is_numeric($value) || $value < $min || $value > $max) { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } else { return true; } } //check whether the input is alphanumeric function isAlpha($field, $msg) { $value = $this->_getValue($field); $pattern = "/^[a-zA-Z]+$/"; if (preg_match($pattern, $value)) { return true; } else { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } } //check whether input is a valid email address function isEmailAddress($field, $msg) { $value = $this->_getValue($field); $pattern = "/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/ "; if (preg_match($pattern, $value)) { return true; } else { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } } //end basic validation routines----- //return the list of current errors function getErrorList() { return $this->_errorList; } //check whether any errors have occured in validation //this method checks the size of the $_errorList array; if the size is greater than one, it implies that one or more errors have occured during validation //it returns a Boolean value function isError() { if(sizeof($this->_errorList) > 0) { return true; } else { return false; } } //reset the error list to a blank array function resetErrorList() { $this->_errorList = array(); } }//end FormValidator class ?> -------Here is the form (simpleform.html) <html> <head> <basefont face="Arial"> </head> <body> <form action="processor.php" method="POST"> <b>Name:</b> <br> <input type="text" name="name" size="15"> <p> <b>Age:</b> <br> <input type="text" name="age" size="2" maxlength="2"> <p> <b>Sex:</b> <br> <input type="Radio" name="sex" value="m">Male <input type="Radio" name="sex" value="f">Female <p> <b>Favourite sandwich type:</b> <br> <select name="stype"> <option value="">-select one-</option> <option value="1">Thin crust</option> <option value="2">Thick crust</option> <option value="3">Toasted</option> </select> <p> <b>Favourite sandwich filling:</b> <br> <input type="Checkbox" name="sfill[]" value="BLT">Bacon, lettuce tomato <input type="Checkbox" name="sfill[]" value="EC">Egg and cheese <input type="Checkbox" name="sfill[]" value="PBJ">Peanut butter and jelly <p> <input type="Submit" name="submit" value="Save"> </form> </body> </html> ------and here is processor.php <?php //include class include("FormValidator.class.inc"); // instantiate object $fv = new FormValidator(); //perform validation $fv->isEmpty("name", "Please enter a name"); $fv->isNumber("age", "Please enter a valid age"); $fv->isWithinRange("age", "Please enter an age within the numeric range 1-99", 1, 99); $fv->isEmpty("sex", "Please enter your sex"); $fv->isEmpty("stype", "Please select one of the listed sandwich types"); $fv->isEmpty("sfill", "Please select one or more of the listed sandwich fillings"); if($fv->isError()) { $errors = $fv->getErrorList(); echo "<b>The operation could not be performed because one or more error(s) occurred.</b> <p> Please resubmit the form after making the following changes:"; echo "<ul>"; foreach($errors as $e) { echo "<li>" . $e['msg'] . "</li>"; } echo "</ul>"; } else { //do something useful with the data echo "Data OK"; } ?> I have a need to create a form that will get info from a mysql table, show that info, two fields one of which I want to be a checkbox that will need to update the table with either a 0 or a 1. I will later use that info. I have searched all over and haven't found what I am looking for. I can find tutorials for creating checkboxes but nothing what I need / want
|