smc
This commit is contained in:
20
smc/panel/json/data.php
Normal file
20
smc/panel/json/data.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?
|
||||
session_start();
|
||||
if (($_SESSION["admin"]["login"] != true) OR ($_SESSION["admin"]["username"] == "") OR ($_SESSION["admin"]["password"] == "")) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}else{
|
||||
include("../../conf/functions.php");
|
||||
$type = $byakman->guvenlik($_GET["type"]);
|
||||
|
||||
if ($type == 1) {
|
||||
$bouqets = $byakman->pdo->query("SELECT id, bouquet_name FROM bouqet_list WHERE status = '1' ORDER BY sira ASC")->fetchAll();
|
||||
$data = array();
|
||||
$i = 0;
|
||||
foreach($bouqets AS $bq) {
|
||||
$data[$i] = $bq;
|
||||
$i++;
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
}
|
||||
0
smc/panel/json/delete.php
Normal file
0
smc/panel/json/delete.php
Normal file
28
smc/panel/json/reorder.php
Normal file
28
smc/panel/json/reorder.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?
|
||||
session_start();
|
||||
if (($_SESSION["admin"]["login"] != true) OR ($_SESSION["admin"]["username"] == "") OR ($_SESSION["admin"]["password"] == "")) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}else{
|
||||
include("../../conf/functions.php");
|
||||
|
||||
if ($_POST) {
|
||||
$type = $byakman->guvenlik($_GET["type"]);
|
||||
if ($type == 1) {
|
||||
$bqid = $byakman->guvenlik($_POST["bqid"]);
|
||||
$position = $byakman->guvenlik($_POST["position"]);
|
||||
|
||||
$sorgu = $byakman->pdo->query("UPDATE bouqet_list SET sira = '$position' WHERE bouquet_id = '$bqid'");
|
||||
|
||||
} else if ($type == 2) {
|
||||
|
||||
$guid = $byakman->guvenlik($_POST["guid"]);
|
||||
$position = $byakman->guvenlik($_POST["position"]);
|
||||
|
||||
$sorgu = $byakman->pdo->query("UPDATE guides SET sira = '$position' WHERE id = '$guid'");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
44
smc/panel/json/upload.php
Normal file
44
smc/panel/json/upload.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?
|
||||
ob_start();
|
||||
session_start();
|
||||
if (($_SESSION["admin"]["login"] != true) OR ($_SESSION["admin"]["username"] == "") OR ($_SESSION["admin"]["password"] == "")) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
} else {
|
||||
include("../../conf/functions.php");
|
||||
|
||||
if ($_POST) {
|
||||
|
||||
$jsonDurum=array("durum"=>2,"adi"=>"","boyut"=>"", "resim"=>"");
|
||||
if(isset($_FILES["file"]["name"]) && !empty($_FILES["file"]["name"])){
|
||||
$resimDosyaYol="../../dosyalar/mansetler/";
|
||||
$veriTurleri=array("jpg"=>"image/jpeg","png"=>"image/png", "jpeg"=>"image/jpeg");
|
||||
if(in_array($_FILES["file"]["type"],$veriTurleri)){
|
||||
if($_FILES["file"]["error"]==0){
|
||||
$veriBoyut=($_FILES["file"]["size"]/1024);
|
||||
$veriUzanti=array_search($_FILES["file"]["type"],$veriTurleri);
|
||||
if($veriBoyut<3000){
|
||||
|
||||
$resimAdi=strtoupper(uniqid()).".".$veriUzanti;
|
||||
$dosVeriDurum=move_uploaded_file($_FILES["file"]["tmp_name"],$resimDosyaYol.$resimAdi);
|
||||
if($dosVeriDurum){
|
||||
$dosyaAdres = $resimDosyaYol.$resimAdi;
|
||||
$zaman = time();
|
||||
}
|
||||
$jsonDurum=array("durum"=>1,"adi"=>"$resimAdi","boyut"=>"$veriBoyut", "resim"=>"$dosyaAdres", "text"=>"");
|
||||
}
|
||||
|
||||
} else {
|
||||
$jsonDurum=array("durum"=>2,"adi"=>"","boyut"=>"", "resim"=>"", "text"=>"Yükleme esnasında bir hata oluştu. Tekrar deneyiniz.");
|
||||
}
|
||||
} else {
|
||||
$jsonDurum=array("durum"=>2,"adi"=>"","boyut"=>"", "resim"=>"", "text"=>"Yükleyebileceğiniz türler: jpg,jpeg,png");
|
||||
}
|
||||
|
||||
} else {
|
||||
$jsonDurum=array("durum"=>2,"adi"=>"","boyut"=>"", "resim"=>"", "text"=>"Yükleme esnasında bir hata oluştu. Tekrar deneyiniz.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user