This topic is locked

translate Academic Week to dates

7/30/2008 12:10:15 PM
PHPRunner General questions
T
thesofa author

OK, here we go again, stupid question number 345.

The application I am writing has a reporting facility.

The reports need to run from a Monday, being the first day of the week, to the Friday, being the last day of a different week.

If you or I were doing it, we would use the date picker to chose the start date, probably a Monday, and then again to chose the last date fro the report span.

Again, from the date picker and this time, being normal, sensible grown up people who can wipe our own noses, we would pick a Friday.

TEACHERS cannot use a calendar, they have to specify a date range in terms of Academic weeks, thus making sure that noone outside of the school can identify what the report is about.

I now have to try to translate dates into academic weeks, or translate the date picker into an academic week picker.

OK, so I have a lookup table with the dates in related to academic weeks, when it comes to the advanced search page and the teacher selects the week number from a drop box,(they cannot type at all, lucky if they can work the mouse correctly too) for the date range, the first date they pick, as a number of the academic week, needs to be for the Monday of the starting week and the second date needs to be for the Friday of the end week.

I would love some pointers from you to help me sort this one.

Will it be easier to re-educate the teachers?

Thanks for your patience in reading this drivel,

What a way to make a living........

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=9141&image=1&table=forumtopics' class='bbc_emoticon' alt=':D' />

T
thesofa author 8/1/2008

I know I wrote this in a trivial manner, but I really could do with some pointers here please!
Been thinking a bit about this, am I right in thinking that if I have an advanced search field for dates 'between' a pair of numbers, the first number chosen is in
"$_SESSION[$strTableName."_asearchfor"]"

and the second is in
"$_SESSION[$strTableName."_asearchfor2"]" ?
can I get an event to run in between the clicking of the "Search" button on the advanced search page and the actual search?

If so, I can take the selected value from each of the 2 session variables and using the Min function, I can look up the number in the look up table, this will reurn 5 values for the 5 days of the working week, If I take the smallest value, I shall then have the Monday.

For the second session variable, I can use the max function and find the Friday, bunging both these values into a modified search string will get me what I want.

Will this work?????

J
Jane 8/1/2008

Here are some tips:

  1. use List page: Before SQL query event to check searched parameters and change where clause if needed.
  2. where clause is stored in the $strWhereClause variable.
  3. to print all session variables use following code:
    print_r($_SESSION);

T
thesofa author 8/1/2008

Here are some tips:


  1. use List page: Before SQL query event to check searched parameters and change where clause if needed.
  2. where clause is stored in the $strWhereClause variable.
  3. to print all session variables use following code:



Thanks for all that, am I on the right lines do you think?