63 lines
3.4 KiB
PHP
Executable File
63 lines
3.4 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
$resConn='';
|
|
include ($includePathAdmin. "/123connect.php");
|
|
|
|
// -----------------------------------------------------
|
|
// 1 - recup idClient 123clients
|
|
// -----------------------------------------------------
|
|
include ($includePathAdmin. "/req/reqRecupClient123.php");
|
|
|
|
// -----------------------------------------------------
|
|
// 1.2 - verif si la ligne existe pas deja dans 123projets
|
|
// $resConn='';
|
|
$idClientExist="";
|
|
// $reqSelect="SELECT idClient FROM `123projets` WHERE idClient=" .$idClient123. " and idModule=2;";
|
|
$tabResult= dynRequete_select('SELECT', '`123projets`', ['idClient'], ['idClient' =>$idClient123, 'idModule' => 2], '', 'domain.reqUpdateToTransfert.php', 1, 0,'');
|
|
if ($tabResult) {
|
|
$idClientExist=$tabResult[0]['idClient'];
|
|
}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['pas de connect' => ''], '');}
|
|
|
|
// -----------------------------------------------------
|
|
// 1.3 - update 123Projets ou insert 123projets
|
|
// -----------------------------------------------------
|
|
if (empty($today)) {
|
|
date_default_timezone_set( 'Europe/Paris' );
|
|
$dateTimeObj = new DateTime('now', new DateTimeZone('Europe/Paris'));
|
|
$today = IntlDateFormatter::formatObject( $dateTimeObj, "y-MM-dd_HH-mm", 'fr' );
|
|
}
|
|
$next = date('Y-m-d', strtotime('+1 year', strtotime($today)) );
|
|
if ($idClientExist=="" || $resConn=="") {
|
|
// 1.3.1 requete insert
|
|
$reqInsert="INSERT INTO `123projets` (numModule, idClient, siteName, idModule, prix, is_payed, param1, param2, stripePaiement_id, stripePortal_id, stripeSubscription_id, stripeClient_id, statut, dateAchat, dateRenouvellement, description, commentaires)
|
|
VALUES (0, " .$idClient123. ", '" .$_SESSION['siteNomTech']. "', '2', '0.00', 0, '2','" .$domToBuy. "', 'pay_id', 'portail_id', 'sub_id'','cust_id,'actif', '" .$today. "', 'sans', 'Domaine redirigé','Redirection de domaine a faire par le client' );";
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['reqInsert' => $reqInsert], 'domain.reqUpdateToTransfert.php');}
|
|
$resConn='';
|
|
$resConn=$connexion->query($reqInsert);
|
|
if ($resConn) {
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Insert module domain Redirection ok' => ''], '');}
|
|
}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['; if (isset($debug[2]) && $debug[2] ==' => '', 'reqInsert' => $reqInsert], 'domain.reqUpdateToTransfert.php');}
|
|
}
|
|
else {
|
|
// 1.3.2 - update 123Projets
|
|
$reqUpdate="UPDATE 123projets SET param1='2', param2='" .$domToBuy. "', statut='actif', commentaire='Domaine redirigé', description='Redirection de domaine a faire par le client' WHERE idClient='" .$idClient123. "'' and idModule='2';";
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['reqUpdate' => $reqUpdate], 'domain.reqUpdateToTransfert.php');}
|
|
$resConn='';
|
|
|
|
$resConn=$connexion->query($reqUpdate);
|
|
if ($resConn) {
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Update module domain Redirection ok' => ''], '');}
|
|
}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['; if (isset($debug[2]) && $debug[2] ==' => '', 'reqUpdate' => $reqUpdate], 'domain.reqUpdateToTransfert.php');}
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Etape 7 to done
|
|
// -----------------------------------------------------
|
|
if ($resConn) {
|
|
include ("reqUpdateEtape7.php");
|
|
}
|
|
?>
|