Пример #1
0
 public static function get_uchebnii_plan_html($kug = [], $attestaciya = [])
 {
     //var_dump($kug);
     $plan = '<table class="tb tb_plan">
     <thead>
     <tr class="thead">
        <td rowspan="2">Номер</td>
        <td  rowspan="2">Наименование</td>
        <td  rowspan="2">Всего часов</td>
        <td colspan="3">В том числе</td>
        <td  rowspan="2">Форма контроля</td>
     </tr>
     <tr class="thead">
       <td>ЛК</td>
       <td>ПР</td>
       <td>СРС</td>
     </tr>
     </thead>
     <tbody>';
     $all_lk = 0;
     $all_pr = 0;
     $all_srs = 0;
     $razdel_num = 1;
     foreach ($kug as $tip_razdela => $razdeli) {
         $razdels = '';
         foreach ($razdeli as $k => $v) {
             $razdel_lk = 0;
             $razdel_pr = 0;
             $razdel_srs = 0;
             $podrazdeli = '';
             $podrazdeli_s_temami = '';
             $for_kug = '';
             $for_plan = '';
             $podrazdel_num = 1;
             $first_podrazdel = key($v['podrazdels']);
             foreach ($v['podrazdels'] as $pr => $pri) {
                 $podrazdel_lk = 0;
                 $podrazdel_pr = 0;
                 $podrazdel_srs = 0;
                 $podrazdel_kontrol = [];
                 $tem_num = 1;
                 $temi = '';
                 foreach ($pri['themes'] as $tema_key => $tema_item) {
                     if (isset($tema_item['forma_kontrolya_temi'])) {
                         $podrazdel_kontrol[] = $tema_item['forma_kontrolya_temi'];
                     }
                     $podrazdel_lk += $tema_item['lk'];
                     $podrazdel_pr += $tema_item['pr'];
                     $podrazdel_srs += $tema_item['srs'];
                     $tem_num++;
                 }
                 $podrzdel_kf = '';
                 if ($pri['podrazdel_fk_name']) {
                     $podrzdel_kf = $pri['podrazdel_fk_name'] ? $pri['podrazdel_fk_name'] . '(' . $pri['podrazdel_chasy_fk'] . ' ч.)' : '';
                     $podrazdel_kontrol[] = $pri['podrazdel_fk_name'];
                     //                        $podrzdel_kf =  '<tr class="sub2head">
                     //                            <td></td>
                     //                            <td>Контроль по '.($v['tip_kursa']=='pk' ? 'блоку тем' : 'дисциплине').'</td>
                     //                            <td class="center">'.($pri['podrazdel_chasy_fk'] ? $pri['podrazdel_chasy_fk'] : '').'</td>
                     //                            <td class="center"></td>
                     //                            <td class="center">'.($pri['podrazdel_chasy_fk'] ? $pri['podrazdel_chasy_fk'] : '').'</td>
                     //                            <td class="center"></td>
                     //                            <td class="center">'.($pri['podrazdel_fk_name'] ? $pri['podrazdel_fk_name'] : '').'</td>
                     //                        </tr>';
                     $podrazdel_pr += $pri['podrazdel_chasy_fk'];
                 }
                 $podrazdeli = '<tr class="sub2head">
                         <td>' . $razdel_num . '.' . $podrazdel_num . '.</td>
                         <td>' . $pri['nazvanie'] . '</td>
                         <td class="center">' . ($podrazdel_lk + $podrazdel_pr + $podrazdel_srs ? $podrazdel_lk + $podrazdel_pr + $podrazdel_srs : '') . '</td>
                         <td class="center">' . ($podrazdel_lk ? $podrazdel_lk : '') . '</td>
                         <td class="center">' . ($podrazdel_pr ? $podrazdel_pr : '') . '</td>
                         <td class="center">' . ($podrazdel_srs ? $podrazdel_srs : '') . '</td>
                         <td class="center">' . $pri['podrazdel_fk_name'] . '</td>
                     </tr>';
                 //$podrazdeli .= $podrzdel_kf;
                 $for_plan .= $podrazdeli;
                 if ($v['tip_razdela'] == 7 and $first_podrazdel == $pr or $v['tip_razdela'] != 7) {
                     $razdel_lk += $podrazdel_lk;
                     $razdel_pr += $podrazdel_pr;
                     $razdel_srs += $podrazdel_srs;
                 }
                 $podrazdel_num++;
             }
             $razdels .= '<tr class="subhead  razdel-tr">
                         <td></td>
                         <td>' . $v['nazvanie'] . '</td>
                         <td class="center">' . ($razdel_lk + $razdel_pr + $razdel_srs ? $razdel_lk + $razdel_pr + $razdel_srs : '') . '</td>
                         <td class="center">' . ($razdel_lk ? $razdel_lk : '') . '</td>
                         <td class="center">' . ($razdel_pr ? $razdel_pr : '') . '</td>
                         <td class="center">' . ($razdel_srs ? $razdel_srs : '') . '</td>
                         <td></td>
                     </tr>';
             $razdels .= $for_plan;
             $razdel_num++;
             $all_lk += $razdel_lk;
             $all_pr += $razdel_pr;
             $all_srs += $razdel_srs;
         }
         $plan .= '<tr>
                     <td class="center" colspan="7">' . KursGlobals::get_tip_razdela_name($tip_razdela) . '</td>
                  </tr>';
         $plan .= $razdels;
     }
     if ($attestaciya) {
         $plan .= '<tr class="subhead  razdel-tr">
                         <td></td>
                         <td>Итоговая аттестация</td>
                         <td class="center">' . ($attestaciya['chasy'] ?: '') . '</td>
                         <td class="center"></td>
                         <td class="center">' . ($attestaciya['chasy'] ? $attestaciya['chasy'] : '') . '</td>
                         <td class="center"></td>
                         <td class="center">' . $attestaciya['forma_attestacii'] . '</td>
                     </tr>';
         $all_pr += $attestaciya['chasy'];
     }
     $plan .= '<tr class="summary  razdel-tr">
                     <td></td>
                     <td>Итого</td>
                     <td class="center">' . ($all_lk + $all_pr + $all_srs ? $all_lk + $all_pr + $all_srs : '') . '</td>
                     <td class="center">' . ($all_lk ? $all_lk : '') . '</td>
                     <td class="center">' . ($all_pr ? $all_pr : '') . '</td>
                     <td class="center">' . ($all_srs ? $all_srs : '') . '</td>
                     <td></td>
                 </tr>';
     $plan .= '</tbody></table>';
     return $plan;
 }
