Skip to content

Commit

Permalink
lalal
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeedas committed Dec 6, 2011
1 parent 69b7c3b commit 6c3f694
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 22 deletions.
31 changes: 31 additions & 0 deletions AjaxActions/Admin/Import.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

session_start();
include("../../Includes.php");

function redirect(){
header("location: ../../index.php?info=admin/vartotojai");
}

$login = new Session(1);

if(!$login->isLogedin()){
die("You must loged in!");
}

$file = $_FILES['file'];

if($file['error'] != 0){
die("<p style='color:red;'>Ivyko klaida ikeliant faila! Error nr: ".$file['error']."</p>");
}

if($file['type'] != "application/vnd.ms-excel"){
die("<p style='color:red;'>Blogas failo formatas!</p>");
}

$importer = new Importer($file['tmp_name']);
$importer->import();

echo "<p style='color:green;'>Importuota.</p>";

?>
4 changes: 4 additions & 0 deletions Design/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -606,4 +606,8 @@ a:hover {
span.delUser{
color:#CA4C44;
cursor:pointer;
}

#importas{
color:red;
}
42 changes: 24 additions & 18 deletions JS/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ var img1_height = 200;
var img2_width = 548;
var img2_height = 200;

function fileUpload(){

}

function validateDate(strDate){
if (new Date(strDate) == "Invalid Date")
return false;
Expand Down Expand Up @@ -207,29 +211,31 @@ function zoomOut(chartType){
})();

function ready() {

$("#ImporterForm").submit(function(){
this.target = "uploadTarget";
});

// User delete
$("span.delUser").click(function(){
var id = $(this).attr("userid");
var elem = this;
if(confirm("Ar tikrai norite ištrinti?")){
var id = $(this).attr("userid");
var elem = this;

$.ajax({
url: "AjaxActions/Admin/DeleteUser.php?id=" + id,
success: function(data){
var mas = data.split(":::", 2);
if(mas[0] == "true"){
$(elem).parent().parent().remove();
}else{
var kids = $(elem).parent().parent().children();
var text = $(kids[0]).text();
$(kids[0]).text(text + " " + mas[1])
$.ajax({
url: "AjaxActions/Admin/DeleteUser.php?id=" + id,
success: function(data){
var mas = data.split(":::", 2);
if(mas[0] == "true"){
$(elem).parent().parent().remove();
}else{
var kids = $(elem).parent().parent().children();
var text = $(kids[0]).text();
$(kids[0]).text(text + " " + mas[1])
}
}
}
});

// var kids = $(this).parent().parent().children();
// var text = $(kids[0]).text();
// $(kids[0]).text(text + " Error!!!");
});
}
});

// Paspaudus ant paramos priemones
Expand Down
2 changes: 1 addition & 1 deletion WebObjects/Panels/Left/DuomenuAnalizePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class DuomenuAnalizePanel extends MainPanel{
protected function htmlContent(){
$this->content = <<<FFF
<li>
<h2>Ataskaitą pagal:</h2>
<h2>Pateikti ataskaitą pagal:</h2>
<ul style="font-size:10px;">
<li><a onClick="apmps();" href="javascript://">Apdorotą per menesį paraiškų skaičių</a></li>
<li><a onClick="ppav();" href="javascript://">Panaudotas paraiškų apdorojimui valandas</a></li>
Expand Down
6 changes: 4 additions & 2 deletions WebObjects/Panels/Right/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ protected function htmlContent(){
<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>
<form id="ImporterForm" enctype="multipart/form-data" action="AjaxActions/Admin/Import.php" method="post">
<p><input type="file" id="importas" name="file" /></p>
<p><input type="submit" class="more" value="Importuoti" /></p>
<iframe id="uploadTarget" src="" style="width:500px; height:100px; border:0px solid #fff;"></iframe>
</div>
</div>
FFF;
Expand Down
6 changes: 5 additions & 1 deletion WebObjects/Panels/Right/ParamosPriemoniuPrognoziuLentele.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ protected function htmlContent(){
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td class="tdPavv"><b>Priemonė</b></td>
<td class="menTd"><b>01</b></td>
<td class="menTd">
<svg width="12px" height="40px" xmlns='http://www.w3.org/2000/svg'>
<text x='-40' y='10' font-family='Tahoma' font-size='12' transform='rotate(-90)' text-rendering='optimizeSpeed' fill='#888'>2001-02</text>
</svg>
</td>
<td class="menTd"><b>02</b></td>
<td class="menTd"><b>03</b></td>
<td class="menTd"><b>04</b></td>
Expand Down

0 comments on commit 6c3f694

Please sign in to comment.