1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
| <html>
<head>
<title>Vacations - Gestion et Paramètrage des Plannings</title>
<link rel="StyleSheet" href="style.css" type="text/css" media="screen" rev="StyleSheet">
<style>
.barre {position:absolute;width:20px;height:20px;font-size:15px;background-color:orange;z-index:1;font-weight:bold;text-align:center}
.barre2 {position:width:100px;height:80px;z-index:1;}
</style>
<script>
var focus;
var obj;
var vic;
var deb;
var aa;
var posx;
var posy;
var num_cadre;
//Initialisation des calques
function init(nb_plage){
vic=0;
focus=0;
deb=0;
for(i=0;i<nb_plage;i++){
num_cadre="cadre"+i;
document.write("<div class=\"barre\" id="+num_cadre+"></div>");
}
}
function param(nb_plage){
posy=201;
posx=190;
var sem=0;
var ligne1=0;
for(i=0;i<nb_plage;i++){
num_cadre="cadre"+i;
document.getElementById(num_cadre).style.backgroundColor = "red";
sem=sem+1;
if(ligne1==1){
if(sem==7){
posy=posy+80;
posx=190;
sem=0;
}
}
else{
if(sem>7){
posy=posy+80;
posx=190;
sem=0;
ligne1=1;
}
}
document.getElementById(num_cadre).style.top = posy+"px";
document.getElementById(num_cadre).style.left = posx+"px";
posx=posx+130;
}
}
function clic(){
obj=this;
obj.style.zIndex=2;
if(focus==0){
focus=obj
}
else focus=0;
}
function declic(){
obj.style.zIndex=1;
focus=0;
}
function go(e){
var limited;
var limiteg;
var colonne;
//if(!e){window.event.cancelBubble=true};
if(obj && focus==obj){
ev=!e ? "event.client" : "e.page"
posx=parseInt(obj.style.left);
posy=parseInt(obj.style.top);
if(posx<200){
limited=190;
limiteg=78;
}
obj.style.left=eval(ev+"X") - 10 + document.body.scrollLeft + 'px';
if(posx>limited){
limited=limited-5;
obj.style.left=limited+'px';
}
if(posx<limiteg){
limiteg=limiteg+5;
obj.style.left=limiteg+'px';
}
}
//alert(limitey);
}
</script>
</head>
<body onLoad="javascript:self.focus();bgcolor="#FFFFFF" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
<div id='cadrep'>
<?
//me permet de savoir le nombre de cadre a créer
$comptmed=$comptmed*7; if($type!=""){
print("<script>");
print("init($comptmed);");
print("</script>");
}
?>
</div>
<script>
var n=document.getElementById("cadrep").getElementsByTagName("div");
<?
print("for(i=0;i<$comptmed;i++){");
?>
n[i].onmousedown=clic;
n[i].onmouseup=declic;
n[i].onmousemove=go}
function no(e){
return false}
document.onmousedown=no;
document.onmouseup=no;
if(typeof document.onselectstart!="undefined"){
document.onselectstart=no}
</script> |
Partager