<br><br><div class="gmail_quote">On Tue, Apr 3, 2012 at 4:03 AM, Ammar Yasir <span dir="ltr"><<a href="mailto:ayax88@gmail.com">ayax88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, <br><br>The noticed that the table search scripts(tbl_select.php, tbl_zoom_select.php) and multi-table query(db_qbe.php) basically display a 'Query-by-Example' form. I think we can design a qbeForm class through which we can customize a QBE form for each of the three scripts. <br>


<br>The basic elements of a QBE form are columns and details about each column. Considering column as an entity, we can assign HTML content of each column element like datatype, collation, operator, sort, criteria as the attributes of 'column' entity. To be more specific,<br>


a 'column'  entity would contain, <br>S.No. | Attribute        |   HTML               |  Script<br> 1      |  Data-type      |  text                   | tbl_select.php, tbl_zoom_select.php<br> 2      |  Collation       |  text                   |  tbl_select.php, tbl_zoom_select.php<br>


 3      |  Sort             |  HTML Select      | db_qbe.php<br> 4      |  Ins/Del         | HTML input         | db_qbe.php<br> 5      |  Modify         |  output of S.No 4 | db_qbe.php<br> 6      |  Show           | HTML checkbox  | db_qbe.php<br>


 7      | Criteria          |  (a) HTML input   | db_qbe.php<br>                               | (b) HTML Select | tbl_select.php, tbl_zoom_select.php<br> 8      |  Value           | (a) HTML input    | tbl_select.php, tbl_zoom_select.php <br>


                              |  (b) multiselect    | tbl_select.php, tbl_zoom_select.php<br>                              | Foreign Values    |  tbl_select.php, tbl_zoom_select.php, browse_foreigners.php<br><br>We can decide on what HTML we want to display for each 'column' entity(depending on the script in consideration) and customize our QBE form.<br>

One thing to note is that, from 'column' entity we will generate an empty HTML skeleton (say column block). The values of HTML select and others(for example operators) will be updated using AJAX calls. I guess that could also be included as a procedure in the QBE class (or column class).  <br>


A QBE form can consist of various column blocks ( tbl_zoom_select.php 
has 2, db_qbe.php initially has 3 and tbl_select.php has count($fields) 
).  For, db_qbe.php 'column' blocks can be added dynamically just by creating an instance of 'column' entity. <br>One issue could be that in tbl_zoom_select.php and db_qbe.php we need to select columns, i.e, columns are displayed in a select box, while in tbl_select.php all the columns are listed. But I guess, it can be worked out in time. <br>

<br>Regards,<br>Ammar Yasir<br><br></blockquote><div>Would such OOP be feasible?  <br></div></div><br>