Javascript 单击codeigniter中的按钮时,在另一个页面中获取视图表值
我的申请中有一个“查看候选人”页面。在该页面中,我显示了所有候选人的详细信息。在该页面中,我给出了一个名为“计划面试”的按钮。当用户单击该按钮时,我希望在另一页面中显示特定行候选人值。我只想获得特定候选人的姓名和电子邮件,如:Javascript 单击codeigniter中的按钮时,在另一个页面中获取视图表值,javascript,jquery,codeigniter,Javascript,Jquery,Codeigniter,我的申请中有一个“查看候选人”页面。在该页面中,我显示了所有候选人的详细信息。在该页面中,我给出了一个名为“计划面试”的按钮。当用户单击该按钮时,我希望在另一页面中显示特定行候选人值。我只想获得特定候选人的姓名和电子邮件,如: Name:****** email:******* 像这样,我想显示特定候选人的详细信息 查看页面: <div class="box-body"> <table id="example2" class="table table-bordered t
Name:******
email:*******
像这样,我想显示特定候选人的详细信息
查看页面:
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th></th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Mobile Number</th>
<th>experience</th>
<th>CTC</th>
<th>Expected Ctc</th>
<th>role</th>
<th>Current Location</th>
<th>Desired Location</th>
<th>Notice Period</th>
<th>Resume</th>
<th>Actions</th>
</tr>
</thead>
<?php foreach ($view_candidates as $idata) { ?>
<tbody>
<tr id="domain<?php echo $idata->user_id;?>">
<td class="cell checkbox">
<input type="checkbox" class="selectedId" name="selectedId" />
</td>
<td><?php echo $idata->first_name;?></td>
<td><?php echo $idata->last_name;?></td>
<td><?php echo $idata->email;?></td>
<td><?php echo $idata->mobile_number;?></td>
<td><?php echo $idata->experience;?></td>
<td><?php echo $idata->ctc;?></td>
<td><?php echo $idata->expectedctc;?></td>
<td><?php echo $idata->role_name;?></td>
<td><?php echo $idata->current_location;?></td>
<td><?php echo $idata->desired_location;?></td>
<td><?php echo $idata->notice_period;?></td>
<td><?php echo $idata->resume;?></td>
<td>
<a href="<?php echo base_url() ? >/index.php/Selection/Selection_process/<?php echo $idata->candidate_id; ?>" class="btn btn-info">Schedule interview</a>
</td>
</tr>
</tbody>
名字
姓
电子邮件
手机号码
经验
反恐委员会
预期反恐委员会
角色
当前位置
所需位置
通知期
简历
行动
如下所示:
<?php
// controller
function candidate_detail($candidateid)
{
$data = $this->model_name->get_candidate_detail($candidateid);
$viewData['getCandidate'] = $data;
$this->load->view('candidate_view',$viewData);
}
// model
function get_candidate_detail($candidateid)
{
$q = $this->db->query("SELECT * FROM tbl_name WHERE candidate_id = $candidateid");
if($q->num_rows() > 0) {
return $q->row_array();
} else {
return '';
}
}
?>
// view candidate_view
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th></th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Mobile Number</th>
<th>experience</th>
<th>CTC</th>
<th>Expected Ctc</th>
<th>role</th>
<th>Current Location</th>
<th>Desired Location</th>
<th>Notice Period</th>
<th>Resume</th>
</tr>
</thead>
<tbody>
<tr id="domain<?php echo $getCandidate['user_id'];?>">
<td class="cell checkbox">
<input type="checkbox" class="selectedId" name="selectedId" />
</td>
<td><?php echo $getCandidate['first_name'];?></td>
<td><?php echo $getCandidate['last_name'];?></td>
<td><?php echo $getCandidate['email'];?></td>
<td><?php echo $getCandidate['mobile_number'];?></td>
<td><?php echo $getCandidate['experience'];?></td>
<td><?php echo $getCandidate['ctc'];?></td>
<td><?php echo $getCandidate['expectedctc'];?></td>
<td><?php echo $getCandidate['role_name'];?></td>
<td><?php echo $getCandidate['current_location'];?></td>
<td><?php echo $getCandidate['desired_location'];?></td>
<td><?php echo $getCandidate['notice_period'];?></td>
<td><?php echo $getCandidate['resume'];?></td>
</tr>
</tbody>
//查看候选视图
名字
姓
电子邮件
手机号码
经验
反恐委员会
预期反恐委员会
角色
当前位置
所需位置
通知期
简历
问题出在哪里?我想在另一个页面中获取特定的行值(姓名和电子邮件)。单击“日程面试”按钮时,您可以通过数据库查询获得。您已经在传递候选id。是的,候选id将出现在URL中。视图页面中没有值。您可以进行查询,从该id获取候选数据,然后在视图中打印数据