Пример #2
0
 public static function get_uchebnii_plan_html($kug = [], $podrazdel_id)
 {
     //var_dump($kug);
     $plan = '<table class="tb tb_plan">
     <thead>
     <tr class="thead">
        <td rowspan="2">Номер</td>
        <td  rowspan="2">Наименование</td>
        <td  rowspan="2">Всего часов</td>
        <td colspan="3">В том числе</td>
        <td  rowspan="2">Форма контроля</td>
     </tr>
     <tr class="thead">
       <td>ЛК</td>
       <td>ПР</td>
       <td>СРС</td>
     </tr>
     </thead>
     <tbody>';
     $all_lk = 0;
     $all_pr = 0;
     $all_srs = 0;
     $razdel_num = 1;
     $is_break = false;
     foreach ($kug as $tip_razdela => $razdeli) {
         $razdels = '';
         foreach ($razdeli as $k => $v) {
             $razdel_lk = 0;
             $razdel_pr = 0;
             $razdel_srs = 0;
             $for_plan = '';
             $podrazdel_num = 1;
             $first_podrazdel = key($v['podrazdels']);
             foreach ($v['podrazdels'] as $pr => $pri) {
                 if ($pr == $podrazdel_id) {
                     $podrazdel_lk = 0;
                     $podrazdel_pr = 0;
                     $podrazdel_srs = 0;
                     $podrazdel_kontrol = [];
                     $tem_num = 1;
                     $temi = '';
                     foreach ($pri['themes'] as $tema_key => $tema_item) {
                         if (isset($tema_item['forma_kontrolya_temi'])) {
                             $podrazdel_kontrol[] = $tema_item['forma_kontrolya_temi'];
                         }
                         $podrazdel_lk += $tema_item['lk'];
                         $podrazdel_pr += $tema_item['pr'];
                         $podrazdel_srs += $tema_item['srs'];
                         $tem_num++;
                     }
                     $podrzdel_kf = '';
                     if ($pri['podrazdel_fk_name']) {
                         $podrzdel_kf = $pri['podrazdel_fk_name'] ? $pri['podrazdel_fk_name'] : '';
                         $podrazdel_pr += $pri['podrazdel_chasy_fk'];
                     }
                     $podrazdeli = '<tr class="sub2head">
                         <td>' . $razdel_num . '.' . $podrazdel_num . '.</td>
                         <td>' . $pri['nazvanie'] . '</td>
                         <td class="center">' . ($podrazdel_lk + $podrazdel_pr + $podrazdel_srs ? $podrazdel_lk + $podrazdel_pr + $podrazdel_srs : '') . '</td>
                         <td class="center">' . ($podrazdel_lk ? $podrazdel_lk : '') . '</td>
                         <td class="center">' . ($podrazdel_pr ? $podrazdel_pr : '') . '</td>
                         <td class="center">' . ($podrazdel_srs ? $podrazdel_srs : '') . '</td>
                         <td class="center">' . $podrzdel_kf . '</td>
                     </tr>';
                     //implode(',', $podrazdel_kontrol)
                     $for_plan .= $podrazdeli;
                     if ($v['tip_razdela'] == 7 and $first_podrazdel == $pr or $v['tip_razdela'] != 7) {
                         $razdel_lk += $podrazdel_lk;
                         $razdel_pr += $podrazdel_pr;
                         $razdel_srs += $podrazdel_srs;
                     }
                     $is_break = true;
                     break;
                 }
                 $podrazdel_num++;
             }
             if ($is_break) {
                 $razdels .= '<tr class="subhead  razdel-tr">
                         <td></td>
                         <td>' . $v['nazvanie'] . '</td>
                         <td class="center"></td>
                         <td class="center"></td>
                         <td class="center"></td>
                         <td class="center"></td>
                         <td></td>
                     </tr>';
                 $razdels .= $for_plan;
                 $razdel_num++;
                 $all_lk += $razdel_lk;
                 $all_pr += $razdel_pr;
                 $all_srs += $razdel_srs;
                 break;
             }
         }
         if ($is_break) {
             $plan .= '<tr>
                     <td class="center" colspan="7">' . KursGlobals::get_tip_razdela_name($tip_razdela) . '</td>
                  </tr>';
             $plan .= $razdels;
             break;
         }
     }
     $plan .= '<tr class="summary  razdel-tr">
                     <td></td>
                     <td>Итого</td>
                     <td class="center">' . ($all_lk + $all_pr + $all_srs ? $all_lk + $all_pr + $all_srs : '') . '</td>
                     <td class="center">' . ($all_lk ? $all_lk : '') . '</td>
                     <td class="center">' . ($all_pr ? $all_pr : '') . '</td>
                     <td class="center">' . ($all_srs ? $all_srs : '') . '</td>
                     <td></td>
                 </tr>';
     $plan .= '</tbody></table>';
     return $plan;
 }