new_preview.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo.'/css/math_htb/pdf.css';?>">
  8. <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo.'/css/math_htb/common.css';?>">
  9. <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo.'/css/math_htb/hao-ti-ben.css';?>">
  10. <title>好题本</title>
  11. <style>
  12. /* 背景图片-水印 -开始 */
  13. .pdf-B5 {
  14. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/watermark.png';?>);
  15. background-repeat: repeat-y;
  16. background-size: 100%;
  17. }
  18. .pdf-B5 .head .student-name .name {
  19. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/bgc-name.png';?>) no-repeat;
  20. background-size: 100% 100%;
  21. }
  22. .pdf-B5 .head .version .version-name {
  23. <?php if($version==1): ?>
  24. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/version-name.png';?>) no-repeat;
  25. <?php elseif($version==2):?>
  26. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/pei-you.png';?>) no-repeat;
  27. <?php endif; ?>
  28. background-size: 100% 100%;
  29. }
  30. .pdf-B5 .head .version .head-tit {
  31. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/tit_bgc.png';?>) no-repeat;
  32. background-size: 100% 100%;
  33. }
  34. .pdf-B5 .part .knowledge-point {
  35. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/kao-dian.png';?>) no-repeat;
  36. background-size: 100% 100%;
  37. }
  38. .pdf-B5 .part .question-training {
  39. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/good-question-training.png';?>) no-repeat;
  40. background-size: 100% 100%;
  41. }
  42. .pdf-B5 .part .question-title .number-type {
  43. background: url(<?php echo Yii::app()->request->hostInfo.'/images/math_htb/titele-number.png';?>) no-repeat;
  44. background-size: 100% 100%;
  45. }
  46. </style>
  47. </head>
  48. <?php
  49. $optionArr = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N');
  50. $number=1;
  51. ?>
  52. <body>
  53. <div class="pdf-B5">
  54. <div class="head">
  55. <div class="version">
  56. <?php if($version_str):?>
  57. <div class="version-name"><span class="text"><?php echo $version_str; ?></span></div>
  58. <?php endif;?>
  59. <div class="head-tit"><?php echo $title; ?></div>
  60. </div>
  61. </div>
  62. <div class="part">
  63. <!--知识点讲解开始-->
  64. <?php foreach($htbNodes as $item): ?>
  65. <?php if(!(empty($item['content']) && empty($item['topic_ids']))): ?>
  66. <div class="knowledge-point">知识点讲解<?php echo $item['number_word']; ?></div>
  67. <?php endif; ?>
  68. <div class="text-content">
  69. <?php echo $item['content']; ?>
  70. </div>
  71. <!--试题题文开始-->
  72. <?php if(isset($item['topic_ids']) && $item['topic_ids']): ?>
  73. <div class="question-training"></div>
  74. <?php foreach($item['topic_ids'] as $topicId):?>
  75. <!--找到试题数据开始-->
  76. <?php if(isset($topicInfos[$topicId]) && $topicInfos[$topicId]): ?>
  77. <?php $topicInfo=$topicInfos[$topicId];?>
  78. <!--试题序号,试题id,试题类型,知识点。开始-->
  79. <div class="question-title">
  80. <div class="number-type">
  81. <i><?php echo $number;?></i>
  82. <p><?php echo "【{$topicInfo['id']}】{$topicInfo['_type_name']}"; ?></p>
  83. </div>
  84. <div class="knowledge">
  85. <?php
  86. if(isset($topicInfo['kps']) && $topicInfo['kps']){
  87. echo '知识点:';
  88. $kpsCount=count($topicInfo['kps']);
  89. $startKp=1;
  90. foreach($topicInfo['kps'] as $kp){
  91. echo $kp['kp_name'];
  92. echo $kpsCount==$startKp?'':'|';
  93. $startKp++;
  94. }
  95. }
  96. ?>
  97. </div>
  98. </div>
  99. <!--试题序号,试题id,试题类型,知识点。结束-->
  100. <div class="test-content">
  101. <!--题文开始-->
  102. <div class="good-question">
  103. <!--选择题-->
  104. <?php if(in_array($topicInfo['basic_type_id'],array(1,3))): ?>
  105. <div class="small-tit">
  106. <div class="xiao-tit"><?php echo $topicInfo['title']; ?></div>
  107. <div class="xuanxiang">
  108. <?php
  109. if(isset($topicInfo['items'][0]['options']) && $topicInfo['items'][0]['options']){
  110. foreach($topicInfo['items'][0]['options'] as $key=>$option){
  111. echo "<div class=\"option\">{$optionArr[$key]}.{$option['option_content']}</div>";
  112. }
  113. }
  114. ?>
  115. </div>
  116. </div>
  117. <?php else:?>
  118. <?php echo $topicInfo['title']; ?>
  119. <?php endif;?>
  120. </div>
  121. <!--题文结束-->
  122. <!--<div class="qr-code">
  123. <img src="<?php /*echo Yii::app()->request->hostInfo.'/images/math_htb/QR-code.png';*/?>" alt="">
  124. </div>-->
  125. </div>
  126. <?php $number++;?>
  127. <?php endif; ?>
  128. <!--找到试题数据结束-->
  129. <?php endforeach;?>
  130. <?php endif; ?>
  131. <!--试题题文结束-->
  132. <?php endforeach; ?>
  133. <!--知识点讲解结束-->
  134. <!--答案解析开始-->
  135. <div class="head">
  136. <div class="version">
  137. <?php if($version_str):?>
  138. <div class="version-name"><span class="text"><?php echo $version_str;?></span></div>
  139. <?php endif; ?>
  140. <div class="head-tit"><?php echo $title; ?>答案解析</div>
  141. </div>
  142. </div>
  143. <?php $number=1;?>
  144. <?php foreach($htbNodes as $item): ?>
  145. <?php if(isset($item['topic_ids']) && $item['topic_ids']): ?>
  146. <!--试题开始-->
  147. <?php foreach($item['topic_ids'] as $topicId):?>
  148. <?php if(isset($topicInfos[$topicId]) && $topicInfos[$topicId]): ?>
  149. <?php $topicInfo=$topicInfos[$topicId];?>
  150. <!--序号和试题id-->
  151. <div class="answer">
  152. <span class="xuhao"><?php echo $number;?></span>
  153. <span class="tihao">【<?php echo $topicInfo['id'];?>】</span>
  154. </div>
  155. <!--答案解析开始-->
  156. <div class="answer-content">
  157. <div class="da-an-box">
  158. <span class="da-an">【答案】</span>
  159. <span class="da-an-content">
  160. <?php
  161. if(isset($topicInfo['items'][0]['options']) && $topicInfo['items'][0]['options']){
  162. $answerIndex=1;
  163. foreach($topicInfo['items'][0]['options'] as $key=>$option){
  164. /*正确的答案*/
  165. if($option['option_correct']){
  166. if(in_array($topicInfo['basic_type_id'],array(1,3))){
  167. if($topicInfo['basic_type_id']==3){
  168. echo $answerIndex.'.';
  169. $answerIndex++;
  170. }
  171. echo $optionArr[$key].' ';
  172. }else{
  173. echo $option['option_content'].' ';
  174. }
  175. }
  176. }
  177. }
  178. ?>
  179. </span>
  180. </div>
  181. <!--解析开始-->
  182. <div class="jie-xi-box">
  183. <div class="jie-xi">【解析】</div>
  184. <div class="jie-xi-content">
  185. <?php echo $topicInfo['parse_content'];?>
  186. </div>
  187. </div>
  188. <!--解析结束-->
  189. </div>
  190. <!-- 答案解析结束-->
  191. <?php $number++;?>
  192. <?php endif; ?>
  193. <?php endforeach;?>
  194. <!--试题结束-->
  195. <?php endif; ?>
  196. <?php endforeach; ?>
  197. <!--答案解析结束-->
  198. <!--<div class="bottom">
  199. <span>这里显示文本,文本字号9pt,右对齐显示</span>
  200. <img src="<?php /*echo Yii::app()->request->hostInfo.'/images/math_htb/QR-code.png';*/?>" alt="">
  201. </div>
  202. <div class="price">提分宝数学2019-2020上学期:120元</div>-->
  203. </div>
  204. </body>
  205. </html>