Skip to content

Commit

Permalink
sda
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeedas committed Nov 30, 2011
2 parents 5709500 + ee69b72 commit 25e1e17
Show file tree
Hide file tree
Showing 18 changed files with 435 additions and 199 deletions.
7 changes: 4 additions & 3 deletions ContentManager/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
class Manager {

public $class = "home";
public $method = "home";
public $method = "login";
public $arguments = array();

private $classArray = array('home' => 'ManageHome');
private $classArray = array('home' => 'ManageHome',
'admin' => 'ManageAdmin');

public function __construct(){
$contentVars = array();
Expand All @@ -31,7 +32,7 @@ public function __construct(){

public function open(){
if(array_key_exists($this->class, $this->classArray)){
$class = new $this->classArray[$this->class];
$class = new $this->classArray[$this->class]($this->method);
if(in_array($this->method, get_class_methods($class))){
if($this->method != "__construct"){
call_user_func_array(array($class, $this->method), $this->arguments);
Expand Down
68 changes: 68 additions & 0 deletions ContentManager/Managers/ManageAdmin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

class ManageAdmin {

public function __construct($method, $checkType = true){
if($checkType == true){
if(isset($GLOBALS['login']->user)){
if(!$GLOBALS['login']->user->isAdmin()){
header("location: index.php?info=home/".$method);
}
}
}
}

public function home(){
$page = new AdminPage();
$page->pagePrint();
}

public function duom_anal(){
$page = new AdminPage();
$panel = new DuomenuAnalizePanel();
$panel1 = new Lenteles();
$panel2 = new Filters();
$page->addToContainer(1, $panel1->getHtml());
$page->addToContainer(2, $panel->getHtml());
$page->addToContainer(2, $panel2->getHtml());
$page->pagePrint();
}

public function prognozes(){
$page = new AdminPage();
$panel = new Prognozes();
$panel1 = new Lenteles();
$page->addToContainer(1, $panel1->getHtml());
$page->addToContainer(2, $panel->getHTML());
$page->pagePrint();
}

public function import(){
$page = new AdminPage();
$panel = new Import();
$page->addToContainer(1, $panel->getHtml());
$page->pagePrint();
}

public function vartotojai(){
$page = new AdminPage();
$panel = new Users();
$panel1 = new UserManage();
$page->addToContainer(1, $panel->getHtml());
$page->addToContainer(2, $panel1->getHtml());
$page->pagePrint();
}

public function login(){
$manager = new ManageHome("login", false);
$manager->login();
}

public function logout(){
$manager = new ManageHome("logout", false);
$manager->logout();
}

}

?>
16 changes: 10 additions & 6 deletions ContentManager/Managers/ManageHome.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<?php

function sortas($a, $b){
$aobj = new IS($a);
$bobj = new IS($b);
return sizeof($bobj->getPadaliniai()) - sizeof($aobj->getPadaliniai());
}

class ManageHome {

public function __construct($method, $checkType = true){
if($checkType == true){
if(isset($GLOBALS['login']->user)){
if($GLOBALS['login']->user->isAdmin()){
header("location: index.php?info=admin/".$method);
}
}
}
}

public function home(){
$page = new Page();
$page->pagePrint();
Expand Down
30 changes: 30 additions & 0 deletions Design/HomeA.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Home</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="header" class="container">
<div id="menu">
<ul>
<li class="current_page_item"><a href="#">Duomenų analizė</a></li>
<li><a href="#">Prognozės</a></li>
<li><a href="#">Importuoti duomenys</a></li>
<li><a href="#">Vartotojai</a></li>
<li><a href="#">Atsijungti</a></li>
<li><a href="#">Pagalba</a></li>
</ul>
</div>
</div>
</div>
<div id="footer">
<p>Copyright (c) 2011. All rights reserved.</p>
</div>
<!-- end #footer -->
</body>
</html>
50 changes: 50 additions & 0 deletions Design/Import.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Plain &amp; Clean by Free CSS Templates</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="header" class="container">
<div id="menu">
<ul>
<li class="current_page_item"><a href="#">Duomenų analizė</a></li>
<li><a href="#">Prognozės</a></li>
<li><a href="#">Importuoti duomenys</a></li>
<li><a href="#">Vartotojai</a></li>
<li><a href="#">Atsijungti</a></li>
<li><a href="#">Pagalba</a></li>
</ul>
</div>
</div>
<!-- end #header -->
<div id="page" class="container">
<div id="content">
<div class="post">
<div class="entry">
<p>Importuoti duomenis:</p>
<p><input type="file" /></p>
<p class="links"><input type="Button" class="more" value="Importuoti" /></p>
</div>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #content -->
<div id="sidebar">
<ul></ul>
</div>
<!-- end #sidebar -->
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #page -->
</div>
<div id="footer">
<p>Copyright (c) 2011 Sitename.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
</div>
<!-- end #footer -->
</body>
</html>
77 changes: 77 additions & 0 deletions Design/Vartotojai.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Ataskaita 1</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="header" class="container">
<div id="menu">
<ul>
<li class="current_page_item"><a href="#">Duomenų analizė</a></li>
<li><a href="#">Prognozės</a></li>
<li><a href="#">Atsijungti</a></li>
<li><a href="#">Pagalba</a></li>
</ul>
</div>
</div>
<!-- end #header -->
<div id="page" class="container">
<div id="content">
<div class="post">
<p>Vartotojai</p>
<table width="100%">
<tr>
<td><b>Vartotojo vardas</b></td>
<td><b>Veiksmas</b></td>
</tr>
<tr>
<td class="name">Povilas</td>
<td><a href="#">Trinti</a></td>
</tr>
<tr>
<td class="name">Povilas</td>
<td><a href="#">Trinti</a></td>
</tr>
<tr>
<td class="name">Povilas</td>
<td><a href="#">Trinti</a></td>
</tr>
<tr>
<td class="name">Povilas</td>
<td><a href="#">Trinti</a></td>
</tr>
<tr>
<td class="name">Povilas</td>
<td><a href="#">Trinti</a></td>
</tr>
</table>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #content -->
<div id="sidebar">
<ul>
<li>
<h2>Valdymas:</h2>
<ul style="font-size:10px;">
<li><a href="#">Prideti vartotoja</a></li>
</ul>
</li>
</ul>
</div>
<!-- end #sidebar -->
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #page -->
</div>
<div id="footer">
<p>Copyright (c) 2011. All rights reserved.</p>
</div>
<!-- end #footer -->
</body>
</html>
File renamed without changes.
7 changes: 5 additions & 2 deletions Design/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,13 @@ a:hover {
/* Menu */

#menu {
width: 500px;
width: 100%;
height: 90px;
margin: 0 auto;
padding: 0;
}

#menu ul {
float: right;
margin: 0;
padding: 85px 0px 0px 0px;
list-style: none;
Expand Down Expand Up @@ -508,4 +507,8 @@ a:hover {
#prognozes > li.active {
background:#CA4C44 !important;
color:white;
}

.name{
vertical-align:middle;
}
Binary file added Test/arial.ttf
Binary file not shown.
28 changes: 28 additions & 0 deletions Utilities/ImageText.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

class ImageText
{
static public function createTextImage($width, $height, $text){
header('Content-Type: image/png');
$img = imagecreatetruecolor($width, $height);

$bgColor = imagecolorallocate($img, 255, 255, 255);
$textColor = imagecolorallocate($img, 0, 0, 0);
$fontSize = 11;
$fontName = "./arial.ttf";

imagefilledrectangle($img, 0, 0, $width, $height, $bgColor);

$fontSizeBounds = imagettfbbox($fontSize, 0, $fontName, $text);
$lineSize = $fontSizeBounds[4];
$lineHeight = abs($fontSizeBounds[5]);
$x = (int)(($width - $lineSize) / 2);
$y = (int)(($height - $lineHeight) / 2);
imagettftext($img, $fontSize, 0, $x, $y, $textColor, $fontName, $text);

imagepng($img);
imagedestroy($img);
}
}

?>
Loading

0 comments on commit 25e1e17

Please sign in to comment.