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 | |
function formatToHourMinutes($decTime) { | |
$negative = false; | |
if(!is_numeric($decTime))return $decTime; | |
if($decTime == 0)return '-'; | |
if($decTime < 0){ | |
$negative = true; | |
$decTime = abs($decTime);//$decTime = -1 * abs($decTime); | |
} |
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
http://stackoverflow.com/questions/4100022/php-validate-integer |
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 | |
class Common_Datetime { | |
static public function months() { | |
$month_name_arr = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); | |
$month_name_arr = array("january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"); | |
return $month_name_arr; | |
} | |
/** |
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 isValidTime($time,$is24Hours=true,$seconds=false) { | |
$pattern = "/^".($is24Hours ? "([1-2][0-3]|[01]?[1-9])" : "(1[0-2]|0?[1-9])").":([0-5]?[0-9])".($seconds ? ":([0-5]?[0-9])" : "")."$/"; | |
if (preg_match($pattern, $time)) { | |
return true; | |
} | |
return 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
<?php | |
/** | |
* | |
* returns array with the next ($next*)years, current year and previous (previous*)years | |
* return as int | |
* (except for current, needs to change) | |
* | |
*/ | |
public function getNextAndPreviousYears($current,$next = null,$previous = null){ |
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() { | |
$('#datatable').dataTable( { | |
//"bSort": false | |
} ); | |
// ##### DATA TABLE COLUMN FILTER ###### // | |
// if($('#datatable').length > 0){ | |
// $('#datatable').dataTable().columnFilter(); |
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 common() { | |
Zend_Controller_Front::getInstance()->getBaseUrl(); | |
//$this->_helper->layout()->setLayout('nomenulayoutwide'); | |
$this->getHelper('layout')->disableLayout(); | |
$this->_helper->_layout->setLayout('login'); | |
$this->_helper->redirector('list'); |
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
["](.*)//finds everything in the line after the " | |
/*********************/ | |
http://stackoverflow.com/questions/4419000/regex-match-everything-after-question-mark | |
\?(.*)//match everything that is after/follows the question mark. | |
/*********************/ |
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
cd /var/www | |
mkdir scrum | |
chmod -R 777 scrum/ | |
cd scrum/ | |
git init | |
git status | |
git remote add origin git@github.com:buschagne/scrum.git | |
sudo nano .git/config |
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 | |
$currentDate = new Zend_Date(); | |
$currentDate->setDate($taskDistribution["date"], "yyyy-MM-dd"); | |
$startTime = new Zend_Date(); | |
$startTime->setTime($taskDistribution["start_time"], "HH:mm:ss"); | |
$endTime = new Zend_Date(); | |
$endTime->setTime($taskDistribution["end_time"], "HH:mm:ss"); | |
if($endTime->toString('HH') == '00') | |
$endTime->setHour('24'); |
OlderNewer