Skip to content

Instantly share code, notes, and snippets.

View awolad's full-sized avatar
😎
Cool

Awolad hossain awolad

😎
Cool
View GitHub Profile
@awolad
awolad / dynamic_rowspan.php
Created January 24, 2018 09:36 — forked from benedict-w/dynamic_rowspan.php
PHP dynamic rowspan for mysql results
<?php
/**
* addRowspan
*
* from an array of assoc mysql results, appends a column 'rowspan' by looking ahead
* for keys with the same value.
*
* @param string $span_key - key to base span on
* @param array $rows - 2d array of rows
*/
@awolad
awolad / List.md
Created February 1, 2018 18:15 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@awolad
awolad / tableAutoRowspan.js
Created February 7, 2018 05:01
Table cell auto merge for same value
function tableAutoRowspan(tableObj, numberOfColumn) {
$(tableObj).each(function () {
var Column_number_to_Merge = numberOfColumn;
// Previous_TD holds the first instance of same td. Initially first TD=null.
var Previous_TD = null;
var i = 1;
$("tbody",this).find('tr').each(function () {
// find the correct td of the correct column
// we are considering the table column 1, You can apply on any table column
@awolad
awolad / addSubTotalRow.js
Created February 7, 2018 05:02
Add subtotal row for tally calculation
$("table.report-fix-table tr.unique_tr_for_sub_total").each(function () {
var currentTd = $(this).find('td:nth-child(2)').text()
var nextTd = $(this).next().find('td:nth-child(2)').text()
if (currentTd != nextTd) {
$(this).after(
'<tr class="unique_tr_for_sub_total">' +
'<td style="border: none;border-left: 1px solid #dddcdc;"></td>' +
/*'<td style="border: none;"></td>' +*/
'<td style="border: none;"></td>' +
@awolad
awolad / tally.js
Created February 7, 2018 05:03
Get sum of subtotal
function tally(selector, tdClass) {
$(selector).each(function () {
var total = 0,
column = $(this).siblings(selector).andSelf().index(this);
$(this).parents().prevUntil(':has(' + selector + ')').each(function () {
total += parseFloat($('td.'+ tdClass +':eq(' + column + ')', this).html()) || 0;
})
$(this).html('<strong>' + total + '</strong>');
});
}
@awolad
awolad / dynamicTrAddRemove.js
Created February 11, 2018 07:02
Dynamically increase / decrease Table row based on input field value using jQuery
var slNo = 1;
$(function () {
$('#no_of_passenger').on('keyup', function (e) {
var noOfPassenger,
rowCount,
extraRow,
rowObj;
<?php
//method one
function taka_format($amount = 0)
{
$tmp = explode('.', $amount); // for float or double values
$strMoney = '';
$divide = 1000;
$amount = $tmp[0];
$strMoney .= str_pad($amount % $divide, 3, '0', STR_PAD_LEFT);
SELECT
s.date,
s.project_id,
pm.property_name,
s.stock_type,
s.category_id,
c.title,
s.sub_category_id,
sc.sub_category_name,
s.item_id,
var total = 1102688;
var totalToBDformat = total.toLocaleString('bn-BD', { minimumFractionDigits: 2 }); // ১১,০২,৬৮৮.০০
var numbers = {
'০': 0,
'১': 1,
'২': 2,
'৩': 3,
'৪': 4,
'৫': 5,
<?php
$attendanceArray = [];
$fp = fopen(request()->attendance, 'rb');
while ( ($line = fgets($fp)) !== false) {
//echo "$line<br>";
//$line = explode(' ', $line);
$line = explode("\t", $line);
array_push($attendanceArray, $line);