Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7505 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I've been working on this little problem, and am beginning to think there's a better way to go about it, that maybe I need a fresh perspective. Hoping someone out there has some ideas.

I have a DB full of events for our school. I'd like visitors to our site to be able to find all events for the next week, and all events for the next month (as well as other sorts of find requests, but I've got those working). I currently have fields with the event date (absolutedate) and today (currentdate), and a field (daysout) that calculates the difference between today and the event date (that yields negative numbers when the date has passed). And I have another field (datestatus) which calculates the value of the daysout field: Case (daysout <8 "week", daysout <31 "month", "future")

On my search page, I'd ideally like to use radio buttons where users can choose "show events for next week" or "show events for next month" or "show all future events", but you can probably guess the problem I'm having:

Searches for "next week" (field datestatus, value="week") work fine, but searches for "next month" omit all those in the next week; searches for all future omit those in the next week and next month.

When I tried using checkboxes for different field names and used the OR selection, I still had problems.

I'm not sure now if I need to run a script in FM from my search page, if I need to create a field that joins my two (or three) subsets so they all appear, or if the solution comes from HTML. (Is it possible to create a form submission where the button does not _equal_ a value, but is greater than or contains a value? I know how to do that within FM, but is there an HTML equivalent?)

Any ideas on this one would be greatly appreciated.

Thanks

Posted

There is a demonstration in the Sample Files Forum on the CDML -op and symbols which covers not equal (an adjustment is required but explained in the thread), contains, greater than as well as the other symbols from the FMP Find.

Depending on what you are trying to accomplish, you may need to incorporate an FMP-If into your solution on the results page.

Posted

Try this:

One Week <input type="radio" name="daysout" value="week">

One Month <input type="radio" name="daysout" value="month">

All Future <input type="radio" name="daysout" value="future">

The Form will only pass whichever one is Selected.

All the best.

Garry

Posted

LOL! I've been working on almost the same exact project at my university OFF/ON for 2 years! I used calculation fields something like...

mytoday = Status(CurrentDate)

mytomorrow = mytoday +1

my7days = mytoday +7

my30days = mytoday +30

Then I just perform finds GTE mytoday and LTE myothervariable. It works great. I stored each of my clickable buttons in a table cell, with each one being its own form.

My system will be for anyone at the University to post, and I'm going to hook it into our clubs and organizations contact info database so people looking up club descriptions and contacts on our website will also see some of the meetings and activities the group has posted in the events database (FMP-inline). The db has all the basic date/time/place/description stuff, as well as target audience, costs, contact info, link to event website, and a corresponding custom logo/graphic if they have it published on the web already and they know the URL.

The problem I am having, though, is with security (of course). At first I was going to use the FMP Web Security Database and load users into the Web _Users.fp5 db from my own custom temporary users db, but I could not figure out how to stop URL hacking between users after they're logged in. I am now looking into a couple of different things, including some things here on FMFORUMS like Unable's redfaced download and BoBWeaver's one-way hashing, but have not had the time to give it the attention I really should yet.

Sometimes, I think I should just hire someone like Garry to do it for me, but alas, I do not control the purse strings over here and am woefully short on resources as it is. Really, this should be a project for some of our professional web developers on campus but when I proposed it a few years back, all I received was a "good idea" kind of resonse with no real interest. I've already got it 85% working, but the security problem and a recently discovered issue w/auto-mailing has temporarily shut me down until I can dedicate steady time to it. Now, I'm playing w/the idea of using FX so I can integrate it w/MySQL and PHP, but I have only just started working w/those technologies and I would hate to start a major project like this as my first project although this would greatly help my security problem and allow me to tap into our campus authentication system.

Well, I hope yours goes better than mine has so far. I actually enjoyed working on it but I hate keep having to put it on the shelf and not touch it for months and then try to remember where I left off. I guess that's what I get for being one of the old-fashioned computer-everything guys (purchasing, repairing, installing hardware/software, user training, networks, file servers, web servers, dns, troubleshooting, desktop publishing and layout, graphic arts, consultations, presentations, and of course web stuff and FILEMAKER WEB DEVELOPMENT when I get a chance... WooHoo!).

One of these days I'm going to put together an article on using FileMaker in higher education... yeah, one of these days... wink.gif

--ST

Posted

To Garry:

I think this is what I'm already doing and it doesn't work because days that are in the next week contain "week", so are returned with that request (which is good, it's what I want) BUT since they have "week" in the daysout field they don't have "month" so they don't appear in a search result for "Events this month" (All I get there are events from 8 to 30 days away; not quite right).

Here's a thought, though. If I use radio buttons with different names, they wouldn't function like regular radio buttons (where only one can be checked)but if it works like this:

One Week <input type="radio" name="weekout" value="week">

One Month <input type="radio" name="monthout" value="month">

All Future <input type="radio" name="monthplusout" value="future">

and those three separate fields (weekout, monthout, monthplusout) were calculated like this:

weekout: If (daysout <8 "week")

monthout: If (daysout <31 "month")

monthplusout: If (daysout >30 "future")

then an event 3 days away, for example would contain "week" in the weekout field (and be returned in a search for this week's events) AND contain "month" in the monthout field (and be returned in a search for this month's events)

But what would happen if someone checked both weekout and monthout? Would the search return the record for an event 3 days away twice? Maybe if I used checkboxes and left instructions to check only one?

Seems like an inelegant solution, and one that might bring its own problems, but I'll try it and report back...unless someone else figures out what I'm trying to do and sees a quicker/ slicker way.

Thanks.

PS to Steve T. ... I'm still working through your response, as you appear to be at a higher level than I am. But it looks promising. If I can sort it all out.

Posted

The fields need to be the same name. This:

One Week <input type="radio" name="weekout" value="week">

One Month <input type="radio" name="monthout" value="month">

All Future <input type="radio" name="monthplusout" value="future">

Should be:

One Week <input type="radio" name="datestatus" value="week">

One Month <input type="radio" name="datestatus" value="month">

All Future <input type="radio" name="datestatus" value="future">

Good Luck.

Garry

Posted

Hi, Peter!

I think it's just a different approach for the same thing... If I follow your solution correctly, you are calculating different values for each record/event (daysout). What I did was just have any particular event have its date stored as a regular date field, but instead of calculating the difference between the event date and the current date, I changed how FileMaker performs the search by using general calc fields to figure out what today is and then calculate what the date will be 7 days from today and 30 days from today. So, when someone wants to see all events in the next 7 days, I have FM do a search for all records with event dates Greater Than or Equal to whatever today is, and Less Than or Equal to the date 7 days from now. This generates the search results hits list and they can click on any of the activities they want to see details for.

I suppose these calc fields (mytoday, my7days, my30days, etc.) are on every record, too, but I keep them unstored and use them like globals... they have the same values on every record, not different values for different records (they all know today is 4/29/2004 and that 5/6/2004 is the date 7 days from now, etc.).

The system I was (I guess I should say I still am) working on was not just a search engine, though. This was (is !!) going to be an interactive system where users can post their own activities and events and not rely on me to input them into FileMaker.

--ST

This topic is 7505 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.