|
Posted by PHPBABY3 on 01/02/07 03:09
Tim Roberts wrote:
> "PHPBABY3" <shymathguy@gmail.com> wrote:
> >
> >1. I have two SQL tables. I will call them employees and departments:
> >
> >EMP: LAST_NAME, FIRST_NAME, DEPTNM
> >DEPT: NUM, NAME
> >
> >Input: text string FIND
> >
> >Output: the LAST_NAME, FIRST_NAME and department name NAME (link DEPTNM
> >in EMP to NUM in DEPT) of all employees whose LAST_NAME or whose
> >FIRST_NAME contains the string FIND in a case-insensitive manner.
> >Example: Employees with LAST_NAME = "Sandleburg" are listed when
> >input FIND = "BURG".
> >
> >2. What if I have to add another field to the display, department
> >budget, from table:
> >
> >ACCOUNTS: DEPTNM, BUDGET
> >
> >3. Display the results 10 at a time.
> >
> >4. Position the results on the page using CSS.
>
> It is *NOT* the job of the folks on this newsgroup to do your homework for
> you, and those who replied should be ashamed at being suckered into doing
> so.
J.O.Aho and Ric and all the other nice people: please don't be bothered
by someone who is mean and nasty. We can just look in the other
direction.
Now, I've worked on my problem and have broken it down into 4
subroutines, that are used like this:
1. Create a button that will appear on all pages in the application at
a particular location using CSS, and that does as follows.
2. Read 2 fields CHOICE and FIND.
a. The top one, CHOICE, is a drop-down list with the same 16 choices
each time.
Function ddlits() returns the list of 16 literal values that are
displayed.
b. The bottom one FIND is a text field with no default, so it is
blank initially.
3. By special rules used only here, we translate (2) into a list of
(Query#,SQL Query) pairs.
Function qrz($choice,$find) = list of ($qnm,$sqry) pairs of Query# and
Query.
4. Execute (3) and accumulate the results into []=(Query#,Tuple). That
is, we have a function runsql($sqry) = list of tuples returned by query
$sqry.
5. Translate (Query#,Tuple) => (Display,URL) by function
qtdis($qnm,$tuple)=($display,$url) to create a list of links to
display.
6. Display the (Display,URL) pairs as links.
Can someone tell me how to implement this in CakePHP? Please be
explicit: I have to write what and store it where and do what to get
the button to appear on the existing pages?
Thanks,
Peter
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
Navigation:
[Reply to this message]
|