Fatal error: Call to undefined method MyProfile::applyDate()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jinfo
Forum Newbie
Posts: 1
Joined: Sat Jul 26, 2008 1:00 am

Fatal error: Call to undefined method MyProfile::applyDate()

Post by jinfo »

Hello Community:

I am just getting started working with php and I am getting the following error:

Fatal error: Call to undefined method MyProfile::applyDate() in C:\xampp\htdocs\7-21\phpfiles\MyPostedJobs.php on line 122

Code: Select all

 
 <?php
session_start();
//include("classes/DateFormat.php");
include_once ("classes/MyProfile.Class.php");
include_once ("classes/Interview.Class.php");
$obj=new  DateFormat();
$profileObj = new myProfile();
$Interview = new Interview();
 
//print_r($this->resultArray);
$user_id=$_SESSION['userID'];
?>
<script type="text/javascript" src="JS/functions.js"></script>
<script type="text/javascript" src="JS/ajax.js"></script>
<script type="text/javascript" src="JS/form-submit.js"></script>
<div id="HomePageDiv"> </div>
<form name="homeList"></form>
 
<div id="HomePage">
            <?php 
            //
             $rowsPerPage = 5; // Paging
                $pageNum = 1; // Paging
         //
            //echo $this->sql;
            //$this->sql="SELECT t1.*,t2.* FROM tbl_requisition t1,tbl_applied_jobs t2 WHERE t1.requisition_id=t2.job_id";
                    $this->sql="SELECT requisition_id,job_req_num,job_title,posted_date,close_date FROM tbl_requisition
                    WHERE requisition_id IN (SELECT job_id FROM tbl_applied_jobs WHERE user_id='$user_id')";
                                    
                    $res=$this->Exec();
                    
                    $num = mysql_num_rows($res);
                    if(isset($_REQUEST['pageNo'])) //
                    {
                      $pageNum = $_REQUEST['pageNo']; //pass pageNumeber if any
                    }
            
                        $offset = ($pageNum - 1) * $rowsPerPage; //offset
                        $numrows = $num; //number of rows
                        $maxPage = ceil($numrows/$rowsPerPage); //maximum pages
                        $self = $_SERVER['PHP_SELF'];
     
                if ($pageNum > 1) //return to previous page
                {
                $page = $pageNum - 1;
                $prev_page = $page;
                $prev_num = $page;
                
                $prev_page = $page;
                }
                else
                {
                    $prev_page = "";
                }
                
                if ($pageNum < $maxPage) //go to next page
                {
                    $page = $pageNum + 1;
                    $next_page = $page;
//                  $next_url = "<label onClick='postValues('"
                
                    $next_page = $page;
                }
                else
                {
                    $next_page = "";
                }
                $this->sql="SELECT requisition_id,job_req_num,job_title,posted_date,close_date FROM tbl_requisition
                    WHERE requisition_id IN (SELECT job_id FROM tbl_applied_jobs WHERE user_id='$user_id') LIMIT $offset,$rowsPerPage ";
        
                    $res = $this->Exec();
                    
                    while($row=mysql_fetch_array($res))
                        {?>
 
                    <table>
                    <tr>
                    <td>    
                    
                        <table align="left" width=100%>
                        <tr>
                        <td colspan="3">
                        <h3><font color="#0000FF">Job Application Status</font></h3>
                        </td>
                        </tr>
                            <tr>
                                <td align="left" width="20%">
                                <strong>Job ID</strong></td>
                                <td>:</td>
                                <td align="left"><?php echo $row['job_req_num'];?></td>
                            </tr>
                            <tr>
                                <td align="left">
                                <strong>Job Title</strong></td>
                                <td>:</td>
                                <td align="left"><?php echo $row['job_title'];?></td>
                            </tr>
                            <tr>
                                <td align="left">
                                <strong>Posted Date</strong>
                                </td>
                                <td>:</td>
                                <td align="left">
                                <?php echo $obj->USFormatDate( $row['posted_date']);?>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                <strong>Closing Date</strong></td>
                                <td>:</td>
                                <td align="left">
                                <?php echo $obj->USFormatDate( $row['close_date']);?>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                <strong>Applied Date</strong>
                                </td>
                                <td>:</td>
                                <td align="left">
                                <?php 
                                echo $profileObj->applyDate($user_id,$row['requisition_id']);
                                ?>
 
The applyDate function is:

Code: Select all

 
function applyDate($user_id,$job_id) {
            
            
                        $Obj = new DBCon();
 
                        $Obj->sql = "SELECT * from tbl_applied_jobs where user_id = '$user_id' and job_id = '$job_id' and job_status = 'yes'";
 
                        $res = $Obj->Exec();
                        $row = mysql_fetch_array($res);
 
 
                        return $this->DateObj->getDate($row['app_date']);
            
            }
 
 
I am not sure why I keep getting this error
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: Fatal error: Call to undefined method MyProfile::applyDate()

Post by ghurtado »

Is your function part of a class or a standalone function?
Post Reply