123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- <?php
- $result_map = "";
- $xl = ['不限制','中专','高技','大专','本科','硕士','博士'];
- //先列出全国 再其他省 再到市
- $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';
- $is_list_empty = '';
- ?>
- {eyou:sql sql="$sql" cachetime='3600' empty='' id="field"}
- <?php
- $is_list_empty = $field['id'];
- ?>
- <div class="panel panel-primary" style="display:none;">
- <div class="panel-body">
-
- {eyou:if condition='((int)$field.sf === 0)'}
- ({$t}匹配结果)全国通用申报要求对比结果如下:
- {eyou:else /}
- <?php
- if((int)$field['sf'] > 0){
- $sql22 = "select id,name from ey_citysite where id=".$field['sf'];
- $sql222 = '';
- if((int)$field['cs'] > 0){
- $sql222 = "select id,name from ey_citysite where id=".$field['cs'];
- }
- }
- ?>
-
- {eyou:sql sql='$sql22' cachetime='3600' empty='' id="kop"}
- <?php
- $aname = $kop['name'];
- ?>
- {/eyou:sql}
- {eyou:if condition='((int)$field.cs > 0)'}
- {eyou:sql sql='$sql222' cachetime='3600' empty='' id="kop"}
- <?php
- $bname = $kop['name'];
- ?>
- {/eyou:sql}
- {/eyou:if}
-
- ({$t}匹配结果){$aname}{$bname}地区申报要求对比结果如下:
- {/eyou:if}
-
-
- </div>
- <div class="panel-footer" style="padding:3px 5px;">
-
- <!--查询专业-->
- <?php
- $num = 0;
- $sql2 = "select * from ey_zcwe_position where type=".$field['id']." and is_del=0 and status=1";
- ?>
- {eyou:sql sql="$sql2" cachetime='3600' empty='暂无相关数据' id="field2"}
- <table class="table table-bordered" style="margin-bottom:0px;margin-top:5px;">
- <thead>
- <tr>
- <th scope="col" style="text-align: center;">情况<br/>{$i}</th>
- <th scope="col">字段<br/>信息</th>
- <th scope="col">实际<br/>要求</th>
- <th scope="col">填写<br/>资料</th>
- <th scope="col">匹配<br/>结果</th>
- </tr>
- </thead>
- <tbody>
- <?php
- //先判断学历是否符合
- ?>
- <tr>
- <th scope="row">1</th>
- <td>学历</td>
- <td><?php //echo $xl[$field2['xlyq']];?></td>
- <td><?php //echo $xl[$detail['xl']];?></td>
- <td>
- <?php
- if($field2['xlyq'] == $detail['xl']){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- //echo "<font style='color: red;'>不符合</font>";
- }
- ?>
- </td>
- </tr>
- <tr>
- <th scope="row">2</th>
- <td>年龄</td>
- <td>
- <?php
- if((int)$field2['is_ega'] === 0){
- //echo "不限制";
- }else{
- //echo $field2['ega_0'].'-'.$field2['ega_1'].'岁';
- }
- ?>
- </td>
- <td>
- {$detail.nl}岁
- </td>
- <td>
- <?php
- if((int)$detail['nl'] <= (int)$field2['ega_1'] && (int)$detail['nl'] >= (int)$field2['ega_0']){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- //echo "<font style='color: red;'>不符合</font>";
- }
- ?>
- </td>
-
- </tr>
- <tr>
- <th scope="row">3</th>
- <td>毕业<br/>专业</td>
- <td>
-
- {eyou:if condition='((int)$field2.byzy === 0)'}
- 不限制
- {eyou:else /}
-
- <?php
- //查询出毕业专业 $deta
- $zhengshu2 = json_decode($field2['zhengshu2'],true);
- $zhengshu2_str = '0';
- foreach ($zhengshu2 as $k => $v){
- if((int)$v > 0) {
- $zhengshu2_str .= ',' . $v;
- }
- }
- $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu2_str.") and is_del=0 and status=1";
- ?>
-
-
- {eyou:if condition='($zhengshu2_str != "0")'}
- {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
- <?php /**{$field3.title}*/ ?><br/>
- {/eyou:sql}
- {eyou:else /}
- 不限制
- {/eyou:if}
-
-
- {/eyou:if}
-
-
-
- </td>
- <td>
- <?php
- //查询出毕业专业 $deta
- $zhengshu = json_decode($detail['zy'],true);
- $zhengshu_str = '0';
- foreach ($zhengshu as $k => $v){
- if ((int)$v > 0) {
- $zhengshu_str .= ',' . $v;
- }
- }
- $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";
- ?>
-
- {eyou:if condition='($zhengshu_str != "0")'}
- {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
- {$field3.title}<br/>
- {/eyou:sql}
- {eyou:else /}
- 无
- {/eyou:if}
- </td>
-
- <td>
- <?php
- if((int)$field2.byzy === 0 || empty($zhengshu2)){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- if(empty($zhengshu)){
- //echo "<font style='color: red;'>不符合</font>";
- }else{
- $run = "<font style='color: red;'>不符合</font>";
- $ik = 1;
- foreach ($zhengshu as $k => $v){
- if(in_array($v,$zhengshu2)){
- //$run = '<font style="color: blue;">符合</font><br/>'.$ik.'项';
- $run = '<font style="color: blue;">符合</font><br/>';
- $ik++;
- }
- }
- //echo $run;
- if($ik>1){
- $num++; //符合+1
- }
- }
- }
- ?>
- </td>
-
-
- </tr>
- <tr>
- <th scope="row">4</th>
- <td>学校<br/>类型</td>
- <td>
- {eyou:if condition='((int)$field2.xxlx === 0)'}
- 不限制
- {eyou:else /}
- <?php
- //if((int)$field2['xxlx'] === 1) //echo "全日制";
- //if((int)$field2['xxlx'] === 2) //echo "非全日制";
- ?>
- {/eyou:if}
- </td>
- <td>
- {eyou:if condition='((int)$detail.xxlx === 1)'}
- 全日制
- {eyou:else /}
- 非全日制
- {/eyou:if}
- </td>
- <td>
- {eyou:if condition='((int)$field2.xxlx === 0)'}
- <!--<font style='color: blue;'>符合</font>-->
- <?php
- $num++;
- ?>
- {eyou:else /}
- <?php
- if((int)$field2['xxlx'] === (int)$detail['xxlx']){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- //echo "<font style='color: red;'>不符合</font>";
- }
- ?>
- {/eyou:if}
- </td>
- </tr>
- <tr>
- <th scope="row">5</th>
- <td>毕业<br/>时间</td>
- <td>
- {eyou:if condition='((int)$field2.bysj === 0)'}
- <?php /*不要求**/ ?>
- {eyou:else /}
- <?php /*要求>={$field2.bysj_time}年**/ ?>
- {/eyou:if}
- </td>
- <td>
-
- <?php
-
- //$detail['bysj']
- //假设我们要计算的时间是2000年1月1日
- $startDate = new DateTime($detail['bysj']);
- // 获取现在的日期
- $now = new DateTime('now');
- // 计算差值
- $interval = date_diff($startDate, $now);
- // 输出年份
- ////echo $interval->y . ' years';
- if($interval->y > 0){
- //echo '已毕业'.$interval->y . '年';
- }else{
- //echo '刚毕业不足1年';
- }
-
-
- ?>
-
-
- </td>
- <td>
- <?php
- if((int)$field2['bysj'] === 0){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- if((int)$field2['bysj_time'] <= $interval->y){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- //echo "<font style='color: red;'>不符合</font>";
- }
- }
- ?>
- </td>
- </tr>
- <tr>
- <th scope="row">6</th>
- <td>前置<br/>证书</td>
- <td>
- <?php
- $zhengshu3 = '';
- $zs_all = [];
- //(且或) 列出证书要求
- //调用需要的记录 is_zs
- $sql5 = "select * from ey_zcwf_position where type_son=".$field2['id']." and is_del=0 and status=1 and is_zs=1";
- ?>
- {eyou:sql sql="$sql5" cachetime='3600' empty='不限制' id="field3"}
-
- <?php
- if($i > 1){
- //echo "或<br/>";
- }
- ?>
-
- <?php
- //查询出证书 $deta
- $zhengshu3 = json_decode($field3['zhengshu'],true);
- $sjnx = json_decode($field3['sjnx'],true);
- //var_dump($field3);
- //var_dump($field3['zhengshu']);
- //var_dump($field3['sjnx']);
- $zs_all[] = [
- 'a' => $zhengshu3,
- 'b' => $sjnx
- ];
- //var_dump($sjnx);
- $zhengshu3_str = '0';
- foreach ($zhengshu3 as $k => $v){
- if((int)$v > 0) {
- $zhengshu3_str .= ',' . $v;
- }
- }
- $sql3 = "select id,title from ey_zczs_position where id IN(".$zhengshu3_str.") and is_del=0 and status=1";
- ?>
- {eyou:if condition='($zhengshu3_str != "0")'}
- {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field4"}
- <?php
- $key_s = array_search($field4['id'], $zhengshu3);
- $year_s = $sjnx[$key_s];
- ?>
- <?php /**{$field4.title}(需要{$year_s}年)**/?><br/>
- {/eyou:sql}
- {eyou:else /}
- <!--忽略-->
- {/eyou:if}
-
-
- {/eyou:sql}
- </td>
- <td>
-
-
- <?php
- //查询出拥有的证书 $deta
- $zhengshu = json_decode($detail['zs'],true);
- $zsnx = json_decode($detail['zsnx'],true);
- $zhengshu_str = '0';
- foreach ($zhengshu as $k => $v){
- if((int)$v > 0){
- $zhengshu_str .= ','.$v;
- }
- }
- $sql3 = "select id,title from ey_zczs_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";
- ?>
-
- {eyou:if condition='($zhengshu_str != "0")'}
- {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
- <?php
- $key_s = array_search($field3['id'], $zhengshu);
- $year_s = $zsnx[$key_s];
- ?>
- <?php /**{$field3.title}(拥有{$year_s}年)**/ ?><br/>
- {/eyou:sql}
- {eyou:else /}
- 无
- {/eyou:if}
-
- </td>
-
- <td>
- <?php
- //var_dump($field['id']);
- //var_dump($zs_all);
- //表示没查出限制要求
- if(empty($zhengshu3)){
- //echo "<font style='color: blue;'>符合</font>";
- $num++;
- }else{
- if(empty($zhengshu)){
- //用户没有证书
- //echo "<font style='color: red;'>不符合</font>";
- }else{
- //判断是否包含
- //第一轮 循环 或
- foreach ($zs_all as $k => $v){
- if($k > 0){
- ////echo "或<br/>";
- }
- $ik = 1;
- $ik2 = 1;
- $ik3 = 1;
- //第二轮 循环 且
- //var_dump($v['a']);
- $ik4 = 0; //真实有效数量
- foreach ($v['a'] as $k2 => $v2){
- //var_dump($v2);
- //var_dump($zhengshu);
- //第三轮 循环 每一项要求是否在 用户拥有的证书 里面
- //必须完全满足
- if((int)$v2 > 0) {
- if (in_array($v2, $zhengshu)) {
- //判断年限是否符合要求
- $key_i = array_search($v2, $zhengshu);
- //var_dump($zsnx[$key_i]);
- if ((int)$zsnx[$key_i] >= (int)$v['b'][$k2]) {
- $run_1 = '<font style="color: blue;">符合</font><br/>' . $ik . '项';
- $ik++;
- } else {
- $run_2 = '<font style="color: blue;">年限不符合</font><br/>' . $ik2 . '项';
- $ik2++;
- }
- } else {
- $run_3 = '<font style="color: blue;">未拥有</font><br/>' . $ik3 . '项';
- $ik3++;
- }
- $ik4++;
- }
- }
- //具体情况 循环且
- ////echo $run_1;
- ////echo $run_2;
- ////echo $run_3;
- ////echo count($v['a']);
- //var_dump($ik);
- //var_dump(count($v['a']));
- if(($ik-1) === $ik4){
- ////echo "<font style='color: blue;'>符合1</font>";
- $res = "<font style='color: blue;'>符合</font>";
- $num++;
- //跳出循环 已经符合其中 一个 且了
- break;
- }else{
- ////echo "<font style='color: red;'>不符合2</font>";
- $res = "<font style='color: red;'>不符合</font>";
- }
- }
- //echo $res;
- }
- }
- ?>
-
-
- </td>
-
-
- </tr>
- <tr>
- <th scope="row">7</th>
- <td>综合<br/>评估</td>
- <td colspan="3" style="vertical-align:middle;">
-
-
- <?php
- ////echo $num;
- if($num >= 6){
- //多次循环可能大于6
- echo "<font style='color: blue;'>完全符合要求!</font>";
-
- if(!empty($bname)){
- $bname_str = '/'.$bname;
- }
-
- $result_map .= $aname.$bname_str.'地区<br/>';
-
-
- }else if($num === 0){
- echo "<font style='color: red;'>完全不符合要求!</font>";
- }else{
- echo "<font style='color: #ff4c08;'>未完全符合要求!</font>";
- }
- $num = 0;
- ?>
-
- </td>
- </tr>
- </tbody>
- </table>
- {/eyou:sql}
- </div>
- </div>
- {/eyou:sql}
-
- <?php
- //var_dump($is_list_empty);
- ?>
- {eyou:if condition='(empty($is_list_empty))'}
- <div class="alert alert-danger" role="alert" style="">
- <!--<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
- <span class="sr-only">Error:</span>-->
- {$scen}
- </div>
- {eyou:else /}
-
- <?php
- if(empty($result_map)){
- $info = '';
- $result_map = "抱歉!未找到符合地区!";
- $class = 'alert-danger';
- }else{
- //$result_map;
- $info = "找到以下符合申请的地区:<br/><br/>";
- $class = 'alert-success';
- }
- ?>
-
-
- <div class="alert {$class}" role="alert" style="">
- <?php
- echo $info;
- echo $result_map;
- ?>
- </div>
-
- {/eyou:if}
|