2014-04-25 47 views
-3

我需要一些幫助..希望你們能幫助我。我是這個網站的新成員。提前致謝。Php未定義抵消:0 1 2 3 4 5 6 etc

嚴重性:注意

消息:未定義偏移量:0

文件名:型號/ atmlist_bybranch_model.php

行號:103

此錯誤在開始

$results = $data[$i]["collectReceivables"] >= $data[$i] "totalDeposit"]?1:0;      

$html .="<td>".$data[$i]["createdDate"]."</td>"; 
$html .="<td>".$data[$i]["clientID"]."</td>"; 
$html .="<td>".$data[$i]["lname"]." ".$data[$i]["fname"]." ".$data[$i]["mname"]."</td>"; 

$html .="<td>".$data[$i]["clientBankLoc"]."</td>"; 
$html .="<td>".$data[$i]["pensionDate"]."</td>"; 

這是我的查詢:

$index = 0; 

$data = array();    
foreach($query->result() as $row){ 
    $data[$row->clientID][$row->trans_type][$index]=array(
       "createdDate" =>$row->createdDate, 
       "trans_type" =>$row->trans_type, 
       "clientID" =>$row->clientID, 
       "fname" =>$row->fname, 
       "mname" =>$row->mname, 
       "lname" =>$row->lname, 
       "pensionDate" =>$row->pensionDate, 
       "clientBankLoc" =>$row->clientBankLoc, 
       "loanLedgerID" =>$row->loanLedgerID, 
      ); 


    $this->db->select("cl.collectionDepositAmount");  
    $this->db->from("collections_ledger cl"); 
    $this->db->where("cl.loanLedgerID", $row->loanLedgerID); 
    $this->db->where("cl.createdDate >= ", strtotime($fullStartDate)); 
    $this->db->where("cl.createdDate <= ", strtotime($fullEndDate."+1 day")); 
    $query2 = $this->db->get(); 

    $totalCollection = 0; 
    foreach($query2->result() as $row2){ 
     $data[$row->clientID][$row->trans_type][$index]["collectionDepositAmount"][] = $row2->collectionDepositAmount; 
     $totalCollection += $row2->collectionDepositAmount; 
    }   
    $data[$row->clientID][$row->trans_type][$index]["totalDeposit"] = $totalCollection; 


    $this->db->select("collectionReceivables"); 
    $this->db->from("collections"); 
    $this->db->where("loanledgerID", $row->loanLedgerID); 
    $query3 = $this->db->get(); 

    $totalReceivables = 0; 
    foreach($query3->result() as $row3){ 
     $data[$row->clientID][$row->trans_type][$index]["collectionReceivables"][] =$row3->collectionReceivables; 
     $totalReceivables += $row3->collectionReceivables; 
    } 
    $data[$row->clientID][$row->trans_type][$index]["collectReceivables"] = $totalReceivables; 
    $index++; 
}     

$results = 0; 
$x = 0; 
for($i=0; $i<count($data); $i++){ 

    $results = $data[$i]["collectReceivables"] >= $data[$i]["totalDeposit"]?1:0;         
    $html .="<tr>"; 
    $html .="<td>".($x +1)."</td>"; 
    $html .="<td>".$data[$i]["createdDate"]."</td>"; 
    $html .="<td>".$data[$i]["clientID"]."</td>"; 
    $html .="<td>".$data[$i]["lname"]." ".$data[$i]["fname"]." ".$data[$i]["mname"]."</td>";     
    if($results == 1){ 
     $html .="<td>IN</td>";     
    }else{ 
     $html .="<td>OUT</td>";     
    } 
    $html .="<td>".$data[$i]["clientBankLoc"]."</td>"; 
    $html .="<td>".$data[$i]["pensionDate"]."</td>"; 
    $html .="</tr>";   
    $x++; 
} 
+0

我不想來算,什麼線103? – Drewdin

+0

@Drewdin \t \t \t \t $ results = $ data [$ i] [「collectReceivables」]> = $ data [$ i] [「totalDeposit」]?1:0; – rose102593

+0

在for循環中 – rose102593

回答

0

替換所有[$row->clientID][$row->trans_type]與空字符串(即刪除)