123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo.'/css/math_htb/pdf.css';?>">
- <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo.'/css/math_htb/common.css';?>">
- <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo.'/css/math_htb/hao-ti-ben.css';?>">
- <title>好题本</title>
- <style>
- /* 背景图片-水印 -开始 */
- .pdf-B5 {
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/watermark.png';?>);
- background-repeat: repeat-y;
- background-size: 100%;
- }
- .pdf-B5 .head .student-name .name {
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/bgc-name.png';?>) no-repeat;
- background-size: 100% 100%;
- }
- .pdf-B5 .head .version .version-name {
- <?php if($version==1): ?>
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/version-name.png';?>) no-repeat;
- <?php elseif($version==2):?>
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/pei-you.png';?>) no-repeat;
- <?php endif; ?>
- background-size: 100% 100%;
- }
- .pdf-B5 .head .version .head-tit {
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/tit_bgc.png';?>) no-repeat;
- background-size: 100% 100%;
- }
- .pdf-B5 .part .knowledge-point {
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/kao-dian.png';?>) no-repeat;
- background-size: 100% 100%;
- }
- .pdf-B5 .part .question-training {
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/good-question-training.png';?>) no-repeat;
- background-size: 100% 100%;
- }
- .pdf-B5 .part .question-title .number-type {
- background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/titele-number.png';?>) no-repeat;
- background-size: 100% 100%;
- }
- </style>
- </head>
- <?php
- $optionArr = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N');
- $number=1;
- ?>
- <body>
- <div class="pdf-B5">
- <div class="head">
- <div class="version">
- <?php if($version_str):?>
- <div class="version-name"><span class="text"><?php echo $version_str; ?></span></div>
- <?php endif;?>
- <div class="head-tit"><?php echo $title; ?></div>
- </div>
- </div>
- <div class="part">
- <!--知识点讲解开始-->
- <?php foreach($htbNodes as $item): ?>
- <?php if(!(empty($item['content']) && empty($item['topic_ids']))): ?>
- <div class="knowledge-point">知识点讲解<?php echo $item['number_word']; ?></div>
- <?php endif; ?>
- <div class="text-content">
- <?php echo $item['content']; ?>
- </div>
- <!--试题题文开始-->
- <?php if(isset($item['topic_ids']) && $item['topic_ids']): ?>
- <div class="question-training"></div>
- <?php foreach($item['topic_ids'] as $topicId):?>
- <!--找到试题数据开始-->
- <?php if(isset($topicInfos[$topicId]) && $topicInfos[$topicId]): ?>
- <?php $topicInfo=$topicInfos[$topicId];?>
- <!--试题序号,试题id,试题类型,知识点。开始-->
- <div class="question-title">
- <div class="number-type">
- <i><?php echo $number;?></i>
- <p><?php echo "【{$topicInfo['id']}】{$topicInfo['_type_name']}"; ?></p>
- </div>
- <div class="knowledge">
- <?php
- if(isset($topicInfo['kps']) && $topicInfo['kps']){
- echo '知识点:';
- $kpsCount=count($topicInfo['kps']);
- $startKp=1;
- foreach($topicInfo['kps'] as $kp){
- echo $kp['kp_name'];
- echo $kpsCount==$startKp?'':'|';
- $startKp++;
- }
- }
- ?>
- </div>
- </div>
- <!--试题序号,试题id,试题类型,知识点。结束-->
- <div class="test-content">
- <!--题文开始-->
- <div class="good-question">
- <!--选择题-->
- <?php if(in_array($topicInfo['basic_type_id'],array(1,3))): ?>
- <div class="small-tit">
- <div class="xiao-tit"><?php echo $topicInfo['title']; ?></div>
- <div class="xuanxiang">
- <?php
- if(isset($topicInfo['items'][0]['options']) && $topicInfo['items'][0]['options']){
- foreach($topicInfo['items'][0]['options'] as $key=>$option){
- echo "<div class=\"option\">{$optionArr[$key]}.{$option['option_content']}</div>";
- }
- }
- ?>
- </div>
- </div>
- <?php else:?>
- <?php echo $topicInfo['title']; ?>
- <?php endif;?>
- </div>
- <!--题文结束-->
- <!--<div class="qr-code">
- <img src="<?php /*echo Yii::app()->request->hostInfo.'/images/math_htb/QR-code.png';*/?>" alt="">
- </div>-->
- </div>
- <?php $number++;?>
- <?php endif; ?>
- <!--找到试题数据结束-->
- <?php endforeach;?>
- <?php endif; ?>
- <!--试题题文结束-->
- <?php endforeach; ?>
- <!--知识点讲解结束-->
- <!--答案解析开始-->
- <div class="head">
- <div class="version">
- <?php if($version_str):?>
- <div class="version-name"><span class="text"><?php echo $version_str;?></span></div>
- <?php endif; ?>
- <div class="head-tit"><?php echo $title; ?>答案解析</div>
- </div>
- </div>
- <?php $number=1;?>
- <?php foreach($htbNodes as $item): ?>
- <?php if(isset($item['topic_ids']) && $item['topic_ids']): ?>
- <!--试题开始-->
- <?php foreach($item['topic_ids'] as $topicId):?>
- <?php if(isset($topicInfos[$topicId]) && $topicInfos[$topicId]): ?>
- <?php $topicInfo=$topicInfos[$topicId];?>
- <!--序号和试题id-->
- <div class="answer">
- <span class="xuhao"><?php echo $number;?></span>
- <span class="tihao">【<?php echo $topicInfo['id'];?>】</span>
- </div>
- <!--答案解析开始-->
- <div class="answer-content">
- <div class="da-an-box">
- <span class="da-an">【答案】</span>
- <span class="da-an-content">
- <?php
- if(isset($topicInfo['items'][0]['options']) && $topicInfo['items'][0]['options']){
- $answerIndex=1;
- foreach($topicInfo['items'][0]['options'] as $key=>$option){
- /*正确的答案*/
- if($option['option_correct']){
- if(in_array($topicInfo['basic_type_id'],array(1,3))){
- if($topicInfo['basic_type_id']==3){
- echo $answerIndex.'.';
- $answerIndex++;
- }
- echo $optionArr[$key].' ';
- }else{
- echo $option['option_content'].' ';
- }
- }
- }
- }
- ?>
- </span>
- </div>
- <!--解析开始-->
- <div class="jie-xi-box">
- <div class="jie-xi">【解析】</div>
- <div class="jie-xi-content">
- <?php echo $topicInfo['parse_content'];?>
- </div>
- </div>
- <!--解析结束-->
- </div>
- <!-- 答案解析结束-->
- <?php $number++;?>
- <?php endif; ?>
- <?php endforeach;?>
- <!--试题结束-->
- <?php endif; ?>
- <?php endforeach; ?>
- <!--答案解析结束-->
- <!--<div class="bottom">
- <span>这里显示文本,文本字号9pt,右对齐显示</span>
- <img src="<?php /*echo Yii::app()->request->hostInfo.'/images/math_htb/QR-code.png';*/?>" alt="">
- </div>
- <div class="price">提分宝数学2019-2020上学期:120元</div>-->
- </div>
- </body>
- </html>
|