Bin e padrões para validação de cartão de crédito.
Bandeira | Começa com | Máximo de número | Máximo de número cvc |
---|---|---|---|
Visa | 4 | 13,16 | 3 |
Mastercard | 5 | 16 | 3 |
<?php | |
/** | |
* Add checkbox field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>'; |
<?php | |
// [wp insert user « WordPress Codex](http://codex.wordpress.org/Function_Reference/wp_insert_user) | |
require_once "wordpress/wp-load.php"; | |
$user_info = array( | |
"user_pass" => "test123", | |
"user_login" => "username", | |
"user_nicename" => "username", | |
"user_email" => "[email protected]", |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('.dragger').mousedown(function (event) { | |
$(this) | |
.data('down', true) | |
.data('x', event.clientX) | |
.data('scrollLeft', this.scrollLeft) | |
.addClass("dragging"); | |
return false; |
function mysite_pending($order_id) { | |
error_log("$order_id set to PENDING", 0); | |
} | |
function mysite_failed($order_id) { | |
error_log("$order_id set to FAILED", 0); | |
} | |
function mysite_hold($order_id) { | |
error_log("$order_id set to ON HOLD", 0); | |
} | |
function mysite_processing($order_id) { |
<?php | |
$serverName = "sqlserver.example.com"; | |
$database = "myDbName"; | |
$uid = 'sqlserver_username'; | |
$pwd = 'password'; | |
try { | |
$conn = new PDO( | |
"sqlsrv:server=$serverName;Database=$database", | |
$uid, |
CREATE FUNCTION `lat_lng_distance` (lat1 FLOAT, lng1 FLOAT, lat2 FLOAT, lng2 FLOAT) | |
RETURNS FLOAT | |
DETERMINISTIC | |
BEGIN | |
RETURN 6371 * 2 * ASIN(SQRT( | |
POWER(SIN((lat1 - abs(lat2)) * pi()/180 / 2), | |
2) + COS(lat1 * pi()/180 ) * COS(abs(lat2) * | |
pi()/180) * POWER(SIN((lng1 - lng2) * | |
pi()/180 / 2), 2) )); | |
END |
//Substituir por valores reais. | |
var data1 = new Date('YYYY', 'MM','DD'); | |
var data2 = new Date('YYYY', 'MM','DD'); | |
var diferenca = parseInt((data1-data2)/(24*3600*1000)); |
/** | |
* Remove acentos de caracteres | |
* @param {String} stringComAcento [string que contem os acentos] | |
* @return {String} [string sem acentos] | |
*/ | |
function removerAcentos( newStringComAcento ) { | |
var string = newStringComAcento; | |
var mapaAcentosHex = { | |
a : /[\xE0-\xE6]/g, | |
e : /[\xE8-\xEB]/g, |