Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/erp/htdocs/custom/gestionhrm/hrm_award/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/erp/htdocs/custom/gestionhrm/hrm_award/card.php
<?php 

if (!defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL', 1);
if (!defined('NOCSRFCHECK'))     define('NOCSRFCHECK', 1);

$res=0;
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");       // For root directory
if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php"); // For "custom" 

require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';

dol_include_once('/gestionhrm/lib/gestionhrm.lib.php');
dol_include_once('/gestionhrm/class/hrm_award.class.php');

$langs->load('gestionhrm@gestionhrm');
$langs->load('products');
$langs->load('ticket');
$langs->load('mails');

// Initial Objects

$award        = new hrm_award($db);
$employe        = new User($db);
$form         = new Form($db);
$formmail     = new FormMail($db);
$formfile     = new FormFile($db);

$modname = $langs->trans('award');

// Get parameters
$request_method = $_SERVER['REQUEST_METHOD'];
$action         = GETPOST('action', 'alpha');
$confirm         = GETPOST('confirm', 'alpha');
$page           = GETPOST('page');
$id             = (int) ( (!empty($_GET['id'])) ? $_GET['id'] : GETPOST('id') ) ;

if(!empty($id)){
    $object = new hrm_award($db);
    $object->fetch($id);
    if (!($object->rowid > 0))
    {
        $langs->load("errors"); 
        print($langs->trans('ErrorRecordNotFound'));
        exit;
    }
} 

$error  = false;
if (!$user->rights->gestionhrm->lire) {
    accessforbidden();
}

if(in_array($action, ["add","edit"])) {
    if (!$user->rights->gestionhrm->creer) {
      accessforbidden();
    }
}
if($action == "delete_elem") {
    if (!$user->rights->gestionhrm->supprimer) {
      accessforbidden();
    }

}

if($action == "add"){
    $modname = $langs->trans('new_event');
}



// ------------------------------------------------------------------------- Actions "Create/Update/Delete"
if ($action == 'create' && $request_method === 'POST') {
    require_once 'z-actions/create.php';
}


$approbateurs = array();

if ($action == 'update' && $request_method === 'POST') {

    require_once 'z-actions/show.php';
}
// If delete of request
if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes' ) {

    $upload_dir = $conf->gestionhrm->dir_output.'/award/'.$id;
    $modulepart = 'gestionhrm';
    $object = new hrm_award($db);
    $object->fetch($id);
    include_once dol_buildpath('/gestionhrm/lib/document_actions_pre_headers.lib.php');

    header('Location: card.php?id='.$id);
    exit();
}
// If delete of request
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' ) {
    require_once 'z-actions/show.php';
}

        
if ($id) {
    // $param      = '&id='. $id;
    $upload_dir = $conf->gestionhrm->dir_output.'/award/'.$id;
    $modulepart = 'gestionhrm';
    $object = new hrm_award($db);
    $object->fetch($id);
    $filearray = array();

    // Construit liste des fichiers
    $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
    $totalsize=0;
    foreach($filearray as $key => $file) {
        $totalsize+=$file['size'];
    }
    if(!empty(GETPOST('sendit'))){
        include_once dol_buildpath('/gestionhrm/lib/document_actions_pre_headers.lib.php');
    }
}


$morejs  = array();
$morejs  = array("/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js");



llxHeader(array(), $modname,'','','','',$morejs,0,0);

print_fiche_titre($modname);


// ------------------------------------------------------------------------- Views
if($action == "add")
    require_once 'z-actions/create.php';

global $user;

if($action == "edit"){
    require_once 'z-actions/show.php';
}

if(($id && empty($action)) || $action == "delete_elem" ){
    require_once 'z-actions/show.php';
}

if(($id && empty($action)) || $action == "delete" || $action == "deletefile" ){
    require_once 'z-actions/show.php';
    die();
}

?>
<script>
    $('.datetimepicker_events').datetimepicker({
        format: 'd/m/Y H:i',
    });
   
</script>
<?php

llxFooter();
$db->close();

?>

Hry