Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Give us an example of code you wrote and what she said you had to change. Maybe she is just nitpicking (or she likes you and just needs an excuse to talk to you ) but is pleased with your work overall. I guess if she wasn't you would be looking for a new job
  2. $settings['0'] is the same as $settings[0] In this code: $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE ); if ( $httpCode == 404 ) { return '404'; } else { return $response; } curl_close( $ch ); curl_close() is never executed. Same here: throw new Exception( "API: Page Not Found - 404" ); // Remove cache file on error to avoid writing wrong json unlink( $cache_file ); unlink() is never executed.
  3. <meta name="robots" content="nofollow"> Means the page will be indexed, to avoid this use: <meta name="robots" content="noindex,nofollow">
  4. PHP Coding Help means we help you with the code YOU wrote. If you want to hire someone to write code for you, you should post your question in the freelance secction. Otherwise post the code you have so far and where you are having trouble with.
  5. Read http://www.phpfreaks.com/tutorial/php-security If you already do this, then your scripts are protected against the most common risks.
  6. You clearly have no idea what you are talking about. procedural pre-dates OO, are you saying all those years there were only newbie programmers?
  7. What no +-operator overloading?
  8. $str = new String("This is a String"); $system->output($str->toupper()); That is just straight out blasphemy! Next thing on your wishlist is to use . as a object operator right?
  9. Is there only one therapist for each treatment? treatment (tmt_id, trp_id, tmt_name, tmt_desc) -- one-to-many/one-to-one: one therapist for one/many treatment(s) therapist (trp_id, trp_name) OR treatment (tmt_id, tmt_name, tmt_desc) therapist (trp_id, trp_name) therapist_does_treatment (trp_id, tmt_id) -- many-to-many one therapist does many treatments, one treatement is done by many therapists If clients have to login, create a table for those: client (clt_id, clt_fname, clt_lname) Now comes the harder part: a therapist can only treat one client at a time and you must reflect this in your DB. What you must do is create a cron that fills a table with possible appointment dates of say one hour (or longer depending on how long it takes a therapist to treat a client) for the entire year. When a client then makes an appointment you create a relationship between the client, the therapist, and the appointment date so that never 2 clients can make an appointment at the same time. Since I am not gonna write out the entire DB schema I'll leave this up to you partly also because I don't have all information to create this schema like: how long does a particular treatment take? Do therapists only do one particular treatment throughout the day or more? Et cetera...
  10. It's free up to 2500 directions and the results MUST be used to display a route on a map otherwise it's prohibited. https://developers.google.com/maps/documentation/directions/#Limits
  11. It completely depends on the project. Find what your project needs and what each framework is good at, then find the framework that serves your project best.
  12. Add a timestamp to the meeting_request? When you left join then on this table you will have to desc sort on this timestamp and then group by, I think. PS I forgot to include that mr_response can also have the value PENDING... except for the requester which will have REQUEST or something. So mr_response can have these values: PENDING, REQUEST, ACCEPTED, DECLINED, RESCHEDULE
  13. I meant injecting into the models (don't know why I forgot that part!) using a DI container, but if you don't feel up to using any third-party, and don't want to write your own, then yeah getDBH() will do.
  14. They would still only change one record, not creating several. participant (ptc_id, ptc_email) meeting_place (plc_id) meeting (mtg_id, mtg_uniqid, plc_id, mtg_reqby, mtg_subject, mtg_body, mtg_created_on, mtg_from_dt, mtg_till_dt, mtg_is_resched, mtg_resched_original) meeting_request (mtg_id, ptc_id, mr_response) A simple table structure, where one, can request a meeting with several other participants (incl. himself). The mr_response is either ACCEPTED, DECLINED or RESCHEDULE. When one of the participants wants to reschedule it creates a new meeting and attaches all participants to this new meeting and refers back to the original meeting request. I should note that a rescheduled meeting can point to a previous rescheduled meeting. The mtg_uniqid should be the same for all of the same meetings. So in this model you would need to find the last known rescheduled meeting which can be done by desc sorting on mtg_created_on where mtg_uniqid is the same. This is a very basic model off-the-bat and may need some serious tweaking.
  15. Well there is not much to comment on. Why do you have both an abstract class and an interface for a controller? To declare every controller with: class Index extends Abstract_Controller implements Interface_Controller Is really cumbersome. Either implement the interface on the AbstractController or drop the interface all together and declare the method as abstract. I would also postfix your controllers with Controller so they do not conflict with library classes. Why does the AbstractController define a dbhandle? This should be injected or something. Why do you not use a framework?
  16. It means you have http links on a https page. Change it to (note the missing http:): '<script type="text/javascript" src="//bp.yahooapis.com/2.4.21/browserplus-min.js"></script>'. '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>'.
  17. Don't know about faster, but it skips the whole mapping (from table rows to objects) process. But this includes only vehicles, right? And this is only for stolen vehicles? And these updates are they send to some PHP script or stored into the db from another source?
  18. When you are talking about units do you then mean vehicles? How does SMS fit in this story? (The Driver texts the system with their position? ) What does a Journey constitute of? Checkpoints?
  19. Both NoSQL and RDBMS have their (dis-/)advantages. I for example use it when I load my objects from a DB using a DataMapper I load them with ALL their data, serialize them, and store them in CouchDB instead of mapping them every time. The hard part is when an entity changes, you have to update both CouchDB and the DB (and any other app that uses this DB, though there are plugins for MySQL that allow you to put/post/delete to CouchDB I believe). When it can't find the entity in CouchDB it starts the mapping/caching process. The Repository queries CouchDB mapper first before querying the DB mapper. When an entity is inserted/updated/deleted it updates both CouchDB and the DB through it's respective mapper. I am only experimenting with this though.
  20. Well, you could for example just create these as columns on the units table and differentiate between them using a type (GPS or SMS) column. Another possible approach is to have a units table, and gps_units and sms_units tables that reference the PK in the units table. The first approach has the advantage that you don't have to do any join's but if you know on forehand on which table you'll need to join (eg, because you know it's GPS) you can use the second approach. And if you do insist on using EAV then look at MongoDB or similar NoSQL alternative.
  21. It's an EAV-model and it has disadvantages you should be aware of before using. I'll reply later on the rest of your posts when I have time.
  22. If units and units_info have a 1:1 relation then I would keep them in one table. Same goes for your LatLng and Address tables, these have, as I see it, a 1:1 relation (unless two different addresses can share a lat/lng?*) otherwise add lat, lng to the Address table and create an Address ID field. Further possibilities could be: give city and postcode their own table. Country too. Maybe even street_name too? It depends on your needs. No. But that's me. I would probably pass the Address entity to a Repository (or a DataMapper at minimum) to insert it into the database. (*) You could argue that an apartment block shares a lat/lng for all it's tenants but a GPS doesn't route you to the 7th floor, right? And since for a row in the address table to be unique the street_number has to be different meaning the location is different also means the lat/lng are different.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.