Aidez-moi sur olorbox-master

mheddine Messages postés 4 Date d'inscription samedi 21 juin 2014 Statut Membre Dernière intervention 21 juillet 2014 - Modifié par mheddine le 21/07/2014 à 17:29
jordane45 Messages postés 38145 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 25 avril 2024 - 21 juil. 2014 à 17:11
Bonjour,

J'ai un problème mes amis dans ma popup (colorbox-master) après modification des données dans la popup je clic pour valider l'action (modifier, suprimer) et la fenêtre reste toujours affichée.

Ce que je veux après l'action que j'ai fait j'aimerai de la fenêtre se ferme et refresh la page principal

Figure : N°1 en action.


Figure : N°2 après action.




La page de l'action modification m'envoies vers une autre page que j'ai nommé close.php et dans cette page que je veux fermer ma popup et me fais la refresh

<?php 
	session_start();
	include ("../config.php"); 
	include ("../verifications.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<title>Catégories</title>
	<link href="../css.css" rel="stylesheet" type="text/css" media="screen" />

	<link rel="stylesheet" href="../claro.css" />
	<script src="../dojo.xd.js" data-dojo-config="parseOnLoad: true"></script>
	<?php
		$result = mysql_query("SELECT * FROM article where id=".$_GET['id']."");
		while($row = mysql_fetch_array($result)) { 
	?>
		<script>
			// Require the Tooltip class
			dojo.require("dijit.Tooltip");
			// When the DOM and reources are ready....
			dojo.ready(function(){
				// Add tooltip of his picture
				new dijit.Tooltip({
					connectId: ["img1"],
					label: "<img src='../../photos/<?php echo "$row[img1]"; ?>' alt='<?php echo "$row[nomarticle]"; ?>' width='500px' height='50%' />"
				});
				new dijit.Tooltip({
					connectId: ["img2"],
					label: "<img src='../../photos/<?php echo "$row[img2]"; ?>' alt='<?php echo "$row[nomarticle]"; ?>' width='500px' height='50%' />"
				});
				new dijit.Tooltip({
					connectId: ["img3"],
					label: "<img src='../../photos/<?php echo "$row[img3]"; ?>' alt='<?php echo "$row[nomarticle]"; ?>' width='500px' height='50%' />"
				});
				new dijit.Tooltip({
					connectId: ["img4"],
					label: "<img src='../../photos/<?php echo "$row[img4]"; ?>' alt='<?php echo "$row[nomarticle]"; ?>' width='500px' height='50%' />"
				});
				new dijit.Tooltip({
					connectId: ["img5"],
					label: "<img src='../../photos/<?php echo "$row[img5]"; ?>' alt='<?php echo "$row[nomarticle]"; ?>' width='500px' height='50%' />"
				});
				// Add custom tooltip
				var myTip = new dijit.Tooltip({
					connectId: ["hoverLink"],
					label: "Don't I look funky?",
					"class": "customTip"
				});
			});
		</script>
	<?php
	}
	?>
	<style type="text/css">
	.image_flottante {
		width: 30px;
		height: 30px;
	    float: inherit;
	    display: run-in;
	    margin: 2px 0 2px 10px;
		padding:1px 0 1px 10px;    
		position: absolute;
	}
	</style>
	
	
</head>
<body>
<div id="main">
<?php

//edit records
if (isset($_POST['edit'])) {

	$id = $_POST['id'];
	$nomarticle	= mysql_real_escape_string(htmlspecialchars($_POST['nomarticle']));
	$quant 		= mysql_real_escape_string(htmlspecialchars($_POST['quant']));
	$categ		= mysql_real_escape_string(htmlspecialchars($_POST['categ']));
	$scateg		= mysql_real_escape_string(htmlspecialchars($_POST['scateg']));
	$sscateg	= mysql_real_escape_string(htmlspecialchars($_POST['sscateg']));
	$prix		= mysql_real_escape_string(htmlspecialchars($_POST['prix']));
	$prixvend	= mysql_real_escape_string(htmlspecialchars($_POST['prixvend']));
	$prixmarg	= mysql_real_escape_string(htmlspecialchars($_POST['prixmarg']));
	$prixestim	= mysql_real_escape_string(htmlspecialchars($_POST['prixestim']));
	$descrip	= mysql_real_escape_string(htmlspecialchars($_POST['descrip']));
	$taile 		= mysql_real_escape_string(htmlspecialchars($_POST['taile']));
	$note 		= mysql_real_escape_string(htmlspecialchars($_POST['note']));
	$etat		= mysql_real_escape_string(htmlspecialchars($_POST['etat']));

	$img1 = $_FILES['img1']['name'];
	$img2 = $_FILES['img2']['name'];
	$img3 = $_FILES['img3']['name'];
	$img4 = $_FILES['img4']['name'];
	$img5 = $_FILES['img5']['name'];

	if ($nomarticle== ''){
		$error = "<div class='n_warning'><p>Attention, le ou les champs sont vide Merci de saisir tous les champs !</p></div>";
		valid($nomarticle, $error);
	}

	else{
	
		$datem 	= date("d-m-Y H:i:s");
		$modi 	= $pseudo;
	
		mysql_query("update article set datem 		= '$datem' 	where id = '$id'");
		mysql_query("update article set modi 		= '$modi' 	where id = '$id'");
		mysql_query("update article set nomarticle 	= '$nomarticle' where id = '$id'");
		mysql_query("update article set quant 		= '$quant' 	where id = '$id'");
		mysql_query("update article set categ 	 	= '$categ' 	where id = '$id'");
		mysql_query("update article set scateg	 	= '$scateg' 	where id = '$id'");
		mysql_query("update article set sscateg		= '$sscateg' 	where id = '$id'");
		mysql_query("update article set prix		= '$prix' 	where id = '$id'");
		mysql_query("update article set prixvend 	= '$prixvend' 	where id = '$id'");
		mysql_query("update article set prixmarg 	= '$prixmarg' 	where id = '$id'");
		mysql_query("update article set prixestim	= '$prixestim' 	where id = '$id'");
		mysql_query("update article set descrip	 	= '$descrip' 	where id = '$id'");
		mysql_query("update article set taile	 	= '$taile' 	where id = '$id'");
		mysql_query("update article set note		= '$note' 	where id = '$id'");
		mysql_query("update article set etat		= '$etat' 	where id = '$id'");

		echo "<meta http-equiv='refresh' content='$meta_refaction;url=../close.php' />";
		echo "<div id='n_oka' align='center'><p>La mise à jour de l´ article à réussi</div>";
		
		if (!empty($img1)){
			$dir  = "../../photos/";
			copy($_FILES["img1"]["tmp_name"],"".$dir."".$_FILES["img1"]["name"]);
			mysql_query("update article set img1 = '$img1' where id = '$id'");
		}
		if (!empty($img2)){
			$dir  = "../../photos/";
			copy($_FILES["img2"]["tmp_name"],"".$dir."".$_FILES["img2"]["name"]);
			mysql_query("update article set img2 = '$img2' where id = '$id'");
		}
		if (!empty($img3)){
			$dir  = "../../photos/";
			copy($_FILES["img3"]["tmp_name"],"".$dir."".$_FILES["img3"]["name"]);
			mysql_query("update article set img3 = '$img3' where id = '$id'");
		}
		if (!empty($img4)){
			$dir  = "../../photos/";
			copy($_FILES["img4"]["tmp_name"],"".$dir."".$_FILES["img4"]["name"]);
			mysql_query("update article set img4 = '$img4' where id = '$id'");
		}
		if (!empty($img5)){
			$dir  = "../../photos/";
			copy($_FILES["img5"]["tmp_name"],"".$dir."".$_FILES["img5"]["name"]);
			mysql_query("update article set img5 = '$img5' where id = '$id'");
		}
		
    }
}
?>

				<form class="main" enctype="multipart/form-data" method="post" action="">
				<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>" />
					<table>
						<tr>
							<td width=><label for="name">Catégorie :</label></td>
							<td>
								  <select name='categ'>
								<?php
								        $res = mysql_query("SELECT * FROM categ order by id=".$_GET['id']."");
								        while($row = mysql_fetch_assoc($res)){
								            echo "<option value='".$row["categ"]."'>".$row["categ"]."</option>";
								        }
								?>
								    </select>
								<a href="../categ/index.php?action=list" rel="lightbox[external 50% 350]" title="Ajouter les categories"><img src="../../images/i_add.png" style="border:none;margin:5px 0 5px 10px; position:absolute" title="Ajouter une categorie" /></a>
							</td>
						</tr>
						<tr>
							<td width=><label for="name">Sous catégorie :</label></td>
							<td>
								  <select name='scateg'>
								<?php
								        $res = mysql_query("SELECT * FROM scateg order by id=".$_GET['id']."");
								        while($row = mysql_fetch_assoc($res)){
								            echo "<option value='".$row["scateg"]."'>".$row["scateg"]."</option>";
								        }
								?>
								    </select>
								<a href="../scateg/index.php?action=list" rel="lightbox[external 50% 350]" title="Ajouter les categories"><img src="../../images/i_add.png" style="border:none;margin:5px 0 5px 10px; position:absolute" title="Ajouter une categorie" /></a>
							</td>
						</tr>
						<tr>
							<td width=><label for="name">Sous sous catégorie :</label></td>
							<td>
								  <select name='sscateg'>
								<?php
								        $res = mysql_query("SELECT * FROM sscateg order by id=".$_GET['id']."");
								        while($row = mysql_fetch_assoc($res)){
								            echo "<option value='".$row["sscateg"]."'>".$row["sscateg"]."</option>";
								        }
								?>
								    </select>
								<a href="../sscateg/index.php?action=list" rel="lightbox[external 50% 350]" title="Ajouter les categories"><img src="../../images/i_add.png" style="border:none;margin:5px 0 5px 10px; position:absolute" title="Ajouter une categorie" /></a>
							</td>
						</tr>

				<?php
					$result = mysql_query("SELECT * FROM article where id=".$_GET['id']."");
					while($row = mysql_fetch_array($result)) { 
				?>

						<tr>
							<td width=><label for="name">Qantité :</label></td>
							<td>
							<select name='quant'>
								<option value="<?php echo $row["quant"]; ?>"><?php echo $row["quant"]; ?></option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
							</select>
							</td>
						</tr>
						<tr>
							<td width=><label for="etat">Etat :</label></td>
							<td>
							<select name='etat'>
								<option value="<?php echo $row["etat"]; ?>"><?php echo $row["etat"]; ?>Non Vendu</option>
								<option value="">Non Vendu</option>
								<option value="vendu">Vendu</option>
							</select>
							</td>
						</tr>
						<tr>
							<td><label for="name">Nom d'article :</label></td>
							<td><input type="text" id="nomarticle" name="nomarticle" value="<?php echo $row["nomarticle"]; ?>" /></td>
						</tr>
						<tr>
							<td><label for="name">Prix pour clients :</label></td>
							<td><input type="text" id="prix" name="prix" value="<?php echo $row["prix"]; ?>" /></td>
						</tr>
						<tr>
							<td><label for="name">Prix de vendeur :</label></td>
							<td><input type="text" id="prixvend" name="prixvend" value="<?php echo $row["prixvend"]; ?>" /></td>
						</tr>
						<tr>
							<td><label for="name">Marge du site :</label></td>
							<td><input type="text" id="prixmarg" name="prixmarg" value="<?php echo $row["prixmarg"]; ?>" /></td>
						</tr>
						<tr>
							<td><label for="name">Estimation de prix :</label></td>
							<td><input type="text" id="prixestim" name="prixestim" value="<?php echo $row["prixestim"]; ?>" /></td>
						</tr>
						<tr>
							<td valign="top"><label for="name">Description de l'article :</label></td>
							<td><textarea name="descrip" class="textarea" rows="10"><?php echo $row["descrip"]; ?></textarea></td>
						</tr>
						<tr>
							<td valign="top"><label for="name">Taile d'article :</label></td>
							<td><textarea name="taile" class="textarea" rows="10"><?php echo $row["taile"]; ?></textarea></td>
						</tr>
						<tr>
							<td valign="top"><label for="name">Note d'article :</label></td>
							<td><textarea name="note" class="textarea" rows="10"><?php echo $row["note"]; ?></textarea></td>
						</tr>
					</table>
					<div class="element">
						<label for="lienimage">Ajouter une image :</label>
						<input type="file" id="file" name="img1" /> <a href="../../photos/<?php echo "$row[img1]"; ?>" id="img1"><img src="../../photos/<?php echo "$row[img1]"; ?>" class="image_flottante" /></a><br />
						<input type="file" id="file" name="img2" /> <a href="../../photos/<?php echo "$row[img2]"; ?>" id="img2"><img src="../../photos/<?php echo "$row[img2]"; ?>" class="image_flottante" /></a><br />
						<input type="file" id="file" name="img3" /> <a href="../../photos/<?php echo "$row[img3]"; ?>" id="img3"><img src="../../photos/<?php echo "$row[img3]"; ?>" class="image_flottante" /></a><br />
						<input type="file" id="file" name="img4" /> <a href="../../photos/<?php echo "$row[img4]"; ?>" id="img4"><img src="../../photos/<?php echo "$row[img4]"; ?>" class="image_flottante" /></a><br />
						<input type="file" id="file" name="img5" /> <a href="../../photos/<?php echo "$row[img5]"; ?>" id="img5"><img src="../../photos/<?php echo "$row[img5]"; ?>" class="image_flottante" /></a><br />
					</div>
					<div class="entry">
						<input class="btn" type="submit" name="edit" value="Modifier" />
					</div>
				</form>
				
</div>
</body>
</html>
<?php
}
?>

La page close.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>sans titre 1</title>
	<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$(".box .h_title").not(this).next("ul").hide("normal");
			$(".box .h_title").not(this).next("#home").show("normal");
			$(".box").children(".h_title").click( function() { $(this).next("ul").slideToggle(); });
		});
		

    </script>
	<link rel="stylesheet" href="../plugins/colorbox-master/mediaboxAdv-Dark.css" type="text/css" title="dark" media="screen,projection" />
	<script src="../plugins/colorbox-master/mootools-core-1.3.2.js" type="text/javascript"></script>
	<script src="../plugins/colorbox-master/mediaboxAdv.js" type="text/javascript"></script>

