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 | |
$phones = array( '447549007599', '353852723831', '614549007599' , '615549007599' , '642549007599' , '918667672071'); | |
#$phones = array( '448549007599'); | |
function isValidMobileNumber($phones = null) { | |
$countryCode = array( '44' => '7', '353' => '8', '61' =>'4|5', '64' =>'2'); | |
$result = array(); | |
foreach( $phones as $number ) | |
{ |
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
$("input[id^='item-']").live('blur',function(e) { | |
var $this = $(this), | |
edit = '<?=$edit;?>', | |
str = $this.val() | |
str = str.replace(/[!£$^*]/gi, ''); | |
str = removeTags(str); | |
$this.val(str) | |
get_name($this.attr('id')) |
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
while($row=mysql_fetch_assoc($result)) { | |
$users_array[]= "'".$row['user']."'"; | |
} | |
$user_list = implode(',', $users_array); |
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
$(document).on('focusin', 'input', function(){ | |
console.log("Saving value " + $(this).val()); | |
$(this).data('val', $(this).val()); | |
}).on('change','input', function(){ | |
var prev = $(this).data('val'); | |
var current = $(this).val(); | |
console.log("Prev value " + prev); | |
console.log("New value " + current); | |
}); |
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
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e){ | |
var currentTab = $(e.target).text(); // get current tab | |
var LastTab = $(e.relatedTarget).attr("href"); // get last tab | |
}); |
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
//echo datediff('w', '9 July 2003', '4 March 2004', false); | |
//Which will tell you the number of weekdays between the 9th July 2003 and the 4th of March 2004. | |
<?php | |
function datediff($interval, $datefrom, $dateto, $using_timestamps = false) { | |
/* | |
$interval can be: | |
yyyy - Number of full years | |
q - Number of full quarters |
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
var iframe = parent.document.getElementById("memo").contentWindow; | |
var h = iframe.document.body.offsetHeight + 'px' | |
parent.$('#memo').css('height', h); |
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
<div class="container"> | |
<form class="form-horizontal" role="form"> | |
<fieldset> | |
<legend>Payment</legend> | |
<div class="form-group"> | |
<label class="col-sm-3 control-label" for="card-holder-name">Name on Card</label> | |
<div class="col-sm-9"> | |
<input type="text" class="form-control" name="card-holder-name" id="card-holder-name" placeholder="Card Holder's Name"> | |
</div> | |
</div> |
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
// output headers so that the file is downloaded rather than displayed | |
header('Content-Type: text/csv; charset=utf-8'); | |
header('Content-Disposition: attachment; filename=data.csv'); | |
// create a file pointer connected to the output stream | |
$output = fopen('php://output', 'w'); | |
// output the column headings | |
fputcsv($output, array('Column 1', 'Column 2', 'Column 3')); |
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 | |
include('../../../connect.php'); | |
include('../../../plugins/GUMP-master/gump.class.php'); | |
$ERROR=0; | |
$gump = new GUMP(); | |
$_POST = $gump->sanitize($_POST); // You don't have to sanitize, but it's safest to do so. |
NewerOlder