
Addam
Members-
Posts
158 -
Joined
-
Last visited
Everything posted by Addam
-
how do you check if a container field is empty?
Addam replied to mlindal's topic in Other Internet Technologies
ok... Here is what you do in this case. One of the geat things about php is that it allows you to break the code and write pure html then put the code back together. Example: <?php if($findData['Coverimage'][0] != NULL) { ?> <img src="<?php echo $findData['Coverimage'][0]; ?>"> <?php }else{ ?> no image... <?php } ?> Basically, I wrapped the PHP code around the HTML. So when it finds an image it will write a completely new html tag. If not, it will write "no image...". Copy and paste the code above and you should see what I'm talking about. I think that is what you are looking for. ~Addam~ -
CDML/Javascript to solve double-click prbs in FM6
Addam replied to colinkeefe's topic in Custom Web Publishing
Try using <a href="#" onClick="alert('link');">click me</a> Basically, use the "onClick" function in a link to call a javascript function. If you copy and paste the abovelink, you will see it in action. -
I'm not sure if you are going in this direction, but you might want to build your Project Management Application as a web based application. I say that because it's probably more work than necessary to build it using FMP by itself (considering all you want to do). This way you can use PHP to communicate with BOTH FMP7 and MySQL. If your client is moving form FMP4 to 7, then they are already in for an nice size learning curve. If it's built right, it will be easier to manage in the long run. Just a suggestion.
-
how do you check if a container field is empty?
Addam replied to mlindal's topic in Other Internet Technologies
Have you tried: if($findData['Coverimage'][0] != NULL) { get the image } -
Here is some syntax you can modify and then use: Your request should look something like this: $max = 15; $skipSize = $_GET['skip']; $request=new FX("127.0.0.1"); $request->SetDBData("mydatabase.fp5","mylayout",$max); $request->AddDBParam("field","value","eq"); $request->FMSkipRecords($skipSize); $result=$request->FMFind(); Your previous and next could look like this: <table> <tr> <td style="width:200px;text-align:right;"> <?php if (strlen($result['linkPrevious']) < 1) { ?> «- Previous <?php } else { ?> <a href="<?php echo $_SERVER['PHP_SELF'] ?>?skip=<?php echo($skipSize - $max) ?>"><strong>«- Previous</strong></a> <?php } ?> </td> <td style="width:200px;text-align:left;"> <?php if (strlen($result['linkNext']) < 1) { ?> Next -» <?php } else { ?> <a href="<?php echo $_SERVER['PHP_SELF'] ?>?skip=<?php echo($skipSize + $max) ?>"><strong>Next -»</strong></a> <?php } ?> </td> </tr> </table> IF you modify the request code to fit your situation, the second code should work as is. I hope this helps! ~Addam~
-
I'm not sure if this will help, but one thing you might want to try is adding 4 fields... One - TO (calculation) Two - CC (calculation) Three - BCC (calculation) Four - SELECTION (selectable) The "Selection" field will have values that are preset to "TO, CC, BCC, none". In your script, you can run something that say's (in so many words), "Find this group of records and then replace the "Selection" with "CC" for all, then insert those results into your email field, then return them back to "none". Now the calculation field for CC's you would calculate everything that has "CC" selected and render the email addresses in one long string that you format. That way it will always be correct, no matter what is selected. This concept would be true for all "TO, CC, and BCC" fields (writen slightly different for each one). It will repeat the same for all or if you choose to select them manually, that will still work just take out the "replace" section. Again, I'm not sure if this is what you were looking for but hopefully it will point you in the right direction.
-
That's it! I also had some rearanging of code to do but that was correct. I guess after you work for 10 hrs. straight, your brain starts to cook! Thanks!
-
Here is the deal... Repeating fields are translated (in so many words) to actuall arrays themselves. So if you have 1 repeating field with 3 entries, you would get their information by: $instance['repeatingfield'][0]; $instance['repeatingfield'][1]; $instance['repeatingfield'][2]; and so on... If you wanted to display a list you would use something like this: <?php for ($i=0; $i < count($instance['repeatingfield']) ; $i++){ echo $instance['repeatingfield'][$i]; } ?> This would return the list of values inside the repeating field. Hope this helps!! ~Addam~
-
Hi Everyone! I'm doing some conversions for a client and I'm trying to find date conflicts in scheduling. Now, I've successfully broke down the day's and times to UNIX time. SETUP: 1) I gather the requestors information $startDate and $endDate. 2) I gather the information from the database for that user. PROBLEM: I'm having trouble trying to get a handle to conflicts in date and start times. Logically I would step through each record and say: "if the requested start date is BEFORE the database END DATE but NOT AFTER the database START DATE, then all is well..." else return an error. I think I'm headed in the right direction but I'm lost as to HOW to put this together in PHP Syntax. Can anyone help!? Thanks a bunch!
-
Thank you for posting this. I was fighting with that all day! ~Addam~
-
Just curious... We are sending out emails using FMP. Now in using this, we need to open a url inside the body of our message. How would we pull that off in FMP. We've made a work around using CDML & PHP, but I'm sure there has to be a way to do it straight out of FMP. Any suggestions?
-
Have you ever thought of using CWP? If you were to do that, then you can wrap the entire page in a "div" with parameters of a "8 1/2 x 11" pixel scheme or whatever size you need.
-
HI Garry... Thanks again for your input. I'm still kind of struggling with this, but I'm sure I'm headed the right direction. There is one thing I'm going to point out that all should know... When using the code you posted for editing multiple records... If you are going to be using a field that contains more than 1 value "word"... Example: $addam = "Addam Driver"; and not $addam="AddamDriver" wrap your "$tag" in the "rawqurlencode()" tag... This will parse it and properly send the information back to FMP. Example: if $addam = "Addam Driver"... You would right this as: rawurlencode($addam) in your http: request line. This was causing me so many problems until I opened my PHP book and ran across it. Hope this helps someone... ~Addam~
-
Hi Garry! I was able to understand and get the edit functions to work. My problem was I kept getting warning and notices on the screen and treating them as ERRORS thinking it wasn't working. My brain was fried. I'm good now though. I do have one question though. I may have come up with a method of "Finding Multiple Records" however, I'm not sure if it would be the way to go, but it's what I came up with. Basically the user group would get a list. The then would select all they wanted to edit and click on a link that say's "Edit Selected". I've worked this out with JavaScript & CDML before, by using a form field to keep track of the array (it's easier) then, set a form value equal to all of the requests and CDML would find them. I'm kind of puzzled on this moving using PHP. Using FX, I can find one record with ease, even multiple ones, but it's all preset. Do you or anyone out there know of a way to do this type of backend transaction with ease? Thanks a million!
-
Thank you sooo much! I'm REALLY having a hard time here. CHEERS!!
-
Do you (or anyone else) know of a way to do this using pure PHP and no CDML? Thanks! ~Addam~
-
Hi Gary... I'm looking at the code you posted on "BASIC PHP/FMP Interation". I got this thing to work once, but for some reason it's not anymore. Can you look at the code and tell me if I'm missing something here? File: fmp.php <body> Hello World<br> <form action="phpEDIT.php" method="POST"> <input type="hidden" name="-db" value="Work_Orders_.fp5"> <input type="hidden" name="-format" value="-fmp_xml"> <input type="submit" name="-new" value="New Rec"> </form> </body> File: phpEDIT.php <?php if ($_SERVER["QUERY_STRING"] != "") { @include("http://localhost:591/FMPro?" . $_SERVER["QUERY_STRING"]); } else { $args = ""; while ($fm_params = Current($_REQUEST)) { $args .= urlencode(key($_REQUEST)) . "=" . urlencode($fm_params) . "&"; next($_REQUEST); }; @include("http://localhost:591/FMPro?" . $args); }; ?>
-
Gary!! Thanks so much for that link... I get it now! Cheers!!
-
HI Everyone... I'm converting my CDML web templates and using PHP. I ran into a road block here. Now if any of you read my post a loooong time ago using CDML & JavaScript to process multiple records, you will know that we covered lots of things and got many results. I'm not sure how to process multiple records using FX.PHP. I though about KEEPING the CDML and just using PHP for authentication and carying states accross each page. I don't think that will work. Does anyone have any suggestions for doing this? Thanks!
-
Hi Everyone! One thing I really like about FMP 7 is that when you assign a user specific layouts, thats all they see in the FMP Layout List. In FMP 6 was able to write a process that would show me the list of layouts in a database and then have a user click on a button, get the list, select a laout, then they will be directed to the one they selected. This process does work in FMP, however, I would like to mimic the functionality in the FMP Drop down list for layouts. Get the layouts that the End User has access to and display them. I was going to try and LIST the layouts as well as they level of access, so I can filter out the ones with "0" access, but was unsucessfull. Does anyone have any suggestions on how to pull this off? Version: v7.x Platform: Windows 2000
-
I totally agree with you Andy and Steven! This is WAY more complex now. So as Andy stated, WORK OUT YOUR PROCESSES ON PAPER FIRST!!! Trust me, it is worth the time to do.
-
Here is a different example on tables using FileMaker Pro 6 and below structure. File 1 = Contact_List.fp5 (this your regular average FMP Database) File 2 = Houses_4_Sale.fp5 (this your regular average FMP Database) Now before, in order create a "Relational Database Suite" you would have to define a key in File 1 that matches a key in File 2. "Tables" in the "Database World" is basically what I have listed above. Table 1 = File 1 (Contact_List.fp5) Table 2 = File 2 (Houses_4_Sale.fp5) What FileMaker Pro 7 is saying is: 1 FileMaker Pro 7 Database = Millions of "Tables". Does this help?
-
starting a script based on a checkbox
Addam replied to Eliz309's topic in Script Workspace and Script Triggers
Sounds like to me you need to create a script that will check the check boxes default values. If you create a script that say's something like: If "check box" = "", then set the value to: "something (checked)"; <<< Run the script here that you want to run when it is CHECKED! >>> Else if "check box = "something (checked)", then set the value to: ""; <<< Run the script that you want to run when it is NOT CHECKED (if any). The button that runs this script would sit OVER the check box, as a "Mask". So the user never really checks the "Check Box". They are just clicking on a button that is doing all of the checking. I hope this helps. -
One method is to add an underscore to the end of the file name like this: filename_.fp5 This will keep it from comming up.
-
It's just as easy if not easier to do. Since you are experienced with other major players, the combination of FileMakers CDML and PHP, you will find it a no brainer.