Browse files

Merge pull request #266 from Ponyboy47/master

Fixed issues with last_ip in client tables
  • Loading branch information...
2 parents 4876c8b + 63bfcce commit ba044dd28664a0817a72d0b33bfff027489b8f37 @Ponyboy47 Ponyboy47 committed Apr 17, 2012
Showing with 40 additions and 40 deletions.
  1. +40 −40 WebInterface/inc/Client.class.php
View
80 WebInterface/inc/Client.class.php
@@ -91,52 +91,52 @@ public function getTotalRecordCount() {
}
public function getClients($count, $startRecord) {
- $query = mysql_query("SELECT * FROM clients ORDER BY id ASC LIMIT " . mysql_real_escape_string($startRecord) . "," . mysql_real_escape_string($count));
- if($query) {
- if(mysql_num_rows($query) == 0) {
- return false;
- }
- else {
- $return = array();
- $deviceArray = array();
- while($data = mysql_fetch_assoc($query)) {
- $query1 = mysql_query("SELECT device_type, last_login, last_ip FROM assistants WHERE client_apple_account_id = '" . $data['apple_account_id'] . "' AND date_created > NOW() - INTERVAL 8 DAY GROUP BY client_apple_account_id");
+ $query = mysql_query("SELECT * FROM clients ORDER BY id ASC LIMIT " . mysql_real_escape_string($startRecord) . "," . mysql_real_escape_string($count));
+ if($query) {
+ if(mysql_num_rows($query) == 0) {
+ return false;
+ }
+ else {
+ $return = array();
+ $deviceArray = array();
+ while($data = mysql_fetch_assoc($query)) {
+ $query1 = mysql_query("SELECT device_type, last_login, last_ip FROM assistants WHERE client_apple_account_id = '" . $data['apple_account_id'] . "'");
while($data1 = mysql_fetch_assoc($query1)) {
$deviceArray = $data1;
}
- $return[] = $data + $deviceArray;
- }
- return $return;
- }
- }
- else {
- return false;
- }
- }
+ $return[] = $data + $deviceArray;
+ }
+ return $return;
+ }
+ }
+ else {
+ return false;
+ }
+ }
- public function getClientsLike($like) {
- $query = mysql_query("SELECT * FROM clients WHERE nickname LIKE '%" . mysql_real_escape_string($like) .
- "%' OR fname LIKE '%" . mysql_real_escape_string($like) . "%' ORDER BY id ASC");
- if($query) {
- if(mysql_num_rows($query) == 0) {
- return false;
- }
- else {
- $return = array();
- $deviceArray = array();
- while($data = mysql_fetch_assoc($query)) {
- $query1 = mysql_query("SELECT device_type, last_login, last_ip FROM assistants WHERE client_apple_account_id = '" . $data['apple_account_id'] . "' AND date_created > NOW() - INTERVAL 8 DAY GROUP BY client_apple_account_id");
+ public function getClientsLike($like) {
+ $query = mysql_query("SELECT * FROM clients WHERE nickname LIKE '%" . mysql_real_escape_string($like) .
+ "%' OR fname LIKE '%" . mysql_real_escape_string($like) . "%' ORDER BY id ASC");
+ if($query) {
+ if(mysql_num_rows($query) == 0) {
+ return false;
+ }
+ else {
+ $return = array();
+ $deviceArray = array();
+ while($data = mysql_fetch_assoc($query)) {
+ $query1 = mysql_query("SELECT device_type, last_login, last_ip FROM assistants WHERE client_apple_account_id = '" . $data['apple_account_id'] . "'");
while($data1 = mysql_fetch_assoc($query1)) {
$deviceArray = $data1;
}
- $return[] = $data + $deviceArray;
- }
- return $return;
- }
- }
- else {
- return false;
- }
- }
+ $return[] = $data + $deviceArray;
+ }
+ return $return;
+ }
+ }
+ else {
+ return false;
+ }
+ }
}
?>

0 comments on commit ba044dd

Please sign in to comment.