40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
<?php
|
|
|
|
session_start();
|
|
global $objDatabase, $vDomaine, $strLangue;
|
|
require_once "php/inc_fonctions.php";
|
|
|
|
if (!empty($_GET['param1']))
|
|
$key_chain_id = $_GET['param1'];
|
|
else
|
|
$key_chain_id = 0;
|
|
$defaut_landingpage="https://ms1.ca";
|
|
|
|
$sqlkey_chain = "SELECT * FROM key_chain WHERE pk_key_chain = " . $key_chain_id ;
|
|
$infoCompte = $objDatabase->fxGetRow($sqlkey_chain);
|
|
if (!$infoCompte==null){
|
|
|
|
$mem_count=$infoCompte['key_chain_count']+1;
|
|
$update_plus="";
|
|
if ($infoCompte['key_chain_com_id']==0 && isset($_SESSION['com_id'])){
|
|
$update_plus="key_chain_com_id=".$_SESSION['com_id'].",";}
|
|
|
|
$sqlUpdate = "UPDATE key_chain SET ".$update_plus."key_chain_adress_ip='". $_SERVER['REMOTE_ADDR'] ."',key_chain_count = ".$mem_count." WHERE pk_key_chain = " . $key_chain_id ;
|
|
$qryUpdate = $objDatabase->fxQuery($sqlUpdate);
|
|
|
|
header("Location: ".$infoCompte['key_chain_http']);
|
|
}else{
|
|
if (isset($_SESSION['com_id'])){
|
|
$mem_com_id=$_SESSION['com_id'];
|
|
}else{
|
|
$mem_com_id=0;
|
|
}
|
|
|
|
|
|
$sqlUpdate = "insert key_chain SET key_chain_com_id=".$mem_com_id.",key_chain_timestamp=now(),key_chain_http='".$defaut_landingpage."',key_chain_adress_ip='". $_SERVER['REMOTE_ADDR'] ."',key_chain_count = 1,pk_key_chain=" . $key_chain_id;
|
|
$qryUpdate = $objDatabase->fxQuery($sqlUpdate);
|
|
|
|
header("Location: $defaut_landingpage" );
|
|
}
|
|
exit;
|