duanla8800 2014-04-25 02:12
浏览 45

Php未定义偏移量:0 1 2 3 4 5 6等[重复]

This question already has an answer here:

i need some help.. hope you guys can help me. im a new member on this site. thanks in advance.

Severity: Notice

Message: Undefined offset: 0

Filename: models/atmlist_bybranch_model.php

Line Number: 103

this error start at

$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>";

here is my query:

$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++;
}
</div>
  • 写回答

1条回答 默认 最新

  • duankuixi1930 2014-04-25 02:26
    关注

    replace all [$row->clientID][$row->trans_type] with empty string (ie delete this)

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化