79 lines
1.9 KiB
PHP
79 lines
1.9 KiB
PHP
<?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';
|
||
}
|
||
|
||
}
|
||
} |