Jump to content

jcombs_31

Staff Alumni
  • Posts

    2,064
  • Joined

  • Last visited

Everything posted by jcombs_31

  1. What if you concat first and lastname?
  2. Did you modify the index.php? http://book.cakephp.org/1.3/en/view/915/Advanced-Installation
  3. If you are calling this from your bookings controller and it is associated with your payments, you need to properly link. $this->Booking->Payment->payMethodAll
  4. Use between. http://book.cakephp.org/1.3/en/view/1030/Complex-Find-Conditions
  5. You have a Auth->deny on everything and also calling parent::isAuthorized which gives no indication of what is in parent or why you'd want to do this. Not sure why you are over complicating things. Just use the examples the cookbook gives you.
  6. Can you please show your table descriptions. E.g., "Describe table users", "Describe table pages" FYI, you can use the bake console utility to create your basic models, controllers, views as long as your DB uses the cake conventions.
  7. $this->params['url'] http://book.cakephp.org/1.3/view/963/The-Parameters-Attribute-params
  8. I don't fully understand your question, but perhaps you are thinking of elements. http://book.cakephp.org/1.3/view/1081/Elements
  9. Didn't realized there is a simple highlight_file function. That makes life pretty easy.
  10. Are there any good web based source code viewers that you can just point to a directory and show read-only source code?
  11. CakePHP does the magic on the backend if models are properly linked. http://book.cakephp.org/1.3/en/view/1017/Retrieving-Your-Data
  12. If models are properly linked you can make references from another controller. Like $this->Pet->Dog->function() You can also use $uses. This would be typical of something like a dashboard controller that you need to access multiple models.
  13. Did you read the cookbook? http://book.cakephp.org/view/1437/css. <code> <?php $this->Html->css(array('forms','myplugin/css/forms'),'stylesheet', array('inline' => false ) ); ?> </code>
  14. Change var $layout = "modal_box"; to $this->layout = "modal_box";
  15. The whole point in the left join is to return all records from the left table regardless of a match on the right table. I want to query only specific employees, not all employees. I've tried adding the to the ON, and I ALWAYS get all employees. My understanding is that you'd use the ON clause for any condition that is not on the left table.
  16. Adding the condition to the WHERE clause would cause ALL employees to be returned. In the end I just ran a query for each employee and combined them into a single array to use for my line graph. There is not much overhead as generally only a few employees will be selected and I can guarantee my results this way. Which part?
  17. Adding the condition to the WHERE clause would cause ALL employees to be returned. In the end I just ran a query for each employee and combined them into a single array to use for my line graph. There is not much overhead as generally only a few employees will be selected and I can guarantee my results this way.
  18. make perfect sense to me... you are LEFT joining the calendar table with the reviews table, therefore if in any week there are no records in the table reviews your reviewee_id field is going to be NULL, hence the JOIN with the employees table will produce as result the employee name with NULL value. In your scenario the only way that your select is going to work and give the result that you are expecting is if for each week and for each employee there are at least 1 record in the table reviews with the field rating_id NULL, ZERO or any other value non-existent in the table ratings. The other probable solution is get only the data available with the SELECT, and post-process at display time (using some array and some logic to fill the missing records for a week). Thanks for the response. I think in the end I'll have to use some application logic to get the results I want. I was hoping I could do this with SQL alone, but based on my needs it seems that may not be possible.
  19. I've tried this SELECT WEEK(Calendar.datefield) AS Week, CONCAT(Employee.firstname, ' ', Employee.lastname) as Name, AVG(Rating.scale) as Average FROM calendar Calendar LEFT JOIN reviews Review ON WEEK(Calendar.datefield) = WEEK(Review.created) LEFT JOIN employees Employee ON Review.reviewee_id = Employee.id AND Employee.id IN (71, 72, 73) INNER JOIN ratings AS Rating on Rating.id = Review.rating_id WHERE Calendar.datefield BETWEEN '2011-09-01' AND '2011-12-31' GROUP BY Week, Employee.id ORDER BY Week, Employee.id which gets me close but the employee field is NULL rather than the rating, which doesn't quite make sense
  20. Hey guys. I posted this on stack overflow but I'm still not getting exactly the results I want . In the end I my just use PHP to put together an array for me, but I'd prefer to get this direct from the SQL query. Instead of typing it all out, here is the issue: http://stackoverflow.com/questions/8647445/join-not-showing-all-rows I'm charting this with google charts. I was reading this http://www.richnetapps.com/using-mysql-generate-daily-sales-reports-filled-gaps/ but I think my query is a bit more complex because of the groupings. Any thoughts on the best way to go about this would be appreciated.
  21. You can use Jquery exactly as you would if not using CakePHP. You'd have to be more specific.
  22. What exactly is your question? What exactly are you trying to accomplish? What controller are you using? Why are you using "query" instead of "find"?
  23. To should be formatted as a string and cc/bcc should be arrays as per the API. http://api.cakephp.org/class/email-component
  24. I don' t quite follow, the form should have fields matching the fields in the database, so your model should be easy to set up validation based on the fields. Perhaps the DB is not designed correctly. Can you give a better example of exactly what you are trying to do? It sounds like you may need a many to many, but we'd need more details.
  25. I don't have an ER to post, but what I'm looking to is a review for a call center type system. This system has a number of fields that the support person must fill out (A CRM for Technical Support). There are a few tables that I need. [Employees] name, login, etc [Cases] Case number, details, etc [Review] Review Date Employee Case Number Case Summary <field in CRM> Problem Detail <field in CRM> Last Action <field in CRM> Notes Action An employee can own many cases and there can be multiple reviews done for each case over time. Within the review the CRM fields will be graded with a list of actions to choose from. This then leads to the actions table. This was the list can be flexible and added to as needed rather than using something like an enum. I like the concept of the many to many for fields <-> actions, but i'm struggling with the fact that a review will contain many fields from the CRM as well as additional data (Notes, Action Plan, etc). There are more details/tables that I don't feel are relevant to this particular relation. I thought about just handling this in PHP (just query the actions table to create the dropdowns for the input form and just use a varchar for the grading system in the table), but I didn't think this would be good design. Does this make sense what I'm trying to accomplish?
×
×
  • 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.