Advertisement
Guest User

important

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. <?php
  2. $columns = array('2018_01');
  3.  
  4. $departments = array('First department', 'Second department');
  5.  
  6. $m_2018_01_dep_1_he_1_hb_1 = 1;
  7. $m_2018_01_dep_1_he_1_hb_2 = 2;
  8.  
  9. $m_2018_01_dep_1_he_2_hb_1 = 1;
  10. $m_2018_01_dep_1_he_2_hb_2 = 2;
  11.  
  12. $m_2018_01_dep_1_he_3_hb_1 = 1;
  13. $m_2018_01_dep_1_he_3_hb_2 = 2;
  14.  
  15. $m_2018_01_dep_1_he_4_hb_1 = 1;
  16. $m_2018_01_dep_1_he_4_hb_2 = 2;
  17.  
  18. $m_2018_01_dep_1_he_5_hb_1 = 1;
  19. $m_2018_01_dep_1_he_5_hb_2 = 2;
  20.  
  21. $m_2018_01_dep_1_he_6_hb_1 = 1;
  22. $m_2018_01_dep_1_he_6_hb_2 = 2;
  23.  
  24. $m_2018_01_dep_1_he_7_hb_1 = 1;
  25. $m_2018_01_dep_1_he_7_hb_2 = 2;
  26.  
  27. $m_2018_01_dep_1_hb_1_total = 10;
  28. $m_2018_01_dep_1_hb_2_total = 20;
  29.  
  30. $m_2018_01_dep_1_full = 30;
  31.  
  32. $m_2018_01_dep_2_he_1_hb_1 = 1;
  33. $m_2018_01_dep_2_he_1_hb_2 = 2;
  34.  
  35. $m_2018_01_dep_2_he_2_hb_1 = 1;
  36. $m_2018_01_dep_2_he_2_hb_2 = 2;
  37.  
  38. $m_2018_01_dep_2_he_3_hb_1 = 1;
  39. $m_2018_01_dep_2_he_3_hb_2 = 2;
  40.  
  41. $m_2018_01_dep_2_he_4_hb_1 = 1;
  42. $m_2018_01_dep_2_he_4_hb_2 = 2;
  43.  
  44. $m_2018_01_dep_2_he_5_hb_1 = 1;
  45. $m_2018_01_dep_2_he_5_hb_2 = 2;
  46.  
  47. $m_2018_01_dep_2_he_6_hb_1 = 1;
  48. $m_2018_01_dep_2_he_6_hb_2 = 2;
  49.  
  50. $m_2018_01_dep_2_he_7_hb_1 = 1;
  51. $m_2018_01_dep_2_he_7_hb_2 = 2;
  52.  
  53. $m_2018_01_dep_2_hb_1_total = 10;
  54. $m_2018_01_dep_2_hb_2_total = 20;
  55.  
  56. $m_2018_01_dep_2_full = 30;
  57.  
  58.  
  59. ?>
  60.  
  61. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  62. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  63. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  64. <style>
  65. .valign{
  66. text-align: center;
  67. vertical-align: middle!important;
  68. }
  69. </style>
  70.  
  71. <table class="table table-bordered">
  72. <thead>
  73. <tr>
  74. <th>Department</th>
  75. <th>How Employed</th>
  76. <?php foreach($columns as $column):?>
  77. <th colspan="2"><?= $column;?></th>
  78. <?php endforeach;?>
  79. </tr>
  80. </thead>
  81. <tbody>
  82.  
  83. <tr>
  84. <td colspan="2"></td>
  85. <?php for($i=1; $i <= count($columns); $i++) : ?>
  86. <td>現地</td>
  87. <td>出向</td>
  88. <?php endfor; ?>
  89. </tr>
  90. <?php foreach($departments as $index => $department) : ?>
  91. <tr>
  92. <td class="valign" rowspan="10"><?= $department;?></td>
  93. </tr>
  94. <tr>
  95. <td>役員</td>
  96. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  97. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  98. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  99. <?php endfor; ?>
  100. </tr>
  101. <tr>
  102. <td>正社員</td>
  103. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  104. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  105. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  106. <?php endfor; ?>
  107. </tr>
  108. <tr>
  109. <td>限定社員</td>
  110. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  111. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  112. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  113. <?php endfor; ?>
  114. </tr>
  115. <tr>
  116. <td>契約社員</td>
  117. <?php for($i=0; $i == count($columns)-1; $i++) : $inc = $i+1;?>
  118. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  119. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  120. <?php endfor; ?>
  121. </tr>
  122. <tr>
  123. <td>派遣社員</td>
  124. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  125. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  126. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  127. <?php endfor; ?>
  128. </tr>
  129. <tr>
  130. <td>常駐社員</td>
  131. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  132. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  133. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  134. <?php endfor; ?>
  135. </tr>
  136. <tr>
  137. <td>パート・アルバイト</td>
  138. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  139. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  140. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  141. <?php endfor; ?>
  142. </tr>
  143. <tr>
  144. <td>合計</td>
  145. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  146. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_hb_{$inc}_total"}; ?></td>
  147. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_hb_{$inc}_total"}; ?></td>
  148. <?php endfor; ?>
  149. </tr>
  150. <tr>
  151. <td>総計</td>
  152. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  153. <td class="text-center" colspan="2"><?= ${"m_{$columns[$i]}_dep_{$inc}_full"}; ?></td>
  154. <?php endfor; ?>
  155. </tr>
  156. <?php endforeach; ?>
  157.  
  158.  
  159. </tbody>
  160. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement