din url se poate modifica sector: http://localhost/sector.php?sector=2
Cod: Selectaţi tot
<script type='text/javascript'>
///////////////////////////////////////////////////////
// BEGIN //
///////////////////////////////////////////////////////
var qs = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
return b;
})(window.location.search.substr(1).split('&'));
///////////////////////////////////////////////////////
// END //
///////////////////////////////////////////////////////
var x,y,i,j,h,st,pt,tilexy,nrclss,nrdraw,sectbegin,sectend;
tilexy = parseInt(20);
sectbegin = (qs['sector'] == 0 || qs['sector'] == '') ? 1 : qs['sector'];
sectend = (sectbegin * tilexy);
for (i=sectbegin; i<sectend; i++) {
for (j=sectbegin; j<sectend; j++) {
nrclss = (i+"_"+j);
nrdraw = (i+":"+j);
};
};
document.write('de la <b>'+sectbegin+'</b> la <b>'+sectend+'</b>');
for (x=1; x<tilexy; x++) {
for (y=1; y<tilexy; y++) {
st = (y * 52); //top-y
pt = (x * 52); //left-x
document.write("<div class='"+nrclss+"' style='position:absolute; width:50px; height:50px; background:gray; top:"+st+"px; left:"+pt+"px;'>"+nrdraw+"</div>");
};
};
</script>
... uite cum sa fie exemplu ca sector 2 .. 20 randuri si 20 coloane :
----------------------------------------------------------------------------
| 20:1 | 20:2 | 20:3 | 20:4 | 20:5 | 20:6 | 20:7 | ..... | 20:20 |
----------------------------------------------------------------------------
| 21:1 | 21:2 | 21:3 | 21:4 | 21:5 | 21:6 | 21:7 | ..... | 21:20 |
----------------------------------------------------------------------------
...............................................................................
----------------------------------------------------------------------------
| 38:1 | 38:2 | 38:3 | 38:4 | 38:5 | 38:6 | 38:7 | ..... | 38:20 |
----------------------------------------------------------------------------
| 39:1 | 39:2 | 39:3 | 39:4 | 39:5 | 39:6 | 39:7 | ..... | 39:20 |
----------------------------------------------------------------------------
...iar ptr sector 7.... 20 coloane si 20 randuri :
----------------------------------------------------------------------------
| 70:1 | 70:2 | 70:3 | 70:4 | 70:5 | 70:6 | 70:7 | ..... | 70:20 |
----------------------------------------------------------------------------
| 71:1 | 71:2 | 71:3 | 71:4 | 71:5 | 71:6 | 71:7 | ..... | 71:20 |
----------------------------------------------------------------------------
...............................................................................
----------------------------------------------------------------------------
| 138:1 | 138:2 | 138:3 | 138:4 | 138:5 | 138:6 | 138:7 | ..... | 138:20 |
----------------------------------------------------------------------------
| 139:1 | 139:2 | 139:3 | 139:4 | 139:5 | 139:6 | 139:7 | ..... | 139:20 |
----------------------------------------------------------------------------
... sa nu fie dublate tabelul... doar sa fie schimbate cifrele de la INCEPUT pana la SFARSIT dupa sector... in class si text pe tabel div.. cred ca ati inteles ca vreau sa ma ajutati..

