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
{{ _self.pagination(4, 1, 'http://127.0.0.1:8000/admin/config/system/mutual-funds?page=') }} | |
{% macro pagination(total, current, url, nearbyPagesLimit = 4) %} | |
{% spaceless %} | |
{% if total > 1 %} | |
<ul class="pagination"> | |
{% for i in 1..total %} | |
{% if 0 == (current - nearbyPagesLimit) - loop.index %} | |
<li><a href="{{ (url ~ 1)|e }}">1</a></li> | |
{% if 1 != loop.index %} |
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
// delay on typing | |
function delay(callback, ms) { | |
let timer = 0; | |
return function() { | |
let context = this, args = arguments; | |
clearTimeout(timer); | |
timer = setTimeout(function () { | |
callback.apply(context, args); | |
}, ms || 0); | |
}; |
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 | |
/** | |
* -- Many to Many -- | |
* [processing the reference table to communicate with the database] | |
* @param string $key [pk of the table] *name of primary keys | |
* @param string $pk [reference pk to main table] *value of primary keys | |
* @param array $data [data to be executed] | |
* @param integer $method [execution method] 0 insert, 1 update | |
* @return boolean [success = true] | |
* |
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 bubble_sort($sortarr) { | |
// Bubble sorting | |
$array_count = count($sortarr); | |
for($x = 0; $x < $array_count; $x++){ | |
for($a = 0 ; $a < $array_count - 1 ; $a++){ | |
if($a < $array_count ){ | |
if($sortarr[$a] > $sortarr[$a + 1]) swap($sortarr, $a, $a+1); | |
} | |
} | |
} |
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
// Set Array | |
var idAdd = []; | |
// Push value to array | |
$('.single-box:checked').map(function () { | |
var vl = $(this).val(); | |
idAdd.push(vl); | |
}); | |
// check the array address have same value or not |
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 | |
// initialize | |
$range = array(); | |
$range_price = array(); | |
// data range | |
$range = array ( | |
0 => array ( | |
"min_range" => 10000, | |
"max_range" => 14000 |
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 element = '#numberFormattedWithDecimal'; | |
$(element).keyup(function(event) { | |
/** | |
* Regular Expression. | |
* ref. | |
* https://regex101.com | |
* | |
* @type {RegExp} | |
*/ |
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 () { | |
// create the chart | |
$('#container').highcharts({ | |
chart: { type: 'column' }, // type charts | |
title: { text: '3 Level Charts' }, // title of charts | |
xAxis: { type: 'category' }, // x Axis | |
legend: { enabled: false }, // rule of legend |
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 ready | |
$(document).ready(function() { | |
// event on change | |
$(document).on("change","#box-all",function() { | |
// check all | |
if(this.checked) { | |
$(".box-single").each(function() { | |
this.checked = true; | |
}) |
NewerOlder