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

79 lines
1.6 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 Method, URI, DB, Session, Cookie;
class Bugs extends Controller{
function main(){
/*
Masterpage::meta([
'name:title' => settings('title'),
'name:description' => contentRow($id)->keywords,
'name:keywords' => contentRow($id)->label,
]);
*/
Cookie::insert('returnlink', 'bugs');
Masterpage::meta([
'name:description' => "Pisilinux istek ve hata kayıtlarının toplandığı alandır",
'name:keywords' => "Bugs, hata, istek",
]);
}
function new(){
if (Session::select('userid') =='') {
redirect('bugs');
}
if (Method::post()) {$this->bugs_model->new(Method::post());}
}
function edit(){
$id = Uri::get('edit');
$userid = Session::select('userid');
if (bugsRow($id)->userid == $userid OR session::select('yetki')=='1') {
if (Method::post()) {$this->bugs_model->edit(Method::post());}
View::id($id)->control('1');
}else{
view::control('0');
//echo "<h1>bu içeriği düzenlemeye yetkili değilsiniz.</h1>";
}
}
function search(){
}
function detail(){
$id = Uri::get('detail');
if (Method::post()) {$this->bugs_model->insert(Method::post());}
View::id($id);
}
function help(){
import::view(THEMA_NAME.'bugs/help');
}
function bugsClose(){
$id = Method::post('id');
$status = Method::post('status');
DB::where('id',$id)->update('bugs',[
'status' => $status
]);
echo 1;
}
function delete($id){
$id = Uri::get('delete');
$par = explode('&', $id);
$id = $par[0];
$parentId = $par[1];
DB::where('id', $id)->delete('bugs');
redirect('bugs/detail/' . $parentId);
}
}