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 htmlData = $('#detail_div').clone().find("#ipod_sub,tr th:eq(12),tr td:last-child").remove().end().html(); | |
$('#tbl_gin').find("tbody tr:last-child").remove(); |
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
***************************************** | |
usual way. only get what you want | |
***************************************** | |
function getMaterial(e) { //call this function @ onclick event, once bind no need to call @ onkey... events. | |
$("#itm_" + e).autocomplete({ //bind to selected element. | |
source: URL + "material_gin/getMaterial_auto", // change url to pass more arguments | |
// "material_gin/getMaterial_auto?from="+$('#from).val()+"&to="+$('#to').val() | |
// then catch them from php as | |
// $from = $_GET['from']; |
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
if (!is_dir('uploads/')) { | |
mkdir('./uploads/', 0777, TRUE); | |
} | |
$fopen = fopen('./uploads/' . $date_time . '-' . $date . '.json', "w+"); | |
$fwrite = fwrite($fopen, $_REQUEST['jsonString']); |
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
$userData = array(); | |
foreach ($userList as $user) { | |
$userData[] = '("' . $user['first_name'] . '", "' . $user['last_name'] . '")'; | |
} | |
$query = 'INSERT INTO users (first_name,last_name) VALUES' . implode(',', $userData); | |
==========>>>>>>>> | |
INSERT INTO users (first_name,last_name) VALUES("John", "Doe"),("Jane", "Doe")... | |
////////////////////////////////////////////////// |
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 getUserIpAddr() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //if from shared | |
return $_SERVER['HTTP_CLIENT_IP']; | |
} else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //if from a proxy | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
return $_SERVER['REMOTE_ADDR']; | |
} | |
} |
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
public function placeStockProduct($dataArray) { | |
print_r($dataArray); | |
$count = $dataArray['count2']; | |
$sql = "INSERT INTO `outlet_stock_check` (`outlet_name`, `outlet_id`, `product_name`, `product_id`, `qty`) VALUES "; | |
$do = FALSE; | |
for ($index = 0; $index < $count; $index++) { | |
if (isset($dataArray['product_name_' . $index]) && !empty($dataArray['product_qty_' . $index])) { | |
$sql.="('', '', '" . $dataArray['product_name_' . $index] . "', ''," . $dataArray['product_qty_' . $index] . ")"; | |
if (!$do) { | |
$do = TRUE; |
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
date_format(now(), '%Y-%m-01') AND LAST_DAY(curdate()) | |
SELECT | |
DATE_SUB(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL 1 DAY) AS GetLastDay, | |
DATE_FORMAT(NOW(),'%Y-%m-%d') AS GetTodaysDate, | |
DATE_ADD(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL 7 DAY) AS Add7DaysFromTodaysDate, | |
DATE_SUB(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL 7 DAY) AS Substract7DaysFromTodaysDate, | |
DATE_ADD(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL 1 MONTH) AS Add1MonthFromTodaysDate, |
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
cast(field as decimal(14, 2)) as formatted |
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
//https://drive.google.com/file/d/0B-zS4yAhFGgEYTZzeVJlTkVmUlk/edit?usp=sharing | |
<?php | |
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ |
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() { | |
$('#from_date_txt').datepicker({ | |
changeMonth: true, | |
changeYear: true, | |
showButtonPanel: true, | |
dateFormat: 'MM yy', | |
maxDate: 0, | |
onClose: function(dateText, inst) { | |
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); | |
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); |