Надеюсь, это поможет вам:
Используйте конструктор запросов ci, чтобы получить желаемый результат
public function edit($cusId)
{
$this->lang->load('content', $this->session->userdata('people_lang'));
$viewData = array();
$this->db->select('*');
/*$this->db->select('dt.docTypeId,dt.docTypeCat,dt.docTypeNameEn,
dt.docTypeNameAr,d.docFileDocType');*/
$this->db->from('documenttype dt');
$this->db->join('document d' ,'d.docFileDocType = dt.docTypeId');
$this->db->join('customer c' ,'c.cusId = d.docFileId');
$this->db->where("c.cusId", $cusId)
$query = $this->db->get();
if ($query->num_rows() > 0 )
{
$viewData['documents'] = $query->result();
}
/*print viewData here to make sure it has data or not
print_r($viewData);die;
*/
print_r($viewData);die;
$this->load->view("file_manager", $viewData);
}
Ваше мнение должно быть таким:
<?php
foreach($documents as $docs){ ?>
<tr>
<td data-title="File ID"><?php echo $docs->docFileId; ?></</td>
<td data-title="Customer Code"><?php echo $docs->cosCode; ?></td>
<td data-title="Name Surname"><?php echo $docs->cosName.' '.$docs->cosSurname; ?></</td>
<td data-title="File Type"><?php echo $docs->docFileDocType; ?></td>
<td data-title="Description"><?php echo $docs->docFileDesc; ?></td>
<td data-title="Create Date"><?php echo $docs->docFileCreateDate; ?></td>
<td data-title="File">
<a href="<?php echo base_url().'upload/file/customer/'.$docs->docFileDirectory;?>" download><?php echo $docs->docFileDirectory; ?>
</a> <i class="fa fa-download"></i>
</td>
</tr>
<?php } ?>
Подробнее: https://www.codeigniter.com/user_guide/database/query_builder.html#selecting-data