2017-03-02 4 views
0

こんにちは私はこのエラーがあります "Catchable fatal error:クラス__PHP_Incomplete_ClassのオブジェクトをC:\ xampp \ htdocs \ ProjectTA \ dao \ CustomerDao.phpの文字列に変換できませんでした161" のように、私はこの問題を解決するための見当がつかない私はすべてをチェックして、すべてが私には大丈夫ですクラス__PHP_Incomplete_Classのオブジェクトを文字列に変換できませんでした

この私の顧客DAO

public function getOneCustomer($id) { 
     try { 
      $conn = Connection::getConnection(); 
      $query = "select * from Customer c join Company comp on c.Company_IdCompany = comp.IdCompany JOIN City cit ON c.City_Id = cit.IdC WHERE c.IdCustomer = ?"; 
      $stmt = $conn->prepare($query); 
      $stmt->bindParam(1, $id); 
      $stmt->execute(); 
      $row = $stmt->fetch(); 


      $customer = new Customer(); 
      $customer->setIdCustomer($row['IdCustomer']); 
      $customer->setCustomerName($row['CustomerName']); 
      $customer->setPhoneNumber($row['PhoneNumber']); 
      $customer->setBankNumber($row['BankNumber']); 
      $customer->setCAddress($row['AddressC']); 
      $customer->setCEmail($row['EmailC']); 
      $customer->setPassword($row['Password']); 
      $customer->setCustomerStatus($row['CustomerStatus']); 
      $customer->setPhoto($row['Photo']); 

      $company = new Company(); 
      $company->setIdCompany($row['IdCompany']); 
      $company->setCompanyName($row['CompanyName']); 
      $company->setWebsite($row['Website']); 
      $company->setPhone($row['Phone']); 
      $company->setEmail($row['Email']); 
      $company->setAddress($row['Address']); 
      $company->setLogo($row['Logo']); 

      $city = new city(); 
      $city->setIdC($row['IdC']); 
      $city->setNameC($row['NameC']); 

      $customer->setCompany_IdCompany($company); 
      $customer->setCity_Id($city); 
     } catch (PDOexception $e) { 
      echo $e->getMessage(); 
      die(); 
     } 
     $conn = null; 
     return $customer; 
    } 

と私は私の顧客ビューでこれを表示したい

<?php 

if (isset($_SESSION['IdCustomer'])) { 
    $dao = new CustomerDao(); 
    $id = $_SESSION['IdCustomer']; 
    $dataInfo = $dao->getOneCustomer($id); 


echo '<div class="col-md-12"> 
     <div id="fh5co-tab-feature-vertical" class="fh5co-tab"> 
       <ul class="resp-tabs-list hor_1"> 
         <li><i class="fh5co-tab-menu-icon ti-ruler-pencil"></i> Company</li> 
         <li><i class="fh5co-tab-menu-icon ti-paint-bucket"></i> Project & Task</li> 
         <li><i class="fh5co-tab-menu-icon ti-shopping-cart"></i> Proof of Payment</li> 
       </ul> 
       <div class="resp-tabs-container hor_1"> 
        <div> 
         <div class="row"> 
          <div class="col-md-12"> 
            <h2 class="h3">Company</h2> 
          </div> 
          <div class="col-md-6"> 
           <h2>'.$dataInfo->getCustomerName().'</h2> // i want diplay customer name 
          </div> 
         </div> 
        </div> 

        </div> 
       </div> 
      </div> 
     </div>'; 

は}?>

は、私は、この問題の解決策を持っている、

答えて

0

ので、ありがとうございました。顧客のログインセッションでデータのログインを確認するときに間違っていた

関連する問題