Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $columns = array('2018_01');
- $departments = array('First department', 'Second department');
- $m_2018_01_dep_1_he_1_hb_1 = 1;
- $m_2018_01_dep_1_he_1_hb_2 = 2;
- $m_2018_01_dep_1_he_2_hb_1 = 1;
- $m_2018_01_dep_1_he_2_hb_2 = 2;
- $m_2018_01_dep_1_he_3_hb_1 = 1;
- $m_2018_01_dep_1_he_3_hb_2 = 2;
- $m_2018_01_dep_1_he_4_hb_1 = 1;
- $m_2018_01_dep_1_he_4_hb_2 = 2;
- $m_2018_01_dep_1_he_5_hb_1 = 1;
- $m_2018_01_dep_1_he_5_hb_2 = 2;
- $m_2018_01_dep_1_he_6_hb_1 = 1;
- $m_2018_01_dep_1_he_6_hb_2 = 2;
- $m_2018_01_dep_1_he_7_hb_1 = 1;
- $m_2018_01_dep_1_he_7_hb_2 = 2;
- $m_2018_01_dep_1_hb_1_total = 10;
- $m_2018_01_dep_1_hb_2_total = 20;
- $m_2018_01_dep_1_full = 30;
- $m_2018_01_dep_2_he_1_hb_1 = 1;
- $m_2018_01_dep_2_he_1_hb_2 = 2;
- $m_2018_01_dep_2_he_2_hb_1 = 1;
- $m_2018_01_dep_2_he_2_hb_2 = 2;
- $m_2018_01_dep_2_he_3_hb_1 = 1;
- $m_2018_01_dep_2_he_3_hb_2 = 2;
- $m_2018_01_dep_2_he_4_hb_1 = 1;
- $m_2018_01_dep_2_he_4_hb_2 = 2;
- $m_2018_01_dep_2_he_5_hb_1 = 1;
- $m_2018_01_dep_2_he_5_hb_2 = 2;
- $m_2018_01_dep_2_he_6_hb_1 = 1;
- $m_2018_01_dep_2_he_6_hb_2 = 2;
- $m_2018_01_dep_2_he_7_hb_1 = 1;
- $m_2018_01_dep_2_he_7_hb_2 = 2;
- $m_2018_01_dep_2_hb_1_total = 10;
- $m_2018_01_dep_2_hb_2_total = 20;
- $m_2018_01_dep_2_full = 30;
- ?>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <style>
- .valign{
- text-align: center;
- vertical-align: middle!important;
- }
- </style>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th>Department</th>
- <th>How Employed</th>
- <?php foreach($columns as $column):?>
- <th colspan="2"><?= $column;?></th>
- <?php endforeach;?>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td colspan="2"></td>
- <?php for($i=1; $i <= count($columns); $i++) : ?>
- <td>現地</td>
- <td>出向</td>
- <?php endfor; ?>
- </tr>
- <?php foreach($departments as $index => $department) : ?>
- <tr>
- <td class="valign" rowspan="10"><?= $department;?></td>
- </tr>
- <tr>
- <td>役員</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>正社員</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>限定社員</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>契約社員</td>
- <?php for($i=0; $i == count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>派遣社員</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>常駐社員</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>パート・アルバイト</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>合計</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_hb_{$inc}_total"}; ?></td>
- <td><?= ${"m_{$columns[$i]}_dep_{$inc}_hb_{$inc}_total"}; ?></td>
- <?php endfor; ?>
- </tr>
- <tr>
- <td>総計</td>
- <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
- <td class="text-center" colspan="2"><?= ${"m_{$columns[$i]}_dep_{$inc}_full"}; ?></td>
- <?php endfor; ?>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement