No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kop.htm 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <?php
  2. $result_map = "";
  3. $xl = ['不限制','中专','高技','大专','本科','硕士','博士'];
  4. //先列出全国 再其他省 再到市
  5. $sql = 'select * from ey_zcwd_position where type='.$detail['sbzy'].' and sbdj='.$detail['sbdj'].' and is_del=0 and status=1'.$sql_end.' order by sf asc';
  6. $is_list_empty = '';
  7. //echo $sql;
  8. $list_data = [];
  9. //测试Db操作
  10. //$row_t = Db::table('ey_zcwd_position')->find();
  11. //var_dump($row_t);
  12. $str_no_err = [];
  13. ?>
  14. {eyou:sql sql="$sql" cachetime='3600' empty='' id="field"}
  15. <?php
  16. $is_list_empty = $field['id'];
  17. $list_data[] = $field;
  18. ?>
  19. {/eyou:sql}
  20. {eyou:if condition='(!empty($is_list_empty))'}
  21. <?php
  22. /**
  23. * 多种循环体
  24. * 每一次循环都是一种匹配情况
  25. */
  26. $tyu_num = 1;
  27. ?>
  28. {eyou:volist name='$list_data' id='field'}
  29. <div class="ta-list-li-box">
  30. <div class="tllb-t">
  31. <!--<div class="panel panel-primary" style="display:block;">
  32. <div class="panel-body">-->
  33. <?php
  34. if($tyu_num == 1){
  35. $t = '收起';
  36. $t_class = 'zklp-2';
  37. }else{
  38. $t = '展开';
  39. $t_class = 'zklp-3';
  40. }
  41. ?>
  42. {eyou:if condition='((int)$field.sf === 0)'}
  43. <!--({$t}匹配结果)全国通用申报要求对比结果如下:-->
  44. <span class="zklp-l">({$tyu_num})根据你的条件符合申报全国地区,结果如下:</span>
  45. <span class="zklp zklp{$tyu_num} {$t_class}" data="{$tyu_num}">{$t}</span>
  46. {eyou:else /}
  47. <?php
  48. if((int)$field['sf'] > 0){
  49. $sql22 = "select id,name from ey_citysite where id=".$field['sf'];
  50. $sql222 = '';
  51. if((int)$field['cs'] > 0){
  52. $sql222 = "select id,name from ey_citysite where id=".$field['cs'];
  53. }
  54. }
  55. ?>
  56. {eyou:sql sql='$sql22' cachetime='3600' empty='' id="kop"}
  57. <?php
  58. $aname = $kop['name'];
  59. ?>
  60. {/eyou:sql}
  61. {eyou:if condition='((int)$field.cs > 0)'}
  62. {eyou:sql sql='$sql222' cachetime='3600' empty='' id="kop"}
  63. <?php
  64. $bname = $kop['name'];
  65. ?>
  66. {/eyou:sql}
  67. {/eyou:if}
  68. <!--({$t}匹配结果){$aname}{$bname}地区申报要求对比结果如下:-->
  69. <span class="zklp-l">({$tyu_num})根据你的条件符合申报{$aname}{$bname}地区,结果如下:</span>
  70. <span class="zklp zklp{$tyu_num} {$t_class}" data="{$tyu_num}">{$t}</span>
  71. {/eyou:if}
  72. </div>
  73. <div class="clear"></div>
  74. <div class="tllb-b p-con68 klp{$tyu_num}">
  75. <!--</div>
  76. <div class="panel-footer" style="padding:3px 5px;">-->
  77. <!--查询专业-->
  78. <?php
  79. $num = 0;
  80. $sql2 = "select * from ey_zcwe_position where type=".$field['id']." and is_del=0 and status=1";
  81. $son_details = [];
  82. ?>
  83. {eyou:sql sql="$sql2" cachetime='3600' empty='暂无相关数据' id="field2"}
  84. <?php
  85. $son_details[] = $field2;
  86. ?>
  87. {/eyou:sql}
  88. <ul class="nav nav-tabs" id="myTab{$tyu_num}" role="tablist">
  89. <?php
  90. $io_num = 1;
  91. ?>
  92. {eyou:volist name='$son_details' id='field2'}
  93. <li class="nav-item {eyou:if condition='($io_num == 1)'}active{/eyou:if}">
  94. <a class="nav-link {eyou:if condition='($io_num == 1)'}active{/eyou:if}" id="home-tab{$io_num}" data-toggle="tab" href="#home{$io_num}" role="tab" aria-controls="home" aria-selected="true">
  95. 情况{$i}
  96. </a>
  97. </li>
  98. <?php
  99. $io_num++;
  100. ?>
  101. {/eyou:volist}
  102. </ul>
  103. <div class="tab-content" id="myTabContent">
  104. <?php
  105. $io_d_num = 1;
  106. ?>
  107. {eyou:volist name='$son_details' id='field2'}
  108. <div class="tab-pane fade {eyou:if condition='($io_d_num == 1)'} active in{/eyou:if}" id="home{$io_d_num}" role="tabpanel" aria-labelledby="home-tab{$io_d_num}">
  109. <table class="" style="">
  110. <!--<caption>第{$i}种情况</caption>-->
  111. <colgroup>
  112. <col class="t-wid1 batman">
  113. <col class="t-wid2 flash">
  114. <col class="t-wid3 flash">
  115. <col class="t-wid4 flash">
  116. </colgroup>
  117. <thead>
  118. <tr>
  119. <th>字段信息</th>
  120. <th>实际要求</th>
  121. <th>填写资料</th>
  122. <th>匹配结果</th>
  123. </tr>
  124. </thead>
  125. <tbody>
  126. <?php
  127. //先判断学历是否符合
  128. ?>
  129. <tr>
  130. <td>学历</td>
  131. <td><?php echo $xl[$field2['xlyq']];?></td>
  132. <td><?php echo $xl[$detail['xl']];?></td>
  133. <td>
  134. <?php
  135. if($field2['xlyq'] == $detail['xl']){
  136. //echo "<font style='color: blue;'>符合</font>";
  137. echo '<font class="td-r">√</font>';
  138. $num++;
  139. }else{
  140. echo '<font class="td-b">x</font>';
  141. //echo "<font style='color: red;'>不符合</font>";
  142. $str_no_err[$field['id']][$field2['id']]['xlyq'] = '学历不符';
  143. }
  144. ?>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>年龄</td>
  149. <td>
  150. <?php
  151. if((int)$field2['is_ega'] === 0){
  152. echo "不限制";
  153. }else{
  154. echo $field2['ega_0'].'-'.$field2['ega_1'].'岁';
  155. }
  156. ?>
  157. </td>
  158. <td>
  159. {$detail.nl}岁
  160. </td>
  161. <td>
  162. <?php
  163. if((int)$field2['is_ega'] === 0){
  164. echo '<font class="td-r">√</font>';
  165. $num++;
  166. }else{
  167. if((int)$detail['nl'] <= (int)$field2['ega_1'] && (int)$detail['nl'] >= (int)$field2['ega_0']){
  168. //echo "<font style='color: blue;'>符合</font>";
  169. echo '<font class="td-r">√</font>';
  170. $num++;
  171. }else{
  172. echo '<font class="td-b">x</font>';
  173. //echo "<font style='color: red;'>不符合</font>";
  174. $str_no_err[$field['id']][$field2['id']]['nl'] = '年龄不符';
  175. }
  176. }
  177. ?>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td>毕业专业</td>
  182. <td>
  183. {eyou:if condition='((int)$field2.byzy === 0)'}
  184. 不限制
  185. {eyou:else /}
  186. <?php
  187. //查询出毕业专业 $deta
  188. $zhengshu2 = json_decode($field2['zhengshu2'],true);
  189. $zhengshu2_str = '0';
  190. foreach ($zhengshu2 as $k => $v){
  191. if((int)$v > 0) {
  192. $zhengshu2_str .= ',' . $v;
  193. }
  194. }
  195. $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu2_str.") and is_del=0 and status=1";
  196. ?>
  197. {eyou:if condition='($zhengshu2_str != "0")'}
  198. {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
  199. {$field3.title}<br/>
  200. {/eyou:sql}
  201. {eyou:else /}
  202. 不限制
  203. {/eyou:if}
  204. {/eyou:if}
  205. </td>
  206. <td>
  207. <?php
  208. //查询出毕业专业 $deta
  209. $zhengshu = json_decode($detail['zy'],true);
  210. $zhengshu_str = '0';
  211. foreach ($zhengshu as $k => $v){
  212. if ((int)$v > 0) {
  213. $zhengshu_str .= ',' . $v;
  214. }
  215. }
  216. $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";
  217. ?>
  218. {eyou:if condition='($zhengshu_str != "0")'}
  219. {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
  220. {$field3.title}<br/>
  221. {/eyou:sql}
  222. {eyou:else /}
  223. {/eyou:if}
  224. </td>
  225. <td>
  226. <?php
  227. if((int)$field2.byzy === 0 || empty($zhengshu2)){
  228. //echo "<font style='color: blue;'>符合</font>";
  229. echo '<font class="td-r">√</font>';
  230. $num++;
  231. }else{
  232. if(empty($zhengshu)){
  233. echo '<font class="td-b">x</font>';
  234. //echo "<font style='color: red;'>不符合</font>";
  235. $str_no_err[$field['id']][$field2['id']]['byzy'] = '专业不符';
  236. }else{
  237. //$run = "<font style='color: red;'>不符合</font>";
  238. $run = '<font class="td-b">x</font>';
  239. $str_no_err[$field['id']][$field2['id']]['byzy'] = '专业不符';
  240. $ik = 1;
  241. foreach ($zhengshu as $k => $v){
  242. if(in_array($v,$zhengshu2)){
  243. //$run = '<font style="color: blue;">符合</font><br/>'.$ik.'项';
  244. //$run = '<font style="color: blue;">符合</font><br/>';
  245. $run = '<font class="td-r">√</font>';
  246. $str_no_err[$field['id']][$field2['id']]['byzy'] = '';
  247. $ik++;
  248. }
  249. }
  250. echo $run;
  251. if($ik>1){
  252. $num++; //符合+1
  253. }
  254. }
  255. }
  256. ?>
  257. </td>
  258. </tr>
  259. <tr>
  260. <td>学校类型</td>
  261. <td>
  262. {eyou:if condition='((int)$field2.xxlx === 0)'}
  263. 不限制
  264. {eyou:else /}
  265. <?php
  266. if((int)$field2['xxlx'] === 1) echo "全日制";
  267. if((int)$field2['xxlx'] === 2) echo "非全日制";
  268. ?>
  269. {/eyou:if}
  270. </td>
  271. <td>
  272. {eyou:if condition='((int)$detail.xxlx === 1)'}
  273. 全日制
  274. {eyou:else /}
  275. 非全日制
  276. {/eyou:if}
  277. </td>
  278. <td>
  279. {eyou:if condition='((int)$field2.xxlx === 0)'}
  280. <!--<font style='color: blue;'>符合</font>-->
  281. <?php
  282. echo '<font class="td-r">√</font>';
  283. $num++;
  284. ?>
  285. {eyou:else /}
  286. <?php
  287. if((int)$field2['xxlx'] === (int)$detail['xxlx']){
  288. //echo "<font style='color: blue;'>符合</font>";
  289. echo '<font class="td-r">√</font>';
  290. $num++;
  291. }else{
  292. //echo "<font style='color: red;'>不符合</font>";
  293. echo '<font class="td-b">x</font>';
  294. $str_no_err[$field['id']][$field2['id']]['xxlx'] = '学校类型不符';
  295. }
  296. ?>
  297. {/eyou:if}
  298. </td>
  299. </tr>
  300. <tr>
  301. <td>毕业时间</td>
  302. <td>
  303. {eyou:if condition='((int)$field2.bysj === 0)'}
  304. 不要求
  305. {eyou:else /}
  306. 要求>={$field2.bysj_time}年
  307. {/eyou:if}
  308. </td>
  309. <td>
  310. <?php
  311. //$detail['bysj']
  312. //假设我们要计算的时间是2000年1月1日
  313. $startDate = new DateTime($detail['bysj']);
  314. // 获取现在的日期
  315. $now = new DateTime('now');
  316. // 计算差值
  317. $interval = date_diff($startDate, $now);
  318. // 输出年份
  319. ////echo $interval->y . ' years';
  320. if($interval->y > 0){
  321. echo '已毕业'.$interval->y . '年';
  322. }else{
  323. echo '刚毕业不足1年';
  324. }
  325. ?>
  326. </td>
  327. <td>
  328. <?php
  329. if((int)$field2['bysj'] === 0){
  330. //echo "<font style='color: blue;'>符合</font>";
  331. echo '<font class="td-r">√</font>';
  332. $num++;
  333. }else{
  334. if((int)$field2['bysj_time'] <= $interval->y){
  335. //echo "<font style='color: blue;'>符合</font>";
  336. echo '<font class="td-r">√</font>';
  337. $num++;
  338. }else{
  339. //echo "<font style='color: red;'>不符合</font>";
  340. echo '<font class="td-b">x</font>';
  341. $str_no_err[$field['id']][$field2['id']]['bysj'] = '毕业时间不符';
  342. }
  343. }
  344. ?>
  345. </td>
  346. </tr>
  347. <tr>
  348. <td>前置证书</td>
  349. <td>
  350. <?php
  351. $zhengshu3 = '';
  352. $zs_all = [];
  353. //(且或) 列出证书要求
  354. //调用需要的记录 is_zs
  355. $sql5 = "select * from ey_zcwf_position where type_son=".$field2['id']." and is_del=0 and status=1 and is_zs=1";
  356. ?>
  357. {eyou:sql sql="$sql5" cachetime='3600' empty='不限制' id="field3"}
  358. <?php
  359. if($i > 1){
  360. echo "或<br/>";
  361. }
  362. ?>
  363. <?php
  364. //查询出证书 $deta
  365. $zhengshu3 = json_decode($field3['zhengshu'],true);
  366. $sjnx = json_decode($field3['sjnx'],true);
  367. //var_dump($field3);
  368. //var_dump($field3['zhengshu']);
  369. //var_dump($field3['sjnx']);
  370. $zs_all[] = [
  371. 'a' => $zhengshu3,
  372. 'b' => $sjnx
  373. ];
  374. //var_dump($sjnx);
  375. $zhengshu3_str = '0';
  376. foreach ($zhengshu3 as $k => $v){
  377. if((int)$v > 0) {
  378. $zhengshu3_str .= ',' . $v;
  379. }
  380. }
  381. $sql3 = "select id,title from ey_zczs_position where id IN(".$zhengshu3_str.") and is_del=0 and status=1";
  382. ?>
  383. {eyou:if condition='($zhengshu3_str != "0")'}
  384. {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field4"}
  385. <?php
  386. $key_s = array_search($field4['id'], $zhengshu3);
  387. $year_s = $sjnx[$key_s];
  388. ?>
  389. {$field4.title}<br/>(需要{$year_s}年)<br/>
  390. {/eyou:sql}
  391. {eyou:else /}
  392. <!--忽略-->
  393. {/eyou:if}
  394. {/eyou:sql}
  395. </td>
  396. <td>
  397. <?php
  398. //查询出拥有的证书 $deta
  399. $zhengshu = json_decode($detail['zs'],true);
  400. $zsnx = json_decode($detail['zsnx'],true);
  401. $zhengshu_str = '0';
  402. foreach ($zhengshu as $k => $v){
  403. if((int)$v > 0){
  404. $zhengshu_str .= ','.$v;
  405. }
  406. }
  407. $sql3 = "select id,title from ey_zczs_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";
  408. ?>
  409. {eyou:if condition='($zhengshu_str != "0")'}
  410. {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
  411. <?php
  412. $key_s = array_search($field3['id'], $zhengshu);
  413. $year_s = $zsnx[$key_s];
  414. ?>
  415. {$field3.title}<br/>(拥有{$year_s}年)<br/>
  416. {/eyou:sql}
  417. {eyou:else /}
  418. {/eyou:if}
  419. </td>
  420. <td>
  421. <?php
  422. //var_dump($field['id']);
  423. //var_dump($zs_all);
  424. //表示没查出限制要求
  425. if(empty($zhengshu3)){
  426. //echo "<font style='color: blue;'>符合</font>";
  427. echo '<font class="td-r">√</font>';
  428. $num++;
  429. }else{
  430. if(empty($zhengshu)){
  431. //用户没有证书
  432. //echo "<font style='color: red;'>不符合</font>";
  433. echo '<font class="td-b">x</font>';
  434. $str_no_err[$field['id']][$field2['id']]['xxlx'] = '未拥有证书';
  435. }else{
  436. //判断是否包含
  437. //第一轮 循环 或
  438. $ik = 1;
  439. $ik2 = 1;
  440. $ik3 = 1;
  441. foreach ($zs_all as $k => $v){
  442. if($k > 0){
  443. //echo "或<br/>";
  444. }
  445. //第二轮 循环 且
  446. //var_dump($v['a']);
  447. $ik4 = 0; //真实有效数量
  448. foreach ($v['a'] as $k2 => $v2){
  449. //var_dump($v2);
  450. //var_dump($zhengshu);
  451. //第三轮 循环 每一项要求是否在 用户拥有的证书 里面
  452. //必须完全满足
  453. $run_1 = '';
  454. $run_2 = '';
  455. $run_3 = '';
  456. if((int)$v2 > 0) {
  457. if (in_array($v2, $zhengshu)) {
  458. //判断年限是否符合要求
  459. $key_i = array_search($v2, $zhengshu);
  460. //var_dump($zsnx[$key_i]);
  461. if ((int)$zsnx[$key_i] >= (int)$v['b'][$k2]) {
  462. $run_1 = '<font style="color: blue;">符合</font><br/>' . $ik . '项';
  463. $ik++;
  464. } else {
  465. $run_2 = '<font style="color: blue;">年限不符合</font><br/>' . $ik2 . '项';
  466. $ik2++;
  467. }
  468. } else {
  469. $run_3 = '<font style="color: blue;">未拥有</font><br/>' . $ik3 . '项';
  470. $ik3++;
  471. }
  472. $ik4++;
  473. }
  474. //具体情况 循环且
  475. //if(!empty($run_1)) echo $run_1.'<br/>';
  476. //if(!empty($run_2)) echo $run_2.'<br/>';
  477. //if(!empty($run_3)) echo $run_3.'<br/>';
  478. }
  479. ////echo count($v['a']);
  480. //var_dump($ik);
  481. //var_dump(count($v['a']));
  482. if(($ik-1) === $ik4){
  483. ////echo "<font style='color: blue;'>符合1</font>";
  484. //$res = "<font style='color: blue;'>符合</font>";
  485. $res = '<font class="td-r">√</font>';
  486. $num++;
  487. //跳出循环 已经符合其中 一个 且了
  488. break;
  489. }else{
  490. ////echo "<font style='color: red;'>不符合2</font>";
  491. //$res = "<font style='color: red;'>不符合</font>";
  492. $res = '<font class="td-b">x</font>';
  493. $str_no_err[$field['id']][$field2['id']]['xxlx'] = '证书要求不符';
  494. }
  495. }
  496. echo $res;
  497. }
  498. }
  499. ?>
  500. </td>
  501. </tr>
  502. <tr>
  503. <td>综合评估</td>
  504. <td colspan="3" style="vertical-align:middle;">
  505. <?php
  506. ////echo $num;
  507. if($num >= 6){
  508. //多次循环可能大于6
  509. echo "<font style='color: blue;'>完全符合要求!</font>";
  510. if(!empty($bname)){
  511. $bname_str = '/'.$bname;
  512. }
  513. $result_map .= $aname.$bname_str.'地区<br/>';
  514. $str_no_err[$field['id']][$field2['id']]['zhpg'] = 2;
  515. $str_no_err[$field['id']][$field2['id']]['diqu'] = $aname.'/'.$bname_str;
  516. }else if($num === 0){
  517. echo "<font style='color: red;'>完全不符合要求!</font>";
  518. $str_no_err[$field['id']][$field2['id']]['zhpg'] = 0;
  519. }else{
  520. echo "<font style='color: #ff4c08;'>未完全符合要求!</font>";
  521. $str_no_err[$field['id']][$field2['id']]['zhpg'] = 1;
  522. }
  523. $num = 0;
  524. ?>
  525. </td>
  526. </tr>
  527. </tbody>
  528. </table>
  529. </div>
  530. <?php
  531. $io_d_num++;
  532. ?>
  533. {/eyou:volist}
  534. </div>
  535. <!-- </div>
  536. </div>-->
  537. </div>
  538. </div>
  539. <?php
  540. $tyu_num++;
  541. ?>
  542. {/eyou:volist}
  543. {/eyou:if}
  544. <!--以下输出结果-->
  545. <?php
  546. //var_dump($is_list_empty);
  547. ?>
  548. {eyou:if condition='(empty($is_list_empty))'}
  549. <?php
  550. $is_tg = 0;
  551. ?>
  552. <div class="alert alert-danger" role="alert" style="margin-top:10px;margin-bottom:8px;">
  553. <!--<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
  554. <span class="sr-only">Error:</span>-->
  555. <font class='result-div'>{$scen}</font>
  556. </div>
  557. {eyou:else /}
  558. <!--输出结论 后台有规则 但是可能匹配不成功或者成功-->
  559. <?php
  560. if(empty($result_map)){
  561. $info = '';
  562. $result_map = "<font class='result-div'>抱歉!未找到完全符合条件的地区!</font>";
  563. $class = 'alert-danger';
  564. $is_tg = 0;
  565. }else{
  566. //$result_map;
  567. $info = "<font class='result-div'>找到以下条件完全符合申请的地区:</font>";
  568. $class = 'alert-success';
  569. $is_tg = 1;
  570. }
  571. ?>
  572. <div class="alert {$class}" role="alert" style="margin-top:10px;display: block;margin-bottom:8px;">
  573. <?php
  574. echo $info;
  575. echo "<font class='result-div'>".$result_map."</font>";
  576. ?>
  577. </div>
  578. {/eyou:if}