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 status($status, $is = true) | |
{ | |
// $status = 99 to show all result, ignore filtering | |
if($status !== null && $status != "" && (int)$status < 10) | |
{ | |
$status = (array) $status; | |
$statusString = implode(", ", (array) $status); | |
if($is) |
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 | |
/** | |
* Auto-versioning. Append last modified datetime to filename, .htaccess needs to have the corresponding rule | |
* Similar function, same name in javascript, common.js | |
* E.g. "assets/css/style.css" converts to "assets/css/style.1363054031.css" | |
* @param $url String Relative path | |
* @return String Modified relative path | |
*/ | |
if ( ! function_exists('site_ver_url')) { |
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
# Default cache values | |
ExpiresActive ON | |
ExpiresByType text/html "access plus 1 minute" | |
ExpiresByType text/css "access plus 1 day" | |
ExpiresByType text/javascript "access plus 7 days" | |
ExpiresByType application/x-javascript "access plus 7 days" | |
ExpiresByType application/javascript "access plus 7 days" | |
ExpiresByType application/x-shockwave-flash "access plus 7 days" | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/jpg "access plus 1 month" |
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
// HTML page | |
// <h2>Customer Summary</h2> | |
// <div> | |
// <button id="esLastHour">Last Hour</button> | |
// <button id="esDaily">24 Hours</button> | |
// <button id="esWeekly">1 Week</button> | |
// <button id="esMonthly">4 Weeks</button> | |
// </div> | |
// <div id="errorSummaryDT" class="dataTable"></div> |
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
// File location: siwapp/lib/templating/Common_Twig_Extension.php | |
function common_twig_extension_round($amount, $decimals = 2) | |
{ | |
//return round($amount, $decimals); | |
return number_format(round($amount, $decimals), $decimals, '.', ''); | |
} |
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
// File location: siwapp/apps/siwapp/modules/common/templates/_invoiceRow.php | |
//connect the selection of a product to update the row item | |
$('#".$invoiceItemForm['product_autocomplete']->renderId()."') | |
.autocomplete('".$urlAjaxSelectProduct."', jQuery.extend({}, { | |
dataType: 'json', | |
parse: function(data) { | |
var parsed = []; | |
for (key in data) { | |
parsed[parsed.length] = { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html lang="{{lang}}" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Invoice</title> | |
<style type="text/css"> | |
@page { margin:0.5cm 0.5cm 0.8cm 1.5cm; } | |
body { margin:0.8cm auto;font:1em;} | |
div { display:block; } | |
table { border-collapse:collapse; border-spacing:0; width:99%;} |
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
/** | |
* Step #4: Database | |
* The validator of this form checks database connection | |
* and creates the database if it doesn\'t exists | |
* See lib/validator/dbConnectionValidator.class.php | |
* File location: siwapp/apps/installer/modules/static/actions/actions.class.php | |
* | |
* @param $request | |
*/ | |
public function executeStep4(sfWebRequest $request) |
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
class Badge { | |
public function __construct() { | |
// Define all the achievements | |
Events::register('badges', array($this, 'badgeCommentator')); | |
Events::register('badges', array($this, 'badgeContributor')); | |
} | |
public function badgeCommentator($comment = '') { | |
if (!empty($comment) && strlen($comment) > 5) { | |
return 'Achievement: Badass Commentator'; |
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
/** | |
* @name EmailInbound (Mail Message Handler for POCO) | |
* @description Receive and sort emails | |
*/ | |
#include "MyMailMessage.h" | |
/** | |
* POCO::Net::MailMessage | |
*/ |
NewerOlder