</head>
<body onload="mbCloseLink">
</div>
</body>
</html>

1 réponse

jordane45 Messages postés 38145 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 25 avril 2024 344
21 juil. 2014 à 17:11
Bonjour,

dans ma popup (colorbox-master)

Quel rapport avec la section du forum dans laquelle tu poste ton message.. SQL ??


De plus... sans nous montrer ton code... impossible pour nous de t'aider.

pour rappel :


Merci de garder à l'esprit que CodeS-SourceS est une communauté d'entraide.

Toutes les réponses sur le forum sont assurées par des bénévoles
qui donnent de leur temps libre pour aider à résoudre les problèmes.

A noter également que nous ne faisons pas dans le "tout cuit" et ne sommes pas là pour remplacer votre moteur de recherches...
... Soit tu trouves ton bonheur dans la partie source du site, soit à l'aide de ton moteur de recherche favori.

Ici, nous aidons volontiers sur des sujets techniques précis.

Je t'invite à lire avec attention le contenu du lien suivant :
charte-de-commentcamarche-net : conseils-d-ecriture

Ainsi que celui concernant l'utilisation de la coloration syntaxique :
Utilisation des Balises de code

Merci donc de reformuler ta demande en respectant ces quelques points.

Quelques points essentiels à retenir :
- On ne pose qu' UNE question par discussion
- Le titre de la question doit refléter le souci rencontré ( Help.. SOS.. Urgent.. n'apporte aucune information utile !)
- Lorsque votre question est résolue.. merci de clore le sujet (lien Marquer comme résolu se trouvant sous le titre de votre question).
- Une question obtiendra de meilleurs réponses si elle est correctement rédigée, que les explications sont clairs et qu'éventuellement vous postez le code qui pose problème.
- Si vous avez un message d'erreur..... MARQUEZ LE (dans son intégralité).

Merci.


0
Rejoignez-nous