Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   How to call base class metod in drive class? (http://www.go4expert.com/forums/base-class-metod-drive-class-t21657/)

iskhan 5Apr2010 01:09

How to call base class metod in drive class?
 
Scenario
Base Class A and its Sub Classes are B, C, D, E, F
Every class have a method B_Menu(), C_Menu(), D_Menu(), E_Menu(), F_Menu() respectively. And following Search_Form ($FileName,$Heading,$SubHeading) method with different x_Menu() method where x=B, C, D, E, F for every Sub Class mentioned in RED COLOR.
PHP Code:

  <?php
  
function Search_Form($FileName,$Heading,$SubHeading)
  {          
  
?>
  &nbsp;             
  <FORM method="POST" action="<?php echo $filename;?>">
  <table border="0" cellpadding="0" cellspacing="0" width="100%" id="AutoNumber1" height="344">
  <?php  $this->Page_Heading("$Heading"); ?>
  <tr>
                <td width="100%" height="51" colspan="2"><BR>
  <?php if($Heading=="REPORT")$this->[B][COLOR=red]B_Menu()[/COLOR][/B]; ?>&nbsp;
                <p align="center"><b><font size="4"> <u>SEARCH FOR 
  <?php echo $SubHeading?></u></font></b></td>
              </tr>
              <tr>
                <td width="50%" height="51"><strong>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  User's ID :</strong></td>
                <td width="50%" height="51">
                <p align="center"><input type="text" name="PatID" size="10"></td>
              </tr>
              <tr>
                <td width="100%" height="19" colspan="2">
                ------------------------------------------------------<b>---------OR</b>-------------------------------------------------------------</td>
              </tr>
              <tr>
                <td width="50%" height="51"><strong>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  First Name :</strong></td>
                <td width="50%" height="51">
                <p align="center"><select size="1" name="FName">
                <option selected>Select First Name...</option> 
                </select></td>
              </tr>
              <tr>
                <td width="50%" height="51"><strong>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  Last Name : </strong>
                </td>
                <td width="50%" height="51">
                <p align="center"><select size="1" name="LName">
                <option selected>Select Last Name...</option>
                </select></td>
              </tr>
              </table>
              <p align="center">
  <?php  $this->Submit_Reset("  Search  ","  Reset  "); ?>
              </p>
  </FORM> 
  <?php
  
}

………..
Calling Search_Form ($FileName,$Heading,$SubHeading) method as follows:
ObjA-> Search_Form (‘x.php’,’REPORT’,’Update’);
ObjB-> Search_Form (‘y.php’,’REPORT’,’Delete’);
:
:
:

Question?
If I move Search_Form ($FileName,$Heading,$SubHeading) method to Base Class A
What changes are required? and how can I call it in any Sub Class?

dasli 13Apr2010 16:24

Re: How to call base class metod in drive class?
 
mm...interesting...


All times are GMT +5.5. The time now is 17:30.