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 | |
// grab the requested file's name | |
$file_name = $_GET['file']; | |
// make sure it's a file before doing anything! | |
if(strpos($file_name, '.pdf')) { | |
// required for IE | |
if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); } |
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 _logFile($filename,$heading,$array) | |
{ | |
$file=fopen($filename, "a+"); | |
if(count(file($filename))==0) | |
{ | |
$string=implode("\t | \t",array_keys($array)); | |
fwrite($file,"\n".$heading); | |
fwrite($file,"\n".str_repeat("-",strlen($string)+62)); | |
fwrite($file,"\n".$string); | |
fwrite($file,"\n".str_repeat("-",strlen($string)+62)); |
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 _isset(fieldName) | |
{ | |
return jQuery("[name='"+fieldName+"']").length==1 && jQuery("[name='"+fieldName+"']").val()!=""; | |
} | |
// For Input,Textarea,Select | |
function _issetDate(fieldName) | |
{ | |
return jQuery("[name='"+fieldName+"']:eq(1)").length==1 && jQuery("[name='"+fieldName+"']:eq(1)").val()!=""; | |
} |
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 | |
add_action( 'widgets_init', array ( 'CPP_Widget', 'register' ) ); | |
class CPP_Widget extends WP_Widget | |
{ | |
/** | |
* Constructor. | |
*/ | |
public function __construct() | |
{ |
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 DBManager { | |
private $selectables = array(); | |
private $table; | |
private $whereClause; | |
private $limit; | |
public function select(){ | |
$this->selectables = func_get_args(); | |
return $this; |
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
<body> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> | |
<style type="text/css"> | |
#userlist {overflow: hidden; height: 40px; background: orange;} | |
#userlist li{display: block; background:white; height: 40px; margin: 1px 0px;} | |
</style> | |
<ul id="userlist"> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
</ul> |
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
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> | |
<style type="text/css"> | |
#userlist {overflow: hidden; height: 40px; background: orange;} | |
#userlist li{display: block; background:white; height: 40px; margin: 1px 0px;} | |
</style> | |
<ul id="userlist"> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
</ul> | |
<!--button id="myButton">Button</button--> |
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 mapImage(lat,lng,element,icon,fa) | |
{ | |
var width=parseInt(parseInt(jQuery('#'+element).css('width'))/2); | |
var height=parseInt(parseInt(jQuery('#'+element).css('height'))/2); | |
var imgURL='https://maps.googleapis.com/maps/api/staticmap?center='+lat+','+lng+'&zoom=14&maptype=roadmap&markers=icon:'+icon+'&scale=2&size='+width+'x'+height+'&key='; | |
//console.log(imgURL); | |
jQuery('#'+element).css('background-image',"url('"+imgURL+"')"); | |
jQuery('#'+element).css('background-repeat',"no-repeat"); | |
jQuery('#'+element).css('background-position',"center center"); | |
jQuery('#'+element).css('background-size',"cover"); |
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 | |
$country_code="US"; | |
$zip_postal="11111"; | |
$ZIPREG=array( | |
"US"=>"^\d{5}([\-]?\d{4})?$", | |
"UK"=>"^(GIR|[A-Z]\d[A-Z\d]??|[A-Z]{2}\d[A-Z\d]??)[ ]??(\d[A-Z]{2})$", | |
"DE"=>"\b((?:0[1-46-9]\d{3})|(?:[1-357-9]\d{4})|(?:[4][0-24-9]\d{3})|(?:[6][013-9]\d{3}))\b", | |
"CA"=>"^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ])\ {0,1}(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$", |
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 | |
echo "<pre>"; | |
$post=array('dob'=>'28-04-2015','doj'=>'4th Feb 2015','dos'=>'January 5th 2018','doh'=>'Next Month'); | |
print_r($post); | |
function toDate(&$date) | |
{ | |
$date=date('Y-m-d',strtotime($date)); | |
} | |
foreach($post as &$r) | |
{ |
NewerOlder