【问题标题】:fetch view table values in another page while click on the button in codeigniter单击codeigniter中的按钮时在另一个页面中获取视图表值
【发布时间】:2017-02-25 13:10:47
【问题描述】:

我在我的应用程序中有一个查看候选人页面..在该页面中我显示所有候选人详细信息..在该页面中我给出了一个名为 SCHEDULE INTERVIEW 的按钮..当用户单击该按钮时,我想显示该特定行另一个页面中的候选人值..我只想获取特定候选人的姓名和电子邮件,例如:

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>

谁能帮帮我.. 如何做到这一点..

提前致谢..

【问题讨论】:

  • 有什么问题?
  • 我想在另一个页面中获取特定的行值(姓名和电子邮件)..同时单击安排面试按钮
  • 你可以通过数据库查询得到。你已经传递了候选ID。
  • 是的候选 id 即将到来 n URL..values 没有出现在视图页面中
  • 您可以通过查询从该id获取候选数据,然后在视图中打印数据

标签: javascript jquery codeigniter


【解决方案1】:

如下所示:

<?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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-15
    • 1970-01-01
    • 2021-12-07
    相关资源
    最近更新 更多