Jump to content

Need help in working with Class/Object using PHP/HTML


navjak

Recommended Posts

Hi Guyz!!

 

Iam New to PHP and trying to generate a report for my project.

Iam using php5.1.4 and Apache Server 2.0.

I dont know where I have gone wrong and facing problem in executing the script. I could et the HTML output where the user can select his choice of report but the php script is not getting executed fully. I have attached my script below. All I could get is the echo statements at the begining of the php script. Iam not able to execute the script which is inside the class and functions.

 

Please help me in this.

 

Regards,

Jaknav.

 

Iam calling the file name in the browser.

File Name: ABC.php

 

<html>
   <body>
      <form action="<?php $PHP_SELF; ?>" method="post">
         <table border="0" align="center" cellpadding="5" cellspacing="0">
            <tr>
               <td align="right" valign="middle">BuildName:</td>  
   <td>
         <select name="BuildName">
                     <option value="CRM89">CRM89</option>
               <option value="CIS88">CIS88</option>
                  </select>
   </td>
</tr>
<tr>
        <td align="right" valign="middle">BuildType:</td>
   <td>
         <select name="BuildType">
                     <option value="STD">STANDARD</option>
                     <option value="CODE">Code</option>
                  </select>
              </td>
           </tr>
        </table>
        <input type="submit" />
     </form>

<?php
   set_time_limit(0);
   set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
   DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "ScoobySnacks");
      echo "include path = " . get_include_path() . "\n";
   require_once("ScoobyScheduler.php");

   class ScoobyBuildTypeAverageTime extends ScoobyScheduler {

      function BuildTypeAverageTime() {
   
   Statements    1
                    .
         .
         N

$BuildName=$_POST['BuildName'];
   $BuildType=$_POST['BuildType'];

echo "Build Name is {$_POST['BuildName']}";
    echo "Build Type is {$_POST['BuildType']}";
                           
          if (!$this->BuildTypeAvgTimeByWeek($this->BuildClasses[$p],$BuildName,$BuildType)) {
             return false;
          }

          if (!$this->BuildTypeAvgTimeByMonth($this->BuildClasses[$p],$BuildName,$BuildType)) {
             return false;
          }

          if (!$this->BuildTypeAvgTimeByYear($this->BuildClasses[$p],$BuildName,$BuildType)) {
             return false;
          }
        }  
        return true;
      }
         
   function BuildTypeAvgTimeByWeek($BuildClass,$BuildName,$BuildType) {
      Statements   1...n}

function BuildTypeAvgTimeByMonth ($BuildClass,$BuildName,$BuildType) {
      Statements   1...n}
function BuildTypeAvgTimeByYear ($BuildClass,$BuildName,$BuildType) {
      Statements   1...n}
} # End of Class

   
$SBATObject = new ScoobyBuildTypeAverageTime("BuildTypeAverageTime");
   if ($SBATObject->rc > 0) {
      echo "Error constructing object SBATObject. Exiting.\n";
      exit(1);
   }

   $SBATObject->BuildTypeAverageTime();
   $SBATObject->Scooby->Log->WriteSectionHeader(Date("H:i:s") . " Finished", "Mediumpurple");

?>

   </body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.