public static function addView($servid, $field, $table) { if (UserLogged::isLogged()) { if (self::checkView($servid, $field, $table) == true) { $con = Database::getCon(); $tim = time(); $sql = "insert into {$table} (user_id, {$field},realip,created_at) value (" . Session::getUID() . ",{$servid},\"" . IpLogger::getRealIP() . "\",{$tim})"; if ($con->query($sql)) { return true; } else { return false; } } } else { if (self::checkView($servid, $field, $table) == true) { $con = Database::getCon(); $tim = time(); $sql = "insert into {$table} ({$field},realip,created_at) value ({$servid},\"" . IpLogger::getRealIP() . "\",{$tim})"; if ($con->query($sql)) { return true; } else { return false; } } } }
public static function addIP() { if (UserLogged::isLogged()) { if (!self::verifyIP()) { $con = Database::getCon(); $sql = "insert into iplog (user_id,realip,created_at) value(" . Session::getUID() . ",\"" . self::getRealIP() . "\"," . time() . ")"; $con->query($sql); return $con->insert_id; } } else { return false; } }