📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv9.demodesign.com.tr
/
adminco
📝
ajax.php
← Geri Dön
<?php require_once('../init.php'); if (!m_admin_check()) { m_redirect(ADMIN_URL . '/login.php'); } if (m_p_check()) { switch (m_a_p('type')) { case 'param_update': $result = array(); if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; } else { if (m_a_p('value') == '') { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_INVALID_REQUEST]; } else { switch (m_a_p('table')) { case 'specifications': if (m_a_p('id') == '') { $data = [ 's_id' => m_a_p('parent_id'), 'title' => m_a_p('value'), 'sef' => m_sef(m_a_p('value')), 'status' => 1 ]; $query = $db->table('specifications')->insert($data); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS, 'id' => $query]; } else { $data = [ 'title' => m_a_p('value'), 'sef' => m_sef(m_a_p('value')), ]; $query = $db->table('specifications')->where('id', '=', m_a_p('id'))->update($data); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS, 'id' => m_a_p('id')]; } break; case 'variants': if (m_a_p('id') == '') { $data = [ 'v_id' => m_a_p('parent_id'), 'title' => m_a_p('value'), 'sef' => m_sef(m_a_p('value')), 'price' => m_a_p('price'), 'status' => 1 ]; $query = $db->table('variants')->insert($data); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS, 'id' => $query]; } else { $data = [ 'title' => m_a_p('value'), 'sef' => m_sef(m_a_p('value')), 'price' => m_a_p('price'), ]; $query = $db->table('variants')->where('id', '=', m_a_p('id'))->update($data); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS, 'id' => m_a_p('id')]; } break; default: $result['status'] = false; $result['msg'] = LGA_INVALID_REQUEST; } } } echo json_encode($result); break; case 'delete_param': $result = array(); if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; } else { if (m_a_p('id') == '') { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_INVALID_REQUEST]; } else { switch (m_a_p('table')) { case 'specifications': $db->table('specifications')->where('id', '=', m_a_p('id'))->delete(); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS]; break; case 'variants': $db->table('variants')->where('id', '=', m_a_p('id'))->delete(); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS]; break; default: $result['status'] = false; $result['msg'] = LGA_INVALID_REQUEST; } } } echo json_encode($result); break; case 'editor_image_upload': $result = array(); if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; } else { $upload = m_image_tmp_uploader('files', 'upload_' . uniqid() . '', true, false); if ($upload[0] != '') { $result['result'] = true; $n = 0; foreach ($upload as $image) { $result['links'][$n] = m_image_tmp_url($image); $n++; } } else { $result['result'] = false; } } echo json_encode($result); break; case 'status_update': $result = array(); if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; } else { $informations = $db->table(m_a_p('table'))->where('id', '=', m_a_p('id'))->get(); if ($informations['total_count'] == 0) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_TRANSACTION_ERROR]; } else { $query = $db->table(m_a_p('table'))->where('id', '=', m_a_p('id'))->update(array('status' => m_a_p('status'))); $result = ['status' => true, 'title' => LGA_SUCCESS, 'msg' => LGA_TRANSACTION_SUCCESS]; } } echo json_encode($result); break; case 'header_menu': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } $data = ['option_name'=>'header_menu','option_value'=>json_encode($_POST['data'])]; $bul = $db->table('theme_options')->where('option_name','=','header_menu')->get(); if($bul['total_count']>0){ $degistir = $db->table('theme_options')->where('option_name','=','header_menu')->update($data); } else{ $degistir = $db->table('theme_options')->insert($data); } break; case 'footer_menu': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } $data = ['option_name'=>'footer_menu','option_value'=>json_encode($_POST['data'])]; $bul = $db->table('theme_options')->where('option_name','=','footer_menu')->get(); if($bul['total_count']>0){ $degistir = $db->table('theme_options')->where('option_name','=','footer_menu')->update($data); } else{ $degistir = $db->table('theme_options')->insert($data); } break; case 'orders-toplu': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } foreach($_POST['data'] as $value){ $db->table('orders')->where('id','=',$value)->delete(); } break; case 'customers-toplu': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } foreach($_POST['data'] as $value){ $db->table('customers')->where('id','=',$value)->delete(); } break; case 'customers-toplu-aktif': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } foreach($_POST['data'] as $value){ $data = ['status'=>1]; $db->table('customers')->where('id','=',$value)->update($data); } break; case 'customers-toplu-pasif': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } foreach($_POST['data'] as $value){ $data = ['status'=>0]; $db->table('customers')->where('id','=',$value)->update($data); } break; case 'image_upload': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } if($_FILES['image']['name']=='') { $image = ''; } else { $upload = m_image_uploader('image','blog_'.m_sef(m_a_p('title')).'_'.uniqid().'',false); $image = $upload[0]; } echo json_encode(['image'=>$image,'url'=>m_image_url($image)]); break; case 'bildirim_yolla': if (DEMO) { $result = ['status' => false, 'title' => LGA_ERROR, 'msg' => LGA_DEMO_ERROR]; echo json_encode($result); exit(); } //netgsm_sms(m_user('phone'),'Sayın '.m_user('name').' '.m_user('lastname').' '.$o_id.' nolu siparisiniz basariyla alinmistir.'); //email_send(m_user('email'),''.LG_ORDER_DETAILS.' - '.$o_id.'',email_order(''.m_user('name').' '.m_user('lastname').'',$o_id,''.$cart_info['total'].' '.currency_types(m_setting('currency_type'),'value').'',strip_tags(m_order_status($status)))); if(m_a_p('baslik') && m_a_p('icerik') && m_a_p('gonderim_turu') && m_a_p('method')){ $baslik = m_a_p('baslik'); $icerik = m_a_p('icerik'); $gonderim_turu = m_a_p('gonderim_turu'); $method = m_a_p('method'); $kullanici = 0; $sms = 0; $mail = 0; $result = 0; if($gonderim_turu == 2){ $kullanici = m_a_p('kullanici'); } if($kullanici){ $kullanici_cek = $db->table('customers')->where('email','=',$kullanici)->get(); if($kullanici_cek['total_count']>0){ $kullanici_detay = $kullanici_cek['data'][0]; if($method == 1){ $sms = 0; $mail = 1; }else if($method == 2){ $mail = 0; $sms = 1; }else{ $sms = 1; $mail = 1; } if($sms){ netgsm_sms($kullanici_detay['phone'],$icerik); } if($mail){ email_send($kullanici_detay['email'],$baslik,$icerik); } $result = 1; // Gönderildi }else{ $result = 2; // Kullanıcı Bulunamadı } }else{ $kullanici_cek = $db->table('customers')->where('status','=',1)->get(); if($method == 1){ $sms = 0; $mail = 1; }else if($method == 2){ $mail = 0; $sms = 1; }else{ $sms = 1; $mail = 1; } if($kullanici_cek['total_count']>0){ foreach ($kullanici_cek['data'] as $k){ if($sms){ netgsm_sms($k['phone'],$icerik); } if($mail){ email_send($k['email'],$baslik,$icerik); } } $result = 1; }else{ $result = 2; } } $data = ['status' => $result]; echo json_encode($data); } break; } } ?>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula