Advertisement
Guest User

asfafsfas

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. <?php
  2. $columns = array('2018_01');
  3.  
  4. $departments = array('First','Second','Third','Fourth','Fifth','Sixth','Seventh');
  5.  
  6. for($d=1; $d <= count($departments); $d++){
  7. ${"m_2018_01_dep_".$d."_he_1_hb_1"} = 1;
  8. ${"m_2018_01_dep_".$d."_he_1_hb_2"} = 2;
  9.  
  10. ${"m_2018_01_dep_".$d."_he_2_hb_1"} = 1;
  11. ${"m_2018_01_dep_".$d."_he_2_hb_2"} = 2;
  12.  
  13. ${"m_2018_01_dep_".$d."_he_3_hb_1"} = 1;
  14. ${"m_2018_01_dep_".$d."_he_3_hb_2"} = 2;
  15.  
  16. ${"m_2018_01_dep_".$d."_he_4_hb_1"} = 1;
  17. ${"m_2018_01_dep_".$d."_he_4_hb_2"} = 2;
  18.  
  19. ${"m_2018_01_dep_".$d."_he_5_hb_1"} = 1;
  20. ${"m_2018_01_dep_".$d."_he_5_hb_2"} = 2;
  21.  
  22. ${"m_2018_01_dep_".$d."_he_6_hb_1"} = 1;
  23. ${"m_2018_01_dep_".$d."_he_6_hb_2"} = 2;
  24.  
  25. ${"m_2018_01_dep_".$d."_he_7_hb_1"} = 1;
  26. ${"m_2018_01_dep_".$d."_he_7_hb_2"} = 2;
  27.  
  28. ${"m_2018_01_dep_".$d."_hb_1_total"} = 10;
  29. ${"m_2018_01_dep_".$d."_hb_2_total"} = 20;
  30.  
  31. ${"m_2018_01_dep_".$d."_full"} = 30;
  32. }
  33.  
  34.  
  35.  
  36. ?>
  37.  
  38. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  39. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  40. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  41. <style>
  42. .valign{
  43. text-align: center;
  44. vertical-align: middle!important;
  45. }
  46. </style>
  47.  
  48. <table class="table table-bordered">
  49. <thead>
  50. <tr>
  51. <th>Department</th>
  52. <th>How Employed</th>
  53. <?php foreach($columns as $column):?>
  54. <th colspan="2"><?= $column;?></th>
  55. <?php endforeach;?>
  56. </tr>
  57. </thead>
  58. <tbody>
  59.  
  60. <tr>
  61. <td colspan="2"></td>
  62. <?php for($i=1; $i <= count($columns); $i++) : ?>
  63. <td>現地</td>
  64. <td>出向</td>
  65. <?php endfor; ?>
  66. </tr>
  67. <?php foreach($departments as $index => $department) : ?>
  68. <tr>
  69. <td class="valign" rowspan="10"><?= $department;?></td>
  70. </tr>
  71. <tr>
  72. <td>役員</td>
  73. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  74. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  75. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  76. <?php endfor; ?>
  77. </tr>
  78. <tr>
  79. <td>正社員</td>
  80. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  81. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  82. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  83. <?php endfor; ?>
  84. </tr>
  85. <tr>
  86. <td>限定社員</td>
  87. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  88. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  89. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  90. <?php endfor; ?>
  91. </tr>
  92. <tr>
  93. <td>契約社員</td>
  94. <?php for($i=0; $i == count($columns)-1; $i++) : $inc = $i+1;?>
  95. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  96. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  97. <?php endfor; ?>
  98. </tr>
  99. <tr>
  100. <td>派遣社員</td>
  101. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  102. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  103. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  104. <?php endfor; ?>
  105. </tr>
  106. <tr>
  107. <td>常駐社員</td>
  108. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  109. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  110. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  111. <?php endfor; ?>
  112. </tr>
  113. <tr>
  114. <td>パート・アルバイト</td>
  115. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  116. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_1"}; ?></td>
  117. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_he_{$inc}_hb_2"}; ?></td>
  118. <?php endfor; ?>
  119. </tr>
  120. <tr>
  121. <td>合計</td>
  122. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  123. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_hb_1_total"}; ?></td>
  124. <td><?= ${"m_{$columns[$i]}_dep_{$inc}_hb_2_total"}; ?></td>
  125. <?php endfor; ?>
  126. </tr>
  127. <tr>
  128. <td>総計</td>
  129. <?php for($i=0; $i <= count($columns)-1; $i++) : $inc = $i+1;?>
  130. <td class="text-center" colspan="2"><?= ${"m_{$columns[$i]}_dep_{$inc}_full"}; ?></td>
  131. <?php endfor; ?>
  132. </tr>
  133. <?php endforeach; ?>
  134.  
  135.  
  136. </tbody>
  137. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement