目前我的网络应用程序中有一个功能,允许雇主查看已申请工作的所有人。
对于每个申请人,它应该在一个专栏中显示他们的技能,在另一个专栏中显示他们的资格,在另一个专栏中显示工作历史,并且应该为每个申请人执
e.g
应用程序数据库表有一列'jobseeker_profile_id'
,它映射到jobseeker_profiles表'id'
列。使用应用程序表中的'jobseeker_profile_id'
,我应该能够查看技能,资格和work_history数据库表,并获得每个表中'jobseeker_profile_id'
与应用程序表中的print_r()
匹配的位置。< / p>
我要问的是如何解决这个问题,以便每个申请人的所有技能,资格和工作经历都在正确的行上?
正如您将在下面看到的,我为每个数组完成了print_r($skills):
Array([0] = > Array([0] = > Array([id] = > 42[name] = > HTML[level] = > 4[jobseeker_profile_id] = > 4[points_value] = > 4))[1] = > Array([0] = > Array([id] = > 41[name] = > CSS[level] = > 2[jobseeker_profile_id] = > 2[points_value] = > 2)[1] = > Array([id] = > 39[name] = > PHP[level] = > 3[jobseeker_profile_id] = > 2[points_value] = > 3)))
,它们按正确的顺序包含了正确的数据,但不确定如何获取数据并将其显示在表格中。
$data = array();
$data['applications'] = $this->db->get_where('applications', array('employer_profile_id' => $employer_id, 'job_id' => $job_id ))->result_array();
foreach($data['applications'] as $jobseeker){
$data['skill'] = $this->db->get_where('skills', array('jobseeker_profile_id' => $jobseeker['jobseeker_profile_id']))->result_array();
$data['qualification'] = $this->db->get_where('qualifications', array('jobseeker_profile_id' => $jobseeker['jobseeker_profile_id']))->result_array();
$data['history'] = $this->db->get_where('work_history', array('jobseeker_profile_id' => $jobseeker['jobseeker_profile_id']))->result_array();
$data['skills'][] = $data['skill'];
$data['qualifications'][] = $data['qualification'];
$data['workhistory'][] = $data['history'];
}
$this->load->view('applications', $data);
CONTROLLER
foreach($applications as $application){
echo "<tbody style=\"background:green;\">";
$value = $application['points_value'] * $this->session->userdata('price');
echo "<tr class=\"row\">";
echo "<td class=\"column\">";
echo $application['name'];
echo "</td>";
echo "<td class=\"column\">";
print_r($skills);
echo "</td>";
echo "<td class=\"column\">";
print_r($qualifications);
echo "</td>";
echo "<td class=\"column\">";
print_r($workhistory);
echo "</td>";
echo "<td class=\"column\">";
echo $value;
echo "</td>";
echo "<td class=\"column\">";
echo form_checkbox('jobseeker[]', $application['jobseeker_profile_id']);
echo "</td>";
echo "</tr>";
echo "</tbody>";
}
查看
{{1}}
如果有人可以提供帮助,那就太棒了:)。