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/dev/htdocs/custom/paiedolibarr/ucard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/dev/htdocs/custom/paiedolibarr/ucard/show.php
<?php

if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' ) {
    
    if (!$id || $id <= 0) {
        header('Location: ./card.php?action=request&error=dalete_failed&id='.$id);
        exit;
    }

    $page  = GETPOST('page');

    $object->fetch($id);
    $error = $object->delete();
    // $error = 1;
    if ($error == 1) {
        header('Location: index.php?delete='.$id.'&page='.$page);
        exit;
    }
    else {      
        header('Location: card.php?delete=1&page='.$page);
        exit;
    }
}


if( ($id && empty($action)) || $action == "delete" ){
    
    // $h = 0;
    // $head = array();
    // $head[$h][0] = dol_buildpath("/paiedolibarr/card.php?id=".$id, 1);
    // $head[$h][1] = $langs->trans($modname);
    // $head[$h][2] = 'affichage';
    // $h++;
    // dol_fiche_head($head,'affichage',"",0,"logo@paiedolibarr");


    if($action == "delete"){
        print $form->formconfirm("card.php?id=".$id."&page=".$page,$langs->trans('Confirmation') , $langs->trans('paiedolibarrmsgconfirmdelet'),"confirm_delete", 'index.php?page='.$page, 0, 1);
    }

    // $paiedolibarr->fetchAll('','',0,0,' and rowid = '.$id);
    $object->fetch($id);
    $item = $object;
    // $extrafields = new ExtraFields($db);
    // $extralabels=$extrafields->fetch_name_optionals_label($item->table_element);
    $d=explode(' ', $item->datehire);
    $date_d = explode('-', $d[0]);
    $date = $date_d[2]."/".$date_d[1]."/".$date_d[0];

    $linkback = '<a href="./index.php?page='.$page.'">'.$langs->trans("BackToList").'</a>';
    print $paiedolibarr->showNavigations($object, $linkback);

    print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" class="card_paiedolibarr">';

    print '<input type="hidden" name="confirm" value="no" id="confirm" />';
    print '<input type="hidden" name="id" value="'.$id.'" />';
    print '<input type="hidden" name="page" value="'.$page.'" />';

    print '<div class="">';
    print '<div class="">';

        print '<table class="border tableforfield" width="100%">';
        print '<tbody>';

        $periods = explode('-', $item->period);
        $periodyear = $periods[0] + 0;
        $periodmonth = $periods[1];
        $period = $langs->trans("Month".sprintf("%02d", $periodmonth))." ".$periodyear;

        print '<tr>';
            print '<td>'.$langs->trans('paieofmonth').'</td>';
            print '<td >';
            print $period;
            print '</td>';
        print '</tr>';
        
        $userpay->fetch($item->fk_user);
        print '<tr>';
            print '<td id="titletdpaiedolibarr">'.$langs->trans('paiedolibarr_employe').'</td>';
            print '<td id="useroradherent">';
            print '<span id="users">';
            print $userpay->getNomUrl(1);
            print '</span>';
            print '</td>';
        print '</tr>';

        print '<tr>';
            print '<td class="titlefieldcreate">'.$langs->trans('paiedolibarr_ref').'</td>';
            print '<td >';
            print nl2br(trim($item->ref));
            print '</td>';
        print '</tr>';

        print '<tr>';
            print '<td class="titlefieldcreate">'.$langs->trans('paiesname').'</td>';
            print '<td >';
            print nl2br(trim($item->label));
            print '</td>';
        print '</tr>';

        print '<tr>';
            print '<td class="">'.$langs->trans('paieSalaireBrut').'</td>';
            print '<td >';
            print $paiedolibarr->number_format($item->salairebrut, 2, ',',' ').' '.$conf->currency;
            print '</td>';
        print '</tr>';

        // print '<tr>';
        //     print '<td class="">'.$langs->trans('paieSalaireNet').'</td>';
        //     print '<td >';
        //     print $paiedolibarr->number_format($item->salairenet, 2, ',',' ').' '.$conf->currency;
        //     print '</td>';
        // print '</tr>';

        print '<tr>';
            print '<td class="">'.$langs->trans('paieNet_a_payer').'</td>';
            print '<td >';
            print $paiedolibarr->number_format($item->netapayer, 2, ',',' ').' '.$conf->currency;
            print '</td>';
        print '</tr>';

        print '<tr>';
            print '<td class="titlefieldcreate">'.$langs->trans('paiedolibarr_comment').'</td>';
            print '<td>';
            print nl2br($item->comment);
            print '</td>';
        print '</tr>';

        print '</tbody>';
        print '</table>';
    print '</div>';

    print '<div style="clear:both"></div>';
    print '</div>';

    print '<br>';
    print '<br>';
    // Actions
    print '<table class="" width="100%">';
    print '<tr>';
        print '<td colspan="2" align="right" >';
            print '<a href="./card.php?id='.$id.'&action=edit" class="butAction">'.$langs->trans('Modify').'</a>';
            print '<a href="./card.php?id='.$id.'&action=delete" class=" butActionDelete">'.$langs->trans('Delete').'</a>';
            print '<a href="./index.php?page='.$page.'" class="butAction">'.$langs->trans('Cancel').'</a>';
            // print '<a style="float:right;margin-left:40px;"  href="./card.php?id='.$id.'&export=pdf" target="_blank" class="butAction">'.$langs->trans('paiePrintFile').'</a>';
        print '</td>';
    print '</tr>';
    print '</table>';

    // print '<br><br>';
    print '<div class="paiecalculdesalaire">';
    print '<div class="titre">';
    print $langs->trans('paiecalculdesalaire');
    print '</div>';

    $cts = '';
    $cts .= '<div class="div-table-responsive tablesalaire">';
    $cts .= '<table class="tagtable liste listwithfilterbefore bodytable" id="paielines" style="width:100%">'; 

    $cts .= '<thead>';
        $cts .= '<tr class="liste_titre">';
        $cts .= '<th align="left">'.$langs->trans('paieDesignation').'</th>'; 
        // $cts .= '<th class="paieemptyline"></th>'; 
        $cts .= '<th align="right">'.$langs->trans('paieTotal').'</th>'; 
        // $cts .= '<th class="paieemptyline"></th>'; 
        // $cts .= '<th align="center">'.$langs->trans('paieCategorie').'</th>'; 
        $cts .= '</tr>';
    $cts .= '</thead>';

    $cts .= '<tbody>';

    $payrules = $object->getRulesOfPaie($item->rowid);
    $i = 1;
    $firstc = $firsto = 0;

    $totbrut = $totcotisation = $totother = $totalpatr_G = $totalpatr_R = 0;

    if($payrules){
        // print_r($payrules);
        foreach ($payrules as $key => $rule) {
            $clas = '';
            // if($rule->category == 'BASIQUE')

            $clas = $key0 = $rule->category;



            $cts .= '<tr class="oddeven '.$clas.'" data-id="'.$i.'">';

            $cts .= '<td class="td_label" align="left">'; 
            $cts .= $rule->label; 
            $cts .= '</td>';
        
            // $cts .= '<th class="paieemptyline"></th>';
            
            $cts .= '<td class="td_total" align="right">'; 
            $cts .= $paiedolibarr->number_format($rule->total,2,',',' '); 
            $cts .= '</td>';

            // $cts .= '<th class="paieemptyline"></th>';
            // $cts .= '<td class="td_category" align="center">';
            // $cts .= '<input type="hidden" name="payrules[new_'.$i.'][category]" size="6" value="'.$rule->category.'"/>';
            // $cts .= $object->rulescategory[$rule->category]; 
            // $cts .= '</td>';

            $cts .= '</tr>';

            
            $i++;
        }
    }

    $cts .= '</tbody>';

    $cts .= '</table>'; 
    $cts .= '</div>';

    print $cts;

    print '</div>';

    print '<br><br>';
    
    // Actions
    print '<table class="" width="100%">';
    print '<tr>';
        print '<td colspan="2" align="right" >';
            print '<a href="./card.php?id='.$id.'&action=edit" class="butAction">'.$langs->trans('Modify').'</a>';
            print '<a href="./card.php?id='.$id.'&action=delete" class="butActionDelete">'.$langs->trans('Delete').'</a>';
            print '<a href="./index.php?page='.$page.'" class="butAction">'.$langs->trans('Cancel').'</a>';
            // print '<a style="float:right;margin-left:40px;"  href="./card.php?id='.$id.'&export=pdf" target="_blank" class="butAction">'.$langs->trans('paiePrintFile').'</a>';
        print '</td>';
    print '</tr>';
    print '</table>';
    
    
    print '</form>';

}

?>

Hry