Exemplo n.º 1
0
function boucleCommande($texte, $args)
{
    $commande = new Commande();
    // récupération des arguments
    $commande_id = lireTag($args, "id", "int");
    $commande_ref = lireTag($args, "ref", "string");
    $client_id = lireTag($args, "client", "int");
    $statut = lireTag($args, "statut", "string");
    $classement = lireTag($args, "classement", "string");
    $statutexcl = lireTag($args, "statutexcl", "int_list");
    $deb = lireTag($args, "deb", "int");
    $num = lireTag($args, "num", "int");
    if ($commande_ref == "" && $client_id == "") {
        return;
    }
    $search = "";
    $order = "";
    $limit = "";
    $res = "";
    // preparation de la requete
    if ($commande_id != "") {
        $search .= " and id=\"{$commande_id}\"";
    }
    if ($commande_ref != "") {
        $search .= " and ref=\"{$commande_ref}\"";
    }
    if ($client_id != "") {
        $search .= " and client=\"{$client_id}\"";
    }
    if ($statutexcl != "") {
        $search .= " and statut not in ({$statutexcl})";
    }
    if ($statut != "" && $statut != "paye") {
        $search .= " and statut=\"{$statut}\"";
    } else {
        if ($statut == "paye") {
            $search .= " and statut>\"1\" and statut<>\"5\"";
        }
    }
    if ($deb == "") {
        $deb = 0;
    }
    if ($num != "") {
        $limit = "limit {$deb},{$num}";
    }
    if ($classement == "inverse") {
        $order = "order by date";
    } else {
        $order = "order by date desc";
    }
    $query = "select * from {$commande->table} where 1 {$search} {$order} {$limit}";
    $statutdesc = new Statutdesc();
    $venteprod = new Venteprod();
    $resul = CacheBase::getCache()->query($query);
    if (empty($resul)) {
        return "";
    }
    foreach ($resul as $row) {
        $jour = substr($row->date, 8, 2);
        $mois = substr($row->date, 5, 2);
        $annee = substr($row->date, 0, 4);
        $heure = substr($row->date, 11, 2);
        $minute = substr($row->date, 14, 2);
        $seconde = substr($row->date, 17, 2);
        $jour_livraison = substr($row->datelivraison, 8, 2);
        $mois_livraison = substr($row->datelivraison, 5, 2);
        $annee_livraison = substr($row->datelivraison, 0, 4);
        $datelivraison = $jour_livraison . "/" . $mois_livraison . "/" . $annee_livraison;
        $datefacturation = $row->datefact == '0000-00-00' ? '' : substr($row->datefact, 8, 2) . "/" . substr($row->datefact, 5, 2) . "/" . substr($row->datefact, 0, 4);
        $query2 = "\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tsum(prixu*quantite) as totalttc,\n\t\t\t\t\t\tsum(prixu*quantite / (1 + tva / 100)) as totalht\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{$venteprod->table}\n\t\t\t\t\twhere\n\t\t\t\t\t\tcommande='{$row->id}'\n\t\t\t\t";
        $resul2 = CacheBase::getCache()->query($query2);
        $totalarticlesttc = $resul2[0]->totalttc;
        $totalarticlesht = $resul2[0]->totalht;
        if ($totalarticlesttc != 0) {
            $pourcremise = $row->remise / $totalarticlesttc * 100;
        } else {
            $pourcremise = 0;
        }
        $total = $totalarticlesttc - $row->remise;
        $port = $row->port;
        $totcmdport = $row->port + $total;
        $statutdesc->charger($row->statut);
        $temp = str_replace("#ID", "{$row->id}", $texte);
        $temp = str_replace("#ADRESSE", "{$row->adrfact}", $temp);
        $temp = str_replace("#ADRFACT", "{$row->adrfact}", $temp);
        $temp = str_replace("#ADRLIVR", "{$row->adrlivr}", $temp);
        if ($jour_livraison != "00") {
            $temp = str_replace("#DATELIVRAISON", $jour_livraison . "/" . $mois_livraison . "/" . $annee_livraison, $temp);
        } else {
            $temp = str_replace("#DATELIVRAISON", "", $temp);
        }
        $temp = str_replace("#DATEFACTURATION", $datefacturation, $temp);
        $temp = str_replace("#DATE", $jour . "/" . $mois . "/" . $annee, $temp);
        $temp = str_replace("#REF", "{$row->ref}", $temp);
        $temp = str_replace("#ADRFACT", "{$row->adrfact}", $temp);
        $temp = str_replace("#ADRLIVR", "{$row->adrlivr}", $temp);
        $temp = str_replace("#FACTURE", "{$row->facture}", $temp);
        $temp = str_replace("#TRANSACTION", "{$row->transaction}", $temp);
        $temp = str_replace("#REMISE", formatter_somme($row->remise), $temp);
        $temp = str_replace("#STATUTID", "{$row->statut}", $temp);
        $temp = str_replace("#STATUT", "{$statutdesc->titre}", $temp);
        $temp = str_replace("#PORT", formatter_somme($port), $temp);
        $temp = str_replace("#COMDEVISE", "{$row->devise}", $temp);
        $temp = str_replace("#TAUX", "{$row->taux}", $temp);
        $temp = str_replace("#COLIS", "{$row->colis}", $temp);
        $temp = str_replace("#LIVRAISON", "{$row->livraison}", $temp);
        $temp = str_replace("#CLIENT", "{$row->client}", $temp);
        $temp = str_replace("#TOTALARTICLESTTC", formatter_somme($totalarticlesttc), $temp);
        $temp = str_replace("#TOTALARTICLESHT", formatter_somme($totalarticlesht), $temp);
        $temp = str_replace("#POURCEREMISE", $pourcremise, $temp);
        $temp = str_replace("#TOTALCMD", formatter_somme($total), $temp);
        $temp = str_replace("#TOTCMDPORT", formatter_somme($totcmdport), $temp);
        $module = new Modules();
        $moduledesc = new Modulesdesc();
        $module->charger_id($row->transport);
        $moduledesc->charger($module->nom);
        $temp = str_replace("#TRANSPORTTITRE", $moduledesc->titre, $temp);
        $module->charger_id($row->paiement);
        $moduledesc->charger($module->nom);
        $temp = str_replace("#PAIEMENTTITRE", $moduledesc->titre, $temp);
        $temp = str_replace("#PAIEMENT", "{$row->paiement}", $temp);
        $temp = str_replace("#TRANSPORT", "{$row->transport}", $temp);
        $res .= $temp;
    }
    return $res;
}
Exemplo n.º 2
0
?>
 <?php 
