Files
2026-07-01 16:44:17 +03:00

79 lines
1.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php namespace Project\Controllers;
use DB, Import, URL, Cookie, Session, ML, Method, URI ;
/*
* Created By: Erkan IŞIK
* Created Date: 2017-12-07
* Update Date: 2019-12-09
*/
class Download extends Controller{
function __construct(){if (!USERID) {redirect(URL::base('panel'));}}
function main(){
$query = DB::orderBy('lang','desc')->where('status','1')->downloadResult();
$archive = DB::orderBy('lang','desc')->where('status','0')->downloadResult();
View::list($query)->archive($archive);
}
function new(){
if (method::post()){$this->download_model->new(method::post());}
}
function edit(){
$id = Uri::get('edit');
if (method::post()){$this->download_model->update(method::post());}
View::id($id)->get('edit');
}
function copy(){
$id = Uri::get('copy');
if (method::post()){$this->download_model->copy(method::post());}
View::id($id)->get('copy');
}
function delete(){
$id = Uri::get('delete');
DB::where('id',$id)->delete('download');
DB::where('downloadId',$id)->delete('downlink');
redirect('download');
}
function detail(){
$id = Uri::get('detail');
view::id($id);
}
function linkedit(){
$id = Uri::get('linkedit');
view::id($id);
}
function downlinkdStatusChange(){
if (Method::post('status') == 1) {
DB::where('id', Method::post('id'))->update('downlink',['status' => '0', ]);
}else{
DB::where('id', Method::post('id'))->update('downlink',['status' => '1', ]);
}
echo DB::error();
}
function downloadStatusChange(){
if (Method::post('status') == 1) {
DB::where('id', Method::post('id'))->update('download',['status' => '0', ]);
}else{
DB::where('id', Method::post('id'))->update('download',['status' => '1', ]);
}
echo DB::error();
}
function downlinkDelete(){
//echo Method::post('id');
DB::where('id', Method::post('id'))->delete('downlink');
if (!DB::error()) {
echo 'Kayıt Silindi';
}
}
}