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
Date.prototype.addDays = function (days) { | |
return new Date(this.valueOf() + days * 864e5); | |
} | |
var date = new Date("2019-10-01"); | |
date.addDays(50); | |
// Or |
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
public function check_unique() { | |
$conf_group = $this->input->post('conf_group'); | |
$label = $this->input->post('label'); | |
$code = strtolower(str_replace(' ', '_', $label)); | |
$this->db->select('code'); | |
$this->db->from('acc_meta_conf'); | |
$this->db->where('code', $code); | |
$this->db->where('conf_group', $conf_group); | |
$query = $this->db->get(); |
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
for (var i = 0; i < rows.length; i++) { | |
item_id[i] = rows[i].book_id; | |
item_name[i] = rows[i].bookname; | |
item_quantity[i] = rows[i].item_quantity; | |
item_rate[i] = rows[i].item_rate; | |
item_price[i] = rows[i].itemcost; | |
strickerArray.push({'id': item_id[i], 'name': item_name[i], 'price': item_rate[i]}); | |
} |
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
SELECT DAYNAME(inv_date+1), SUM(`total_cost`), COUNT(*) FROM `sales_invoice` | |
GROUP BY DAYNAME(inv_date) | |
ORDER BY SUM(`total_cost`) DESC |
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 rem = new Date('2020-05-05') - new Date(); | |
var days = Math.floor(rem / 86400000); | |
var hour = Math.floor((rem % 86400000)/3600000); | |
var min = Math.floor(((rem % 86400000) % 3600000) / 60000); | |
var second = Math.round((((rem % 86400000) % 3600000) / 60000)/1000); | |
var remaining = days + ' days ' + hour + ' hour ' + min + ' Minute ' + second + ' second.'; |
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 unitConverter(value, precession, lvl1, lvl2){ | |
var level1,level2,level3, rem, formatedUnit; | |
if(lvl1 && lvl1 > 0){ | |
level3 = value % lvl1; | |
rem = parseInt(value /lvl1); | |
formatedUnit = rem + "-"+ level3; | |
}else{ |
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 | |
function unit_converter($value, $precession, $lvl1, $lvl2){ | |
$level1 = ""; | |
$level2 = ""; | |
$level3 = ""; | |
$rem = ""; | |
$formatedUnit = ""; | |
if($lvl1 && $lvl1 > 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
DELIMITER $$ | |
DROP FUNCTION IF EXISTS `unit_conversion`$$ | |
CREATE FUNCTION `unit_conversion`(value_to_convert DECIMAL(10,2), precission INT, au_lbl_1 INT, au_lbl_2 INT) | |
RETURNS VARCHAR(50) CHARSET utf8 COLLATE utf8_unicode_ci | |
DETERMINISTIC | |
BEGIN | |
DECLARE level1 VARCHAR(10); | |
DECLARE level2 VARCHAR(10); |
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 url1 = "<?php echo base_url('issue/UnitDemandController/subdepotWiseStoreOrg') . '/'; ?>" + orgID + '/' + vocab_id; | |
$.ajax({ | |
url: url1, | |
type:'post', | |
datatype:'json', | |
async: false,// without it array cannot process on time | |
success: function(result){ | |
var i=0; | |
JSON.parse(result).map(item => { |
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(function (){ | |
function getBase64File (file){ | |
var reader = new FileReader(); | |
reader.readAsDataURL(file); | |
reader.onload = function () { | |
console.log(reader.result); | |
}; | |
reader.onerror = function (error) { |
OlderNewer