<?php

namespace Modules\Additional\Specifique\Client77\Modules\Liste\Service;

use Helpers\ChampsSupplementaire\ChampSupp;
use Helpers\Outil\Sql;

class SpecifiqueCentreLivraison
{

    /**
     * @param array<mixed> $array
     */
    public function clauseCentre(\PDO $pdo, $array = []):string
    {
        //3440
        return '';
    }

    /**
     * @param array<mixed> $array
     */
    public static function controleCtrLivraison(\PDO $pdo, string $centre = '', $array = []):bool
    {
        $req = "select * from CENTRE with (nolock) where CODE_CTR = :centre and LIVRAISON = 0x54 ";
        $array[':centre'] = $centre;
        if (is_array($array) && $array['CODE_SI'] == $centre) {
        } else {
            $req .= " and EMISSION = 0x54 ";
        }

        $requete = $pdo->prepare($req);
        $requete->execute($array);

        $return = $requete->fetch();
        if ($return) {
            return true;
        } else {
            return false;
        }
    }
}
