"; if ($choix && $action!="Retour") { print ""; majliste($choix,$colid); exit; }; if ($action=="Valider") { if ($qual) { mysqli_query($mi,"update pelote set qualite='".esc($qual)."', marque='$marque', taille='$taille', mailles='$mailles', rangs='$rangs', metres='$metres', grammes='$grammes', comp1='$m1', prop1='$q1', comp2='$m2', prop2='$q2', comp3='$m3', prop3='$q3', comp4='$m4', prop4='$q4', type='$type', dispo='$dispo', remarques='".esc($rem)."' WHERE $qid"); $qid="marque=$marque and qualite='".esc($qual)."'"; $nimg="images/".md5($qid).".png"; if (file_exists($img)) rename($img,$nimg); $img=$nimg; } else { mysqli_query($mi,"DELETE FROM pelote WHERE $qid"); print "Supprimé! ".mysqli_error($mi); @unlink($img); exit; }; $q=$qual; print mysqli_error($mi); }; print ""; if ($qid) $res=mysqli_query($mi,"SELECT * FROM pelote WHERE $qid"); if ($res) list($qual,$mid,$tid,$mailles,$rangs,$metres,$grammes,$m1,$q1,$m2,$q2,$m3,$q3,$m4,$q4,$dispo,$rem,$prix,$type,$dispo)=mysqli_fetch_array($res); // print mysqli_error($mi); $q=$qual; affsel("marque",$mid,"marqueid"); print ""; affsel("taille",$tid,"tid"); affsel("type",$type,"typeid"); print "
Mailles:"; print "Rangs:"; print "Mètres:"; print "Grammes:
"; affmat(1,$m1);print "%
"; affmat(2,$m2);print "%
"; affmat(3,$m3);print "%
"; affmat(4,$m4);print "%
"; print "Epuisé: "; print "Image";if (file_exists($img)) print " OK"; print "
Remarque:
"; ?>Voir".ucfirst($sel).":Matière $sel:".mysqli_error($mi); }; if ($nouveau!="") { if (list($id)=mysqli_fetch_row(mysqli_query($mi,"select $colid from $choix where $choix='$nouveau'"))) { print "$nouveau deja existant. Automatiquement selectionne!
"; if ($choix!="matiere") mysqli_query($mi,"update pelote set $choix=$id where $qid"); } else { $up='';$upv='';reset($opt); foreach ($opt as $u) { $up.=",$u";$upv.=",'".esc(${"nouv".$u})."'"; } // print "insert into $choix ($choix $up) values ('$nouveau' $upv) $nouvurl";exit; mysqli_query($mi,"insert into $choix ($choix $up) values ('$nouveau' $upv)"); $nouvid=mysqli_insert_id($mi); if ($choix!="matiere") mysqli_query($mi,"update pelote set $choix=$nouvid where $qid"); }; print ucfirst($choix)." ajouté(e)! "; exit; }; print "Liste ".ucfirst($choix).":
Ajout:"; $up='';reset($opt); foreach ($opt as $u) print " ".ucfirst($u).":"; print "
"; $r=mysqli_query($mi,"select * from $choix order by $choix"); echo mysqli_error($mi); while ($res=mysqli_fetch_array($r)) { $catid=$res[0];$nom=$res[1]; print "
$nom"; $up='';if (is_array($opt)) reset($opt); foreach ($opt as $n=>$u) print "".ucfirst($u).":"; print "
\n"; } print "
"; };