zoukankan      html  css  js  c++  java
  • PHP 下载简历

    下载简历:先生成html模版,然后在下载转化为word格式;

    获取数据方法:

    先获取数据,然后开启缓存,写入数据,关闭缓存;然后下载成word;

    /**
    * 下载简历--简单
    * @author LaoWen <bjlaowen@163.com>
    */
    public function downresume(){

    $uid = 4; // $uid = $_GET['uid'];

    // 获取用户基本信息
    $data['userInfo'] = $model_UserInfo->where( 'UR_ID = '.$uid )->find();

    // 获取工作经历信息
    $data['userWork'] = $model_UserWorkInfo->where( 'UR_ID = '.$uid )->select();

    // 获取教育经历信息
    $data['userEdu'] = $model_UserEdu->where( 'UR_ID = '.$uid )->select();

    // 获取期望工作信息
    $data['userWant'] = $model_UserWork->where( 'UR_ID = '.$uid )->find();

    // 获取项目经验信息
    $data['userProject'] = $model_UserProject->where("UR_ID = ".$uid)->select();

    // 赋值
       $this->assign('data',$data);

    // 写入缓存
       ob_start();
    $this->display();
    $html = ob_get_contents();
    ob_clean();
    $name = $data['userInfo']['name'].'的简历';

    header('Content-type: application/doc');
    header('Content-Disposition: attachment; filename="'.$name.'.doc"');
    echo $html;

    }
  • 相关阅读:
    C++ for循环遍历几种写法
    Windwos查看本地局域网内所有的ip方法
    c define
    ssh
    Linux的iptables菜鸟初学
    nc命令的用法
    电脑莫名重启,VS代码丢失的解决办法
    string判断是否是正常的ip格式
    机器学习之推荐算法
    Springboot将mybatis替换为mybatis-plus
  • 原文地址:https://www.cnblogs.com/laowenBlog/p/5784093.html
Copyright © 2011-2022 走看看