HEX
Server: Apache
System: Linux server1.royalgt4.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
User: mostafedeg (1125)
PHP: 5.6.40
Disabled: mail,passthru,parse_ini_file,show_source,eval,assert,pcntl_exec,dl,putenv,proc_open,popen
Upload Files
File: /home/mostafedeg/public_html/erp/controllers/taskstypes.php
<?php
include("../public/impOpreation.php");

$do = $_GET['do'];
$today = date("Y-m-d H:i:s");
$date = date("Y-m-d");
$userid = $_SESSION['userid'];
if (empty($do)) {  
    
    $smarty->display("header.html");
    $smarty->display("taskstypesview/add.html");
    $smarty->display("footer.html");
} elseif ($do == "show") {
    $taskstypes = R::findAll('taskstypes','del = 0');
    $smarty->assign('taskstypes', $taskstypes);
    $smarty->display("header.html");
    $smarty->display("taskstypesview/show.html");
    $smarty->display("footer.html");
} elseif ($do == "edit") {
    $id = filter_input(INPUT_GET, 'id');
    $tasktype = R::load('taskstypes', $id);
    $smarty->assign('tasktype', $tasktype);
    $smarty->display("header.html");
    $smarty->display("taskstypesview/edit.html");
    $smarty->display("footer.html");   
}else if ($do == 'add') {
    $typename = filter_input(INPUT_POST, 'typename');
    $taskstypes = R::dispense('taskstypes');
    $taskstypes->del = 0;
    $taskstypes->today = $today;          
    $taskstypes->userid = $userid;
    $taskstypes->typename = $typename;
    try {
       R::store($taskstypes);    
       header("location:taskstypes.php?do=show");
    } catch (Exception $e) {
       header("location:taskstypes.php");
    }
}else if ($do == 'update') {
    $id = filter_input(INPUT_POST, 'id');
    $typename = filter_input(INPUT_POST, 'typename');
    $taskstypes = R::load('taskstypes',$id);
    $taskstypes->updatetoday = $today;          
    $taskstypes->updateuserid = $userid;
    $taskstypes->typename = $typename;
    try {
       R::store($taskstypes); 
       header("location:taskstypes.php?do=show");
    } catch (Exception $e) {
       header("location:taskstypes.php?do=edit&id=".$id);
    }
}else if ($do == 'del') {
    $id = filter_input(INPUT_GET, 'id');
    $taskstypes = R::load('taskstypes',$id);
    $taskstypes->del = 1;
    $taskstypes->todaydel = $today;  
    $taskstypes->useriddel = $userid;
    try {
       R::store($taskstypes); 
       header("location:taskstypes.php?do=show");
    } catch (Exception $e) {
       header("location:taskstypes.php?do=show");
    }
}






?>