Bonjour,

Voici mon problème:
Je fais une mise à jour d'une donnée venant de la database.
Update sans problème mais quand la page parent se recharge, elle ne m'affiche pas tout le temps la modification effectuée

Pouvez-vous m'aider en fonction du code que vous trouverez ci-dessous?

Merci d'avance
David
Code page parent:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
 
<script type="text/javascript"> 
<!-- 
function popup_category(page,largeur,hauteur,options) 
{ 
    var top=(screen.height-hauteur)/2; 
    var left=(screen.width-largeur)/2;
    window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); 
} 
 
--> 
</script>
	<div id="tablewrapper">
		<div id="tableheader">
        	<div class="search">
                <select id="columns" onchange="sorter.search('query')"></select>
                <input type="text" id="query" onkeyup="sorter.search('query')" />
            </div>
            <span class="details">
				<div>Records <span id="startrecord"></span>-<span id="endrecord"></span> of <span id="totalrecords"></span></div>
        		<div><a href="javascript:sorter.reset()">reset</a></div>
        	</span>
        </div>
        <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable">
            <thead>
                <tr>
                    <th class="nosort"><h3>ID</h3></th>
                    <th><h3>Name Category</h3></th>
                    <th><h3>Category Free</h3></th>
                    <th><h3>Amount</h3></th>
                    <th class="nosort"><h3></h3></th>
                    <th class="nosort"><h3></h3></th>
                </tr>
            </thead>
            <tbody>
			<?php 
			$sql = "SELECT * FROM category_parent;";
 
			$result = mysql_query($sql);
 
			while($row = mysql_fetch_array($result)){
				echo "<tr>\n";
				echo "<td>".$row["cp_id_category_parent"]."</td>\n";
				echo "<td><a href=\"".htmlentities("?section=manage_category_child&id=".$row["cp_id_category_parent"]."")."\">".$row["cp_name_category"]."</a></td>\n";
				if($row["cp_free"] == 0){
					echo "<td>No</td>\n";
				}else{
					echo "<td>Yes</td>\n";
				}
				echo "<td>".$row["cp_amount"]."</td>\n";
				if($row["cp_active"] == 1){
					echo "<td><a href=\"".htmlentities("?section=active_category&id=".$row["cp_id_category_parent"]."")."\"><img src=\"css/img/yes.png\" width=\"16\" height=\"16\" title=\"Active: Yes\" alt=\"Yes\" /></a></td>\n";
				}else{
					echo "<td><a href=\"".htmlentities("?section=active_category&id=".$row["cp_id_category_parent"]."")."\"><img src=\"css/img/delete.png\" width=\"16\" height=\"16\" title=\"Active: No\" alt=\"No\" /></a></td>\n";
				}
				?>
				<td><a name="tagada" href='javascript:popup_category("<?php echo htmlentities("?section=edit_category&id=".$row["cp_id_category_parent"]."");?>",500,500,"location=no,resizable=no,menubar=no,scrollbars=no,statusbar=no")'><img src="css/img/edit.png" width="16" height="16" title="Edit the category" alt="edit" /></a></td>
				<?
				//echo "<td><a href=\"".htmlentities("?section=edit_category&id=".$row["cp_id_category_parent"]."")."\"><img src=\"css/img/edit.png\" width=\"16\" height=\"16\" title=\"Edit the category\" alt=\"edit\" /></a></td>\n";
				echo "</tr>\n";
			}
			?>
            </tbody>
        </table>
        <table cellpadding="0" cellspacing="0" border="0" class="tinytable">
          <tbody>			
          </tbody>
        </table>
        <div id="tablefooter">
      <div id="tablenav">
            	<div>
                    <img src="css/img/first.gif" width="16" height="16" alt="First Page" onclick="sorter.move(-1,true)" />
                    <img src="css/img/previous.gif" width="16" height="16" alt="First Page" onclick="sorter.move(-1)" />
                    <img src="css/img/next.gif" width="16" height="16" alt="First Page" onclick="sorter.move(1)" />
                    <img src="css/img/last.gif" width="16" height="16" alt="Last Page" onclick="sorter.move(1,true)" />
                </div>
                <div>
                	<select id="pagedropdown"></select>
				</div>
                <div>
                	<a href="javascript:sorter.showall()">view all</a>
                </div>
            </div>
			<div id="tablelocation">
            	<div>
                    <select onchange="sorter.size(this.value)">
                    <option value="5">5</option>
                        <option value="10" selected="selected">10</option>
                        <option value="20">20</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                    <span>Entries Per Page</span>
                </div>
                <div class="page">Page <span id="currentpage"></span> of <span id="totalpages"></span></div>
            </div>
        </div>
    </div>
	<script type="text/javascript">
	var sorter = new TINY.table.sorter('sorter','table',{
		headclass:'head',
		ascclass:'asc',
		descclass:'desc',
		evenclass:'evenrow',
		oddclass:'oddrow',
		evenselclass:'evenselected',
		oddselclass:'oddselected',
		paginate:true,
		size:10,
		colddid:'columns',
		currentid:'currentpage',
		totalid:'totalpages',
		startingrecid:'startrecord',
		endingrecid:'endrecord',
		totalrecid:'totalrecords',
		hoverid:'selectedrow',
		pageddid:'pagedropdown',
		navid:'tablenav',
		sortcolumn:1,
		sortdir:1,
		//sum:[8],
		//avg:[6,7,8,9],
		columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}],
		init:true
	});
  </script>
Code Page popup (enfant) :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
<?php 
$sql = "SELECT cp_id_category_parent,cp_name_category FROM category_parent
		WHERE cp_id_category_parent='".$_GET["id"]."';";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);		
 
if(isset($_POST["button"])){
	$error = "";
	$id_category = $_POST["id_category"];
	$category_parent = $_POST["category_parent"];
	if(empty($_POST["category_parent"])){
		$error .= "<p class\"message\">The fiels Category Parent is empty.</p>";
	}
	if($error == 0){
		$sql = "UPDATE category_parent SET cp_name_category='".$category_parent."'
				WHERE cp_id_category_parent='".$id_category."';";
		$result = mysql_query($sql);		
	}
	if($result){
		echo "<script language=\"javascript\" type=\"text/javascript\"> setTimeout(\"window.close()\", 2000); </script>";
	}	
}
?>
<!--<script language="JavaScript" type="text/javascript">-->
<script type="text/javascript">
function refresh(){
/*window.opener.location.href="?section=manage_category";*/
window.opener.location = window.opener.location;
}
</script>
<?php 
if($error != ""){
	echo $error;
}
?>
<form name="edit_category" action="?section=edit_category" method="post" >
	<h1>Modifify this Category : <?php echo $row["cp_name_category"];?></h1>
	<p>Name of the Parent Category :</p>
	<input name="id_category" type="hidden" value="<?php echo $row['cp_id_category_parent'];?>"/>
	<input type="text" name="category_parent" value="<?php echo $row["cp_name_category"];?>" />
	<input type="submit" name="button" value="Update" onclick="refresh()" />
</form>