@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $bstream->allocate($bits); |
| 51 | 51 | |
| 52 | 52 | $mask = 1 << ($bits - 1); |
| 53 | - for ($i = 0; $i < $bits; $i++) { |
|
| 53 | + for ($i = 0; $i<$bits; $i++) { |
|
| 54 | 54 | if ($num & $mask) { |
| 55 | 55 | $bstream->data[$i] = 1; |
| 56 | 56 | } else { |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | $bstream->allocate($size * 8); |
| 70 | 70 | $p = 0; |
| 71 | 71 | |
| 72 | - for ($i = 0; $i < $size; $i++) { |
|
| 72 | + for ($i = 0; $i<$size; $i++) { |
|
| 73 | 73 | $mask = 0x80; |
| 74 | - for ($j = 0; $j < 8; $j++) { |
|
| 74 | + for ($j = 0; $j<8; $j++) { |
|
| 75 | 75 | if ($data[$i] & $mask) { |
| 76 | 76 | $bstream->data[$p] = 1; |
| 77 | 77 | } else { |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | return -1; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if ($arg->size() == 0) { |
|
| 95 | + if ($arg->size()==0) { |
|
| 96 | 96 | return 0; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if ($this->size() == 0) { |
|
| 99 | + if ($this->size()==0) { |
|
| 100 | 100 | $this->data = $arg->data; |
| 101 | 101 | |
| 102 | 102 | return 0; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | //---------------------------------------------------------------------- |
| 111 | 111 | public function appendNum($bits, $num) |
| 112 | 112 | { |
| 113 | - if ($bits == 0) { |
|
| 113 | + if ($bits==0) { |
|
| 114 | 114 | return 0; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | //---------------------------------------------------------------------- |
| 130 | 130 | public function appendBytes($size, $data) |
| 131 | 131 | { |
| 132 | - if ($size == 0) { |
|
| 132 | + if ($size==0) { |
|
| 133 | 133 | return 0; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -150,18 +150,18 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $size = $this->size(); |
| 152 | 152 | |
| 153 | - if ($size == 0) { |
|
| 153 | + if ($size==0) { |
|
| 154 | 154 | return []; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - $data = array_fill(0, (int) (($size + 7) / 8), 0); |
|
| 158 | - $bytes = (int) ($size / 8); |
|
| 157 | + $data = array_fill(0, (int)(($size + 7) / 8), 0); |
|
| 158 | + $bytes = (int)($size / 8); |
|
| 159 | 159 | |
| 160 | 160 | $p = 0; |
| 161 | 161 | |
| 162 | - for ($i = 0; $i < $bytes; $i++) { |
|
| 162 | + for ($i = 0; $i<$bytes; $i++) { |
|
| 163 | 163 | $v = 0; |
| 164 | - for ($j = 0; $j < 8; $j++) { |
|
| 164 | + for ($j = 0; $j<8; $j++) { |
|
| 165 | 165 | $v = $v << 1; |
| 166 | 166 | $v |= $this->data[$p]; |
| 167 | 167 | $p++; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | if ($size & 7) { |
| 173 | 173 | $v = 0; |
| 174 | - for ($j = 0; $j < ($size & 7); $j++) { |
|
| 174 | + for ($j = 0; $j<($size & 7); $j++) { |
|
| 175 | 175 | $v = $v << 1; |
| 176 | 176 | $v |= $this->data[$p]; |
| 177 | 177 | $p++; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $blacks = 0; |
| 47 | 47 | $format = QRspec::getFormatInfo($mask, $level); |
| 48 | 48 | |
| 49 | - for ($i = 0; $i < 8; $i++) { |
|
| 49 | + for ($i = 0; $i<8; $i++) { |
|
| 50 | 50 | if ($format & 1) { |
| 51 | 51 | $blacks += 2; |
| 52 | 52 | $v = 0x85; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $frame[8][$width - 1 - $i] = chr($v); |
| 58 | - if ($i < 6) { |
|
| 58 | + if ($i<6) { |
|
| 59 | 59 | $frame[$i][8] = chr($v); |
| 60 | 60 | } else { |
| 61 | 61 | $frame[$i + 1][8] = chr($v); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $format = $format >> 1; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - for ($i = 0; $i < 7; $i++) { |
|
| 66 | + for ($i = 0; $i<7; $i++) { |
|
| 67 | 67 | if ($format & 1) { |
| 68 | 68 | $blacks += 2; |
| 69 | 69 | $v = 0x85; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $frame[$width - 7 + $i][8] = chr($v); |
| 75 | - if ($i == 0) { |
|
| 75 | + if ($i==0) { |
|
| 76 | 76 | $frame[8][7] = chr($v); |
| 77 | 77 | } else { |
| 78 | 78 | $frame[8][6 - $i] = chr($v); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | public function mask4($x, $y) |
| 109 | 109 | { |
| 110 | - return (((int) ($y / 2)) + ((int) ($x / 3))) & 1; |
|
| 110 | + return (((int)($y / 2)) + ((int)($x / 3))) & 1; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | public function mask5($x, $y) |
@@ -130,13 +130,13 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); |
| 132 | 132 | |
| 133 | - for ($y = 0; $y < $width; $y++) { |
|
| 134 | - for ($x = 0; $x < $width; $x++) { |
|
| 133 | + for ($y = 0; $y<$width; $y++) { |
|
| 134 | + for ($x = 0; $x<$width; $x++) { |
|
| 135 | 135 | if (ord($frame[$y][$x]) & 0x80) { |
| 136 | 136 | $bitMask[$y][$x] = 0; |
| 137 | 137 | } else { |
| 138 | 138 | $maskFunc = call_user_func([$this, 'mask'.$maskNo], $x, $y); |
| 139 | - $bitMask[$y][$x] = ($maskFunc == 0) ? 1 : 0; |
|
| 139 | + $bitMask[$y][$x] = ($maskFunc==0) ? 1 : 0; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -197,12 +197,12 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $d = $s; |
| 199 | 199 | |
| 200 | - for ($y = 0; $y < $width; $y++) { |
|
| 201 | - for ($x = 0; $x < $width; $x++) { |
|
| 202 | - if ($bitMask[$y][$x] == 1) { |
|
| 203 | - $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int) $bitMask[$y][$x]); |
|
| 200 | + for ($y = 0; $y<$width; $y++) { |
|
| 201 | + for ($x = 0; $x<$width; $x++) { |
|
| 202 | + if ($bitMask[$y][$x]==1) { |
|
| 203 | + $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int)$bitMask[$y][$x]); |
|
| 204 | 204 | } |
| 205 | - $b += (int) (ord($d[$y][$x]) & 1); |
|
| 205 | + $b += (int)(ord($d[$y][$x]) & 1); |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
@@ -224,20 +224,20 @@ discard block |
||
| 224 | 224 | { |
| 225 | 225 | $demerit = 0; |
| 226 | 226 | |
| 227 | - for ($i = 0; $i < $length; $i++) { |
|
| 228 | - if ($this->runLength[$i] >= 5) { |
|
| 227 | + for ($i = 0; $i<$length; $i++) { |
|
| 228 | + if ($this->runLength[$i]>=5) { |
|
| 229 | 229 | $demerit += (N1 + ($this->runLength[$i] - 5)); |
| 230 | 230 | } |
| 231 | 231 | if ($i & 1) { |
| 232 | - if (($i >= 3) && ($i < ($length - 2)) && ($this->runLength[$i] % 3 == 0)) { |
|
| 233 | - $fact = (int) ($this->runLength[$i] / 3); |
|
| 234 | - if (($this->runLength[$i - 2] == $fact) && |
|
| 235 | - ($this->runLength[$i - 1] == $fact) && |
|
| 236 | - ($this->runLength[$i + 1] == $fact) && |
|
| 237 | - ($this->runLength[$i + 2] == $fact)) { |
|
| 238 | - if (($this->runLength[$i - 3] < 0) || ($this->runLength[$i - 3] >= (4 * $fact))) { |
|
| 232 | + if (($i>=3) && ($i<($length - 2)) && ($this->runLength[$i] % 3==0)) { |
|
| 233 | + $fact = (int)($this->runLength[$i] / 3); |
|
| 234 | + if (($this->runLength[$i - 2]==$fact) && |
|
| 235 | + ($this->runLength[$i - 1]==$fact) && |
|
| 236 | + ($this->runLength[$i + 1]==$fact) && |
|
| 237 | + ($this->runLength[$i + 2]==$fact)) { |
|
| 238 | + if (($this->runLength[$i - 3]<0) || ($this->runLength[$i - 3]>=(4 * $fact))) { |
|
| 239 | 239 | $demerit += N3; |
| 240 | - } elseif ((($i + 3) >= $length) || ($this->runLength[$i + 3] >= (4 * $fact))) { |
|
| 240 | + } elseif ((($i + 3)>=$length) || ($this->runLength[$i + 3]>=(4 * $fact))) { |
|
| 241 | 241 | $demerit += N3; |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -254,18 +254,18 @@ discard block |
||
| 254 | 254 | $head = 0; |
| 255 | 255 | $demerit = 0; |
| 256 | 256 | |
| 257 | - for ($y = 0; $y < $width; $y++) { |
|
| 257 | + for ($y = 0; $y<$width; $y++) { |
|
| 258 | 258 | $head = 0; |
| 259 | 259 | $this->runLength[0] = 1; |
| 260 | 260 | |
| 261 | 261 | $frameY = $frame[$y]; |
| 262 | 262 | |
| 263 | - if ($y > 0) { |
|
| 263 | + if ($y>0) { |
|
| 264 | 264 | $frameYM = $frame[$y - 1]; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - for ($x = 0; $x < $width; $x++) { |
|
| 268 | - if (($x > 0) && ($y > 0)) { |
|
| 267 | + for ($x = 0; $x<$width; $x++) { |
|
| 268 | + if (($x>0) && ($y>0)) { |
|
| 269 | 269 | $b22 = ord($frameY[$x]) & ord($frameY[$x - 1]) & ord($frameYM[$x]) & ord($frameYM[$x - 1]); |
| 270 | 270 | $w22 = ord($frameY[$x]) | ord($frameY[$x - 1]) | ord($frameYM[$x]) | ord($frameYM[$x - 1]); |
| 271 | 271 | |
@@ -273,11 +273,11 @@ discard block |
||
| 273 | 273 | $demerit += N2; |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | - if (($x == 0) && (ord($frameY[$x]) & 1)) { |
|
| 276 | + if (($x==0) && (ord($frameY[$x]) & 1)) { |
|
| 277 | 277 | $this->runLength[0] = -1; |
| 278 | 278 | $head = 1; |
| 279 | 279 | $this->runLength[$head] = 1; |
| 280 | - } elseif ($x > 0) { |
|
| 280 | + } elseif ($x>0) { |
|
| 281 | 281 | if ((ord($frameY[$x]) ^ ord($frameY[$x - 1])) & 1) { |
| 282 | 282 | $head++; |
| 283 | 283 | $this->runLength[$head] = 1; |
@@ -290,16 +290,16 @@ discard block |
||
| 290 | 290 | $demerit += $this->calcN1N3($head + 1); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - for ($x = 0; $x < $width; $x++) { |
|
| 293 | + for ($x = 0; $x<$width; $x++) { |
|
| 294 | 294 | $head = 0; |
| 295 | 295 | $this->runLength[0] = 1; |
| 296 | 296 | |
| 297 | - for ($y = 0; $y < $width; $y++) { |
|
| 298 | - if ($y == 0 && (ord($frame[$y][$x]) & 1)) { |
|
| 297 | + for ($y = 0; $y<$width; $y++) { |
|
| 298 | + if ($y==0 && (ord($frame[$y][$x]) & 1)) { |
|
| 299 | 299 | $this->runLength[0] = -1; |
| 300 | 300 | $head = 1; |
| 301 | 301 | $this->runLength[$head] = 1; |
| 302 | - } elseif ($y > 0) { |
|
| 302 | + } elseif ($y>0) { |
|
| 303 | 303 | if ((ord($frame[$y][$x]) ^ ord($frame[$y - 1][$x])) & 1) { |
| 304 | 304 | $head++; |
| 305 | 305 | $this->runLength[$head] = 1; |
@@ -324,9 +324,9 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | $checked_masks = [0, 1, 2, 3, 4, 5, 6, 7]; |
| 326 | 326 | |
| 327 | - if (QR_FIND_FROM_RANDOM !== false) { |
|
| 327 | + if (QR_FIND_FROM_RANDOM!==false) { |
|
| 328 | 328 | $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9); |
| 329 | - for ($i = 0; $i < $howManuOut; $i++) { |
|
| 329 | + for ($i = 0; $i<$howManuOut; $i++) { |
|
| 330 | 330 | $remPos = rand(0, count($checked_masks) - 1); |
| 331 | 331 | unset($checked_masks[$remPos]); |
| 332 | 332 | $checked_masks = array_values($checked_masks); |
@@ -342,11 +342,11 @@ discard block |
||
| 342 | 342 | $blacks = 0; |
| 343 | 343 | $blacks = $this->makeMaskNo($i, $width, $frame, $mask); |
| 344 | 344 | $blacks += $this->writeFormatInformation($width, $mask, $i, $level); |
| 345 | - $blacks = (int) (100 * $blacks / ($width * $width)); |
|
| 346 | - $demerit = (int) ((int) (abs($blacks - 50) / 5) * N4); |
|
| 345 | + $blacks = (int)(100 * $blacks / ($width * $width)); |
|
| 346 | + $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); |
|
| 347 | 347 | $demerit += $this->evaluateSymbol($width, $mask); |
| 348 | 348 | |
| 349 | - if ($demerit < $minDemerit) { |
|
| 349 | + if ($demerit<$minDemerit) { |
|
| 350 | 350 | $minDemerit = $demerit; |
| 351 | 351 | $bestMask = $mask; |
| 352 | 352 | $bestMaskNum = $i; |
@@ -51,6 +51,6 @@ |
||
| 51 | 51 | { |
| 52 | 52 | public static function set(&$srctab, $x, $y, $repl, $replLen = false) |
| 53 | 53 | { |
| 54 | - $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false) ? substr($repl, 0, $replLen) : $repl, $x, ($replLen !== false) ? $replLen : strlen($repl)); |
|
| 54 | + $srctab[$y] = substr_replace($srctab[$y], ($replLen!==false) ? substr($repl, 0, $replLen) : $repl, $x, ($replLen!==false) ? $replLen : strlen($repl)); |
|
| 55 | 55 | } |
| 56 | 56 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $id = $r['id_modul']; |
| 13 | 13 | $fa_icon = $r['fa_icon']; |
| 14 | 14 | |
| 15 | -if ($r[orientation] == 'P') { |
|
| 15 | +if ($r[orientation]=='P') { |
|
| 16 | 16 | $orientation = 'portrait'; |
| 17 | 17 | } else { |
| 18 | 18 | $orientation = 'landscape'; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | <!--<body onload="cetakspk()">--> |
| 141 | 141 | |
| 142 | -<?php if ($_GET['printto'] == '2') { |
|
| 142 | +<?php if ($_GET['printto']=='2') { |
|
| 143 | 143 | ?> |
| 144 | 144 | <body onload="icetak()"> |
| 145 | 145 | <?php |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | |
| 80 | 80 | if ($id) { |
| 81 | 81 | $query = mysql_query('SELECT * FROM general_setting WHERE id_general_setting = "'.$id.'"'); |
| 82 | - if ($query && mysql_num_rows($query) == 1) { |
|
| 82 | + if ($query && mysql_num_rows($query)==1) { |
|
| 83 | 83 | $data = mysql_fetch_object($query); |
| 84 | 84 | } else { |
| 85 | 85 | die('Data general_setting tidak ditemukan'); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $datetime = date('Y-m-d G:i:s', $hour); |
| 18 | 18 | $userid = $_SESSION['userid']; |
| 19 | 19 | |
| 20 | - if ($module == 'general_setting' and $act == 'input') { |
|
| 20 | + if ($module=='general_setting' and $act=='input') { |
|
| 21 | 21 | $id_module = $_POST['id_module']; |
| 22 | 22 | |
| 23 | 23 | $lokasi_file = $_FILES['fupload']['tmp_name']; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | if ($id) { |
| 46 | 46 | $query = mysql_query('SELECT * FROM poli WHERE id_poli = "'.$id.'"'); |
| 47 | - if ($query && mysql_num_rows($query) == 1) { |
|
| 47 | + if ($query && mysql_num_rows($query)==1) { |
|
| 48 | 48 | $data = mysql_fetch_object($query); |
| 49 | 49 | } else { |
| 50 | 50 | die('Data modul tidak ditemukan'); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | <?php if ($id) { |
| 82 | 82 | ?> |
| 83 | 83 | |
| 84 | - <?php if (@$data->aktif == 'Y') { |
|
| 84 | + <?php if (@$data->aktif=='Y') { |
|
| 85 | 85 | ?> |
| 86 | 86 | |
| 87 | 87 | <div class="form-group"> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $userid = $_SESSION['userid']; |
| 17 | 17 | |
| 18 | 18 | // Hapus modul |
| 19 | - if ($module == 'poli' and $act == 'hapus') { |
|
| 19 | + if ($module=='poli' and $act=='hapus') { |
|
| 20 | 20 | $id = $_GET['id']; |
| 21 | 21 | $id_module = $_GET['id_module']; |
| 22 | 22 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Input group |
| 36 | - elseif ($module == 'poli' and $act == 'input') { |
|
| 36 | + elseif ($module=='poli' and $act=='input') { |
|
| 37 | 37 | $id_module = $_POST['id_module']; |
| 38 | 38 | |
| 39 | 39 | if ($_POST['ID']) { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $userid = $_SESSION['userid']; |
| 17 | 17 | |
| 18 | 18 | // Hapus modul |
| 19 | - if ($module == 'kategori' and $act == 'hapus') { |
|
| 19 | + if ($module=='kategori' and $act=='hapus') { |
|
| 20 | 20 | $id = $_GET['id']; |
| 21 | 21 | $id_module = $_GET['id_module']; |
| 22 | 22 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Input group |
| 36 | - elseif ($module == 'kategori' and $act == 'input') { |
|
| 36 | + elseif ($module=='kategori' and $act=='input') { |
|
| 37 | 37 | $id_module = $_POST['id_module']; |
| 38 | 38 | |
| 39 | 39 | if ($_POST['ID']) { |