This commit is contained in:
Viggo
2017-12-20 13:23:22 +08:00
parent c463423d63
commit 2ddd48d844
1196 changed files with 227177 additions and 0 deletions

13
data/ajax-content.txt Normal file
View File

@@ -0,0 +1,13 @@
<p class="lead">Pasture he invited mr company shyness</p>
<p>Entire any had depend and figure winter. Change stairs and men likely wisdom new happen piqued six. Now taken him timed sex world get. Enjoyed married an feeling delight pursuit as offered. As admire roused length likely played pretty to no. Means had joy miles her merry solid order.</p>
<p>Repulsive questions contented him few extensive supported. Of remarkably thoroughly he appearance in. Supposing tolerably applauded or of be. Suffering unfeeling so objection agreeable allowance me of. Ask within entire season sex common far who family. As be valley warmth assure on. Park girl they rich hour new well way you. Face ye be me been room we sons fond.</p>
<p>Son agreed others exeter period myself few yet nature. Mention mr manners opinion if garrets enabled. To an occasional dissimilar impossible sentiments. Do fortune account written prepare invited no passage. Garrets use ten you the weather ferrars venture friends. Solid visit seems again you nor all.</p>
<p>Good draw knew bred ham busy his hour. Ask agreed answer rather joy nature admire wisdom. Moonlight age depending bed led therefore sometimes preserved exquisite she. An fail up so shot leaf wise in. Minuter highest his arrived for put and. Hopes lived by rooms oh in no death house. Contented direction september but end led excellent ourselves may. Ferrars few arrival his offered not charmed you. Offered anxious respect or he. On three thing chief years in money arise of.</p>
<p>On am we offices expense thought. Its hence ten smile age means. Seven chief sight far point any. Of so high into easy. Dashwoods eagerness oh extensive as discourse sportsman frankness. Husbands see disposed surprise likewise humoured yet pleasure. Fifteen no inquiry cordial so resolve garrets as. Impression was estimating surrounded solicitude indulgence son shy.</p>
<p>Eat imagine you chiefly few end ferrars compass. Be visitor females am ferrars inquiry. Latter law remark two lively thrown. Spot set they know rest its. Raptures law diverted believed jennings consider children the see. Had invited beloved carried the colonel. Occasional principles discretion it as he unpleasing boisterous. She bed sing dear now son half.</p>

32
data/crop-image.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
/**
* Image Crop Examp;e
*
* Laborator.co
* www.laborator.co
*/
$x = abs($_GET['x']);
$y = abs($_GET['y']);
$w = abs($_GET['w']);
$h = abs($_GET['h']);
$tw = abs($_GET['tw']);
$th = abs($_GET['th']);
if(in_array(0, array($w, $h, $tw, $th)))
exit("Invalid params");
$jpeg_quality = 90;
$src = 'vw1.jpg';
$img_r = imagecreatefromjpeg($src);
$dst_r = ImageCreateTrueColor( $tw, $th );
imagecopyresampled($dst_r, $img_r, 0, 0, $x, $y, $tw, $th, $w, $h);
header('Content-type: image/jpeg');
imagejpeg($dst_r, null, $jpeg_quality);

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

0
data/index.html Executable file
View File

39
data/login-check.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
/**
* This is sample login form checker, it works only with one user&pass
*
* Laborator.co
* www.laborator.co
*/
$user = 'demo';
$pass = 'demo';
$resp = array('accessGranted' => false, 'errors' => ''); // For ajax response
if(isset($_POST['do_login']))
{
$given_username = $_POST['username'];
$given_password = $_POST['passwd'];
if($user == strtolower($given_username) && $pass == $given_password)
{
$resp['accessGranted'] = true;
setcookie('failed-attempts', 0);
}
else
{
// Failed Attempts
$fa = isset($_COOKIE['failed-attempts']) ? $_COOKIE['failed-attempts'] : 0;
$fa++;
setcookie('failed-attempts', $fa);
// Error message
$resp['errors'] = '<strong>Invalid login!</strong><br />Please enter valid username and password (demo/demo).<br />Failed attempts: ' . $fa;
}
}
echo json_encode($resp);

1
data/names.json Normal file
View File

