- @license
- Multiselect v1
- https://gist.github.com/mazfreelance/568f770e45f6c8cc028157e0fe2e38f7
- Copyright (c) 2019 MAZ Tech
- Licensed under the MIT license
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 getDatesFromRange($start, $end, $format = 'Y-m-d') { | |
$array = array(); | |
$interval = new DateInterval('P1D'); | |
$realEnd = new DateTime($end); | |
$realEnd->add($interval); | |
$period = new DatePeriod(new DateTime($start), $interval, $realEnd); | |
foreach($period as $date) { |
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 calculateBusinessDays(startDate, endDate){ | |
// Validate input | |
if (endDate < startDate) | |
return 0; | |
// Calculate days between dates | |
var millisecondsPerDay = 86400 * 1000; // Day in milliseconds | |
startDate.setHours(0,0,0,1); // Start just after midnight | |
endDate.setHours(23,59,59,999); // End just before midnight | |
var diff = endDate - startDate; // Milliseconds between datetime objects |
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
//html | |
<input type="checkbox" class="checkbox" name="checkbox[]" value="checkbox 1"/> | |
<input type="checkbox" class="checkbox" name="checkbox[]" value="checkbox 2"/> | |
<p id="validation"></p> | |
//form submit | |
$('#form-id').submit(function(evt){ | |
evt.preventDefault(); | |
... | |
if(!$('.checkbox').is(":checked")) { |
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
//Model | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class ModelName extends Model | |
{ | |
protected $table = 'table_name_dB'; | |
} |
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
$file_name = str_replace(base_url().'/uploads/email/', '', $src); // striping host to get relative path | |
if(unlink($file_name)) | |
{ | |
echo 'File Delete Successfully'; | |
} |
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
$.ajax({ | |
url: '../example.php', | |
type: 'post', | |
data: {}, | |
success: function( data, textStatus, jQxhr ){ | |
// console.log(data); | |
var itemID = <?php echo json_encode($item_id); ?>; | |
// console.log(itemID); | |
$.each(data['data'], function(key, value) { | |
$('select#select_item').append($("<option></option>").attr("value",key).text(value)).trigger('change'); |
- @license
- Multiselect v1
- https://gist.github.com/mazfreelance
- Copyright (c) 2019 MAZ Tech
- Licensed under the MIT license
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
old : https://github.com/<username>/<username/project_name.git> | |
new : https://<username>:<personal_token>@github.com/<username/project_name.git> | |
- generate personal token | |
Settings > Developer settings > Personal access tokens | |
git remote set-url origin <url> | |
git remote -v (view remote url) |