!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/multirest.picotech.app/public_html/app/Http/Controllers/   drwxr-xr-x
Free 28.54 GB of 117.98 GB (24.19%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     QrMakerController.php (5.14 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers;

use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Storage;
use 
SimpleSoftwareIO\QrCode\Facades\QrCode;

class 
QrMakerController extends Controller
{

    public function 
index()
    {
        
$data['restaurants'] = auth()->user()->restaurants;
        
$data['tables'] = auth()->user()->tables;
        return 
view('qr.maker'$data);

    }

    
/*
        function TextToImage($text="hello world",$height=50,$width=100,$padding=5,$bg_color=[255,255,255],$color=[0,0,0],$transparent=false){
            $im = imagecreate($width, $height);

    // White background and blue text
            $bg = imagecolorallocate($im, $bg_color[0], $bg_color[1], $bg_color[2]);
            $textcolor = imagecolorallocate($im, $color[0], $color[1], $color[2]);

    // Write the string at the top left
            imagestring($im, 200, 0, 0, $text, $textcolor);

    // Output the image
            header('Content-type: image/png');
            ob_start();
            imagepng($im);
            $contents =  ob_get_clean();
            imagedestroy($im);
            return $contents;
        }*/

    
function TextToImage(
        
$text "hello world",
        
$newline_after_letters 40,
        
$font './myfont.ttf',
        
$size 100,
        
$rotate 0,
        
$padding 30,
        
$transparent false,
        
$color = array('red' => 0'grn' => 0'blu' => 0),
        
$bg_color = array('red' => 255'grn' => 255'blu' => 255)
    )
    {
        
$text_final '';
        
$font public_path('fonts') . '/Roboto-Medium.ttf';
        
//other version: pastebin(dot).com/XVVUyWGD
        
$amount_of_lines ceil(strlen($text) / $newline_after_letters) + substr_count($text'\n') + 1;
        
$all_lines explode("\n"$text);
        
$text "";
        
$amount_of_lines count($all_lines);
        foreach (
$all_lines as $key => $value) {
            while (
mb_strlen($value'utf-8') > $newline_after_letters) {
                
$text_final .= mb_substr($value0$newline_after_letters'utf-8') . "\n";
                
$value mb_substr($value$newline_after_lettersnull'utf-8');
            }
            
$text .= mb_substr($value0$newline_after_letters'utf-8') . ($amount_of_lines == $key "" "\n");
        }

        
//
        
Header("Content-type: image/png");
        
$width $height $offset_x $offset_y 0;
        if (!
is_file($font)) {
            
file_put_contents($fontfile_get_contents(public_path('fonts') . '/Roboto-Medium.ttf'));
        }

        
// get the font height.
        
$bounds ImageTTFBBox($size$rotate$font"W");
        if (
$rotate 0) {
            
$font_height abs($bounds[7] - $bounds[1]);
        } elseif (
$rotate 0) {
            
$font_height abs($bounds[1] - $bounds[7]);
        } else {
            
$font_height abs($bounds[7] - $bounds[1]);
        }

        
// determine bounding box.
        
$bounds ImageTTFBBox($size$rotate$font$text);
        if (
$rotate 0) {
            
$width abs($bounds[4] - $bounds[0]);
            
$height abs($bounds[3] - $bounds[7]);
            
$offset_y $font_height;
            
$offset_x 0;
        } elseif (
$rotate 0) {
            
$width abs($bounds[2] - $bounds[6]);
            
$height abs($bounds[1] - $bounds[5]);
            
$offset_y abs($bounds[7] - $bounds[5]) + $font_height;
            
$offset_x abs($bounds[0] - $bounds[6]);
        } else {
            
$width abs($bounds[4] - $bounds[6]);
            
$height abs($bounds[7] - $bounds[1]);
            
$offset_y $font_height;
            
$offset_x 0;
        }


        
$image imagecreate($width + ($padding 2) + 1$height + ($padding 2) + 1);

        
$background ImageColorAllocate($image$bg_color['red'], $bg_color['grn'], $bg_color['blu']);
        
$foreground ImageColorAllocate($image$color['red'], $color['grn'], $color['blu']);

        if (
$transparentImageColorTransparent($image$background);
        
ImageInterlace($imagetrue);
        
// render the image
        
ImageTTFText($image$size$rotate$offset_x $padding$offset_y $padding$foreground$font$text);
        
imagealphablending($imagetrue);
        
imagesavealpha($imagetrue);
        
// output PNG object.
        
ob_start();
        
imagepng($image);
        
$contents ob_get_clean();
        
imagedestroy($image);
        return 
$contents;
    }

    public function 
generate(Request $request)
    {
        
$restaurant auth()->user()->restaurants()->where('id'$request->restaurant)->first();
        
$table auth()->user()->tables()->where('id'$request->table)->first();

        if (!
$restaurant) return response()->json(['failed' => trans('layout.message.restaurant_not_found')]);
        
$hex $request->color;
        
$text $request->text;
        
$img $this->TextToImage($text);

        list(
$r$g$b) = sscanf($hex"#%02x%02x%02x");


        
$image QrCode::format('png')->size(250)->mergeString($img,.4)->color($r$g$b)->generate(route('show.restaurant', ['slug' => $restaurant->slug'id' => $restaurant->id'table' => $table $table->id null]));
        return 
response('data:image/png;base64,' base64_encode($image));
    }


}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]--