@@ -674,16 +674,13 @@ |
||
674 | 674 | if ($this->mailtype == 'html' && count($this->_attach_name) == 0) |
675 | 675 | { |
676 | 676 | return 'html'; |
677 | - } |
|
678 | - elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) |
|
677 | + } elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) |
|
679 | 678 | { |
680 | 679 | return 'html-attach'; |
681 | - } |
|
682 | - elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) |
|
680 | + } elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) |
|
683 | 681 | { |
684 | 682 | return 'plain-attach'; |
685 | - } |
|
686 | - else |
|
683 | + } else |
|
687 | 684 | { |
688 | 685 | return 'plain'; |
689 | 686 | } |
@@ -640,13 +640,13 @@ discard block |
||
640 | 640 | // Users can use any native PHP function call that has one param. |
641 | 641 | if (function_exists($rule)) |
642 | 642 | { |
643 | - $str=null; |
|
644 | - if(is_array($postdata)){ |
|
645 | - foreach($postdata as $key=>$value){ |
|
646 | - $str.=$value.","; |
|
643 | + $str = null; |
|
644 | + if (is_array($postdata)) { |
|
645 | + foreach ($postdata as $key=>$value) { |
|
646 | + $str .= $value.","; |
|
647 | 647 | } |
648 | - $str=rtrim($str,','); |
|
649 | - $postdata=$str; |
|
648 | + $str = rtrim($str, ','); |
|
649 | + $postdata = $str; |
|
650 | 650 | } |
651 | 651 | $result = $rule($postdata); |
652 | 652 | |
@@ -974,20 +974,20 @@ discard block |
||
974 | 974 | */ |
975 | 975 | public function is_unique($str, $field) |
976 | 976 | { |
977 | - $id=''; |
|
978 | - $data =explode('.', $field); |
|
979 | - $table=$data[0]; |
|
980 | - $field=$data[1]; |
|
981 | - if(isset($data[2])) |
|
982 | - $id=$data[2]; |
|
983 | - $where=array($field => $str); |
|
984 | - if($id != ''){ |
|
985 | - $where['id !=']=$id; |
|
977 | + $id = ''; |
|
978 | + $data = explode('.', $field); |
|
979 | + $table = $data[0]; |
|
980 | + $field = $data[1]; |
|
981 | + if (isset($data[2])) |
|
982 | + $id = $data[2]; |
|
983 | + $where = array($field => $str); |
|
984 | + if ($id != '') { |
|
985 | + $where['id !='] = $id; |
|
986 | 986 | } |
987 | - if($table == 'accounts'){ |
|
988 | - $where['deleted']=0; |
|
987 | + if ($table == 'accounts') { |
|
988 | + $where['deleted'] = 0; |
|
989 | 989 | } |
990 | - $query = $this->CI->db->limit(1)->get_where($table,$where ); |
|
990 | + $query = $this->CI->db->limit(1)->get_where($table, $where); |
|
991 | 991 | return $query->num_rows() > 0 ? FALSE : TRUE; |
992 | 992 | } |
993 | 993 | |
@@ -1421,54 +1421,54 @@ discard block |
||
1421 | 1421 | { |
1422 | 1422 | return ( ! preg_match("/^([.a-z0-9])+$/i", $str)) ? FALSE : TRUE; |
1423 | 1423 | } |
1424 | - public function valid_decimal($str){ |
|
1425 | - return (bool) preg_match('#^\d+(?:\.\d{1,5})?$#', $str); |
|
1424 | + public function valid_decimal($str) { |
|
1425 | + return (bool)preg_match('#^\d+(?:\.\d{1,5})?$#', $str); |
|
1426 | 1426 | } |
1427 | 1427 | public function alpha_numeric_space($str) |
1428 | 1428 | { |
1429 | 1429 | return ( ! preg_match("/^[A-Za-z0-9\s]+$/", $str)) ? FALSE : TRUE; |
1430 | 1430 | } |
1431 | - public function alpha_space($str){ |
|
1431 | + public function alpha_space($str) { |
|
1432 | 1432 | return ( ! preg_match("/^[A-Za-z\s]+$/", $str)) ? FALSE : TRUE; |
1433 | 1433 | // return ( ! preg_match("/^([-a-z0-9_-\s])+$/i", $str)) ? FALSE : TRUE; |
1434 | 1434 | } |
1435 | - public function currency_decimal($str){ |
|
1436 | - return (bool) preg_match('#^\d{0,5}+(?:\.\d{1,5})?$#', $str); |
|
1435 | + public function currency_decimal($str) { |
|
1436 | + return (bool)preg_match('#^\d{0,5}+(?:\.\d{1,5})?$#', $str); |
|
1437 | 1437 | // test(num) |
1438 | 1438 | } |
1439 | 1439 | /* ASTPP 3.0 |
1440 | 1440 | * For Old Password checking |
1441 | 1441 | */ |
1442 | - public function password_check($str,$table){ |
|
1442 | + public function password_check($str, $table) { |
|
1443 | 1443 | $this->CI->db->select('password'); |
1444 | - $this->CI->db->where('id',$_POST['id']); |
|
1445 | - $result=$this->CI->db->get($table); |
|
1446 | - if($result->num_rows() > 0 ){ |
|
1447 | - $result=(array)$result->first_row(); |
|
1448 | - $password=$this->CI->common->decode($result['password']); |
|
1449 | - if($password && $password == $str){ |
|
1444 | + $this->CI->db->where('id', $_POST['id']); |
|
1445 | + $result = $this->CI->db->get($table); |
|
1446 | + if ($result->num_rows() > 0) { |
|
1447 | + $result = (array)$result->first_row(); |
|
1448 | + $password = $this->CI->common->decode($result['password']); |
|
1449 | + if ($password && $password == $str) { |
|
1450 | 1450 | return true; |
1451 | - }else{ |
|
1451 | + } else { |
|
1452 | 1452 | return false; |
1453 | 1453 | } |
1454 | - }else{ |
|
1454 | + } else { |
|
1455 | 1455 | return false; |
1456 | 1456 | } |
1457 | 1457 | } |
1458 | - public function did_account_checking($str){ |
|
1459 | - $post_array=$this->CI->input->post(); |
|
1460 | - if($str > 0){ |
|
1461 | - $this->CI->db->where("id",$str); |
|
1458 | + public function did_account_checking($str) { |
|
1459 | + $post_array = $this->CI->input->post(); |
|
1460 | + if ($str > 0) { |
|
1461 | + $this->CI->db->where("id", $str); |
|
1462 | 1462 | $this->CI->db->select('posttoexternal,balance,credit_limit'); |
1463 | - $acc_result=$this->CI->db->get('accounts'); |
|
1464 | - $customer_info=(array)$acc_result->first_row(); |
|
1463 | + $acc_result = $this->CI->db->get('accounts'); |
|
1464 | + $customer_info = (array)$acc_result->first_row(); |
|
1465 | 1465 | $available_bal = ($customer_info["balance"]) + $customer_info["posttoexternal"] * ($customer_info["credit_limit"]); |
1466 | - if($available_bal >= $post_array['setup']){ |
|
1466 | + if ($available_bal >= $post_array['setup']) { |
|
1467 | 1467 | return TRUE; |
1468 | - }else{ |
|
1468 | + } else { |
|
1469 | 1469 | return FALSE; |
1470 | 1470 | } |
1471 | - }else{ |
|
1471 | + } else { |
|
1472 | 1472 | return TRUE; |
1473 | 1473 | } |
1474 | 1474 | } |
@@ -412,13 +412,11 @@ discard block |
||
412 | 412 | if (isset($array[$keys[$i]])) |
413 | 413 | { |
414 | 414 | $array = $this->_reduce_array($array[$keys[$i]], $keys, ($i + 1)); |
415 | - } |
|
416 | - else |
|
415 | + } else |
|
417 | 416 | { |
418 | 417 | return NULL; |
419 | 418 | } |
420 | - } |
|
421 | - else |
|
419 | + } else |
|
422 | 420 | { |
423 | 421 | return $array; |
424 | 422 | } |
@@ -456,8 +454,7 @@ discard block |
||
456 | 454 | if (count($row['keys']) == 1) |
457 | 455 | { |
458 | 456 | $post_ref = & $post_ref[current($row['keys'])]; |
459 | - } |
|
460 | - else |
|
457 | + } else |
|
461 | 458 | { |
462 | 459 | foreach ($row['keys'] as $val) |
463 | 460 | { |
@@ -978,8 +975,9 @@ discard block |
||
978 | 975 | $data =explode('.', $field); |
979 | 976 | $table=$data[0]; |
980 | 977 | $field=$data[1]; |
981 | - if(isset($data[2])) |
|
982 | - $id=$data[2]; |
|
978 | + if(isset($data[2])) { |
|
979 | + $id=$data[2]; |
|
980 | + } |
|
983 | 981 | $where=array($field => $str); |
984 | 982 | if($id != ''){ |
985 | 983 | $where['id !=']=$id; |
@@ -1448,10 +1446,10 @@ discard block |
||
1448 | 1446 | $password=$this->CI->common->decode($result['password']); |
1449 | 1447 | if($password && $password == $str){ |
1450 | 1448 | return true; |
1451 | - }else{ |
|
1449 | + } else{ |
|
1452 | 1450 | return false; |
1453 | 1451 | } |
1454 | - }else{ |
|
1452 | + } else{ |
|
1455 | 1453 | return false; |
1456 | 1454 | } |
1457 | 1455 | } |
@@ -1465,10 +1463,10 @@ discard block |
||
1465 | 1463 | $available_bal = ($customer_info["balance"]) + $customer_info["posttoexternal"] * ($customer_info["credit_limit"]); |
1466 | 1464 | if($available_bal >= $post_array['setup']){ |
1467 | 1465 | return TRUE; |
1468 | - }else{ |
|
1466 | + } else{ |
|
1469 | 1467 | return FALSE; |
1470 | 1468 | } |
1471 | - }else{ |
|
1469 | + } else{ |
|
1472 | 1470 | return TRUE; |
1473 | 1471 | } |
1474 | 1472 | } |
@@ -307,14 +307,12 @@ discard block |
||
307 | 307 | { |
308 | 308 | return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); |
309 | 309 | } |
310 | - } |
|
311 | - else |
|
310 | + } else |
|
312 | 311 | { |
313 | 312 | if ($objectCall && ! is_callable(array($method_parts['0'], $method_parts['1']))) |
314 | 313 | { |
315 | 314 | return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); |
316 | - } |
|
317 | - elseif ( ! $objectCall && ! is_callable($this->methods[$methName]['function'])) |
|
315 | + } elseif ( ! $objectCall && ! is_callable($this->methods[$methName]['function'])) |
|
318 | 316 | { |
319 | 317 | return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); |
320 | 318 | } |
@@ -362,22 +360,19 @@ discard block |
||
362 | 360 | if ($method_parts[0] == "this" && $system_call == TRUE) |
363 | 361 | { |
364 | 362 | return call_user_func(array($this, $method_parts[1]), $m); |
365 | - } |
|
366 | - else |
|
363 | + } else |
|
367 | 364 | { |
368 | 365 | if ($this->object === FALSE) |
369 | 366 | { |
370 | 367 | $CI = & get_instance(); |
371 | 368 | return $CI->$method_parts['1']($m); |
372 | - } |
|
373 | - else |
|
369 | + } else |
|
374 | 370 | { |
375 | 371 | return $this->object->$method_parts['1']($m); |
376 | 372 | //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); |
377 | 373 | } |
378 | 374 | } |
379 | - } |
|
380 | - else |
|
375 | + } else |
|
381 | 376 | { |
382 | 377 | return call_user_func($this->methods[$methName]['function'], $m); |
383 | 378 | } |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier-BoldOblique'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier-Bold'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier-Oblique'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -407,8 +407,7 @@ discard block |
||
407 | 407 | { |
408 | 408 | $this->width = $this->orig_height; |
409 | 409 | $this->height = $this->orig_width; |
410 | - } |
|
411 | - else |
|
410 | + } else |
|
412 | 411 | { |
413 | 412 | $this->width = $this->orig_width; |
414 | 413 | $this->height = $this->orig_height; |
@@ -502,8 +501,7 @@ discard block |
||
502 | 501 | { |
503 | 502 | $create = 'imagecreatetruecolor'; |
504 | 503 | $copy = 'imagecopyresampled'; |
505 | - } |
|
506 | - else |
|
504 | + } else |
|
507 | 505 | { |
508 | 506 | $create = 'imagecreate'; |
509 | 507 | $copy = 'imagecopyresized'; |
@@ -1010,25 +1008,27 @@ discard block |
||
1010 | 1008 | // invert the offset. Note: The horizontal |
1011 | 1009 | // offset flips itself automatically |
1012 | 1010 | |
1013 | - if ($this->wm_vrt_alignment == 'B') |
|
1014 | - $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
1011 | + if ($this->wm_vrt_alignment == 'B') { |
|
1012 | + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
1013 | + } |
|
1015 | 1014 | |
1016 | - if ($this->wm_hor_alignment == 'R') |
|
1017 | - $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
1015 | + if ($this->wm_hor_alignment == 'R') { |
|
1016 | + $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
1017 | + } |
|
1018 | 1018 | |
1019 | 1019 | // Set font width and height |
1020 | 1020 | // These are calculated differently depending on |
1021 | 1021 | // whether we are using the true type font or not |
1022 | 1022 | if ($this->wm_use_truetype == TRUE) |
1023 | 1023 | { |
1024 | - if ($this->wm_font_size == '') |
|
1025 | - $this->wm_font_size = '17'; |
|
1024 | + if ($this->wm_font_size == '') { |
|
1025 | + $this->wm_font_size = '17'; |
|
1026 | + } |
|
1026 | 1027 | |
1027 | 1028 | $fontwidth = $this->wm_font_size - ($this->wm_font_size / 4); |
1028 | 1029 | $fontheight = $this->wm_font_size; |
1029 | 1030 | $this->wm_vrt_offset += $this->wm_font_size; |
1030 | - } |
|
1031 | - else |
|
1031 | + } else |
|
1032 | 1032 | { |
1033 | 1033 | $fontwidth = imagefontwidth($this->wm_font_size); |
1034 | 1034 | $fontheight = imagefontheight($this->wm_font_size); |
@@ -1065,13 +1065,15 @@ discard block |
||
1065 | 1065 | case "L": |
1066 | 1066 | break; |
1067 | 1067 | case "R": |
1068 | - if ($this->wm_use_drop_shadow) |
|
1069 | - $x_shad += ($this->orig_width - $fontwidth * strlen($this->wm_text)); |
|
1068 | + if ($this->wm_use_drop_shadow) { |
|
1069 | + $x_shad += ($this->orig_width - $fontwidth * strlen($this->wm_text)); |
|
1070 | + } |
|
1070 | 1071 | $x_axis += ($this->orig_width - $fontwidth * strlen($this->wm_text)); |
1071 | 1072 | break; |
1072 | 1073 | case "C": |
1073 | - if ($this->wm_use_drop_shadow) |
|
1074 | - $x_shad += floor(($this->orig_width - $fontwidth * strlen($this->wm_text)) / 2); |
|
1074 | + if ($this->wm_use_drop_shadow) { |
|
1075 | + $x_shad += floor(($this->orig_width - $fontwidth * strlen($this->wm_text)) / 2); |
|
1076 | + } |
|
1075 | 1077 | $x_axis += floor(($this->orig_width - $fontwidth * strlen($this->wm_text)) / 2); |
1076 | 1078 | break; |
1077 | 1079 | } |
@@ -1400,8 +1402,7 @@ discard block |
||
1400 | 1402 | if ($vals['new_width'] == 0) |
1401 | 1403 | { |
1402 | 1404 | $vals['new_width'] = ceil($vals['width'] * $vals['new_height'] / $vals['height']); |
1403 | - } |
|
1404 | - elseif ($vals['new_height'] == 0) |
|
1405 | + } elseif ($vals['new_height'] == 0) |
|
1405 | 1406 | { |
1406 | 1407 | $vals['new_height'] = ceil($vals['new_width'] * $vals['height'] / $vals['width']); |
1407 | 1408 | } |
@@ -369,8 +369,7 @@ |
||
369 | 369 | |
370 | 370 | $tb_array = explode('=', $tb_end); |
371 | 371 | $tb_id = $tb_array[count($tb_array) - 1]; |
372 | - } |
|
373 | - else |
|
372 | + } else |
|
374 | 373 | { |
375 | 374 | $url = rtrim($url, '/'); |
376 | 375 |