Jump to content

edit de um edit


diokhan
 Share

Recommended Posts

boas

eu tenho na minha pagina uma tabela que mostra projectos e ha um botao que ao clicar mostra as tarefas deste projecto e na tabela das tarefas tenho um botao para editar a tarefa, como posso fazer estas ligaçoes?

deixo aqui parte referente do codigo em causa:

este codigo faz parte do projects.php

if (isset($_SESSION['ACCESS_LEVEL'])){
        	if ($_SESSION['ACCESS_LEVEL']==2){
        	echo"
       			<td align=center>
       				<a href=restrito.php?opcao=project&po=edit&id=$r->ID_PROJECT>
       					<img src=images/pencil.png border=0 align=center></a>
      			</td>
       			<td align=center>
       				<a href=restrito.php?opcao=project&po=delete&id=$r->ID_PROJECT>
       					<img src=images/cross.png border=0 align=center></a>
       			</td>
       			<td align=center>
       				<a href=restrito.php?opcao=project&po=task&id=$r->ID_PROJECT>
       					<img src=images/clipboard_text.png border=0 align=center></a>
       			</td>";
        	}
        	}
		echo'</tr>';
	}
        
echo "</table>";
$paginacao->imprimeBarraNavegacao(); 

if ( isset ($_GET['po'])){
	echo"<table align=center>";
		if ($_GET['po']=='edit'){
			include('admin/edit_project.php');
		}elseif($_GET['po']=='delete'){
			include('admin/delete_project.php');
		}elseif($_GET['po']=='task'){
			include('admin/viewtask.php');
		}
	echo "</table>";
}

este codigo faz parte do viewtask.php

if (isset($_SESSION['ACCESS_LEVEL'])){
        	if ($_SESSION['ACCESS_LEVEL']==2){
        	echo"
       			<td align=center>
       				<a href=restrito.php?opcao=project&po=task&tas=edit&id=$row[iD_TASK]>
       					<img src=images/pencil.png border=0 align=center></a>
      			</td>
       			<td align=center>
       				<a href=restrito.php?opcao=project&po=task&tas=delete&id=$row[iD_TASK]>
       					<img src=images/cross.png border=0 align=center></a>
       			</td>";
        	}
        	}
echo "</tr>";
}
echo "</table>";

if ( isset ($_GET['tas'])){
	echo"<table align=center>";
		if ($_GET['tas']=='edit'){
			include('admin/edit_task.php');
		}elseif($_GET['tas']=='delete'){
			include('admin/delete_task.php');
		}
	echo "</table>";
}

sempre que faço para ir ao editar tarefa aparece a mesma barra em cima que aparece quando faço para ver as tarefas, tipo uma barra de titulo e nao queria que aparecesse assim. alguma sugestao?  ?

...Join the dark side...and get a free cookie...

Link to comment
Share on other sites

eu arranjei uma solução, talvez não seja a melhor mas funciona.

if (isset($_SESSION['ACCESS_LEVEL'])){
        	if ($_SESSION['ACCESS_LEVEL']==2){
        	echo"
       			<td align=center>
       				<a href=restrito.php?opcao=edit_task&tas=edit&id=$row[iD_TASK]>
       					<img src=images/pencil.png border=0 align=center></a>
      			</td>
       			<td align=center>
       				<a href=restrito.php?opcao=edit_task&tas=delete&id=$row[iD_TASK]>
       					<img src=images/cross.png border=0 align=center></a>
       			</td>";
        	}
        	}
echo "</tr>";
}
echo "</table>";

if (isset ($_GET['tas'])){
	echo"<table align=center>";
		if ($_GET['tas']=='edit'){
			include('admin/edit/edit_task.php');
		}elseif($_GET['tas']=='delete'){
			include('admin/edit/delete_task.php');
		}

e no ficheiro do restrito.php fiz:

elseif($_GET['opcao']=="edit_task"){
include('admin/edit/edit_task.php');
}

basicamente, sempre que quiser editar uma tarefa do projecto ele manda-me para outra pagina. não seria bem isto que pretendia mas esta a funcionar  😄

...Join the dark side...and get a free cookie...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.