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
| function getSumProductPurchaseAmount($product_id){ | |
| $CI=&get_instance(); | |
| $result=$CI->db->select_sum('amount','total')->get_where('purchase',['product_id'=>$product_id])->row()->total; | |
| return $result; | |
| } | |
| function getSumProductSaleAmount($product_id){ | |
| $CI=&get_instance(); |
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
| myApp.config(function($stateProvider,$urlRouterProvider){ | |
| $stateProvider.state('task', | |
| { | |
| url:'/task', | |
| controller:'TaskController', | |
| views:{ | |
| "sidebar":{templateUrl:'/partial/task/taskcreateform.html'}, | |
| "content":{templateUrl:'/partial/task/taskgrid.html'} | |
| }, | |
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 endorsPlusButtons = document.querySelectorAll(".endorsable"); | |
| var index = 0; | |
| if (endorsPlusButtons.length) { | |
| var interval = setInterval(() => { | |
| if (index < (endorsPlusButtons.length)) { | |
| setTimeout((indx) => { | |
| endorsPlusButtons[indx].querySelector(".endorse-plus").click(); | |
| }, parseInt(Math.random() * 11) * 400, index); | |
| } else { |
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
| const data = { | |
| first: { | |
| second: { | |
| user: { | |
| name:'Rahul', | |
| title: 'Baruri' | |
| }, | |
| third: { | |
| info: { | |
| salary: 70000, |
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 originalArray = [1, [2], [3, 4, [5, [6,7]]]]; | |
| function flatten(arr) { | |
| var flattenarr = []; | |
| arr.forEach(item => { | |
| if(Array.isArray(item)) { | |
| var arrItem = item; | |
| while(Array.isArray(arrItem)) { | |
| arrItem.forEach(next => { | |
| if(Array.isArray(next)) { |
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
| const fetch = require("node-fetch"); | |
| const fs = require('fs'); | |
| function getAllRepos() { | |
| return fetch('https://api.github.com/users/rbrahul/repos'); | |
| } | |
| function getRepoInfo(repoName) { | |
| return fetch(`https://api.github.com/repos/rbrahul/${repoName}`); | |
| } |
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 EventDispatcher= function() { | |
| this.events = {}; | |
| } | |
| EventDispatcher.prototype.add = function(name, handler) { | |
| if(!(name in this.events)) { | |
| this.events[name] = [handler]; | |
| } else { | |
| this.events[name].push(handler); | |
| } |
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
| Object.prototype.oloo = function(o1, o2){ | |
| if( o1 && o2 && typeof o1 === "object" && typeof o2 === "object"){ | |
| // create new object | |
| var o0 = Object.create(o1); | |
| // copy all props to the brand new obj | |
| for( var key in o2 ){ | |
| if(o2.hasOwnProperty(key)){ | |
| o0[key] = o2[key]; | |
| } | |
| } |
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
| function toBengaliNumber(number) { | |
| var numbers = { | |
| '1': '১', | |
| '2': '২', | |
| '3': '৩', | |
| '4': '৪', | |
| '5': '৫', | |
| '6': '৬', | |
| '7': '৭', | |
| '8': '৮', |
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 holidays = []; | |
| $(document).ready(function () { | |
| $(".list-table").find("tbody").find("tr").each(function (index, item) { | |
| var holiday = {}; | |
| $(item).find("td").each(function (indx, colunm) { | |
| if (indx == 1) { | |
| var timeTag = $(colunm).find("time"); | |
| var timeStamp; | |
| var dateText; | |
| if (timeTag.length) { |
OlderNewer