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
var isError = false; | |
$('[name="member-books-guest"]').submit(function (e) { | |
$.LoadingOverlay("show"); | |
$( ".error-message" ).remove(); | |
for ( let i = 0; i < e.target.length; i++ ) { | |
let currentField = e.target[i]; | |
if (currentField.type == 'text') { | |
if(!currentField.value) { | |
$('[name="'+currentField.name+'"]').after("<span style='color:tomato' class='error-message'>* Field can't be empty</span>"); |
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 | |
# app/Exceptions/Handler.php | |
public function render($request, Exception $exception) | |
{ | |
if ($exception instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) | |
{ | |
return response()->json([ | |
'message' => 'Resource not found' | |
], 404); |
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 | |
# In factory | |
use Faker\Generator as Faker; | |
$factory->define(App\Poll::class, function (Faker $faker) { | |
return [ | |
'title' => $faker->text | |
]; | |
}); |
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 store(Request $request) | |
{ | |
$this->validate($request, [ | |
'images.*' => 'required|mimes:jpg,jpeg,png,bmp|max:2000' | |
],[ | |
'images.*.required' => 'Please upload an image only', | |
'images.*.mimes' => 'Only jpeg, png, jpg and bmp images are allowed', | |
'images.*.max' => 'Sorry! Maximum allowed size for an image is 2MB', |
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 static function segmentation_option() | |
{ | |
global $wpdb; | |
$version = '1.0'; | |
$table_name = $wpdb->prefix . 'segmentation_option'; | |
$seg_table=$wpdb->prefix . 'question'; | |
$charset_collate = $wpdb->get_charset_collate(); | |
$sql = "CREATE TABLE $table_name ( |
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 | |
// config | |
// ------------------------------- | |
// only file name + .zip | |
$zip_filename = $_POST['zip_filename'] ?? ''; | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> |
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
$('.ui.search').search({ | |
apiSettings: { | |
action: 'search', | |
url: '/wp-admin/admin-ajax.php?action=search_customer&query={query}' | |
}, | |
fields: { | |
results: 'results', | |
title: 'FirstName', | |
description: 'Email', | |
}, |
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 if(!is_user_logged_in()): ?> | |
<h3>Please <a href="<?php echo wp_login_url(get_the_permalink()) ?>">Login</a></h3> | |
<?php return; endif ?> |
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
individualPriceChange(); | |
totalPriceChange(); | |
$(".qty").change(function() { | |
individualPriceChange(); | |
totalPriceChange(); | |
}); | |
// price calculation row | |
function individualPriceChange() { |