Skip to content

Instantly share code, notes, and snippets.

@akakiev
Created June 28, 2017 16:16
Show Gist options
  • Select an option

  • Save akakiev/842f82e1b1e806a2c47510d270ce1715 to your computer and use it in GitHub Desktop.

Select an option

Save akakiev/842f82e1b1e806a2c47510d270ce1715 to your computer and use it in GitHub Desktop.
The_best_programmers
body{ background:#111111;
color:white;}
#center{ width:100%;
min-width:780px;
margin-top:-25px;}
td{ padding:15px;
background:#111111;}
#logo_text{ height:10px;
font:24px impact;
letter-spacing:3px;
width:20%;
min-width:200px;}
#menu a{ font:bold 20px tahoma;
display:block;
margin-bottom:8px;
text-decoration:none;
color:#909090;}
#menu a:hover{ color:#ffffff;}
#menu a.action{ color:#ffffff;}
#content img{ width:45%;
border:3px solid white;
margin:10px 0px 10px 20px;}
#content h1,h2,h3{ padding-top:-20px;
font-family:verdana;
color:#ffffff;}
#content p{ color:#f0f0f0;
font:16px tahoma;
text-align:justify;}
#chStyle a{ margin-top:50px;
text-decoration:none;
padding:10px;
font:bold 16px verdana;
color:#eee;
border:1px solid #eee;
text-align:center;}
#chStyle a:hover{border:2px solid yellow;
color:yellow;}
<!DOCTYPE html>
<html>
<head>
<title>Кращі програмісти світу</title>
<?
if(isset($_GET['st'])){
$old_dizayn=$_GET['st'];
}else{
$old_dizayn=1;
}
if($old_dizayn==2){
echo"<link rel='stylesheet' type='text/css' href='t14z4_new.css'>";
$new_dizayn=1;
}else{
echo"<link rel='stylesheet' type='text/css' href='t14z4.css'>";
$new_dizayn=2;
}
?>
</head>
<body>
<?
include "start1.php";
$action_menu=get_action_menu();
$menu=get_menu();
$about_programmers=get_аbout_programmers($action_menu);
?>
<table id='center' cellspacing="0" border='0' bordercolor='white'>
<tr id='top'>
<td id='logo_text'>
КРАЩІ ПРОГРАМІСТИ СВІТУ
</td>
<td id='content' rowspan='2'>
<? print_inf_programmer($about_programmers); ?>
</td>
</tr>
<tr valign='top'>
<td id='menu'>
<?
print_menu($menu,$action_menu,$old_dizayn);
echo"<div id=chStyle>";
if($new_dizayn==2){
echo "<a href='?menu=".$menu[$action_menu]['id']."&st=".$new_dizayn."'".$cl.">світлий дизайн</a><br>";
}else{
echo "<a href='?menu=".$menu[$action_menu]['id']."&st=".$new_dizayn."'".$cl.">темний дизайн</a><br>";
}
echo "</div>";
?>
</td>
</tr>
</table>
</body>
</html>
<?
function get_action_menu(){
if(isset($_GET['menu'])){
$action_menu=$_GET['menu'];
}else{
$tab=mysql_query("SELECT id FROM pages ");
$row=mysql_fetch_array($tab);
$action_menu=$row['id'];
}
return $action_menu;
}
function get_menu(){
$tab=mysql_query("SELECT id,name FROM pages");
$i=1;
while($row=mysql_fetch_array($tab)){
$menu[$i]['id']=$row['id'];
$menu[$i]['name']=$row['name'];
$i++;
}
return $menu; }
function get_аbout_programmers($action_menu){
$tab=mysql_query("SELECT text,foto FROM pages WHERE id='$action_menu'");
$row=mysql_fetch_array($tab);
return $row;
}
function print_menu($menu,$action_menu,$old_dizayn){
for($i=1;$i<=count($menu);$i++){
$clas_action="";
if($i==$action_menu){
$clas_action="class='action'"; }
echo "<a href='?menu=".$menu[$i]['id']."&st=".$old_dizayn."' ".$clas_action.">".$menu[$i]['name']."</a><br>";} }
function print_inf_programmer($inf_prog){
echo "<img src='".$inf_prog["foto"]."' align='right'>";
echo $inf_prog["text"]; }
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment