Jump to content

Barand

Moderators
  • Posts

    24,602
  • Joined

  • Last visited

  • Days Won

    829

Everything posted by Barand

  1. These are the tables I have in my test db mysql> show tables; +---------------+ | Tables_in_db | +---------------+ | booking | | holiday | | patient | | patient_notes | | sched_hours | | staff | | staff_type | | timeslot | | weekday | +---------------+
  2. The calendar code and booking form will need rewriting to take into account which member of staff the appointment is to be with and when they are available in terms of days and timeslots (from the holiday and schedhours tables) booking table shown below. The staff and patients are the users. You have tables for those.
  3. change line 44 $res = $db->query($sql); to $res = $db->query($sql) or die( $db->error );
  4. The sched_hours table will only contain records where the staff member is available whereas the form requires every day of the week for every staff member. As you can see from the query, this is ensured by the CROSS JOIN. FROM staff CROSS JOIN weekday
  5. the model would look like this
  6. Neither am I. It worked when it left the shop but I don't know what you have changed. I wonder? I use a weekday table to define all the days of the week CREATE TABLE `weekday` ( `dow` int(11) NOT NULL, `abbrev` varchar(2) DEFAULT NULL, PRIMARY KEY (`dow`) ); +-----+--------+ | dow | abbrev | +-----+--------+ | 1 | Su | | 2 | Mo | | 3 | Tu | | 4 | We | | 5 | Th | | 6 | Fr | | 7 | Sa | +-----+--------+
  7. That's because you have $options[$query_data["adate"]] = $query_data["adate"]; when you should have $options[$query_data["ndate"]] = $query_data["adate"];
  8. If you use the revised model that I gave you (attached) then you can use this form and update script to populate with the timeslots that each staff is normally available each day. To produce the calendar and booking form you would also take holidays into account. cal_sched_form.php cal_sched_updt.php
  9. If you use my query to get the options and then process those options as did in your earlier post foreach ($options as $key => $val) then you should get eg <option value='2015-01'>Jan 2015</option>
  10. The query I gave you was for the date options, so selecting would give a value like "2015-02" (yy-mm). You would then query your films for those WHERE fileDate LIKE '$date%' (assuming fileDate is a DATE field in format yyyy-mm-dd)
  11. Barand

    Back online.

    Even though it was only for a day
  12. $yesterday = strtolower((new DateTime('yesterday'))->format('D'));
  13. Is this what you are looking for? SELECT YEAR(addDate) as yr , COUNT(DISTINCT a.personID) as tot FROM stu_acad_cred s LEFT JOIN application a ON s.stuID = a.personID AND a.startTerm = '12/FA' GROUP BY yr;
  14. I'd use a query like this to build the option array $query_disp="SELECT DISTINCT DATE_FORMAT(FileDate, '%b %Y') as adate ,DATE_FORMAT(FileDate, '%Y-%m') as ndate FROM DayMovie ORDER BY FileDate"; $result_disp = mysql_query($query_disp, $conn); $options = array(); while ($query_data = mysql_fetch_array($result_disp)) { $options[$query_data["ndate"]] = $query_data["adate"]; }
  15. Are those the actual results that you expect from the SQLFiddle data?
  16. Barand

    Back online.

    Badgers? You think us insane? Our questions, it seems, are in vain Cos the senior staff Seem to think it's a laugh To look on the rest with disdain.
  17. for ($c=0, $a='a'; $c < $num; $c++, $a++) { //echo "($a) " . $data[$c] . "<br />\n"; }
  18. Barand

    Back online.

    Are there any plans to offer an explanation for the blackout?
  19. You can use ALTER TABLE to change the auto inc value, or set it on creation of the table but easiest would be to add a dummy invoice with a value 1 less than the required start value - it can later be deleted.
  20. I would suggest a form something like this for editing the "sched_hours" table so part-time working (Dr Doe doesn't work on Wed afternoon and Mrs Malone doesn't work Fridays) and mid-day breaks can be taken into account. Weekend working could also be easily added if required.
  21. Do you think you are biting off more than you can chew with this as your first end-of-week assignment?
  22. And you are trying to use the same statement syntax for update and delete that you used for insert. They all use different statements syntaxes. http://dev.mysql.com/doc/refman/5.6/en/insert.html http://dev.mysql.com/doc/refman/5.6/en/update.html http://dev.mysql.com/doc/refman/5.6/en/delete.html
  23. All master files ie all except booking and patient_note.
  24. I'd start by creating the code to maintain (add, edit, delete) the tables then you can use those to create the test data to use when coding and testing the main processes (booking and reporting)
  25. It was created in Excel and exported as html. Now I looked at the file it's apparent M$ don't know what a .html file looks like. Here's a screenshot of the content.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.