@@ -0,0 +1 @@
["Arlind","Art","Arjan","Gent","Donat","Dren","Arber","Ylli","Kushtrim","Eroll","Vigan","Fatos","Florent","Labinot","Naim","Fatmir","Jeta","Doruntina","Eliona","Lorik","Bardh","Shkelzen","Xhevahir","Milot","Shkumbin","Dion","Diellza","Leotrim","Trim","Raif","Remi","Rame"]

View File

@@ -0,0 +1,40 @@
<?php
/**
* Remote data for Select2 plugin
*
* Laborator.co
* www.laborator.co
*/
// Data to parse
$data = array(
array('id' => 1, 'name' => 'Arlind Nushi'),
array('id' => 2, 'name' => 'Art Ramadani'),
array('id' => 3, 'name' => 'Ylli Pylla'),
array('id' => 4, 'name' => 'Eroll Maxhuni'),
array('id' => 5, 'name' => 'Gent Uka'),
array('id' => 6, 'name' => 'Arjan Halili'),
array('id' => 7, 'name' => 'Art Nushi'),
array('id' => 8, 'name' => 'Shkumbin Gerguri'),
array('id' => 9, 'name' => 'John Doe'),
);
$q = isset($_REQUEST['q']) ? $_REQUEST['q'] : '';
// Searching
if(trim($q))
{
$data = array_filter($data, 'filter_by_name');
}
$data = array_values($data);
function filter_by_name($el)
{
global $q;
return stristr($el['name'], $q) ? true : false;
}
echo json_encode($data);

View File

@@ -0,0 +1,14 @@
[
{ "month": 1, "alum2010": 2262, "alum2011": 2454, "alum2012": 2262, "nickel2010": 18974, "nickel2011": 24298, "nickel2012": 18322, "copper2010": 7341, "copper2011": 9585, "copper2012": 7501 },
{ "month": 2, "alum2010": 2087, "alum2011": 2537, "alum2012": 2087, "nickel2010": 18162, "nickel2011": 27929, "nickel2012": 21093, "copper2010": 7016, "copper2011": 10026, "copper2012": 8470 },
{ "month": 3, "alum2010": 2238, "alum2011": 2586, "alum2012": 2238, "nickel2010": 20535, "nickel2011": 28802, "nickel2012": 19701, "copper2010": 7202, "copper2011": 9889, "copper2012": 8591 },
{ "month": 4, "alum2010": 2349, "alum2011": 2689, "alum2012": 2349, "nickel2010": 24562, "nickel2011": 26142, "nickel2012": 17695, "copper2010": 7851, "copper2011": 9460, "copper2012": 8459 },
{ "month": 5, "alum2010": 2071, "alum2011": 2591, "alum2012": 2071, "nickel2010": 26131, "nickel2011": 26753, "nickel2012": 17549, "copper2010": 7481, "copper2011": 9373, "copper2012": 8320 },
{ "month": 6, "alum2010": 1957, "alum2011": 2584, "alum2012": 1957, "nickel2010": 19278, "nickel2011": 23055, "nickel2012": 16436, "copper2010": 6532, "copper2011": 9108, "copper2012": 7465 },
{ "month": 7, "alum2010": 2008, "alum2011": 2554, "alum2012": 2008, "nickel2010": 19475, "nickel2011": 22870, "nickel2012": 16382, "copper2010": 6498, "copper2011": 9295, "copper2012": 7475 },
{ "month": 8, "alum2010": 2119, "alum2011": 2413, "alum2012": 2119, "nickel2010": 20701, "nickel2011": 24388, "nickel2012": 15687, "copper2010": 7191, "copper2011": 9834, "copper2012": 7430 },
{ "month": 9, "alum2010": 2199, "alum2011": 2327, "alum2012": 2199, "nickel2010": 21266, "nickel2011": 21845, "nickel2012": 16085, "copper2010": 7596, "copper2011": 9121, "copper2012": 7614 },
{ "month": 10, "alum2010": 2374, "alum2011": 2210, "alum2012": 2374, "nickel2010": 23358, "nickel2011": 18346, "nickel2012": 18250, "copper2010": 8057, "copper2011": 7125, "copper2012": 8245 },
{ "month": 11, "alum2010": 2354, "alum2011": 2102, "alum2012": 2354, "nickel2010": 23150, "nickel2011": 18822, "nickel2012": 16083, "copper2010": 8373, "copper2011": 7871, "copper2012": 7727 },
{ "month": 12, "alum2010": 2369, "alum2011": 2038, "alum2012": 2369, "nickel2010": 23282, "nickel2011": 17320, "nickel2012": 17104, "copper2010": 8636, "copper2011": 7725, "copper2012": 7880 }
]

