douke8473 2015-07-20 06:09
浏览 35

在codeigniter中生成多个结果

Currently I am working on one Web-based software which creates results automatically in codeigniter. I create modules like add student, add marks & generate mark sheet. here in generate marksheet i created individual marksheet but now I want to generate code for generate marksheet on one button click.

For that i use file_get_content(), curl(), fopen() but this all showing blank page if file_get_content("http://127.0.0.1/exam/admission/forms/showResult/41/2/1")

shows individual students result i want to show it in page

Here is My controller code

class forms extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->admin_layout->setLayout('template/layout_admission');

        $session = $this->session->userdata('admin_session');
        if (empty($session) || $session->type != 'admission') {
            $this->session->set_flashdata('error', 'Login First');
            redirect(base_url() . 'login', 'refresh');
        }

    function printDoc(){
        $siteaddressAPI = "http://127.0.0.1/exam/admission/forms/showResult/41/2/1";
        $data = file_get_contents($siteaddressAPI);
        echo $data;
        }
    }
  • 写回答

1条回答 默认 最新

  • duanjie9630 2015-07-20 07:54
    关注

    Your Question does not explain exactly what you need.!!! Better you can give your sample code with expected result.

    Still I have a solution which might help you in some way.

    You can use view template to generate mark-sheet code. For Example:

    $mark_sheets = array();
    foreach($all_students_data as $student_data){
        $mark_sheets[] = $this -> load -> view('marksheet_template', $student_data, TRUE);
    }
    

    Here $this -> load -> view() with third parameter TRUE will return generated html code and then store it in mark_sheets array.

    By this way, you can access all your mark-sheets from $mark_sheets array.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,