begin process at 2012 05 27 04:19:17
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Graphique

 > ABRE EN ASP

ABRE EN ASP


 Information sur la source

Note :
Aucune note
Catégorie :Graphique Niveau :Débutant Date de création :13/05/2002 Date de mise à jour :13/05/2002 16:56:20 Vu :8 261

Auteur : MarxKarl

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
ce code permet a& l'aide de 2 requet SQL (1 de propagation et 1 d'affichage) de realiser un abre.

Source

  • <%
  • 'vertical space between cell
  • Vspace = 40
  • 'horizontal space between cell
  • Hspace = 10
  • 'width of cell
  • width = 160
  • 'height of cell
  • height =80
  • Set Ma_conn = Server.CreateObject("ADODB.Connection")
  • DSN_base = "DSN=rh;"
  • Ma_conn.open DSN_base
  • Dim LastY
  • Dim FirstChild() : Redim FirstChild(0)
  • Dim LastChild() : Redim LastChild(0)
  • Function Draw(Clef, X, Y)
  • If Ubound(FirstChild) < Y Then
  • Redim Preserve FirstChild(Y)
  • Redim Preserve LastChild(Y)
  • Redim Preserve From(Y)
  • FirstChild(Y) = Hspace
  • LastChild(Y) = 0
  • ElseIf Y = LastY-1 Then
  • If FirstChild(Y) = 0 Then
  • FirstChild(Y) = FirstChild(LastY)+(LastChild(LastY)-(width+Hspace))/2
  • FirstChild(Y) = Cint(Right(Cstr(FirstChild(Y)),Len(Cstr(FirstChild(Y))) - InStrRev(Cstr(FirstChild(Y)),".")))
  • LastChild(Y) = 0
  • Else
  • LastChild(Y) = FirstChild(LastY)+(LastChild(LastY)-(width+Hspace))/2-FirstChild(Y)
  • LastChild(Y) = Cint(Right(Cstr(LastChild(Y)),Len(LastChild(Y)) - InStrRev(Cstr(LastChild(Y)),".")))
  • End If
  • FirstChild(LastY)=FirstChild(LastY)+LastChild(LastY)+Hspace
  • LastChild(LastY)=0
  • End If
  • PosX = FirstChild(Y)+Cint(Right(Cstr(width/2),Len(width/2) - InStrRev(Cstr(width/2),".")))
  • PosY = Y*(Vspace+height)-height-Vspace/2
  • ma_div = "<div style='position:absolute;top:" & PosY & ";left:" & PosX & ";width:" & LastChild(Y) & ";height:" & height & ";color:black;font-size:11px;text-align=center'><hr align='center' noshade width='100%' size='3'></div>"
  • response.write ma_div
  • PosX = FirstChild(Y) + LastChild(Y)
  • PosY = Y*(Vspace+height)-height
  • Set result2 = Ma_conn.Execute(REQUETTE SQL POUR l'AFFICHAGE DES DONNEES)
  • ma_div = "<div style='position:absolute;top:" & PosY & ";left:" & PosX & ";width:" & width & ";height:" & height & ";color:black;background-color:white;font-size:11px;text-align=center'>AFFICHAGES DES DONNEES</div>"
  • response.write ma_div
  • result2.close
  • Set result2 = nothing
  • LastChild(Y)=LastChild(Y)+Hspace+width
  • LastY = Y
  • End Function
  • Function DrawTree(racine, X, Y)
  • tmp = 1
  • Set result1 = Ma_conn.Execute("REQUETTE SQL POU LA PROPAGATION DE L'ARBRE")
  • While Not result1.EOF
  • first = DrawTree(result1("ClefDePropagation"), tmp, y + 1)
  • tmp = tmp + 1
  • result1.MoveNext
  • Wend
  • Draw chef, X, Y
  • result1.close
  • Set result1 = nothing
  • father = chef
  • End Function
  • %>
  • appel : DrawTree MaClef, 1, 1
  • exemple de requete
  • requete de propagation : SELECT Clef2 FROM Aebre WHERE Clef1 ="& racine
  • exemple de rquete d'affichage : SELECT nom, prenom, login FROM personne WHERE id_pers = " & Clef
<%
'vertical space between cell
Vspace = 40
'horizontal space between cell
Hspace = 10
'width of cell
width = 160
'height of cell
height =80
Set Ma_conn = Server.CreateObject("ADODB.Connection")
DSN_base = "DSN=rh;"
Ma_conn.open DSN_base
Dim LastY
Dim FirstChild() : Redim FirstChild(0)
Dim LastChild() : Redim LastChild(0)
Function Draw(Clef, X, Y)
	If Ubound(FirstChild) < Y Then
		Redim Preserve FirstChild(Y)
		Redim Preserve LastChild(Y)
		Redim Preserve From(Y)
		FirstChild(Y) = Hspace
		LastChild(Y) = 0
	ElseIf Y = LastY-1 Then
		If FirstChild(Y) = 0 Then
			FirstChild(Y) = FirstChild(LastY)+(LastChild(LastY)-(width+Hspace))/2
			FirstChild(Y) = Cint(Right(Cstr(FirstChild(Y)),Len(Cstr(FirstChild(Y))) - InStrRev(Cstr(FirstChild(Y)),".")))
			LastChild(Y) = 0
		Else
			LastChild(Y) = FirstChild(LastY)+(LastChild(LastY)-(width+Hspace))/2-FirstChild(Y)
			LastChild(Y) = Cint(Right(Cstr(LastChild(Y)),Len(LastChild(Y)) - InStrRev(Cstr(LastChild(Y)),".")))
		End If
		FirstChild(LastY)=FirstChild(LastY)+LastChild(LastY)+Hspace
		LastChild(LastY)=0
	End If
	PosX = FirstChild(Y)+Cint(Right(Cstr(width/2),Len(width/2) - InStrRev(Cstr(width/2),".")))
	PosY = Y*(Vspace+height)-height-Vspace/2
	ma_div = "<div style='position:absolute;top:" & PosY & ";left:" & PosX & ";width:" & LastChild(Y) & ";height:" & height & ";color:black;font-size:11px;text-align=center'><hr align='center' noshade width='100%' size='3'></div>"
	response.write ma_div
	PosX = FirstChild(Y) + LastChild(Y)
	PosY = Y*(Vspace+height)-height
	Set result2 = Ma_conn.Execute(REQUETTE SQL POUR l'AFFICHAGE DES DONNEES)
	ma_div = "<div style='position:absolute;top:" & PosY & ";left:" & PosX & ";width:" & width & ";height:" & height & ";color:black;background-color:white;font-size:11px;text-align=center'>AFFICHAGES DES DONNEES</div>"
	response.write ma_div
	result2.close
	Set result2 = nothing
	LastChild(Y)=LastChild(Y)+Hspace+width
	LastY = Y
End Function
Function DrawTree(racine, X, Y)
	tmp = 1
	Set result1 = Ma_conn.Execute("REQUETTE SQL POU LA PROPAGATION DE L'ARBRE")
	While Not result1.EOF
		first = DrawTree(result1("ClefDePropagation"), tmp, y + 1)
		tmp = tmp + 1
		result1.MoveNext
	Wend
	Draw chef, X, Y
	result1.close
	Set result1 = nothing
	father = chef
End Function
%>
appel : DrawTree MaClef, 1, 1
exemple de requete
requete de propagation : SELECT Clef2 FROM Aebre WHERE Clef1 ="& racine
exemple de rquete d'affichage : SELECT nom, prenom, login FROM personne WHERE id_pers = " & Clef 



 Sources de la même categorie

Source avec Zip Source avec une capture Source .NET (Dotnet) CLASS CHARTS, HISTOGRAMCHART ET SECTORCHART par The Red Man
EXTRACTION D'INFORMATIONS IPTC D'UNE IMAGE par teenage
Source avec Zip Source avec une capture Source .NET (Dotnet) MANIPULATION D'IMAGES EN TEMPS RÉEL - RÉDUCTION COMPRESSION ... par badrbadr
Source avec Zip Source avec une capture Source .NET (Dotnet) UTILISATION D’AJAX ET D’UN WEBSERVICE POUR LA GÉNÉRATION D’I... par tikrimi
REDIMENSIONNER UNE IMAGE - ASPIMAGE par Keneyda

Commentaires et avis

Commentaire de Fabio972 le 31/08/2002 18:16:01

Voilà un code bien intéressant, mais qu'appelles-tu clé de propagation ?!?
Un site pour avoir plus d'infos ?
(Ou mieux, un exemple en ligne...)

Commentaire de gils58 le 29/01/2003 13:50:41

L'explication est un peu legère; un exemple concret avec la structure de la base" de données serait la bienvenue

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 6,989 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales