ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
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
-
$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.
-
<meta name="robots" content="nofollow"> Means the page will be indexed, to avoid this use: <meta name="robots" content="noindex,nofollow">
-
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.
-
set_exception_handler
-
Securing Script against injection in Laymans terms please
ignace replied to Scooby-Doo's topic in PHP Coding Help
Read http://www.phpfreaks.com/tutorial/php-security If you already do this, then your scripts are protected against the most common risks. -
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?
-
What no +-operator overloading?
-
$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?
-
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...
-
Delivery range validation for food online ordering website
ignace replied to eldan88's topic in PHP Coding Help
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 -
Best Framework to use to Convert existing PHP App
ignace replied to thomasw_lrd's topic in Frameworks
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. -
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
-
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.
-
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?
-
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>'.
-
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?
-
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?
-
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.
-
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.
-
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.
-
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.