Jump to content

Mark Johnson

  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mark Johnson

  • Rank
  1. Well as for moving all the files into separate tables or one solution that would be next to impossible. Not Impossible but next to. It would be extremely time consuming. Its been added to by so many people that its just gotten out of hand but to go and do all that into one solution and all wouldnt be very good. Its all to intertwined together plus we have c# apps that connect to the different solutions that would have to be re programmed to accommodate it. The only reason i was gonna put them into a function is to not use something that can be put into a function if that code is being used all the time but considering its only used once i guess, it doesnt matter. The whole APi for PHP thing is new to me as well as php also so im learning as i go hands on. I dont mind using the filemaker native security login stuff and i can get it all set up that way no problem but it will be time consuming but we may potentially have like 10000-20000 users as right now we have 14000 clients but not all of them have website access but going php we will be working on moving alot of them toward using our website. We dont do it much now cause we are using iwp and to us it just sucks all around. The other thing i can do is use one file that has external connections to other files and just have layouts for the different solutions in one file referencing that file. So basically like a data separation model would be, you have an interface file that everyone uses but it references the data file. A file thats like a portal to other solutions if thats able to be done. So they login and check the login with that one file and then i can query tables form other solutions in that one file just going to the layout assigned to it.
  2. Well the reasoning with the table of logins is its not for internal use its for a client website for our clients to login and we arent talking just a few, were talking about a few 1000 or more. Now granite we only have about 5 or so logging in at any given moment.  Right now we have a .fmp12 file that is slated for IWP in filemaker 12 that is in general just a portal meaning it only has 1 table but references all our other filemaker files via relationships. the reason why its multiple files is this is a database that has been built and added on since filemaker 5 and im the one dealing with it now. I would like to have a data seperation model where we have a data file and interface file but that would be an EXTREMELY long project and almost impossible for us to do in a good time frame plus to make sure the data is correct.  Theres alot of stuff that was done really funky and not by far the best way but to go and change that to a more effective way or less calculations or less scripts and all that would be hard.  ***********************************  - Now for logins issue......  Right now we have a client record with a corporate login (all records assigned to that corporation), regional login (only records assigned to that region) and client login (the individual location only meaning that 1 location). Now we do have a table for contacts where we can assign multiple contact people tot hat one location but if that one person is part of other client records then you have to add them to those client records as well. What i would like to do is be able to assign that one person to multiple client records across the board but thats a different story i guess possibly.  As for the function, how would i put that into a class or just a function to pass different logins if needed and return what is needed to say it was good or what would i return in the function for that? And how would i use it on the php code if i wanted to pull a list of client records once the function passed and it connected? Im trying to learn functions and some of it i can udnerstand but not when it comes to classes or writing functions for filemaker API for php. that im still learning but i need to learn it.
  3. Im looking at creating a connection class for connecting to the different databases that ill be needing to connect to to query for data and not familiar with classes much but found this one im trying to figure out. How do i get it to work properly and return to me what i need and also that it did connect successfully? as well as being able to use it for other filemaker databases i need to connect to? The connection details below is example but ill connect to logins.fmp12 first to check the users credentials with a table that has their login and password info then if success and they are active then ill go to a layout where they can do finds and pull data for customers etc which will not be the logins.fmp12 database it will be something like ohc_data.fmp12? <?php require_once 'FileMaker.php'; class FilemakerDB { // database connection details public static $host = ''; public static $database = 'logins'; public static $username = 'user'; public static $password = 'pass'; private static $connection = null; // Private constructor for singleton pattern private function __construct() { } /** Values required for setting up the connection. **/ public static function setup($host, $database, $username, $password) { self::$host = $host; self::$database = $database; self::$username = $username; self::$password = $password; } // filemaker database connection public static function getConnection() { if (!self::$connection) { self::$connection = new FileMaker(); self::$connection->setProperty('database', self::$database); self::$connection->setProperty('hostspec', self::$host); self::$connection->setProperty('username', self::$username); self::$connection->setProperty('password', self::$password); } return self::$connection; } // clone private for singleton pattern private function __clone(){ } } $db = new FilemakerDB(); if (FileMaker::isError($db){ echo "Error"; }else{ echo "Good Job"; } ?>
  4. I have a Searchloads.php file that is showing a lsit of my records im pulling from filemaker. right now its hardcoded to sort records based on two fields. How do i allow the user to sort records based on what they choose in a drop down menu? Or maybe two sort drop down menus? and if the second isnt set then it just works off the first one.
  5. below is some code that i loop through records creating an unordered list. basically a table just in list form. What i want to do is in the url i have a variable being passes called page= and whatever page number i get at that time. I have a css style that when im on a specific page the pagination link that corresponds to that page should be green so i know by looking at pagination links what page im on instead of looking at the url for page number. how do i do that? $n = 1; while ($n <= $totalLinks and $totalLinks > 1) if ($page == $n) { echo '<li><a href="' . $_SERVER['PHP_SELF'] . '?page=' . $n . '&skip=' . $skip . '&max=' . $max . '">' . $n . '</a>&nbsp;</li>'; $n++; } else { $skip = ($n - 1) * $max; echo '<li><a href="' . $_SERVER['PHP_SELF'] . '?page=' . $n . '&skip=' . $skip . '&max=' . $max . '">' . $n . '</a>&nbsp;</li>'; $n++; } The li tag thats active would be <li class="active">. Each time i click a page number on pagination links it should highlight for that page number. figured it out my self. Sorry.. played with it and realized it was like supper simple what i did. Im learning php along with php for api for filemaker so im not familiar with it all.
  6. One more question, how to i write that fmpTrapError2 function to not only go to an error page but also give me a url in a variable that i can echo out to that go back to previous page button so they can click the button and go back if i wanted them to? obviously i have the navigation so they can click whatever but id like to have it just in case.
  7. ok i got it to redirect finally. it was an error on my error.php page with session start etc on top with a redirect back to login which was working correctly. My only issues now is, and i've uploaded the updated pages, is on line 24 or so, theres an fmpTrapError2 function that im passing my own message into along with the error code that doesnt seem to work properly on the error page. Not sure if im doing it right or not in the function. Functions.php error.php login.php
  8. still having issues. I rearranged the getrecords() function to go below the Filemaker::iserror($result) and it doesnt give me the above error but the fmpTraperror or fmptraperror2 not the standard header redirect doesnt go to the error page like its suppose to. fmpTrapError is the standard error function that gives me filemaker's errors but i modified it with fmpTrapError2 to pass my own errors if i want to so if someone can look at that and make sure im doing it right that would be great. error.php login.php Functions.php defines.php
  9. the error i get is Fatal error: Call to undefined method FileMaker_Error::getRecords() in /home/mjohnson/public_html/ergo/login.php on line 101. Yea i have it commented out for now but if i re-enable fmpTrapError($result, "error.php"); function then i get the above if it try to login with the wrong credentials but if i login with correct credentials then it redirects to LoginSuccessfull.php like its suppose to.
  10. Ive attached my code pages. The issue i have is if the login credentials is correct it redirects great but of not then it doesn't work and displays an error of below. Whats goin wrong? I used some of the functions from a plugin that i own to play with and they work just not if its wrong login. login.zip
  11. Ive got a similar issue but ive got a PC running FM server 12 adv on my network and ive got FM go 12 on my ipad connected to the same network via wireless. I add my PC to the list on FM go 12 with its ip address but i can see any of the files on it. All my files i can see if i use open remote on FM Client 12 on any computer on the network running FM client 12 but my ipad wont see them. Even if i try to manually type the name in the field it says host either unavailable or file not found error. windows firewall says its disabled and my antivirus is disabled as well. What can be the issue? I have a client i need to set up this way but i gotta figure it out why it aint working on my system first. Mark
  12. I downloaded a file that uses the reactor plugin. I was looking at the functions of it and was trying to use the slider function for sliding from one record to another via the slider bar. I have the plugin inside of a webviewer and can use the slider and slide from left to right and vice versa but how do you get it to slide from one record to another either on found set or show all records? Also is there anymore detailed documentation that actually shows you how to use the plugins and how to set them up otehr than what little info i found on their website? Mark
  13. One quick question. After you select the items in the portal rows you want and you perform what ever script you need to perform with them, how do you get them to deselect or un highlight?
  14. I have a database that has a table with a list of techs and the contact info for them but also have a seperate table that has a list of all my clients. what i want to do is on the main page of the database that gives me an overview of the client, i have a portal that lists all the techs that are associated with the state that my client is in but i want to be able to have a field calculation that i can do that will show the distance between the location of the tech and the location of the client based on the city and state between each so that i can scroll throught the list and find the techs that are closest to the client and then view the info for the tech and call them instead of having to go to google all the time and type in all the info. One thing though, i dont want the google webpage to be viewed in filemaker, i just want a number in the field and thats it. Is there a way to do it.
  15. But how do i sum up the monthly premium amount on a weekly basses so i can see how much i am pulling in so far? I need to sum up the monthly premium amount for all records created each week in a weekly column but also sum up the same monthly premium field on a monthly bases. I need to break it down per day, week, month and year. Ive attached a jpg of the layout. the text in red is my notes. I hope this helps some. The monthly summary on the layout now is already done but i tried to figure out what was done and can't. I guess in a nutshell, How do you do a summary for a price field based on a calc field with WeekOfYear that basically gets what week it is for the current week?
  • Create New...

Important Information

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