echo $client->prenom;
?>
</a></li>
		<li><?php 
echo $dateaff . " " . $heureaff;
?>
</li>
</ul>
</div>

<?php 
$moduletransport = new Modules();
$moduletransport->charger_id($commande->transport);
$moduletransportdesc = new Modulesdesc();
$moduletransportdesc->charger($moduletransport->nom);
?>

<div class="bordure_bottom" style="margin:0 0 10px 0;">
	<div class="entete_liste_client">
		<div class="titre"><?php 
echo trad('INFO_TRANSPORT', 'admin');
?>
</div>
	</div>
	<ul class="ligne_claire_BlocDescription">
		<li class="designation" style="width:290px;"><?php 
echo trad('Mode_transport', 'admin');
?>
</li>
Exemplo n.º 3
0
    echo trad('Acces', 'admin');
    ?>
</li>
	</ul>

	<div class="bordure_bottom">
	<?php 
    $liste = ActionsAdminModules::instance()->lister(false, true);
    $idx = 0;
    foreach ($liste as $module) {
        $autorisation_modules = new Autorisation_modules();
        $autorisation_modules->charger($module->id, $_GET['id']);
        try {
            if (ActionsAdminModules::instance()->est_administrable($module->nom)) {
                $fond = "ligne_" . ($idx % 2 ? 'fonce' : 'claire') . "_rub";
                $modulesdesc = new Modulesdesc();
                $modulesdesc->charger($module->id);
                ?>
					<ul class="<?php 
                echo $fond;
                ?>
">
						<li style="width:250px;"><?php 
                echo ActionsAdminModules::instance()->lire_titre_module($module);
                ?>
</li>
						<li style="width:510px; border-left:1px solid #96A8B5;"><?php 
                echo $modulesdesc->description;
                ?>
</li>
						<li style="width:47px; border-left:1px solid #96A8B5;"><input type="checkbox" onchange="changer_droits_module(<?php 
 /**
  *
  * @method void Mise à jour de la description d'un module
  * @param string $nom nom du module associé
  * @param int $lang ID de la langue de la description
  * @param string $titre titre du module
  * @param string $chapo chapo du module
  * @param string $description description du module
  * @param int $devise ID de la devise associée
  */
 public function mise_a_jour_description($nom_module, $lang, $titre, $chapo, $description, $devise)
 {
     $md = new Modulesdesc();
     $existe = $md->verif($nom_module, $lang);
     $md->titre = $titre;
     $md->chapo = $chapo;
     $md->description = $description;
     $md->devise = $devise;
     if ($existe) {
         $md->maj();
     } else {
         $md->id = '';
         $md->lang = $lang;
         $md->plugin = $nom_module;
         $md->add();
     }
 }
Exemplo n.º 5
0
	<ul class="ligne_fonce_BlocDescription">
		<li class="designation" style="width:280px;"><?php 
echo trad('Type_transport', 'admin');
?>
</li>
		<li><select name="type_livraison" class="form_client">
					<option value=""><?php 
echo trad('Choisir', 'admin');
?>
... </option>
				<?php 
$modules = new Modules();
$query = "select * from {$modules->table} where type=2 and actif=1";
$resul = CacheBase::getCache()->mysql_query($query, $modules->link);
foreach ($resul as $row) {
    $modulesdesc = new Modulesdesc();
    $modulesdesc->charger($row->nom);
    ?>
						<option value="<?php 
    echo $row->id;
    ?>
"><?php 
    echo $modulesdesc->titre;
    ?>
</option>
						<?php 
}
?>
				</select>
</li>
	</ul>
Exemplo n.º 6
0
/*************************************************************************************/
require_once "pre.php";
require_once "auth.php";
if (!est_autorise("acces_configuration")) {
    exit;
}
if (!isset($lang)) {
    $lang = $_SESSION["util"]->lang;
}
if (isset($action) && $action == "modifier") {
    ActionsAdminModules::instance()->mise_a_jour_description($nom, $lang, $titre, $chapo, $description, $devise);
}
// Charger les infos modules
$module = new Modules();
$module->charger($nom);
$moduledesc = new Modulesdesc();
$moduledesc->charger($nom, $lang);
$existe = $moduledesc->verif($nom, $lang);
// Initialiser si la description n'existe pas dans cette langue.
if (!$existe) {
    $moduledesc->lang = $lang;
    $moduledesc->plugin = $nom;
    $moduledesc->devise = 0;
    $moduledesc->titre = '';
    $moduledesc->chapo = '';
    $moduledesc->description = '';
    $moduledesc->devise = 0;
}
// Charger les devises
$devises = array();
$result = mysql_query('select * from ' . Devise::TABLE . ' order by nom');