示例#1
0
文件: index.php 项目: PayIcam/shotgun
 } else {
     $id = $_GET["id"];
 }
 $desc = new Desc();
 $desc->select($id);
 try {
     // $payutcClient->checkRight(array("user">true, "app"=>false, "fun_check"=>true, "fun_id"=>$desc->payutc_fun_id));
     checkRight($payutcClient, true, false, true, $desc->payutc_fun_id);
 } catch (JsonException $e) {
     $app->flash('info', 'Vous n\'avez pas les droits suffisants.');
     $app->redirect("admin");
 }
 if (isset($_GET["choice_id"])) {
     $choice_id = $_GET["choice_id"];
     $choice = new Choice($id);
     $choice->select($choice_id);
     $form = $choice->getForm("Modification d'un choix", "choiceform?id=" . $id . "&choice_id=" . $choice_id, "Modifier");
     $form->load();
     // article cotisant
     $payutcClient->setProduct(array("obj_id" => $choice->payutc_art_idC, "name" => $desc->titre . " " . $choice->name, "parent" => $desc->payutc_cat_id, "prix" => $choice->priceC, "stock" => $choice->stock, "image" => '', "alcool" => 0, "cotisant" => False, "fun_id" => $desc->payutc_fun_id));
     // article non cotisant
     // $payutcClient->setProduct(array(
     //         "obj_id" => $choice->payutc_art_idNC,
     //         "name" => $desc->titre." ".$choice->name,
     //         "parent" =>  $desc->payutc_cat_id,
     //         "prix" => $choice->priceNC,
     //         "stock" => $choice->stock,
     //         "image" => '',
     //         "alcool" => 0,
     //         "cotisant" => False,
     //         "fun_id" => $desc->payutc_fun_id));
示例#2
0
 public function checkStatus($payutcClient, $funId)
 {
     $transaction = $payutcClient->getTransactionInfo(array("fun_id" => $funId, "tra_id" => $this->payutc_tra_id));
     if ($transaction->status != $this->status) {
         $this->date_paiement = date("Y-m-d H:i:s");
         $this->status = $transaction->status;
         $this->update();
         if ($this->status == 'V') {
             $desc = new Desc($this->fk_desc_id);
             $choice = new Choice();
             $choice->select($this->fk_choice_id);
             // send
             $to = $this->user_mail;
             $subject = "[ShotgunUTC] - Confirmation d'achat";
             $message = "Bonjour {$this->user_prenom} {$this->user_nom},<br />\n                <br />\n                Ce mail vient confirmer que tu as bien acheté une place pour :<br />\n                {$desc->titre} - {$choice->name}<br />\n                <br />\n                Ton n° de reservation est le : {$this->id}<br />\n                <br />\n                Normalement les organisateurs te recontacteront prochainement pour te donner plus d'informations.<br />\n                Si ce n'est pas le cas, contacte les ;) <br />\n                <br />\n                En cas de problème, n'essaie pas de contacter shotgun@assos.utc.fr (personne ne reçoit l'adresse)<br />\n                Pour les problèmes 'techniques' tu peux contacter simde@assos.utc.fr<br />\n                ";
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $headers .= 'From: Shotgunutc <*****@*****.**>' . "\r\n";
             mail($to, $subject, $message, $headers);
         }
     }
     return $this->status;
 }