Advertisement
Guest User

Untitled

a guest
May 1st, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.95 KB | None | 0 0
  1. <?php
  2.  
  3. $m=array();
  4. $m[0]=array("Menu", 1,2,3,6,7);
  5. $m[1]=array("Login", 4);
  6. $m[2]=array("Register", 5);
  7. $m[3]=array("Logout");
  8. $m[4]=array("Login_Dialog",13);
  9. $m[5]=array("Register_Dialog");
  10. $m[6]=array("About");
  11. $m[7]=array("Contact");
  12. $m[8]=array("m8",10,11);
  13. $m[9]=array("m9",12,13);
  14. $m[10]=array("m10");
  15. $m[11]=array("m11");
  16. $m[12]=array("m12");
  17. $m[13]=array("x",14);
  18. $m[14]=array("x");
  19.  
  20. $wb=100;
  21. $ac=0;
  22. $xstring="";
  23. $bstring="";
  24. $bstring.= "<div class='dropdown'>\n";
  25. $bstring.= "<button class='dropbtn'>".$m[0][0]."</button>\n\n";
  26. for ($a=1;$a<count($m[0]);$a++){
  27.     $mx1=$m[$m[0][$a]][0];
  28.     $ax=$m[0][$a];
  29.  //   echo "A=".$ax;
  30.  
  31.  
  32.  
  33. $axx=$wb*$a;
  34. $top=$wb*($a);
  35. $left=0;
  36. $xstring.="
  37. .mx1{b: $b; a: $a;}
  38.  
  39. .$mx1 {
  40.    top: $top;
  41.    left: $left;
  42.    display: none;
  43.    position: absolute;
  44.    background-color: #333333;
  45.    width: $wb;
  46.    height: $wb;
  47. }
  48.  
  49. .$mx1:hover {background-color: #3e8e41}
  50. .dropdown:hover .$mx1 {    display: block;}
  51.  
  52. .$mx1 a {
  53.    color: red;
  54.    text-decoration: none;
  55.    display: block;
  56. }
  57. ";
  58.  
  59.  
  60.    
  61.     $bstring.=  "\t<div class='$mx1'><ax href='#'>$mx1</a>\n";
  62.  
  63.     for ($b=1;$b<count($m[$ax]);$b++){
  64.         $bx=$m[$ax][$b];
  65.      //   echo "B=".$bx;
  66.         $mx2=$m[$bx][0];
  67.  
  68.  
  69. $top=0;
  70. $left=$wb*($b);
  71.        
  72.  
  73. $xstring.="
  74. .mx2{b: $b; a: $a;}
  75.  
  76. .$mx2 {
  77.    top: ".($top).";
  78.    left: ".($left).";
  79.    display: none;
  80.    position: absolute;
  81.    background-color: #333333;
  82.    width: $wb;
  83.    height: $wb;
  84. }
  85. .$mx2:hover {background-color: #3e8e41}
  86. .$mx1:hover .$mx2 {    display: block;}
  87.  
  88. .$mx2 a {
  89.    color: red;
  90.    text-decoration: none;
  91.    display: block;
  92. }
  93.  
  94. ";
  95.  
  96.  
  97.         $bstring.=  "\t\t<div class='$mx2'><xa href='#'>$mx2 </a>\n";
  98.        
  99.         for ($c=1;$c<count($m[$bx]);$c++){
  100.             $cx=$m[$bx][$c];
  101.     //        echo "C=".$cx;
  102.             $mx3=$m[$cx][0];
  103.            
  104. $top=$wb*($a);
  105. $left=0;
  106.        
  107.             $bstring.=  "\t\t\t<div class='$mx3'><xa href='#'>$mx3 </a> ";
  108.             $bstring.=  " </div>\n";
  109.  
  110. $xstring.="
  111. .mx3{b: $b; a: $a;}
  112. .$mx3 {
  113.    top: ".($top).";
  114.    left: ".($left).";
  115.    display: none;
  116.    position: absolute;
  117.    background-color: #333333;
  118.    width: $wb;
  119.    height: $wb;
  120. }
  121. .$mx3:hover {background-color: #3e8e41}
  122.  
  123. .$mx3 a {
  124.    color: red;
  125.    text-decoration: none;
  126.    display: block;
  127. }
  128. .$mx2:hover .$mx3 {    display: block;}
  129.  
  130. ";
  131.  
  132. }
  133.  
  134. $bstring.= "\t\t</div>\n";
  135.     }
  136.    
  137.     $bstring.=   "\t</div>\n\n";
  138. }
  139.  
  140.             $bstring.=  " </div>\n";
  141.  
  142.  
  143. echo "<html><head><style>";
  144. echo "
  145. .dropdown {
  146.        position: relative;
  147.        display: inline-block;
  148.    }
  149.  
  150.  
  151.    .dropbtn {
  152.        background-color: #222222;
  153.        color: gray;
  154.        padding: 16px;
  155.        font-size: 16px;
  156.        border: none;
  157.        cursor: pointer;
  158.      width: $wb;
  159.      height: $wb;
  160.    }";
  161.  
  162. echo $xstring;
  163.  
  164.  
  165. echo "</style></head><body>";
  166.  
  167. echo $bstring;
  168.  
  169. echo "</body></html>";
  170.  
  171. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement