Bonjour, j'ai un véritable problème pour renommer un dossier physiquement. Logiquement, çà marche, avec UPDATE, mais pas physiquement. Mon problème se situe dans la partie où j'ai mis mon code en gras, question de mieux situer ma difficulté. Pouvez-vous m'aider?
Voici mon code : j'ai un table appelée "dossier" dans laquelle il y a tous les champs que vous voyez là ci-dessous.
<?php
$id = $_POST['id'];
$actif = $_POST['actif'];
$sys_ins_date = $_POST['sys_ins_date'];
$sys_upd_date = $_POST['sys_upd_date'];
$sys_del_date = $_POST['sys_del_date'];
$sys_ins_user = $_POST['sys_ins_user'];
$sys_upd_user = $_POST['sys_upd_user'];
$numero = $_POST['numero'];
$libelle = $_POST['libelle'];
$new_libelle = $_POST['new_libelle'];
$id_agt = $_POST['id_agt'];
$nomfull_agt = $_POST['nomfull_agt'];
$id_entite = $_POST['id_entite'];
$code_org = $_POST['code_org'];
$code_div = $_POST['code_div'];
$service = $_POST['service'];
$niv_conf = $_POST['niv_conf'];
$priorite = $_POST['priorite'];
$id_agt_resp = $_POST['id_agt_resp'];
$nomfull_agt_resp = $_POST['nomfull_agt_resp'];
$code_org_resp = $_POST['code_org_resp'];
$code_div_resp = $_POST['code_div_resp'];
$service_resp = $_POST['service_resp'];
$id_agt_dest = $_POST['id_agt_dest'];
$nomfull_agt_dest = $_POST['nomfull_agt_dest'];
$code_org_dest = $_POST['code_org_dest'];
$code_div_dest = $_POST['code_div_dest'];
$service_dest = $_POST['service_dest'];
$type = $_POST['type'];
$categorie = $_POST['categorie'];
$genre = $_POST['genre'];
$resume = $_POST['resume'];
$traitement = $_POST['traitement'];
$recommandation = $_POST['recommandation'];
$dtdebut = $_POST['dtdebut'];
$dtstatut = $_POST['dtstatut'];
$dtmaj = $_POST['dtmaj'];
include('lisaApp/connexion.php');
[b]$url = "archives/dossiers/";
$doc = $libelle;
$doc_modif = $url.$doc;
$doc2 = $new_libelle;
$doc_modif2 = $url.$doc2;
$sql
mysql_query('SELECT id,libelle FROM dossier WHERE id "'.$id.'" AND libelle = "'.$libelle.'" ');
while($data = mysql_fetch_array($sql))
{
$old_libelle = $data['libelle'];
$doc_modif = $url.$doc;
}
if (!is_dir($doc_modif2)) rename($doc_modif, $doc_modif2);
/b
$req
mysql_query('UPDATE dossier SET actif "'.$actif.'", sys_ins_date = "'.$sys_ins_date.'", sys_upd_date = "'.$sys_upd_date.'", sys_del_date = "'.$sys_del_date.'", sys_ins_user = "'.$sys_ins_user.'", sys_upd_user = "'.$sys_upd_user.'", numero = "'.$numero.'", libelle = "'.$libelle.'", new_libelle = "'.$new_libelle.'", id_agt = "'.$id_agt.'", nomfull_agt = "'.$nomfull_agt.'", id_entite = "'.$id_entite.'", code_org = "'.$code_org.'", code_div = "'.$code_div.'", service = "'.$service.'", niv_conf = "'.$niv_conf.'", priorite = "'.$priorite.'", id_agt_resp = "'.$id_agt_resp.'", nomfull_agt_resp = "'.$nomfull_agt_resp.'", code_org_resp = "'.$code_org_resp.'", code_div_resp = "'.$code_div_resp.'", service_resp = "'.$service_resp.'", id_agt_dest = "'.$id_agt_dest.'", nomfull_agt_dest = "'.$nomfull_agt_dest.'", code_org_dest = "'.$code_org_dest.'", code_div_dest = "'.$code_div_dest.'", service_dest = "'.$service_dest.'", type = "'.$type.'", categorie = "'.$categorie.'", genre = "'.$genre.'", resume = "'.$resume.'", traitement = "'.$traitement.'", recommandation = "'.$recommandation.'", dtdebut = "'.$dtdebut.'", dtstatut = "'.$dtstatut.'", dtmaj = "'.$dtmaj.'" WHERE id = "'.$id.'" ');
if($req)
{
?>
<script language="javascript">
alert('Dossier modifié avec succès');
window.close();
if(window.opener && !window.opener.closed)
{
window.opener.location.reload();
}
</script>
<?php
}
else
{
?>
<script language="javascript">
alert('La modification a échoué');
window.close();
</script>
<?php
}
?>
Afficher la suite