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
   |  
 
//if we want delete one or several context
if(@$_REQUEST['delete_context'])
{
 
  $sql="SELECT * FROM $prefix"."context WHERE ID_version='".$_SESSION['id_version']."';";
	$done=mssql_query($sql);
	$nb_delete = 0;
  while($fixe = mssql_fetch_array($done))
	{
	  //if context is selected
		if(@$_REQUEST["id_context".$fixe['ID']])
	  {
		  $sql = "SELECT COUNT(ID_instance) AS nb_instance FROM $prefix"."context_instance WHERE ID_context='".$fixe['ID']."';";
		  $nb_done = mssql_query($sql);
		  $nb_res = mssql_fetch_array($nb_done);
		  $nb_instance = $nb_res['nb_instance'];
 
		  //if context is shared
		  if($nb_instance>=1)
		  {
 
			  ?>
			  <script type='text/javascript'>
 
					if(confirm("Be carreful, this context is shared with other test case. Deleted it will affect all other test case. Confirm?"))
					{
 
					  <?php echo "window.open(\"./traitment/remove_context.php?id_context=".$fixe['ID']."¶m_link=".$fixe['parameter_link']."\", \"remove\", 'height=200, width=350, top=10, left=10, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=no, status=no');";  ?>
 
					}
 
			  </script>
			  <?php
                        }
                        else
                        {
                          remove_context($fixe['ID'], $fixe['parameter_link']);
                          
                }
                }
        }
  
}
 
 
 
et dans remove_context.php
 
 
        $index_C = $_REQUEST['id_context'];     
        $link = $_REQUEST['param_link'];
        
        remove_context($index_C, ".".$link);
 
 
 
 
?>
 
<script type="text/javascript">
	window.opener.location.reload();
	self.close();
</script> | 
Partager