Skip to content

Instantly share code, notes, and snippets.

<?php
rs::metabox(array(
'title' => 'Select custom date sale',
'layout' => 'none',
'rules' => array(
'post_type' => 'product'
),
'context' => 'normal',
'priority' => 'default',
'controls' => array(
<?php
sleep(6);
$get_value[] = $_GET['variable1'];
$get_value[] = $_GET['variable2'];
echo json_encode($get_value);
@binmaocom
binmaocom / ajax-javascript.php
Created June 8, 2015 09:21
ajax-javascript.php
<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc(){
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
public ActionResult Edit(EditUserModel model)
{
if (db.Users.Any(item => item.UserName == model.UserName && item.Id != model.Id))
{
ModelState.AddModelError("UserName", string.Format(Translate("UserNameIsAlreadyTaken", "ValidationMessage", "Tài khoản '{0}' đã tồn tại."), model.UserName));
}
if (db.Users.Any(item => item.Email == model.Email && item.Id != model.Id))
{
ModelState.AddModelError("Email", string.Format(Translate("EmailIsAlreadyTaken", "ValidationMessage", "Email đã tồn tại."), model.Email));
}