本文整理汇总了PHP中Modules::charger_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::charger_id方法的具体用法?PHP Modules::charger_id怎么用?PHP Modules::charger_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules
的用法示例。
在下文中一共展示了Modules::charger_id方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: port
function port($type = 0, $_pays = false, $_cpostal = "")
{
if ($_SESSION['navig']->commande->transport == "" && !$type) {
return -1;
}
if ($_SESSION['navig']->adresse != 0) {
$chadr = 1;
} else {
$chadr = 0;
}
$modules = new Modules();
if (!$type) {
$modules->charger_id($_SESSION['navig']->commande->transport);
} else {
$modules->charger_id($type);
}
if ($modules->type != Modules::TRANSPORT || !$modules->actif) {
return -1;
}
$p = new Pays();
if ($chadr) {
$adr = new adresse();
$adr->charger($_SESSION['navig']->adresse);
$p->charger($adr->pays);
$cpostal = $adr->cpostal;
} else {
$p->charger($_SESSION['navig']->client->pays);
$cpostal = $_SESSION['navig']->client->cpostal;
}
// Prise en compte des infos passée, si aucune des infos précédentes n'est pertinente.
if (empty($p->id) && $_pays) {
$p->charger($_pays);
}
if (empty($cpostal) && $_cpostal != "") {
$cpostal = $_cpostal;
}
$zone = new Zone();
$zone->charger($p->zone);
try {
$port = ActionsModules::instance()->instancier($modules->nom);
$port->nbart = $_SESSION['navig']->panier->nbart();
$port->poids = $_SESSION['navig']->panier->poids();
$port->total = $_SESSION['navig']->panier->total();
$port->zone = $p->zone;
$port->pays = $p->id;
$port->unitetr = $zone->unite;
$port->cpostal = $cpostal;
$frais = $port->calcule();
ActionsModules::instance()->appel_module("port", $frais);
return $frais;
} catch (exception $e) {
return -1;
}
}
示例2: est_module_de_transport_pour
public function est_module_de_transport_pour($commande)
{
$module = new Modules();
return $module->charger_id($commande->transport) && $module->nom == $this->getNom();
}
示例3: defalquer_stock
public function defalquer_stock($retourenstock = false)
{
try {
$modules = new Modules();
if ($modules->charger_id($this->paiement)) {
$modpaiement = ActionsModules::instance()->instancier($modules->nom);
if ($retourenstock) {
$defalquer = $modpaiement->defalqcmd != 0 || $modpaiement->defalqcmd == 0 && $this->statut != self::NONPAYE;
} else {
$defalquer = $modpaiement->defalqcmd == 0;
}
if ($defalquer) {
$delta = $retourenstock ? 1 : -1;
$venteprod = new Venteprod();
$query = "select * from {$venteprod->table} where commande='" . $this->id . "'";
$resul = $venteprod->query($query);
while ($resul && ($row = $venteprod->fetch_object($resul))) {
// Mise à jour du stock général
$produit = new Produit($row->ref);
$produit->stock += $delta * $row->quantite;
$produit->maj();
$vdec = new Ventedeclidisp();
$query2 = "select * from {$vdec->table} where venteprod='" . $row->id . "'";
$resul2 = $vdec->query($query2);
while ($resul2 && ($row2 = $vdec->fetch_object($resul2))) {
$stock = new Stock();
// Mise à jour du stock des declinaisons
if ($stock->charger($row2->declidisp, $produit->id)) {
$stock->valeur += $delta * $row->quantite;
$stock->maj();
}
}
}
}
}
} catch (Exception $ex) {
// Rien
}
}
示例4: modifier_transports
function modifier_transports($idtransport)
{
$transzone = new Transzone();
$zone = new Zone();
$tr = new Modules();
if ($tr->charger_id($_GET['id'])) {
$zone = new Zone();
?>
<div class="entete_liste_config" style="margin-top:15px;">
<div class="titre"><?php
echo trad('MODIFICATION_TRANSPORT', 'admin') . ' ' . ActionsAdminModules::instance()->lire_titre_module($tr);
?>
</div>
</div>
<ul class="ligne1">
<li style="width:250px;">
<select class="form_select" id="zone">
<?php
$query = "select * from {$zone->table}";
$resul = $transzone->query($query);
while ($resul && ($row = $transzone->fetch_object($resul))) {
$test = new Transzone();
if (!$test->charger($idtransport, $row->id)) {
?>
<option value="<?php
echo $row->id;
?>
"><?php
echo $row->nom;
?>
</option>
<?php
}
}
?>
</select>
</li>
<li><a href="javascript:ajouter($('#zone').val())"><?php
echo trad('AJOUTER_ZONE', 'admin');
?>
</a></li>
</ul>
<?php
$query = "select * from {$transzone->table} where transport=\"" . $idtransport . "\"";
$resul = $transzone->query($query);
$i = 0;
while ($resul && ($row = $transzone->fetch_object($resul))) {
$zone = new Zone();
$zone->charger($row->zone);
$fond = "ligne_" . ($i++ % 2 ? "fonce" : "claire") . "_BlocDescription";
?>
<ul class="<?php
echo $fond;
?>
">
<li style="width:492px;"><?php
echo $zone->nom;
?>
</li>
<li style="width:32px;"><a href="javascript:supprimer(<?php
echo $row->id;
?>
)"><?php
echo trad('Supprimer', 'admin');
?>
</a></li>
</ul>
<?php
}
}
}
示例5: boucleReprisePaiement
function boucleReprisePaiement($texte, $args)
{
$paiement = lireTag($args, "paiement", "int");
$refcommande = lireTag($args, "refcommande", "string");
$module = new Modules();
$commande = new Commande();
$res = "";
if (!empty($paiement) && $module->charger_id($paiement) && !empty($refcommande) && $commande->charger_ref($refcommande)) {
if ($module->type == 1 && $module->actif == 1) {
$res = str_replace("#URL", sprintf("index.php?action=reprise_paiement&id_commande=%d&id_paiement=%d", $commande->id, $module->id), $texte);
}
}
return $res;
}
示例6: trad
echo $client->nom;
?>
<?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');
?>
示例7: createOrder
public function createOrder($facturation_raison, $facturation_entreprise, $facturation_nom, $facturation_prenom, $facturation_adresse1, $facturation_adresse2, $facturation_adresse3, $facturation_cpostal, $facturation_ville, $facturation_tel, $facturation_pays, $livraison_raison, $livraison_entreprise, $livraison_nom, $livraison_prenom, $livraison_adresse1, $livraison_adresse2, $livraison_adresse3, $livraison_cpostal, $livraison_ville, $livraison_tel, $livraison_pays, $type_paiement, $type_transport, $fraisport, $remise, $client_selected, $ref_client, $email, \Panier $panier, $applyClientDiscount, $callMail, $callPayment)
{
$client = new Client();
if ($client_selected == 1) {
$clientOK = $client->charger_ref($ref_client);
} else {
if ($email != '' && $client->charger_mail($email)) {
$existeDeja = 1;
} elseif ($email != '' && !filter_var($email, FILTER_VALIDATE_EMAIL)) {
$badFormat = 1;
} else {
$client->email = $email;
$client->raison = $facturation_raison;
$client->entreprise = $facturation_entreprise;
$client->prenom = $facturation_prenom;
$client->nom = $facturation_nom;
$client->adresse1 = $facturation_adresse1;
$client->adresse2 = $facturation_adresse2;
$client->adresse3 = $facturation_adresse3;
$client->cpostal = $facturation_cpostal;
$client->ville = $facturation_ville;
$client->tel = $facturation_tel;
$client->pays = $facturation_pays;
$pass = genpass(8);
$client->motdepasse = $pass;
}
}
$facturationAddress = new Venteadr();
$facturationAddress->raison = $facturation_raison;
$facturationAddress->entreprise = $facturation_entreprise;
$facturationAddress->prenom = $facturation_prenom;
$facturationAddress->nom = $facturation_nom;
$facturationAddress->adresse1 = $facturation_adresse1;
$facturationAddress->adresse2 = $facturation_adresse2;
$facturationAddress->adresse3 = $facturation_adresse3;
$facturationAddress->cpostal = $facturation_cpostal;
$facturationAddress->ville = $facturation_ville;
$facturationAddress->tel = $facturation_tel;
$facturationAddress->pays = $facturation_pays;
$livraisonAddress = new Venteadr();
$livraisonAddress->raison = $livraison_raison;
$livraisonAddress->entreprise = $livraison_entreprise;
$livraisonAddress->prenom = $livraison_prenom;
$livraisonAddress->nom = $livraison_nom;
$livraisonAddress->adresse1 = $livraison_adresse1;
$livraisonAddress->adresse2 = $livraison_adresse2;
$livraisonAddress->adresse3 = $livraison_adresse3;
$livraisonAddress->cpostal = $livraison_cpostal;
$livraisonAddress->ville = $livraison_ville;
$livraisonAddress->tel = $livraison_tel;
$livraisonAddress->pays = $livraison_pays;
$order = new Commande();
$order->date = date("Y-m-d H:i:s");
$order->livraison = "L" . date("ymdHis") . strtoupper(ereg_caracspec(substr($client->prenom, 0, 3)));
$order->transport = $type_transport;
$order->paiement = $type_paiement;
$order->statut = Commande::NONPAYE;
$order->transaction = genid($order->id, 6);
$module_paiement = new Modules();
$module_paiement->charger_id($type_paiement);
if ($facturationAddress->raison != "" && $facturationAddress->prenom != "" && $facturationAddress->nom != "" && $facturationAddress->adresse1 != "" && $facturationAddress->cpostal != "" && $facturationAddress->ville != "" && $facturationAddress->pays != "" && $livraisonAddress->raison != "" && $livraisonAddress->prenom != "" && $livraisonAddress->nom != "" && $livraisonAddress->adresse1 != "" && $livraisonAddress->cpostal != "" && $livraisonAddress->ville != "" && $livraisonAddress->pays != "" && $order->transport != "" && is_numeric($fraisport) && $fraisport >= 0 && is_numeric($remise) && $remise >= 0 && $module_paiement->actif && $order->paiement != "" && $panier->nbart > 0 && ($clientOK || $client_selected != 1 && !$existeDeja && !$badFormat) && $email != '') {
$facturationAddress->id = $facturationAddress->add();
$livraisonAddress->id = $livraisonAddress->add();
if (!$client->id) {
$client->crypter();
$client->id = $client->add();
$client->ref = date("ymdHi") . genid($client->id, 6);
$client->maj();
ClientAdmin::getInstance()->sendMailCreation($client, $pass);
}
$devise = ActionsDevises::instance()->get_devise_courante();
$order->adrfact = $facturationAddress->id;
$order->adrlivr = $livraisonAddress->id;
$order->client = $client->id;
$order->devise = $devise->id;
$order->taux = $devise->taux;
$order->lang = ActionsLang::instance()->get_id_langue_courante();
$order->id = $order->add();
$order->ref = "C" . date("ymdHi") . genid($order->id, 6);
$order->maj();
$total = 0;
foreach ($panier->tabarticle as $pos => $article) {
$venteprod = new Venteprod();
$dectexte = "\n";
$stock = new Stock();
foreach ($article->perso as $perso) {
$declinaison = new Declinaison();
$declinaisondesc = new Declinaisondesc();
if (is_numeric($perso->valeur) && ActionsModules::instance()->instancier($module_paiement->nom)->defalqcmd) {
// diminution des stocks de déclinaison si on est sur un module de paiement qui défalque de suite
$stock->charger($perso->valeur, $article->produit->id);
$stock->valeur -= $article->quantite;
$stock->maj();
}
$declinaison->charger($perso->declinaison);
$declinaisondesc->charger($declinaison->id);
// recup valeur declidisp ou string
if ($declinaison->isDeclidisp($perso->declinaison)) {
$declidisp = new Declidisp();
$declidispdesc = new Declidispdesc();
//.........这里部分代码省略.........
示例8: Modules
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
require_once "pre.php";
require_once "auth.php";
require_once "../fonctions/divers.php";
if (!est_autorise("acces_commandes")) {
exit;
}
if (isset($_POST["action"]) && $_POST["action"] == "ajouter") {
$total = 0;
$poids = 0;
$modules = new Modules();
$modules->charger_id($type_paiement);
$client = new Client();
$client->charger_ref($id_client);
$nbart = $_SESSION["commande"]->nbart;
$sessionventeprod = $_SESSION["commande"]->venteprod;
$commande = new Commande();
$commande->client = $client->id;
$commande->transport = $type_livraison;
$commande->paiement = $type_paiement;
$commande->statut = Commande::NONPAYE;
$adr = new Venteadr();
$adr->raison = $client->raison;
$adr->entreprise = $client->entreprise;
$adr->nom = $client->nom;
$adr->prenom = $client->prenom;
$adr->adresse1 = $client->adresse1;
示例9: reprise_paiement
function reprise_paiement($id_paiement, $id_commande)
{
if (!$_SESSION['navig']->client->id) {
redirige(urlfond());
}
$commande = new Commande();
$paiement = new Modules();
if ($commande->charger_id($id_commande) && $paiement->charger_id($id_paiement)) {
if ($commande->client != $_SESSION['navig']->client->id) {
redirige(urlfond());
}
$_SESSION['navig']->panier = new Panier();
$commande->total = $commande->total(true, true);
$commande->paiement = $paiement->id;
$commande->maj();
$_SESSION['navig']->commande = $commande;
$className = $paiement->nom;
$modpaiement = ActionsModules::instance()->instancier($paiement->nom);
$modpaiement->paiement($commande);
}
}