2014-04-25 42 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]与空字符串(即删除)