@@ -28,8 +28,9 @@ |
||
| 28 | 28 | function get_configurations($db) { |
| 29 | 29 | $query = "SELECT * FROM system WHERE group_title IN ('global','opensips')"; |
| 30 | 30 | $res_conf = $db->run($query); |
| 31 | - foreach ($res_conf as $res_conf_key => $res_conf_value) |
|
| 32 | - $this->config[$res_conf_value['name']] = $res_conf_value['value']; |
|
| 31 | + foreach ($res_conf as $res_conf_key => $res_conf_value) { |
|
| 32 | + $this->config[$res_conf_value['name']] = $res_conf_value['value']; |
|
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | return $this->config; |
| 35 | 36 | } |
@@ -52,10 +52,11 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function cleanup($bind) { |
| 54 | 54 | if ( ! is_array($bind)) { |
| 55 | - if ( ! empty($bind)) |
|
| 56 | - $bind = array($bind); |
|
| 57 | - else |
|
| 58 | - $bind = array(); |
|
| 55 | + if ( ! empty($bind)) { |
|
| 56 | + $bind = array($bind); |
|
| 57 | + } else { |
|
| 58 | + $bind = array(); |
|
| 59 | + } |
|
| 59 | 60 | } |
| 60 | 61 | return $bind; |
| 61 | 62 | } |
@@ -68,10 +69,11 @@ discard block |
||
| 68 | 69 | try { |
| 69 | 70 | $pdostmt = $this->prepare($this->sql); |
| 70 | 71 | if ($pdostmt->execute($this->bind) !== false) { |
| 71 | - if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql)) |
|
| 72 | - return $pdostmt->fetchAll(PDO::FETCH_ASSOC); |
|
| 73 | - elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql)) |
|
| 74 | - return $pdostmt->rowCount(); |
|
| 72 | + if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql)) { |
|
| 73 | + return $pdostmt->fetchAll(PDO::FETCH_ASSOC); |
|
| 74 | + } elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql)) { |
|
| 75 | + return $pdostmt->rowCount(); |
|
| 76 | + } |
|
| 75 | 77 | } |
| 76 | 78 | } catch (PDOException $e) { |
| 77 | 79 | $this->error = $e->getMessage(); |
@@ -154,8 +154,9 @@ |
||
| 154 | 154 | |
| 155 | 155 | $sp_gw_settings = json_decode($sp_gw_value['gateway_data'], true); |
| 156 | 156 | foreach ($sp_gw_settings as $sp_gw_settings_key => $sp_gw_settings_value) { |
| 157 | - if ($sp_gw_settings_value != "") |
|
| 158 | - $xml .= " <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n"; |
|
| 157 | + if ($sp_gw_settings_value != "") { |
|
| 158 | + $xml .= " <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n"; |
|
| 159 | + } |
|
| 159 | 160 | } |
| 160 | 161 | $xml .= " </gateway>\n"; |
| 161 | 162 | } |
@@ -29,22 +29,25 @@ |
||
| 29 | 29 | function logger($lib) { |
| 30 | 30 | $this->config = $lib->config; |
| 31 | 31 | $this->config['log_path'] = "/var/log/astpp/"; |
| 32 | - if ($this->config['debug'] == '0') |
|
| 33 | - $this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a'); |
|
| 32 | + if ($this->config['debug'] == '0') { |
|
| 33 | + $this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a'); |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | function log($log) { |
| 37 | 38 | if ($this->config['debug'] == '0') { |
| 38 | - if (is_array($log)) |
|
| 39 | - fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE)); |
|
| 40 | - else |
|
| 41 | - fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n"); |
|
| 39 | + if (is_array($log)) { |
|
| 40 | + fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE)); |
|
| 41 | + } else { |
|
| 42 | + fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n"); |
|
| 43 | + } |
|
| 42 | 44 | } |
| 43 | 45 | } |
| 44 | 46 | |
| 45 | 47 | function close() { |
| 46 | - if ($this->config['debug'] == '0') |
|
| 47 | - fclose($this->fp); |
|
| 48 | + if ($this->config['debug'] == '0') { |
|
| 49 | + fclose($this->fp); |
|
| 50 | + } |
|
| 48 | 51 | } |
| 49 | 52 | |
| 50 | 53 | } |
@@ -28,10 +28,11 @@ |
||
| 28 | 28 | |
| 29 | 29 | if (isset($_REQUEST['user']) && isset($_REQUEST['domain'])) { |
| 30 | 30 | $xml = load_directory($logger, $db); |
| 31 | - if ($xml == "") |
|
| 32 | - xml_not_found(); |
|
| 31 | + if ($xml == "") { |
|
| 32 | + xml_not_found(); |
|
| 33 | + } |
|
| 33 | 34 | echo $xml; |
| 34 | -}else { |
|
| 35 | +} else { |
|
| 35 | 36 | xml_not_found(); |
| 36 | 37 | } |
| 37 | 38 | $logger->log("*************************** Directory Ends **********************************"); |
@@ -119,7 +119,8 @@ discard block |
||
| 119 | 119 | <div style="width:550px;"><label style="text-align:right;" class="col-md-3">Status </label> |
| 120 | 120 | <select name="sipstatus" class="col-md-5 form-control selectpicker" data-live-search='true'> |
| 121 | 121 | |
| 122 | - <option value="0" <?if ($status == 0)echo 'selected=selected;'?>>Active</option> |
|
| 122 | + <option value="0" <?if ($status == 0) { |
|
| 123 | + echo 'selected=selected;'?>>Active</option> |
|
| 123 | 124 | <option value="1" <?if ($status == 1)echo 'selected=selected;'?>>Inactive</option> |
| 124 | 125 | </select> |
| 125 | 126 | </div> |
@@ -146,7 +147,8 @@ discard block |
||
| 146 | 147 | <div class="container"> |
| 147 | 148 | <div class="row"> |
| 148 | 149 | <div class="portlet-content" id="search_bar" style="cursor:pointer; display:none"> |
| 149 | - <?php echo $form_search; |
|
| 150 | + <?php echo $form_search; |
|
| 151 | +} |
|
| 150 | 152 | |
| 151 | 153 | ?> |
| 152 | 154 | </div> |
@@ -194,7 +196,7 @@ discard block |
||
| 194 | 196 | if($params_name!='') |
| 195 | 197 | {
|
| 196 | 198 | $type="edit_setting"; |
| 197 | - }else{
|
|
| 199 | + } else{
|
|
| 198 | 200 | $type="add_setting"; |
| 199 | 201 | } |
| 200 | 202 | ?> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Log In | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Log In | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 57 | 57 | <?php if (isset($astpp_notification)){ ?> |
| 58 | 58 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 59 | - <?php }else{ |
|
| 59 | + <?php } else{ |
|
| 60 | 60 | echo " "; |
| 61 | 61 | } ?> |
| 62 | 62 | </span></div> <br/> |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | <?php |
| 73 | 73 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 74 | 74 | $logo = $this->session->userdata['user_logo']; |
| 75 | - }else{ |
|
| 75 | + } else{ |
|
| 76 | 76 | $logo = 'logo.png'; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | <span class="login_error"> |
| 60 | 60 | <?php if (isset($astpp_notification)){ ?> |
| 61 | 61 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 62 | - <?php }else{ |
|
| 62 | + <?php } else{ |
|
| 63 | 63 | echo " "; |
| 64 | 64 | } ?> |
| 65 | 65 | </span> |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | <?php |
| 78 | 78 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 79 | 79 | $logo = $this->session->userdata['user_logo']; |
| 80 | - }else{ |
|
| 80 | + } else{ |
|
| 81 | 81 | $logo = 'logo.png'; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -104,10 +104,18 @@ discard block |
||
| 104 | 104 | <div class="input-group col-md-12 margin-t-15 padding-r-32 padding-l-32"> |
| 105 | 105 | <span class="input-group-addon"><i class="fa fa-envelope"></i></span> |
| 106 | 106 | |
| 107 | - <input type="text" class="form-control" id="email" name="email" placeholder="User Name OR Email" value = "<?php if (isset($value['email'])) echo $value['email']; else ''; ?>" style="height:40px;"> |
|
| 107 | + <input type="text" class="form-control" id="email" name="email" placeholder="User Name OR Email" value = "<?php if (isset($value['email'])) { |
|
| 108 | + echo $value['email']; |
|
| 109 | +} else { |
|
| 110 | + ''; |
|
| 111 | +} |
|
| 112 | +?>" style="height:40px;"> |
|
| 108 | 113 | </div> |
| 109 | 114 | |
| 110 | - <?php if (isset($error['email'])) echo $error['email']; ?> |
|
| 115 | + <?php if (isset($error['email'])) { |
|
| 116 | + echo $error['email']; |
|
| 117 | +} |
|
| 118 | +?> |
|
| 111 | 119 | <div style="width: 97.67%; float: left;text-align: left; margin: 2% 22%;"> |
| 112 | 120 | <span id="e_name" style="color:red;"> </span> |
| 113 | 121 | </div> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | <?php |
| 74 | 74 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 75 | 75 | $logo = $this->session->userdata['user_logo']; |
| 76 | - }else{ |
|
| 76 | + } else{ |
|
| 77 | 77 | $logo = 'logo.png'; |
| 78 | 78 | } |
| 79 | 79 | |