Trying to make DF work for what we need it for ... hardly an
43 posts
• Page 1 of 3 • 1, 2, 3
Here is what we are trying achieve. We have a script that goes into a site that grabs reports of information automatically every day and that script then shoots over the values it pulls into a mySQL database I have set up.
The database consists of 2 tables one for one part of the script that grabs a certain section of data from units and then another table that does the same thing. So we have 2 tables with data in them. Within these tables both of them have a field that has a string value of the "unit number / description" I have managed thus far to successfully install DF onto our server and it is interacting with the mySQL db perfectly and I even set up users and a read only account and admin account like you instructed how to do in the getting started guide. The rest of the guide as far as relationships, delegation and the templating and stuff just...I look at the code and have no idea where to start. Here is what I want to do with this. The customer will be seeing DF in its READ ONLY permissions set up by their user account. So, they will not be doing any editing or adding of new records or anything like that, it is simply going to be used so they can parse units by their group ( unit number / description ) mentioned above. And also by a range of dates of collected data. Here is what the idea so far has been: To somehow add a navigation menu to the left side that will contain buttons or a drop down list for a section ( the unit number / description - mentioned above in that field ) and also a date range calender icon of 2 calenders to select their range or 2 date drop down fields to select the date range. Submit a query based on that information and have it displayed properly in the right main pane. Im guessing this can all probably be done similarly to how your demo of the bookstore is set up .. you have a navigation menu on the left that has the "categories" and then that shows up in the right accordingly. If I could get that somehow with a date finder below those categories that would be what we are ultimately looking for. If anyone could help me or tell me the easiest way to achieve what we want this thing to do that would be awesome. Like just point me in the direction of something like... well first you need to do this relationship and then this delegate control thingy here and then do this in the template... Just get me started and I would be greatful. I do not know how hard or easy this is to do what I need it to do. Thanks a ton for all willing to help =) Jason
Hi Jason, It looks like you're on the right track.Ê Everything is pretty straight forward - except the calendar thing will probably require a little bit of javascript.Using Dataface's url convention, you can probably get what you need by just creating links in a clever way. For example you can search for date range with a url like: http://yourdomain.com/yourapp/index.php?date=2004-09-18..2005-09-12 (to find records where the date field has a value between sept 18 2004 and sept 12 2005). And as you know, you can make this all happen by creating a form:
ok awesome, I have then one question for you, The date / time format that the script from the server we are pulling the data from is now pulled in the format of 00/00/0000 00:00:00 MST which is I noticed not how the DATE field in mySQL stores that information. How do I make the date we are pulling compatible with a DATE field type in mySQL? also what would be the best field for the dates would it be DATE or another field you recommend?
They will only need to query using the date as the time does not matter. Thanks, Jason
You are able to adjust these values with jscalendar.ÊÊ I don't have the specifics at my fingertips, but a good way to find this information is to just look at the HTML source for an edit record form that uses the calendar and see how it is done there (if you are outputing directly from javascript).ÊÊ If you are using PHP to generate the source for it, then you can check out the HTML/QuickForm/calendar.php file in the dataface distribution to see how dataface does it. Let me know if you have trouble finding it.-Steve
ok another question, Im trying to use javascript like you suggest to handle certain parts of my form, but... the { } brackets, for IF statements in javascript, are seen as comments or something inside the dataface_application_menu.html and Im getting all sort of parsing errors because its not kicking in the javascript....how do I get aroud this?
Also, sorry for the many replies but I keep having questions come from me, is there any way to display all the data in the list view from both tables at the same time? what can I use in my GET statement that would show both tables contents at same time on same list.
Thanks
Wrap your javascript in {literal} ... {/literal} tags. e.g. {literal}
Value 1 OR Value 2 OR Value 3 e.g. If you wanted to search for a person named Peter or Paul or John, you would type: "Peter OR Paul OR John" in the search field.
Yes.Ê The way to do it will depend on what exactly you mean by displaying both tables at the same time.Ê You could display two tables one on top of the other, in which case we don't worry about how the data in the tables are related. Or you could display a combined table where each row has columns from both tables (i.e. a JOIN table).Ê Which of these ways did you have in mind? -Steve
ok I need help, I have the javascript successfully changing the value of a hidden field to correctly do DATESTART..DATESTOP into that hidden form element for the GET query. BUT, I need to also write javscript that will basically take out the .. in the query if the person does not enter any dates to the 2 fields.
So, here is the code I have so far, Im sure the syntax is just screwed up...if you could help me with it that would be awesome =) {literal} {/literal}
ok I need help, I have the javascript successfully changing the value of a hidden field to correctly do DATESTART..DATESTOP into that hidden form element for the GET query. BUT, I need to also write javscript that will basically take out the .. in the query if the person does not enter any dates to the 2 fields.
Looks good, except your order is a little off.Ê You probably want to do the check for '..' after you have placed the values in. e.g. form1.call_data_time.value = form1.datestart.value + '..' + form1.datestop.value; I also notice that there is probably a typo somewhere here, because you are using 'call_date_time' in some places and 'call_data_time' in other places.Ê (note the difference between date and data). -Steve
sweet figured it out =)
onsubmit="form1.call_data_time.value = form1.datestart.value + '..' + form1.datestop.value; if(form1.call_data_time.value == '..'){ form1.call_data_time.value = ''; }" cant use "" in the IF statement have to use '' =) ok next question...when I say put in a range of dates from 05/25/2007..06/06/2007 It will only show an actual query of dates from 05/25/2007 to 06/05/2007 Is there any way to make it with your engine to tell it to include all numbers typed in including the 06/06/2007 one in the query? Cuz this will confuse the client lol.
One technique that I often use when debugging javascript is to add alert() statements to see what is stored in different variables along the way.. This will tell you where you are going wrong. e.g. Check what values are in form1.datestart.value and form1.datestop.value: alert(form1.datestart.value); alert(form1.datestop.value); and so on... this will lead you to the problem. -Steve
43 posts
• Page 1 of 3 • 1, 2, 3
Who is onlineUsers browsing this forum: No registered users and 3 guests |