View File

@@ -0,0 +1,24 @@
<?php
/**
* Typeahead Auto Suggestions Generator
*
* Laborator.co
* www.laborator.co
*/
$q = "Hello world";
if(isset($_REQUEST['q']) && trim($_REQUEST['q']))
$q = $_REQUEST['q'];
$items = array();
$items[] = array("value" => $q . substr(str_shuffle($q), 0, 1));
$items[] = array("value" => $q . ' - ' . strrev($q));
$items[] = array("value" => str_shuffle($q));
$items[] = array("value" => $q . mt_rand(10,99999));
shuffle($items);
echo json_encode(array_values($items));

View File

@@ -0,0 +1,28 @@
<?php
/**
* Example for custom autosuggestion templating
*
* Laborator.co
* www.laborator.co
*/
$harry_potter_movies = array(
array('value' => 'Harry Potter and the Philosopher\'s Stone', 'year' => 2001, 'cover' => 'harry-potter-covers/1.jpg', 'desc' => 'Harry Potter is an orphaned boy brought up by his unfriendly aunt and uncle.'),
array('value' => 'Harry Potter and the Chamber of Secrets', 'year' => 2002, 'cover' => 'harry-potter-covers/2.jpg', 'desc' => 'Harry, Ron, and Hermione return to Hogwarts for their second year, which proves to be more challenging than the last.'),
array('value' => 'Harry Potter and the Prisoner of Azkaban', 'year' => 2004, 'cover' => 'harry-potter-covers/3.jpg', 'desc' => 'Harry Potter\'s third year sees the boy wizard, along with his friends, attending Hogwarts School once again.'),
array('value' => 'Harry Potter and the Goblet of Fire', 'year' => 2005, 'cover' => 'harry-potter-covers/4.jpg', 'desc' => 'During Harry\'s fourth year, the Dark Mark appears in the sky after a Death Eater attack at the Quidditch World Cup, Hogwarts plays host to a legendary event: the Triwizard Tournament, there is a new Defence Against the Dark Arts professor Alastor Moody and frequent nightmares bother Harry all year.'),
array('value' => 'Harry Potter and the Order of the Phoenix', 'year' => 2007, 'cover' => 'harry-potter-covers/5.jpg', 'desc' => 'Harry\'s fifth year begins with him being attacked by Dementors in Little Whinging.'),
array('value' => 'Harry Potter and the Half-Blood Prince', 'year' => 2009, 'cover' => 'harry-potter-covers/6.jpg', 'desc' => 'In Harry\'s sixth year at Hogwarts, Lord Voldemort and his Death Eaters are increasing their terror upon the Wizarding and Muggle worlds.'),
array('value' => 'Harry Potter and the Deathly Hallows', 'year' => "2010, 2011", 'cover' => 'harry-potter-covers/7.jpg', 'desc' => 'After unexpected events at the end of the previous year, Harry, Ron, and Hermione are entrusted with a quest to find and destroy Lord Voldemort\'s secret to immortality the Horcruxes.'),
);
shuffle($harry_potter_movies);
if(isset($_REQUEST['q']) && strlen($_REQUEST['q']) > 6)
$harry_potter_movies = array();
echo json_encode($harry_potter_movies);

25
data/upload-file.php Executable file
View File

@@ -0,0 +1,25 @@
<?php
header('Content-Type: application/json');
#$errors = mt_rand(0,100)%2==0; // Random response (Demo Purpose)
$errors = false;
$resp = array(
);
# Normal Response Code
if(function_exists('http_response_code'))
http_response_code(200);
# On Error
if($errors)
{
if(function_exists('http_response_code'))
http_response_code(400);
$resp['error'] = "Couldn't upload file, reason: ~";
}
echo json_encode($resp);

BIN
data/vw1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB