Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
tbfguestbe.tbf.ro
/
app
/
Helpers
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
general.php
| Size :
4.71
KB
Copy
<?php use Illuminate\Support\Facades\DB; function interpret(string $text, array $replacements) { $result = $text; foreach ($replacements as $key => $value) { $result = str_replace("$"."$key", $value, $result); } return $result; } function removeSpecialCharacters(string $text) { $pattern = '/""|[`\n\r\t]/'; $string = preg_replace($pattern, '', $text); return $string; } /** * Combines SQL and its bindings * * @param \Eloquent $query * @return string */ function getEloquentSqlWithBindings($query) { return vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function ($binding) { return is_numeric($binding) ? $binding : "'{$binding}'"; })->toArray()); } function isEmoji($string) { $emojiRegex = '/[\x{1F600}-\x{1F64F}\x{1F300}-\x{1F5FF}\x{1F680}-\x{1F6FF}\x{1F700}-\x{1F77F}\x{1F780}-\x{1F7FF}\x{1F800}-\x{1F8FF}\x{1F900}-\x{1F9FF}\x{1FA00}-\x{1FA6F}\x{1FA70}-\x{1FAFF}\x{1FAB0}-\x{1FABF}\x{1FAC0}-\x{1FAFF}\x{1FAD0}-\x{1FAD6}\x{1FAD7}\x{1FAD8}\x{1FAD9}\x{1FADA}\x{1FADB}\x{1FADC}\x{1FADD}\x{1FADE}\x{1FADF}\x{1FAE0}-\x{1FAFF}\x{1F004}\x{1F0CF}\x{1F18E}\x{1F191}-\x{1F19A}\x{1F1E6}-\x{1F1FF}\x{2B05}-\x{2B07}\x{2934}\x{2935}\x{25AA}\x{25AB}\x{25FE}\x{25FD}\x{231A}\x{231B}\x{23E9}\x{23EA}\x{23EB}\x{23EC}\x{23F0}\x{23F3}\x{2B50}\x{26BD}\x{1F004}\x{1F0CF}\x{1F18E}\x{1F191}-\x{1F19A}\x{1F1E6}-\x{1F1FF}\x{1F201}-\x{1F251}\x{1F004}\x{1F0CF}\x{1F18E}\x{1F191}-\x{1F19A}\x{1F1E6}-\x{1F1FF}\x{2700}-\x{27BF}\x{1F600}-\x{1F64F}\x{1F300}-\x{1F5FF}\x{1F680}-\x{1F6FF}\x{1F700}-\x{1F77F}\x{1F780}-\x{1F7FF}\x{1F800}-\x{1F8FF}\x{1F900}-\x{1F9FF}\x{1FA00}-\x{1FA6F}\x{1FA70}-\x{1FAFF}\x{1FAB0}-\x{1FABF}\x{1FAC0}-\x{1FAFF}\x{1FAD0}-\x{1FAD6}\x{1FAD7}\x{1FAD8}\x{1FAD9}\x{1FADA}\x{1FADB}\x{1FADC}\x{1FADD}\x{1FADE}\x{1FADF}\x{1FAE0}-\x{1FAFF}\x{1F004}\x{1F0CF}\x{1F18E}\x{1F191}-\x{1F19A}\x{1F1E6}-\x{1F1FF}\x{2B05}-\x{2B07}\x{2934}\x{2935}\x{25AA}\x{25AB}\x{25FE}\x{25FD}\x{231A}\x{231B}\x{23E9}\x{23EA}\x{23EB}\x{23EC}\x{23F0}\x{23F3}\x{2B50}]+$/u'; return preg_match($emojiRegex, $string); } function uploadFile($file, $fieldName, $directory, $instance, $prefix) { $file = $file; $extension = $file->getClientOriginalExtension(); $filename = $instance->id . '_' . time() . $prefix . '.' . $extension; $file->storeAs('public/' . $directory, $filename); return config('app.url').'/storage/' . $directory . '/' . $filename; } function hexToRgb($hex) { // Elimină # dacă există $hex = ltrim($hex, '#'); // Parsează și întoarce valori RGB $rgb = [ 'r' => mapRGB(hexdec(substr($hex, 0, 2)), 0, 255, 0, 1), 'g' => mapRGB(hexdec(substr($hex, 2, 2)), 0, 255, 0, 1), 'b' => mapRGB(hexdec(substr($hex, 4, 2)), 0, 255, 0, 1) ]; return $rgb; } function mapRGB($value, $fromLow, $fromHigh, $toLow, $toHigh) { $fromRange = $fromHigh - $fromLow; $toRange = $toHigh - $toLow; $scaleFactor = $toRange / $fromRange; // Re-zero the value within the from range $tmpValue = $value - $fromLow; // Rescale the value to the to range $tmpValue *= $scaleFactor; // Re-zero back to the to range return $tmpValue + $toLow; } function sendSmsToClient($phone, $body, $accessToken){ $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://connect.routee.net/sms", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"body\": \"".$body."\",\"to\" : \"".$phone."\",\"from\": \"0758577968\"}", CURLOPT_HTTPHEADER => array( "authorization: Bearer ".$accessToken, "content-type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); return $response; } function accessTokenSms() { //string before encoding $string = config('app.routee_app_id').':'.config('app.routee_app_secret'); //string after encode $stringEncode = base64_encode($string); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://auth.routee.net/oauth/token", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "grant_type=client_credentials", CURLOPT_HTTPHEADER => array( "authorization: Basic ".$stringEncode, "content-type: application/x-www-form-urlencoded" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); return $response; }
Back