예제 #1
0
         $str_html = "<html><head></head><body><p>" . str_replace("\n", "</p><p>", $str) . "</p></body></html>";
         $envoi_mail = requetemysql::envoyer_mail2(array('message_txt' => $str_txt, 'message_html' => $str_html, 'mail' => $mail_supr_perm, 'sujet' => $mon_titre, 'from_mail' => '', 'from_name' => ''));
         if (empty($envoi_mail)) {
             throw new Exception("Error in envoyer_mail2 function ! param : message_txt: " + $str_txt + " message_html: " + $str_html + " mail:" + $mail_supr_perm);
         }
         $envoi_mail2 = requetemysql::envoyer_mail2(array('message_txt' => $str_txt, 'message_html' => $str_html, 'mail' => $mail_valid_perm, 'sujet' => $mon_titre, 'from_mail' => '', 'from_name' => ''));
         if (empty($envoi_mail2)) {
             throw new Exception("Error in envoyer_mail2 function ! param : message_txt: " + $str_txt + " message_html: " + $str_html + " mail:" + $mail_valid_perm);
         }
         $recherche_consult = requetemysql::change_permission(array('choix' => $_POST['choix'], 'numero_consult' => $_POST['num_consult'], 'choix_ant' => $login_supr_perm));
         echo $recherche_consult;
     } catch (Exception $e) {
         echo json_encode('Erreur reqête Mysql section : change_permission ficher: reglage.php ', $e->getMessage(), "\n");
     }
 } elseif ($data3 == "totaux") {
     $recup_totaux = requetemysql::totaux(array('debut' => $_POST['debut'] * 1000, 'fin' => $_POST['fin'] * 1000, 'choix' => 'total'));
     echo $recup_totaux;
 } elseif ($data3 == "totaux2") {
     $recup_totaux = requetemysql::totaux2(array('debut' => $_POST['debut'] * 1000, 'fin' => $_POST['fin'] * 1000, 'choix' => 'total', 'recherche' => array("espece", "cheque", "carte", "virement")));
     echo $recup_totaux;
 } elseif ($data3 == "remise") {
     $recup_totaux = requetemysql::brouillard(array('debut' => $_POST['debut'] * 1000, 'fin' => $_POST['fin'] * 1000, 'choix' => 'cheque'));
     echo $recup_totaux;
 } elseif ($data3 == "save_remise") {
     $date_actu = date("d/m/Y");
     $sql = "INSERT INTO `remise`(`id`, `numero_remise`, `date`, `remise`, `veto`) VALUES ('', :remise_num, ( UNIX_TIMESTAMP(STR_TO_DATE(:date_actu,'%d/%m/%Y')) *1000 ), :liste_remise, :permission)";
     $sth = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
     $sth->execute(array(':remise_num' => $_POST['remise_num'], ':date_actu' => $date_actu, ':liste_remise' => $_POST['liste_remise'], ':permission' => $_SESSION['login']));
     $remise_id = $db->lastInsertId();
     echo $remise_id;
 } elseif ($data3 == "search_remise") {