Ajout

jspimen Messages postés 40 Date d'inscription jeudi 17 avril 2008 Statut Membre Dernière intervention 24 novembre 2010 - 7 juin 2008 à 13:09
Twinuts Messages postés 5375 Date d'inscription dimanche 4 mai 2003 Statut Modérateur Dernière intervention 14 juin 2023 - 9 juin 2008 à 09:57
bonjour;
voici mon code qui permet d'ajouter des données dans une base Mysql

<%//@ page import= "java.sql.*" %>

<%@ page import="java.io.File" %>
<%@ page import="java.io.BufferedWriter" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.LinkedList" %>
<%
boolean Ajouter=false;
String IDTA="";
String Password="";
String Nom="";
String Prenom="";
String CIN="";
String ProfilTA="";
String ProfilAD="";
String ProfilSUP="";
boolean SaveFile=false;

DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
Iterator itr = items.iterator();
File fullFile=null;
File savedFile=null;
File Toren=null;
FileItem Fitm=null;
while(itr.hasNext()){
FileItem item = (FileItem) itr.next();
if(item.isFormField()) {
String fieldName = item.getFieldName();
if(fieldName.equals("IDTA")) IDTA=item.getString();
if(fieldName.equals("Password")) Password=item.getString();
if(fieldName.equals("Nom")) Nom=item.getString();
if(fieldName.equals("Prenom")) Prenom=item.getString();
if(fieldName.equals("CIN")) CIN=item.getString();
if(fieldName.equals("ProfilTA")) ProfilTA=item.getString();
if(fieldName.equals("ProfilSUP")) ProfilSUP=item.getString();
if(fieldName.equals("ProfilAD")) ProfilAD=item.getString();
if(fieldName.equals("Ajouter")) Ajouter=true;
}else{
if(!item.getName().equals("")){
fullFile = new File(item.getName());
savedFile = new File(getServletContext().getRealPath("/")+"\\Photo\", fullFile.getName());//fullFile.getName()
System.out.print(getServletContext().getRealPath("/")+"/Photo/"+fullFile.getName());
SaveFile=true;
Fitm=item;
}
}}


if(Ajouter==true)
{
Connection con;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/tunis", "root", "admin");
Statement Stmt = con.createStatement();
ResultSet rs=Stmt.executeQuery("select count(*) from personnel where ID='"+IDTA+"'");
rs.next();
if(rs.getInt(1)==1)
{
%>
<html>
<head>
<title>
paged'accueil
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>



<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data" >

</form>

<!--<table width="100%">
-->
<!--<form action="Personnel1.jsp" name="F" onSubmit="return check()" method="post" enctype="multipart/form-data" >
--> <center>

[index.jsp Page d'Accueil ]
</center>
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
">,

----

Entrer Mot de passe *,
,

----

Entrer le Nom *,
">,

----

Entrer le Prénom *,
<label for ="Prenom">"></label>,

----

N° CIN ,
<label for= "prenom">"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA ,
,

----

Profil Administrateur,
,

----

Profil Superviseur ,
,
</td>


,

----

Identifiant existe déjà: Veuillez choisir un autre


</form>

</html>

<%
}else{
Statement StmtI=con.createStatement();
String reqins="insert into personnel values('"+IDTA+"','"+Password+"','"+
Nom+"','"+Prenom+"',"+
CIN+"";

if(ProfilTA!=""){reqins+=",1,";}else reqins+=",0,";

if(ProfilAD!=""){reqins+="1,";}else reqins+="0,";

if(ProfilSUP!=""){reqins+="1,";}else reqins+="0,";


reqins+="0,";
reqins+="'00:00:00','00:00:00','Poste_101')";
System.out.print(reqins);
StmtI.executeUpdate(reqins);

if(SaveFile){
Fitm.write(savedFile);
Toren=new File(getServletContext().getRealPath("/")+"\\Photo\"+IDTA+".jpg");
savedFile.renameTo(Toren);
savedFile.delete();

}


%>

<html>
<head>
<title>
AjoutTA
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>





<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data">
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
,

----

Entrer Mot de passe * ,
,

----

Entrer le Nom * ,
,

----

Entrer le Prénom * ,
<label for="Prenom"></label>,

----

N° CIN,
<label for="prenom"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA,
,

----

Profil Administrateur,
,

----

Profil Superviseur,
,
</td>


,

----

Personnel ajouté avec succés


</form>

</html>


mais ce code affiche des erreurs:
<%//@ page import="java.sql.*" %>

<%@ page import="java.io.File" %>
<%@ page import="java.io.BufferedWriter" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.LinkedList" %>
<%
boolean Ajouter=false;
String IDTA="";
String Password="";
String Nom="";
String Prenom="";
String CIN="";
String ProfilTA="";
String ProfilAD="";
String ProfilSUP="";
boolean SaveFile=false;

DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
Iterator itr = items.iterator();
File fullFile=null;
File savedFile=null;
File Toren=null;
FileItem Fitm=null;
while(itr.hasNext()){
FileItem item = (FileItem) itr.next();
if(item.isFormField()) {
String fieldName = item.getFieldName();
if(fieldName.equals("IDTA")) IDTA=item.getString();
if(fieldName.equals("Password")) Password=item.getString();
if(fieldName.equals("Nom")) Nom=item.getString();
if(fieldName.equals("Prenom")) Prenom=item.getString();
if(fieldName.equals("CIN")) CIN=item.getString();
if(fieldName.equals("ProfilTA")) ProfilTA=item.getString();
if(fieldName.equals("ProfilSUP")) ProfilSUP=item.getString();
if(fieldName.equals("ProfilAD")) ProfilAD=item.getString();
if(fieldName.equals("Ajouter")) Ajouter=true;
}else{
if(!item.getName().equals("")){
fullFile = new File(item.getName());
savedFile = new File(getServletContext().getRealPath("/")+"\\Photo\", fullFile.getName());//fullFile.getName()
System.out.print(getServletContext().getRealPath("/")+"/Photo/"+fullFile.getName());
SaveFile=true;
Fitm=item;
}
}}


if(Ajouter==true)
{
Connection con;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/tunis", "root", "admin");
Statement Stmt = con.createStatement();
ResultSet rs=Stmt.executeQuery("select count(*) from personnel where ID='"+IDTA+"'");
rs.next();
if(rs.getInt(1)==1)
{
%>
<html>
<head>
<title>
paged'accueil
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>



<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data" >

</form>

<!--<table width="100%">
-->
<!--<form action="Personnel1.jsp" name="F" onSubmit="return check()" method="post" enctype="multipart/form-data" >
--> <center>

[index.jsp Page d'Accueil ]
</center>
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
">,

----

Entrer Mot de passe *,
,

----

Entrer le Nom *,
">,

----

Entrer le Prénom *,
<label for ="Prenom">"></label>,

----

N° CIN ,
<label for= "prenom">"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA ,
,

----

Profil Administrateur,
,

----

Profil Superviseur ,
,
</td>


,

----

Identifiant existe déjà: Veuillez choisir un autre


</form>

</html>

<%
}else{
Statement StmtI=con.createStatement();
String reqins="insert into personnel values('"+IDTA+"','"+Password+"','"+
Nom+"','"+Prenom+"',"+
CIN+"";

if(ProfilTA!=""){reqins+=",1,";}else reqins+=",0,";

if(ProfilAD!=""){reqins+="1,";}else reqins+="0,";

if(ProfilSUP!=""){reqins+="1,";}else reqins+="0,";


reqins+="0,";
reqins+="'00:00:00','00:00:00','Poste_101')";
System.out.print(reqins);
StmtI.executeUpdate(reqins);

if(SaveFile){
Fitm.write(savedFile);
Toren=new File(getServletContext().getRealPath("/")+"\\Photo\"+IDTA+".jpg");
savedFile.renameTo(Toren);
savedFile.delete();

}


%>

<html>
<head>
<title>
AjoutTA
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>





<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data">
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
,

----

Entrer Mot de passe * ,
,

----

Entrer le Nom * ,
,

----

Entrer le Prénom * ,
<label for="Prenom"></label>,

----

N° CIN,
<label for="prenom"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA,
,

----

Profil Administrateur,
,

----

Profil Superviseur,
,
</td>


,

----

Personnel ajouté avec succés


</form>

</html>



<%//@ page import="java.sql.*" %>

<%@ page import="java.io.File" %>
<%@ page import="java.io.BufferedWriter" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.LinkedList" %>
<%
boolean Ajouter=false;
String IDTA="";
String Password="";
String Nom="";
String Prenom="";
String CIN="";
String ProfilTA="";
String ProfilAD="";
String ProfilSUP="";
boolean SaveFile=false;

DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
Iterator itr = items.iterator();
File fullFile=null;
File savedFile=null;
File Toren=null;
FileItem Fitm=null;
while(itr.hasNext()){
FileItem item = (FileItem) itr.next();
if(item.isFormField()) {
String fieldName = item.getFieldName();
if(fieldName.equals("IDTA")) IDTA=item.getString();
if(fieldName.equals("Password")) Password=item.getString();
if(fieldName.equals("Nom")) Nom=item.getString();
if(fieldName.equals("Prenom")) Prenom=item.getString();
if(fieldName.equals("CIN")) CIN=item.getString();
if(fieldName.equals("ProfilTA")) ProfilTA=item.getString();
if(fieldName.equals("ProfilSUP")) ProfilSUP=item.getString();
if(fieldName.equals("ProfilAD")) ProfilAD=item.getString();
if(fieldName.equals("Ajouter")) Ajouter=true;
}else{
if(!item.getName().equals("")){
fullFile = new File(item.getName());
savedFile = new File(getServletContext().getRealPath("/")+"\\Photo\", fullFile.getName());//fullFile.getName()
System.out.print(getServletContext().getRealPath("/")+"/Photo/"+fullFile.getName());
SaveFile=true;
Fitm=item;
}
}}


if(Ajouter==true)
{
Connection con;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/tunis", "root", "admin");
Statement Stmt = con.createStatement();
ResultSet rs=Stmt.executeQuery("select count(*) from personnel where ID='"+IDTA+"'");
rs.next();
if(rs.getInt(1)==1)
{
%>
<html>
<head>
<title>
paged'accueil
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>



<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data" >

</form>

<!--<table width="100%">
-->
<!--<form action="Personnel1.jsp" name="F" onSubmit="return check()" method="post" enctype="multipart/form-data" >
--> <center>

[index.jsp Page d'Accueil ]
</center>
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
">,

----

Entrer Mot de passe *,
,

----

Entrer le Nom *,
">,

----

Entrer le Prénom *,
<label for ="Prenom">"></label>,

----

N° CIN ,
<label for= "prenom">"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA ,
,

----

Profil Administrateur,
,

----

Profil Superviseur ,
,
</td>


,

----

Identifiant existe déjà: Veuillez choisir un autre


</form>

</html>

<%
}else{
Statement StmtI=con.createStatement();
String reqins="insert into personnel values('"+IDTA+"','"+Password+"','"+
Nom+"','"+Prenom+"',"+
CIN+"";

if(ProfilTA!=""){reqins+=",1,";}else reqins+=",0,";

if(ProfilAD!=""){reqins+="1,";}else reqins+="0,";

if(ProfilSUP!=""){reqins+="1,";}else reqins+="0,";


reqins+="0,";
reqins+="'00:00:00','00:00:00','Poste_101')";
System.out.print(reqins);
StmtI.executeUpdate(reqins);

if(SaveFile){
Fitm.write(savedFile);
Toren=new File(getServletContext().getRealPath("/")+"\\Photo\"+IDTA+".jpg");
savedFile.renameTo(Toren);
savedFile.delete();

}


%>

<html>
<head>
<title>
AjoutTA
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>





<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data">
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
,

----

Entrer Mot de passe * ,
,

----

Entrer le Nom * ,
,

----

Entrer le Prénom * ,
<label for="Prenom"></label>,

----

N° CIN,
<label for="prenom"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA,
,

----

Profil Administrateur,
,

----

Profil Superviseur,
,
</td>


,

----

Personnel ajouté avec succés


</form>

</html>



<%//@ page import="java.sql.*" %>

<%@ page import="java.io.File" %>
<%@ page import="java.io.BufferedWriter" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.LinkedList" %>
<%
boolean Ajouter=false;
String IDTA="";
String Password="";
String Nom="";
String Prenom="";
String CIN="";
String ProfilTA="";
String ProfilAD="";
String ProfilSUP="";
boolean SaveFile=false;

DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
Iterator itr = items.iterator();
File fullFile=null;
File savedFile=null;
File Toren=null;
FileItem Fitm=null;
while(itr.hasNext()){
FileItem item = (FileItem) itr.next();
if(item.isFormField()) {
String fieldName = item.getFieldName();
if(fieldName.equals("IDTA")) IDTA=item.getString();
if(fieldName.equals("Password")) Password=item.getString();
if(fieldName.equals("Nom")) Nom=item.getString();
if(fieldName.equals("Prenom")) Prenom=item.getString();
if(fieldName.equals("CIN")) CIN=item.getString();
if(fieldName.equals("ProfilTA")) ProfilTA=item.getString();
if(fieldName.equals("ProfilSUP")) ProfilSUP=item.getString();
if(fieldName.equals("ProfilAD")) ProfilAD=item.getString();
if(fieldName.equals("Ajouter")) Ajouter=true;
}else{
if(!item.getName().equals("")){
fullFile = new File(item.getName());
savedFile = new File(getServletContext().getRealPath("/")+"\\Photo\", fullFile.getName());//fullFile.getName()
System.out.print(getServletContext().getRealPath("/")+"/Photo/"+fullFile.getName());
SaveFile=true;
Fitm=item;
}
}}


if(Ajouter==true)
{
Connection con;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/tunis", "root", "admin");
Statement Stmt = con.createStatement();
ResultSet rs=Stmt.executeQuery("select count(*) from personnel where ID='"+IDTA+"'");
rs.next();
if(rs.getInt(1)==1)
{
%>
<html>
<head>
<title>
paged'accueil
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>



<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data" >

</form>

<!--<table width="100%">
-->
<!--<form action="Personnel1.jsp" name="F" onSubmit="return check()" method="post" enctype="multipart/form-data" >
--> <center>

[index.jsp Page d'Accueil ]
</center>
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
">,

----

Entrer Mot de passe *,
,

----

Entrer le Nom *,
">,

----

Entrer le Prénom *,
<label for ="Prenom">"></label>,

----

N° CIN ,
<label for= "prenom">"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA ,
,

----

Profil Administrateur,
,

----

Profil Superviseur ,
,
</td>


,

----

Identifiant existe déjà: Veuillez choisir un autre


</form>

</html>

<%
}else{
Statement StmtI=con.createStatement();
String reqins="insert into personnel values('"+IDTA+"','"+Password+"','"+
Nom+"','"+Prenom+"',"+
CIN+"";

if(ProfilTA!=""){reqins+=",1,";}else reqins+=",0,";

if(ProfilAD!=""){reqins+="1,";}else reqins+="0,";

if(ProfilSUP!=""){reqins+="1,";}else reqins+="0,";


reqins+="0,";
reqins+="'00:00:00','00:00:00','Poste_101')";
System.out.print(reqins);
StmtI.executeUpdate(reqins);

if(SaveFile){
Fitm.write(savedFile);
Toren=new File(getServletContext().getRealPath("/")+"\\Photo\"+IDTA+".jpg");
savedFile.renameTo(Toren);
savedFile.delete();

}


%>

<html>
<head>
<title>
AjoutTA
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>





<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data">
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
,

----

Entrer Mot de passe * ,
,

----

Entrer le Nom * ,
,

----

Entrer le Prénom * ,
<label for="Prenom"></label>,

----

N° CIN,
<label for="prenom"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA,
,

----

Profil Administrateur,
,

----

Profil Superviseur,
,
</td>


,

----

Personnel ajouté avec succés


</form>

</html>



<%//@ page import="java.sql.*" %>

<%@ page import="java.io.File" %>
<%@ page import="java.io.BufferedWriter" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.LinkedList" %>
<%
boolean Ajouter=false;
String IDTA="";
String Password="";
String Nom="";
String Prenom="";
String CIN="";
String ProfilTA="";
String ProfilAD="";
String ProfilSUP="";
boolean SaveFile=false;

DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
Iterator itr = items.iterator();
File fullFile=null;
File savedFile=null;
File Toren=null;
FileItem Fitm=null;
while(itr.hasNext()){
FileItem item = (FileItem) itr.next();
if(item.isFormField()) {
String fieldName = item.getFieldName();
if(fieldName.equals("IDTA")) IDTA=item.getString();
if(fieldName.equals("Password")) Password=item.getString();
if(fieldName.equals("Nom")) Nom=item.getString();
if(fieldName.equals("Prenom")) Prenom=item.getString();
if(fieldName.equals("CIN")) CIN=item.getString();
if(fieldName.equals("ProfilTA")) ProfilTA=item.getString();
if(fieldName.equals("ProfilSUP")) ProfilSUP=item.getString();
if(fieldName.equals("ProfilAD")) ProfilAD=item.getString();
if(fieldName.equals("Ajouter")) Ajouter=true;
}else{
if(!item.getName().equals("")){
fullFile = new File(item.getName());
savedFile = new File(getServletContext().getRealPath("/")+"\\Photo\", fullFile.getName());//fullFile.getName()
System.out.print(getServletContext().getRealPath("/")+"/Photo/"+fullFile.getName());
SaveFile=true;
Fitm=item;
}
}}


if(Ajouter==true)
{
Connection con;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/tunis", "root", "admin");
Statement Stmt = con.createStatement();
ResultSet rs=Stmt.executeQuery("select count(*) from personnel where ID='"+IDTA+"'");
rs.next();
if(rs.getInt(1)==1)
{
%>
<html>
<head>
<title>
paged'accueil
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>



<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data" >

</form>

<!--<table width="100%">
-->
<!--<form action="Personnel1.jsp" name="F" onSubmit="return check()" method="post" enctype="multipart/form-data" >
--> <center>

[index.jsp Page d'Accueil ]
</center>
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
">,

----

Entrer Mot de passe *,
,

----

Entrer le Nom *,
">,

----

Entrer le Prénom *,
<label for ="Prenom">"></label>,

----

N° CIN ,
<label for= "prenom">"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA ,
,

----

Profil Administrateur,
,

----

Profil Superviseur ,
,
</td>


,

----

Identifiant existe déjà: Veuillez choisir un autre


</form>

</html>

<%
}else{
Statement StmtI=con.createStatement();
String reqins="insert into personnel values('"+IDTA+"','"+Password+"','"+
Nom+"','"+Prenom+"',"+
CIN+"";

if(ProfilTA!=""){reqins+=",1,";}else reqins+=",0,";

if(ProfilAD!=""){reqins+="1,";}else reqins+="0,";

if(ProfilSUP!=""){reqins+="1,";}else reqins+="0,";


reqins+="0,";
reqins+="'00:00:00','00:00:00','Poste_101')";
System.out.print(reqins);
StmtI.executeUpdate(reqins);

if(SaveFile){
Fitm.write(savedFile);
Toren=new File(getServletContext().getRealPath("/")+"\\Photo\"+IDTA+".jpg");
savedFile.renameTo(Toren);
savedFile.delete();

}


%>

<html>
<head>
<title>
AjoutTA
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked=="" && document.F.ProfilAD.checked=="" && document.F.ProfilSUP.checked=="" ){return true;}
return false;
}


function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>





<form action="" name="form1" onSubmit="return check()" method="post" enctype="multipart/form-data">
Formulaire d'ajout de nouveaux personnels,
</td>

----

Entrer Identifiant *,
,

----

Entrer Mot de passe * ,
,

----

Entrer le Nom * ,
,

----

Entrer le Prénom * ,
<label for="Prenom"></label>,

----

N° CIN,
<label for="prenom"></label>,

----

Photo,
<label for="prenom"></label>,

----

Profil TA,
,

----

Profil Administrateur,
,

----

Profil Superviseur,
,
</td>


,

----

Personnel ajouté avec succés


</form>

</html>



<%//@ page import="java.sql.*" %>

<%@ page import="java.io.File" %>
<%@ page import="java.io.BufferedWriter" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.LinkedList" %>
<%
boolean Ajouter=false;
String IDTA="";
String Password="";
String Nom="";
String Prenom="";
String CIN="";
String ProfilTA="";
String ProfilAD="";
String ProfilSUP="";
boolean SaveFile=false;

DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
Iterator itr = items.iterator();
File fullFile=null;
File savedFile=null;
File Toren=null;
FileItem Fitm=null;
while(itr.hasNext()){
FileItem item = (FileItem) itr.next();
if(item.isFormField()) {
String fieldName = item.getFieldName();
if(fieldName.equals("IDTA")) IDTA=item.getString();
if(fieldName.equals("Password")) Password=item.getString();
if(fieldName.equals("Nom")) Nom=item.getString();
if(fieldName.equals("Prenom")) Prenom=item.getString();
if(fieldName.equals("CIN")) CIN=item.getString();
if(fieldName.equals("ProfilTA")) ProfilTA=item.getString();
if(fieldName.equals("ProfilSUP")) ProfilSUP=item.getString();
if(fieldName.equals("ProfilAD")) ProfilAD=item.getString();
if(fieldName.equals("Ajouter")) Ajouter=true;
}else{
if(!item.getName().equals("")){
fullFile = new File(item.getName());
savedFile = new File(getServletContext().getRealPath("/")+"\\Photo\", fullFile.getName());//fullFile.getName()
System.out.print(getServletContext().getRealPath("/")+"/Photo/"+fullFile.getName());
SaveFile=true;
Fitm=item;
}
}}


if(Ajouter==true)
{
Connection con;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/tunis", "root", "admin");
Statement Stmt = con.createStatement();
ResultSet rs=Stmt.executeQuery("select count(*) from personnel where ID='"+IDTA+"'");
rs.next();
if(rs.getInt(1)==1)
{
%>
<html>
<head>
<title>
paged'accueil
</title>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}

function isBeginBlank(val){
if(val==null){return true;}

if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}

return true;
}

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function NoOnIsChecked()
{
if(document.F.ProfilTA.checked==""

2 réponses

cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
7 juin 2008 à 14:28
Salut,

Bah c'est cool, mais c'est quoi le problème au juste ???

Tu veux faire la jsp la plus longue au monde ?

Tu veux faire la jsp qui respecte le moins possible les standards préconisés par sun ?
______________________________________
DarK Sidious
0
Twinuts Messages postés 5375 Date d'inscription dimanche 4 mai 2003 Statut Modérateur Dernière intervention 14 juin 2023 111
9 juin 2008 à 09:57
Salut,

tu n'es pas chez mémé ici alors calmos avec les pavés de codes !

------------------------------------
"On n'est pas au resto : ici on ne fait pas dans les plats tout cuits ..."

OoWORAoO
0
Rejoignez-nous