This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, undefined) { | |
$.nette.ext('spinner', { | |
init: function () { | |
spinner = $('<div></div>', { id: "ajax-spinner" }); | |
spinner.appendTo("body"); | |
}, | |
before: function (xhr, settings) { | |
$("#ajax-spinner").css({ | |
visibility: "visible", | |
left: settings.nette.e.pageX, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mpdf = new \mPDF('utf-8','A4','','',12,12,2,2,10,10, 'P'); | |
$mpdf->useOnlyCoreFonts = true; | |
$mpdf->SetDisplayMode('fullpage'); | |
$this->template->setFile(INDEX_DIR . '/app/FrontModule/templates/ConfigIt/pdf.latte'); | |
$mpdf->WriteHTML((string) $this->template); | |
$mpdf->Output($name, 'd'); | |
$this->terminate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createTemplate($class = NULL) | |
{ | |
$template = parent::createTemplate($class); | |
$template->addFilter('streakBar', function($s, $maxBar = 5, $paramId){ | |
if ($paramId == 1470) | |
{ | |
$streakBar = \Nette\Utils\Html::el('div')->addClass('streak-bar'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{** Bootstrapové vykreslení paginatoru *} | |
{default $maxOdkazu = 15} | |
{default $postupnychStranek = 4} | |
{var $min = $paginator->getBase()} | |
{var $max = $paginator->getPageCount()} | |
{var $pocet = ($max - $min)} | |
{var $aktStrana = $paginator->getPage()} | |
{var $doplnkovychStran = $maxOdkazu - 2 - ($postupnychStranek*2) + 1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getGbookTreeData($articleId, $languageId = 1) | |
{ | |
$data = $this->connection->table('gbook')->where('article_id', $articleId)->where('language_id', $languageId)->order('id ASC'); | |
$tree = array(); | |
foreach ($data as $item) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once('./Nette/loader.php'); | |
define(HESLO_MIN_ZNAKU,6); | |
define(URL_ADRESA_OBCHODNICH_PODMINEK,'http://www.example.com/'); | |
function loginValidator($item){ | |
return dibi::query('SELECT [id] FROM [zakaznici] WHERE [nick]=%s LIMIT 1',$item->getValue())->count() == 0 ? true : false; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common: | |
security: | |
debugger: true | |
frames: SAMEORIGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Google Maps Multiple Markers</title> | |
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="map" style="height: 400px; width: 500px;"> | |
</div> | |
<script type="text/javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Praha, Drazdany | |
SET @lat1 = 50.0598058; | |
SET @lat2 = 51.0769658; | |
SET @lng1 = 14.3255396; | |
SET @lng2 = 13.6325016; | |
select | |
6371 * 2 * ASIN(SQRT( | |
POWER(SIN((@lat1 - abs(@lat2)) * pi()/180 / 2), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$imgname = "1.gif"; | |
$im = imagecreatefromgif ($imgname); | |
$index = imagecolorexact ($im,0,128,0); | |
imagecolorset($im,$index,240,255,0); | |
$imgname = "result.gif"; | |
imagegif($im,$imgname); | |
?> | |
<img src="result.gif"> |