Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php header('Content-Type: application/json'); $data = array(); include 'config...

Decoded Output download

<?php 
header('Content-Type: application/json'); 
 
 
$data = array(); 
 
include 'config.php'; 
include 'function.php'; 
 
if (isset($_POST['veri_gonder'])) {  
 
  $id = $_POST['id']; 
  $urun_adi = $_POST['urun_adi']; 
  $magaza_adi = $_POST['magaza_adi']; 
  $fiyat = $_POST['fiyat']; 
  $zaman = $_POST['zaman']; 
 
  // Veriyi uygun biimde biimlendirme 
if ($fiyat >= 1000) { 
    $duzgunFormat = number_format((float)$fiyat / 1000, 3, '.', ''); 
    $duzgunFormat = str_replace(array('.', ','), '', $duzgunFormat); 
} else { 
    if (strpos($fiyat, ',') !== false) { 
        // Virgl varsa virglden ncesini al 
        $duzgunFormat = strtok($fiyat, ','); 
    } else { 
        // Virgl yoksa veriyi olduu gibi al 
        $duzgunFormat = str_replace(array('.', ','), '', $fiyat); 
    } 
} 
 
  $query = $db->prepare("UPDATE liste SET 
    urun_adi = :urun_adi, 
    magaza_adi = :magaza_adi, 
    urun_fiyati = :urun_fiyati, 
    son_update = :son_update, 
    durum = :durum WHERE id = '$id'"); 
    $update = $query->execute(array( 
         "urun_adi" => $urun_adi, 
         "magaza_adi" => $magaza_adi, 
         "urun_fiyati" => $duzgunFormat, 
         "son_update" => $zaman, 
         "durum" => 1 
    )); 
 
  echo "ok"; 
 
}else if(isset($_POST['notification'])) { 
 
echo "ok"; 
 
}else { 
 
  if (isset($_GET['get_data'])) { 
 
    $veri_cek = $_GET['get_data']; 
 
    if ($veri_cek == "orders") { 
 
      $sql = " 
          SELECT o.*, os.name as order_status 
          FROM `oc_order` o 
          JOIN `oc_order_status` os ON o.order_status_id = os.order_status_id 
          WHERE os.language_id = :language_id 
          AND (o.erp_status IS NULL OR o.erp_status = '') 
          ORDER BY o.order_id DESC 
      "; 
 
      $stmt = $db->prepare($sql); 
      $language_id = 1; 
      $stmt->bindParam(':language_id', $language_id, PDO::PARAM_INT); 
      $stmt->execute(); 
 
      $orders = $stmt->fetchAll(PDO::FETCH_ASSOC); 
 
      if (!$orders) { 
          echo json_encode(['error' => 'No orders found']); 
          exit; 
      } 
 
      foreach ($orders as &$order) { 
          $sqlProducts = " 
              SELECT op.*, pd.name as product_name, p.model as product_model 
              FROM `oc_order_product` op 
              JOIN `oc_product` p ON op.product_id = p.product_id 
              JOIN `oc_product_description` pd ON p.product_id = pd.product_id 
              WHERE op.order_id = :order_id 
              AND pd.language_id = :language_id 
          "; 
 
          $stmtProducts = $db->prepare($sqlProducts); 
          $stmtProducts->bindParam(':order_id', $order['order_id'], PDO::PARAM_INT); 
          $stmtProducts->bindParam(':language_id', $language_id, PDO::PARAM_INT); 
          $stmtProducts->execute(); 
 
          $products = $stmtProducts->fetchAll(PDO::FETCH_ASSOC); 
 
          if (!$products) { 
              $order['products'] = 'No products found for this order'; 
          } else { 
              $order['products'] = $products; 
          } 
      } 
 
      header('Content-Type: application/json'); 
      echo json_encode($orders, JSON_PRETTY_PRINT); 
 
    } 
 
  } 
 
 
 
  echo json_encode($data); 
} 
 ?>

Did this file decode correctly?

Original Code

<?php
header('Content-Type: application/json');


$data = array();

include 'config.php';
include 'function.php';

if (isset($_POST['veri_gonder'])) { 

  $id = $_POST['id'];
  $urun_adi = $_POST['urun_adi'];
  $magaza_adi = $_POST['magaza_adi'];
  $fiyat = $_POST['fiyat'];
  $zaman = $_POST['zaman'];

  // Veriyi uygun biimde biimlendirme
if ($fiyat >= 1000) {
    $duzgunFormat = number_format((float)$fiyat / 1000, 3, '.', '');
    $duzgunFormat = str_replace(array('.', ','), '', $duzgunFormat);
} else {
    if (strpos($fiyat, ',') !== false) {
        // Virgl varsa virglden ncesini al
        $duzgunFormat = strtok($fiyat, ',');
    } else {
        // Virgl yoksa veriyi olduu gibi al
        $duzgunFormat = str_replace(array('.', ','), '', $fiyat);
    }
}

  $query = $db->prepare("UPDATE liste SET
    urun_adi = :urun_adi,
    magaza_adi = :magaza_adi,
    urun_fiyati = :urun_fiyati,
    son_update = :son_update,
    durum = :durum WHERE id = '$id'");
    $update = $query->execute(array(
         "urun_adi" => $urun_adi,
         "magaza_adi" => $magaza_adi,
         "urun_fiyati" => $duzgunFormat,
         "son_update" => $zaman,
         "durum" => 1
    ));

  echo "ok";

}else if(isset($_POST['notification'])) {

echo "ok";

}else {

  if (isset($_GET['get_data'])) {

    $veri_cek = $_GET['get_data'];

    if ($veri_cek == "orders") {

      $sql = "
          SELECT o.*, os.name as order_status
          FROM `oc_order` o
          JOIN `oc_order_status` os ON o.order_status_id = os.order_status_id
          WHERE os.language_id = :language_id
          AND (o.erp_status IS NULL OR o.erp_status = '')
          ORDER BY o.order_id DESC
      ";

      $stmt = $db->prepare($sql);
      $language_id = 1;
      $stmt->bindParam(':language_id', $language_id, PDO::PARAM_INT);
      $stmt->execute();

      $orders = $stmt->fetchAll(PDO::FETCH_ASSOC);

      if (!$orders) {
          echo json_encode(['error' => 'No orders found']);
          exit;
      }

      foreach ($orders as &$order) {
          $sqlProducts = "
              SELECT op.*, pd.name as product_name, p.model as product_model
              FROM `oc_order_product` op
              JOIN `oc_product` p ON op.product_id = p.product_id
              JOIN `oc_product_description` pd ON p.product_id = pd.product_id
              WHERE op.order_id = :order_id
              AND pd.language_id = :language_id
          ";

          $stmtProducts = $db->prepare($sqlProducts);
          $stmtProducts->bindParam(':order_id', $order['order_id'], PDO::PARAM_INT);
          $stmtProducts->bindParam(':language_id', $language_id, PDO::PARAM_INT);
          $stmtProducts->execute();

          $products = $stmtProducts->fetchAll(PDO::FETCH_ASSOC);

          if (!$products) {
              $order['products'] = 'No products found for this order';
          } else {
              $order['products'] = $products;
          }
      }

      header('Content-Type: application/json');
      echo json_encode($orders, JSON_PRETTY_PRINT);

    }

  }



  echo json_encode($data);
}

Function Calls

None

Variables

None

Stats

MD5 a791953694a09f717989e699feca3e8f
Eval Count 0
Decode Time 81 ms