aepnat /
simpuskesmas
| 1 | <?php |
||
| 2 | |||
| 3 | function tgl_indo($tgl) |
||
| 4 | { |
||
| 5 | $tanggal = substr($tgl, 8, 2); |
||
| 6 | |||
| 7 | $bulan = getBulan1(substr($tgl, 5, 2)); |
||
| 8 | |||
| 9 | $tahun = substr($tgl, 0, 4); |
||
| 10 | |||
| 11 | return $tanggal.'/'.$bulan.'/'.$tahun; |
||
| 12 | } |
||
| 13 | |||
| 14 | function getBulan($bln) |
||
| 15 | { |
||
| 16 | switch ($bln) { |
||
| 17 | |||
| 18 | case 1: |
||
| 19 | |||
| 20 | return '01'; |
||
| 21 | |||
| 22 | break; |
||
|
0 ignored issues
–
show
|
|||
| 23 | |||
| 24 | case 2: |
||
| 25 | |||
| 26 | return '02'; |
||
| 27 | |||
| 28 | break; |
||
| 29 | |||
| 30 | case 3: |
||
| 31 | |||
| 32 | return '03'; |
||
| 33 | |||
| 34 | break; |
||
| 35 | |||
| 36 | case 4: |
||
| 37 | |||
| 38 | return '04'; |
||
| 39 | |||
| 40 | break; |
||
| 41 | |||
| 42 | case 5: |
||
| 43 | |||
| 44 | return '05'; |
||
| 45 | |||
| 46 | break; |
||
| 47 | |||
| 48 | case 6: |
||
| 49 | |||
| 50 | return '06'; |
||
| 51 | |||
| 52 | break; |
||
| 53 | |||
| 54 | case 7: |
||
| 55 | |||
| 56 | return '07'; |
||
| 57 | |||
| 58 | break; |
||
| 59 | |||
| 60 | case 8: |
||
| 61 | |||
| 62 | return '08'; |
||
| 63 | |||
| 64 | break; |
||
| 65 | |||
| 66 | case 9: |
||
| 67 | |||
| 68 | return '09'; |
||
| 69 | |||
| 70 | break; |
||
| 71 | |||
| 72 | case 10: |
||
| 73 | |||
| 74 | return '10'; |
||
| 75 | |||
| 76 | break; |
||
| 77 | |||
| 78 | case 11: |
||
| 79 | |||
| 80 | return '11'; |
||
| 81 | |||
| 82 | break; |
||
| 83 | |||
| 84 | case 12: |
||
| 85 | |||
| 86 | return '12'; |
||
| 87 | |||
| 88 | break; |
||
| 89 | |||
| 90 | } |
||
| 91 | } |
||
| 92 | |||
| 93 | function tgl_indo1($tgl1) |
||
| 94 | { |
||
| 95 | $tanggal1 = substr($tgl1, 8, 2); |
||
| 96 | |||
| 97 | $bulan1 = getBulan1(substr($tgl1, 5, 2)); |
||
| 98 | |||
| 99 | $tahun1 = substr($tgl1, 0, 4); |
||
| 100 | |||
| 101 | return $tanggal1.' '.$bulan1.' '.$tahun1; |
||
| 102 | } |
||
| 103 | |||
| 104 | function getBulan1($bln1) |
||
| 105 | { |
||
| 106 | switch ($bln1) { |
||
| 107 | |||
| 108 | case 1: |
||
| 109 | |||
| 110 | return 'January'; |
||
| 111 | |||
| 112 | break; |
||
|
0 ignored issues
–
show
break is not strictly necessary here and could be removed.
The switch ($x) {
case 1:
return 'foo';
break; // This break is not necessary and can be left off.
}
If you would like to keep this construct to be consistent with other Loading history...
|
|||
| 113 | |||
| 114 | case 2: |
||
| 115 | |||
| 116 | return 'February'; |
||
| 117 | |||
| 118 | break; |
||
| 119 | |||
| 120 | case 3: |
||
| 121 | |||
| 122 | return 'March'; |
||
| 123 | |||
| 124 | break; |
||
| 125 | |||
| 126 | case 4: |
||
| 127 | |||
| 128 | return 'April'; |
||
| 129 | |||
| 130 | break; |
||
| 131 | |||
| 132 | case 5: |
||
| 133 | |||
| 134 | return 'May'; |
||
| 135 | |||
| 136 | break; |
||
| 137 | |||
| 138 | case 6: |
||
| 139 | |||
| 140 | return 'June'; |
||
| 141 | |||
| 142 | break; |
||
| 143 | |||
| 144 | case 7: |
||
| 145 | |||
| 146 | return 'July'; |
||
| 147 | |||
| 148 | break; |
||
| 149 | |||
| 150 | case 8: |
||
| 151 | |||
| 152 | return 'August'; |
||
| 153 | |||
| 154 | break; |
||
| 155 | |||
| 156 | case 9: |
||
| 157 | |||
| 158 | return 'September'; |
||
| 159 | |||
| 160 | break; |
||
| 161 | |||
| 162 | case 10: |
||
| 163 | |||
| 164 | return 'October'; |
||
| 165 | |||
| 166 | break; |
||
| 167 | |||
| 168 | case 11: |
||
| 169 | |||
| 170 | return 'November'; |
||
| 171 | |||
| 172 | break; |
||
| 173 | |||
| 174 | case 12: |
||
| 175 | |||
| 176 | return 'December'; |
||
| 177 | |||
| 178 | break; |
||
| 179 | |||
| 180 | } |
||
| 181 | } |
||
| 182 | |||
| 183 | ?> |
||
|
0 ignored issues
–
show
It is not recommended to use PHP's closing tag
?> in files other than templates.
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore. A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever. Loading history...
|
|||
| 184 | |||
| 185 |
The
breakstatement is not necessary if it is preceded for example by areturnstatement:If you would like to keep this construct to be consistent with other
casestatements, you can safely mark this issue as a false-positive.