This file contains hidden or 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
CREATE TABLE `customer` ( | |
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | |
`npid` char(8) CHARACTER SET ascii NOT NULL, | |
`email` char(254) CHARACTER SET ascii DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `npid` (`npid`), | |
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; | |
DELIMITER ;; | |
CREATE trigger before_insert_customer BEFORE INSERT ON customer FOR EACH ROW |
This file contains hidden or 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 | |
function spanSplit($string) { | |
function mb_str_split( $string, $string_length = 1, $charset = 'utf-8' ) { | |
if ( mb_strlen( $string, $charset ) > $string_length || !$string_length ) { | |
do { | |
$c = mb_strlen( $string, $charset ); | |
$parts[] = mb_substr( $string, 0, $string_length, $charset ); | |
$string = mb_substr( $string, $string_length, $c - $string_length, $charset ); | |
} while ( !empty( $string ) ); | |
} else { |
This file contains hidden or 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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#core_scroll_header_panel { | |
width: 380px; |
This file contains hidden or 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 | |
function generateSlug($string, $separator = '-') { | |
// nowa magia PHP 5.4 & intl | |
$transliterator = \Transliterator::create("Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();"); | |
$string = $transliterator->transliterate($string); | |
//TODO przeklejone z starej funkcji - zapewne to powyżej większość z tego umie; część nadmiarowa | |
return strtolower(trim(preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')), '-')); | |
} |
This file contains hidden or 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 | |
$this->tablegateway->select(function (\Zend\Db\Sql\Select $select) use ($params){ | |
// kolumna created = updated | |
$select->where->equalTo('id','created'); | |
// i pole like zawiera cos tam szukanego | |
$select->where->AND->like('name',"%".$params['search']."%"); | |
// i pole email jest [email protected] albo z domeny @test.com | |
$select->where->AND->NEST->equalTo('email','[email protected]')->OR->like('email','%@test.com'); | |
// a do tego jeszcze parametr email malymi literkami równa ... itd | |
$select->where->addPredicate(new \Zend\Db\Sql\Predicate\Expression("LOWER(email) = ?",$params['email'])); |
This file contains hidden or 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 | |
$this->tablegateway->select(function (\Zend\Db\Sql\Select $select) use ($params){ | |
// kolumna created = updated | |
$select->where->equalTo('created','updated'); | |
}); |
This file contains hidden or 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 onBootstrap(MvcEvent $e) { | |
if ($e->getApplication()->getServiceManager()->get('AuthStorage')->hasIdentity()) | |
$pages = new \Zend\Navigation\Page\Mvc(array( | |
'pages'=> | |
array( | |
'auth-user-logout' => array( | |
'label' => 'Wylogowanie', | |
'route' => 'auth-user-login', | |
) |