本文整理汇总了PHP中my_sql_date函数的典型用法代码示例。如果您正苦于以下问题:PHP my_sql_date函数的具体用法?PHP my_sql_date怎么用?PHP my_sql_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了my_sql_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$godown_transfer_master['gto'] = "";
$godown_transfer_master['gto_hidden'] = "";
$godown_transfer_master['gfrom'] = "";
$godown_transfer_master['gfrom_hidden'] = "";
$godown_transfer_master['remarks'] = "";
$godown_transfer_detail = array();
$orderby = "";
$sortorder = "";
require_once 'paginator.class.php';
$pages = new Paginator();
$accordion_active = "1";
if ($_SERVER['REQUEST_METHOD'] == 'POST' || isset($_GET['ipp'])) {
require_once 'paginator.class.php';
$vdate = "";
if (isset($_POST['godown_transfer_date']) && strlen($_POST['godown_transfer_date']) > 0) {
$vdate = "gtm.trans_date = '" . my_sql_date($_POST['godown_transfer_date']) . "'";
} else {
if (isset($_GET['godown_transfer_date']) && strlen($_GET['godown_transfer_date']) > 0) {
$vdate = "gtm.trans_date = '{$_GET['godown_transfer_date']}'";
}
}
$vfgodown = "";
if (isset($_POST['godown_transfer_from1_hidden']) && strlen($_POST['godown_transfer_from1_hidden']) > 0 && strlen($_POST['godown_transfer_from1']) > 0) {
$vfgodown = "gtm.from_godown = '{$_POST['godown_transfer_from1_hidden']}'";
} else {
if (isset($_GET['godown_transfer_from1_hidden']) && strlen($_GET['godown_transfer_from1_hidden']) > 0 && strlen($_GET['godown_transfer_from1']) > 0) {
$vfgodown = "gtm.from_godown = '{$_GET['godown_transfer_from1_hidden']}'";
}
}
$vtgodown = "";
if (isset($_POST['godown_transfer_to1_hidden']) && strlen($_POST['godown_transfer_to1_hidden']) > 0 && strlen($_POST['godown_transfer_to1']) > 0) {
示例2: session_start
session_start();
$selected_company_id = $_SESSION['company_id'];
ob_start();
dump($_POST);
$data = array();
updateDate('voucher', $_POST['voucher_date']);
$year_id = getValue("year_id", "sys_financial_year", "company_ref_id = {$selected_company_id} AND is_active = 'Yes'", true);
$first_colval = "";
$seprator = "";
$last_part = "";
$first_part = "";
$first_tab_ins = "";
foreach ($_POST as $key => $val) {
if ($key == "voucher_date" || $key == "voucher_remarks" || $key == "voucher_type" || $key == "voucher_cheque") {
if ($key == 'voucher_date') {
$val = my_sql_date($val);
}
$first_colval = $first_colval . $seprator . $key . " = '" . $val . "'";
$seprator = ',';
} else {
if ($key == "voucher_id") {
$last_part = " WHERE voucher_id = " . $val;
}
}
}
$oper = $_POST['oper'];
if ($oper == 'add') {
$data['seq'] = getSequenceNextVal('voucher_master', $_SESSION['company_id']);
$first_part = " INSERT INTO voucher_master SET company_ref_id = {$_SESSION['company_id']}, year_id = {$year_id}, seq = {$data['seq']}, voucher_by = {$_SESSION['user_id']}, ";
$first_tab_ins = $first_part . $first_colval;
} else {
示例3: implode
continue;
} else {
$billnos[] = $range * 1;
}
}
}
$billnos = implode("','", $billnos);
$where .= " AND m.seq IN ('{$billnos}')\n";
$year_id = getIVal("year_id", "sys_financial_year", "company_ref_id = {$_SESSION['company_id']} AND is_active = 'Yes'");
$where .= " AND m.year_id = {$year_id}\n";
} else {
if (strlen($_GET['date_start']) > 0) {
$where .= " AND TO_DAYS(m.pur_ret_date) >= TO_DAYS('" . my_sql_date($_GET['date_start']) . "')\n";
}
if (strlen($_GET['date_end']) > 0) {
$where .= " AND TO_DAYS(m.pur_ret_date) <= TO_DAYS('" . my_sql_date($_GET['date_end']) . "')\n";
}
if (strlen($_GET['bill']) > 0) {
$where .= " AND m.billno = '{$_GET['bill']}'\n";
}
if (strlen($_GET['supplier']) > 0 && strlen($_GET['supplier_hidden']) > 0) {
$where .= " AND pm.party_code = " . $_GET['supplier_hidden'] . "\n";
}
}
$sql = "" . "SELECT m.pur_ret_master_id,\n" . " DATE_FORMAT(m.pur_ret_date, '%d-%b-%y') pur_ret_date,\n" . " m.billno,\n" . " p.party_name\n" . " FROM purchase_return_master m\n" . " INNER JOIN purchase_return_detail d ON d.pur_ret_master_id = m.pur_ret_master_id\n" . " LEFT OUTER JOIN party p ON p.party_code = m.party_code\n" . " WHERE m.company_ref_id = {$_SESSION['company_id']}\n" . $where . "ORDER BY m.pur_ret_date, p.party_name";
//dump($sql);
$result = $mysqli->query($sql);
$ddata = array();
while ($row = $result->fetch_assoc()) {
$ddata[] = $row;
}
示例4: getReportTitle
$_title = getReportTitle();
if (isset($_GET['report'])) {
updateDate('rpt_inventory_movement_start', $_GET['date1']);
updateDate('rpt_inventory_movement_end', $_GET['date2']);
$item = array();
$result = $mysqli->query("SELECT im.i_code, im.cno, im.manufacturer_no, im.description, im.company_ref_id FROM item_master im WHERE i_code = {$_GET['item_hidden']}");
if ($row = $result->fetch_assoc()) {
$item = $row;
}
$date1 = $_GET['date1'];
if (strlen($date1) < 1) {
$date1 = getFinancialStartDate();
}
$where = " AND TO_DAYS(trans_date) >= TO_DAYS('" . my_sql_date($date1) . "')\n";
if (strlen($_GET['date2']) > 0) {
$where .= " AND TO_DAYS(trans_date) <= TO_DAYS('" . my_sql_date($_GET['date2']) . "')\n";
}
$data = array();
$result = $mysqli->query("SELECT g.g_name FROM godown g WHERE g.company_ref_id = {$item['company_ref_id']}");
while ($row = $result->fetch_assoc()) {
$gname = $row['g_name'];
$data["{$gname}"] = array();
$data["{$gname}"]['total'] = (double) 0;
$data["{$gname}"]['opening_balance'] = (double) 0;
$data["{$gname}"]['rate'] = (double) 0;
$data["{$gname}"]['item'] = $item;
$data["{$gname}"]['data'] = array();
}
$sql = "" . "SELECT g.g_name, ob.opening_balance, ob.rate\n" . " FROM item_opening_balance ob\n" . " LEFT OUTER JOIN godown g ON g.g_code = ob.g_code\n" . " WHERE ob.item_code = {$item['i_code']}\n" . " AND ob.year_id = (SELECT year_id FROM sys_financial_year WHERE STR_TO_DATE('{$date1}', '%d-%m-%Y') BETWEEN start_date AND end_date AND company_ref_id = {$item['company_ref_id']})\n";
$result = $mysqli->query($sql);
while ($row = $result->fetch_assoc()) {
示例5: getValue
$dr_acc = getValue("code", "sys_codes", "description = 'Cash in Hand' AND company_ref_id = {$selected_company_id}", true);
$cr_acc = getValue("code", "sys_codes", "description = 'Cash Sales' AND company_ref_id = {$selected_company_id}", true);
} else {
//Credit Sale
//Debit - Party
//Credit - Credit Sales
$dr_acc = getValue("account_ref_id", "party", "party_code = {$_POST['sales_party_hidden']}", true);
$cr_acc = getValue("code", "sys_codes", "description = 'Credit Sales' AND company_ref_id = {$selected_company_id}", true);
}
if ($_POST['oper'] == 'update') {
$voucher_id = getValue("voucher_id", "sales_master", "sale_master_id = {$_POST['sales_id']}", true);
d_mysql_query("UPDATE voucher_detail SET debit_amount = {$sale}, account_ref_id = {$dr_acc} WHERE voucher_id = {$voucher_id} AND remarks = 'Debit'");
d_mysql_query("UPDATE voucher_detail SET credit_amount = {$sale}, account_ref_id = {$cr_acc} WHERE voucher_id = {$voucher_id} AND remarks = 'Credit'");
d_mysql_query("UPDATE voucher_master SET voucher_date = '" . my_sql_date($_POST['sales_date']) . "', voucher_remarks = '{$_POST['sales_remarks']}' WHERE voucher_id = {$voucher_id}");
} else {
$createVoucher = createVoucher($selected_company_id, $year_id, $dr_acc, $cr_acc, $sale, $_POST['sales_remarks'], $parent_key, 'S', my_sql_date($_POST['sales_date']), $_SESSION['user_id']);
dump($createVoucher);
$mysqli->close();
}
$voucher_id = getValue("voucher_id", "sales_master", "sale_master_id = {$parent_key}", true);
d_mysql_query("UPDATE voucher_detail SET debit_amount = {$sum} WHERE voucher_id = {$voucher_id} AND remarks = 'Debit'");
d_mysql_query("UPDATE voucher_detail SET debit_amount = {$disc} WHERE voucher_id = {$voucher_id} AND remarks = 'Discount'");
//reset all taxes
d_mysql_query("UPDATE voucher_detail SET credit_amount = 0 WHERE voucher_id = {$voucher_id} AND remarks = 'Tax'");
if ($tax > 0) {
$taxes = array();
$counter = $_POST['counter'] * 1;
for ($i = 1; $i <= $counter; $i++) {
$i_code = $_POST["item_" . $i . "_hidden"];
if (strlen($i_code) < 1) {
continue;
示例6: ob_start
<?php
include '../includes/connect.php';
require_once '../includes/connecti.php';
require_once '../includes/funcs.inc.php';
/** @var $mysqli mysqli */
/** @var $result mysqli_result */
include '../includes/JSON.php';
@session_start();
$selected_company_id = $_SESSION['company_id'];
$login_user_name = $_SESSION['user_name'];
ob_start();
dump($_POST);
$data = array();
updateDate('cash_book', $_POST['cash_book_date']);
$cash_book_date = my_sql_date($_POST['cash_book_date']);
if ($_POST['oper'] == 'delete') {
$cash_book_id = $_POST['cb_id'];
$voucher_id = getValue("voucher_id", "voucher_detail", "voucher_id = (SELECT voucher_id FROM cash_book WHERE cb_id = {$cash_book_id})", true);
d_mysql_query("DELETE FROM voucher_detail WHERE voucher_id = {$voucher_id}");
d_mysql_query("DELETE FROM voucher_master WHERE voucher_id = {$voucher_id}");
d_mysql_query("DELETE FROM cash_book WHERE cb_id = {$cash_book_id}");
} else {
$v_cash_acc_id = $_POST['cash_book_id'];
$year_id = getValue("year_id", "sys_financial_year", "company_ref_id = {$selected_company_id} AND is_active = 'Yes'", true);
$counter = $_POST['counter'] * 1;
for ($i = 1; $i <= $counter; $i++) {
$account_code = $_POST["account_" . $i . "_hidden"];
$cash_book_ammount = 0;
$cash_book_type = "";
if (isset($_POST["inp3_{$i}"])) {
示例7: Paginator
require_once 'paginator.class.php';
$pages = new Paginator();
$accordion_active = "1";
if ($_SERVER['REQUEST_METHOD'] == 'POST' || isset($_GET['ipp'])) {
$year_id = getValue("year_id", "sys_financial_year", "company_ref_id = {$selected_company_id} AND is_active = 'Yes'");
$s_sale_id = "";
if (isset($_POST['s_sale_id']) && strlen($_POST['s_sale_id']) > 0) {
$s_sale_id = "srm.seq = {$_POST['s_sale_id']}";
} else {
if (isset($_GET['s_sale_id']) && strlen($_GET['s_sale_id']) > 0) {
$s_sale_id = "srm.seq = {$_GET['s_sale_id']}";
}
}
$s_sdate = "";
if (isset($_POST['s_sale_date']) && strlen($_POST['s_sale_date']) > 0) {
$s_sdate = "srm.rsale_date = '" . my_sql_date($_POST['s_sale_date']) . "'";
} else {
if (isset($_GET['s_sale_date']) && strlen($_GET['s_sale_date']) > 0) {
$s_sdate = "srm.rsale_date = '{$_GET['s_sale_date']}'";
}
}
$s_supplier = "";
if (isset($_POST['s_supplier_hidden']) && strlen($_POST['s_supplier_hidden']) > 0 && strlen($_POST['s_supplier']) > 0) {
$s_supplier = "srm.party_code = '{$_POST['s_supplier_hidden']}'";
} else {
if (isset($_GET['s_supplier_hidden']) && strlen($_GET['s_supplier_hidden']) > 0 && strlen($_GET['s_supplier']) > 0) {
$s_supplier = "srm.party_code = '{$_GET['s_supplier_hidden']}'";
}
}
$s_billno = "";
if (isset($_POST['s_billno']) && strlen($_POST['s_billno']) > 0) {
示例8: getValue
$v_cr_sal_acc_id = getValue("code", "sys_codes", "description = 'CREDIT SALES'");
$v_party_acc_code = getValue("account_code", "party", "party_code = {$_POST['sales_party_hidden']}");
dd_mysql_query("UPDATE voucher_detail SET account_code = {$v_party_acc_code}, remarks = '2-1' WHERE voucher_id = {$voucher_id} AND debit_amount > 0");
dd_mysql_query("UPDATE voucher_detail SET account_code = {$v_cr_sal_acc_id}, remarks = '3-1' WHERE voucher_id = {$voucher_id} AND credit_amount > 0");
}
dd_mysql_query("UPDATE voucher_master SET voucher_date = '" . my_sql_date($_POST['sales_date']) . "' WHERE voucher_id = {$voucher_id}");
} else {
$v_ch_sale_acc_id = getValue("code", "sys_codes", "description = 'CASH SALES'");
$v_cash_acc_id = getValue("code", "sys_codes", "description = 'CASH ACCOUNT'");
$v_cr_sale_acc_id = getValue("code", "sys_codes", "description = 'CREDIT SALES'");
$v_party_acc_code = getValue("account_code", "party", "party_code = {$_POST['sales_party_hidden']}");
require_once '../includes/connecti.php';
if (isset($_POST['sales_type']) && $_POST['sales_type'] == 'C') {
createVoucher($selected_company_id, $year_id, $v_cash_acc_id, $v_ch_sale_acc_id, $sum, $_POST['sales_remarks'], $parent_key, 'S', my_sql_date($_POST['sales_date']));
} else {
createVoucher($selected_company_id, $year_id, $v_party_acc_code, $v_cr_sale_acc_id, $sum, $_POST['sales_remarks'], $parent_key, 'S', my_sql_date($_POST['sales_date']));
}
$mysqli->close();
}
$url .= "?sales_id={$parent_key}";
}
echo "<a href='{$url}'>{$url}</a><br/>";
$json = new Services_JSON();
$output = $json->encode($data);
print $output;
$out = ob_get_contents();
ob_end_clean();
if (!isLive()) {
$fp = fopen('sales_cud.htm', 'w');
fwrite($fp, "<html><head><title>SALES CUD</title></head><body>");
fwrite($fp, $out);
示例9: getOutstandingDataTransactions
/**
* @param int $account_ref_id Chart of Account Reference ID
* @param string $date_start Start Date
* @param string $date_end End Date
*
* @return array of float containing debit amount and credit amount
*/
function getOutstandingDataTransactions($account_ref_id, $date_start = "", $date_end = "")
{
global $mysqli;
/** @var $result mysqli_result */
$sql = "" . " SELECT IFNULL(sum(vd.debit_amount), 0) debit,\n" . " IFNULL(sum(vd.credit_amount), 0) credit\n" . " FROM voucher_detail vd\n" . " INNER JOIN voucher_master vm ON vm.voucher_id = vd.voucher_id\n" . " WHERE vd.account_ref_id = {$account_ref_id}\n" . " AND vm.voucher_type <> 'CO'\n";
if (strlen($date_start) > 0) {
$sql .= " AND TO_DAYS(vm.voucher_date) >= TO_DAYS('" . my_sql_date($date_start) . "')\n";
}
if (strlen($date_end) > 0) {
$sql .= " AND TO_DAYS(vm.voucher_date) <= TO_DAYS('" . my_sql_date($date_end) . "')\n";
}
if (strlen($date_start) + strlen($date_end) < 1) {
$d = date('Y') . "-01-01";
$sql .= " AND TO_DAYS(vm.voucher_date) >= TO_DAYS('{$d}')\n";
}
//dump($sql);
$result = $mysqli->query($sql);
$data = array('debit' => (double) 0, 'credit' => (double) 0);
if ($row = $result->fetch_assoc()) {
$data['debit'] = $row['debit'] * 1;
$data['credit'] = $row['credit'] * 1;
}
$result->close();
return $data;
}
示例10: oci_connect
require_once '../includes/funcs.inc.php';
$conn = oci_connect($db_user, $db_pass, $db_host);
$selected_company_id = $_SESSION['company_id'];
$year_id = getValue("year_id", "sys_financial_year", "company_ref_id = {$selected_company_id} AND is_active = 'Yes'");
$login_user_name = $_SESSION['user_name'];
$v_ch_id = null;
if (isset($_GET['cash_book_id'])) {
$v_ch_id = $_GET['cash_book_id'];
}
if (is_null($v_ch_id)) {
$v_ch_id = getValue("account_ref_id", "sys_users", "user_name = '{$login_user_name}' AND company_ref_id = {$selected_company_id}");
}
if (is_null($v_ch_id)) {
$v_ch_id = getValue("code", "sys_codes", "description = 'Cash in Hand' AND company_ref_id = {$selected_company_id}");
}
$cash_book_date = my_sql_date($_SESSION['dates']['cash_book']);
$cash_book_detail = array();
if (isset($_GET['cash_date'])) {
$cash_book_date = $_GET['cash_date'];
}
$sql = "" . " SELECT cb.cb_id,\n" . " cb.account_ref_id,\n" . " cb.cb_type,\n" . " cb.cb_amount,\n" . "\t cb.cb_remarks,\n" . " coa.account_name\n" . " FROM cash_book cb\n" . " INNER JOIN chart_of_account coa ON coa.account_ref_id = cb.account_ref_id\n" . " INNER JOIN sys_financial_year y ON y.year_id = cb.year_id AND NVL(y.is_close, 'No') = 'No'\n" . " WHERE to_char(cb.cb_date, 'RRRR-MM-DD') = '{$cash_book_date}'\n" . " AND cb.book_id = {$v_ch_id}\n" . "ORDER BY cb_id";
//echo $sql;
$cash_book_search = oci_parse($conn, $sql);
oci_execute($cash_book_search);
while ($row = oci_fetch_array($cash_book_search)) {
$arr = array();
$arr['cash_book_id'] = $row[0];
$arr['account_code_hidden'] = $row[1];
$arr['cash_book_type'] = $row[2];
$arr['cash_book_amount'] = $row[3];
$arr['cash_book_remarks'] = $row[4];
示例11: getIVal
$days_limit = getIVal("days_limit", "party", "account_ref_id = {$account}");
$payment_term = getIVal("payment_term", "party", "account_ref_id = {$account}") * 1;
$aob = getInitialOpeningBalance($account);
$pay = getPayments($account, $date_start, $date_end, true);
$balance = $aob - $pay;
if ($balance < 0) {
$balance = $balance * -1;
} else {
$balance = 0;
}
$sql = "" . "SELECT sa.invoice, sa.seq,\n" . " sa.remarks,\n" . " DATE_FORMAT(sa.sale_date, '%d-%b-%y') sale_date,\n" . " DATEDIFF(now(), sa.sale_date) days,\n" . " sa.net\n" . " FROM vu_sales_age sa\n" . " WHERE sa.party_code = {$party_hidden}\n" . " AND sa.company_ref_id = {$_SESSION['company_id']}\n";
if (strlen($date_start) > 0) {
$sql .= " AND TO_DAYS(sa.sale_date) >= TO_DAYS('" . my_sql_date($date_start) . "')\n";
}
if (strlen($date_end) > 0) {
$sql .= " AND TO_DAYS(sa.sale_date) <= TO_DAYS('" . my_sql_date($date_end) . "')\n";
}
if (strlen($date_start) + strlen($date_end) < 1) {
$d = date('Y') . "-01-01";
$sql .= " AND TO_DAYS(sa.sale_date) >= TO_DAYS('{$d}')\n";
}
$sql .= "ORDER BY sa.party_code, sa.sale_date";
//dump($sql);
$result = $mysqli->query($sql);
$data = array();
$lastBalance = (double) 0;
while ($row = $result->fetch_assoc()) {
$row['net'] = $row['net'] * 1;
$net = $row['net'];
if ($balance >= $net) {
$balance -= $net;
示例12: array
<?php
include '../includes/db.php';
include '../includes/JSON.php';
include '../includes/funcs.inc.php';
$data = array();
$data['valid'] = false;
if (isset($_GET['date'])) {
$items = oci_parse($conn, "SELECT TO_DAYS(start_date) s, TO_DAYS(end_date) e, TO_DAYS('" . my_sql_date($_GET['date']) . "') u\n" . " FROM sys_financial_year\n" . " WHERE is_active = 'Yes'\n" . " AND company_ref_id = {$_GET['company']}");
oci_execute($items);
if ($row = oci_fetch_assoc($items)) {
$s = $row['s'] * 1;
$e = $row['e'] * 1;
$u = $row['u'] * 1;
$data['valid'] = $s <= $u && $u <= $e;
}
}
$json = new Services_JSON();
$output = $json->encode($data);
print $output;
示例13: array
$result = $mysqli->query($sql);
$data = array();
while ($row = $result->fetch_assoc()) {
$city = $row['party_city'];
$party = $row['party_name'];
if (!isset($data[$city])) {
$data[$city] = array();
}
$data[$city][$party] = array('city' => $row['party_city'], 'party' => $row['party_name'], 'DEPO' => (double) 0, 'TIK' => (double) 0, 'FPI' => (double) 0, 'Local' => (double) 0, 'Total' => (double) 0, 'Collection' => $row['amt'] * 1);
}
$sql = "" . "SELECT p.party_city, p.party_name, p.vendor_name, p.net\n" . " FROM vu_vendor_sales_amount p\n" . " WHERE p.company_ref_id = {$_SESSION['company_id']}\n" . " AND p.vendor_name IS NOT NULL\n" . $where;
if (strlen($_GET['date_start']) > 0) {
$sql .= " AND TO_DAYS(IFNULL(p.trans_date, '" . my_sql_date($_GET['date_start']) . "')) >= TO_DAYS('" . my_sql_date($_GET['date_start']) . "')\n";
}
if (strlen($_GET['date_end']) > 0) {
$sql .= " AND TO_DAYS(IFNULL(p.trans_date, '" . my_sql_date($_GET['date_end']) . "')) <= TO_DAYS('" . my_sql_date($_GET['date_end']) . "')\n";
}
if (strlen($_GET['date_start']) + strlen($_GET['date_end']) < 1) {
$d = date('Y') . "-01-01";
$sql .= " AND TO_DAYS(IFNULL(p.trans_date, '{$d}')) >= TO_DAYS('{$d}')\n";
}
$result = $mysqli->query($sql);
while ($row = $result->fetch_assoc()) {
$city = $row['party_city'];
$party = $row['party_name'];
$vendor = $row['vendor_name'];
$net = $row['net'] * 1;
$data[$city][$party][$vendor] += $net;
$data[$city][$party]['Total'] += $net;
}
$mysqli->close();
示例14: implode
continue;
} else {
$billnos[] = $range * 1;
}
}
}
$billnos = implode("','", $billnos);
$where .= " AND m.seq IN ('{$billnos}')\n";
$year_id = getIVal("year_id", "sys_financial_year", "company_ref_id = {$_SESSION['company_id']} AND is_active = 'Yes'");
$where .= " AND m.year_id = {$year_id}\n";
} else {
if (strlen($_GET['date1']) > 0) {
$where .= " AND TO_DAYS(m.rsale_date) >= TO_DAYS('" . my_sql_date($_GET['date1']) . "')\n";
}
if (strlen($_GET['date2']) > 0) {
$where .= " AND TO_DAYS(m.rsale_date) <= TO_DAYS('" . my_sql_date($_GET['date2']) . "')\n";
}
if (strlen($_GET['bill']) > 0) {
$where .= " AND m.billno = '{$_GET['bill']}'\n";
}
if (strlen($_GET['party_hidden']) > 0) {
$where .= " AND m.party_code = {$_GET['party_hidden']} \n";
}
}
$sql = "" . "SELECT distinct m.rsale_master_id,\n" . " DATE_FORMAT(m.rsale_date, '%d-%b-%y') rsale_date,\n" . " m.billno,\n" . " p.party_name\n" . " FROM sales_return_master m\n" . " INNER JOIN sales_return_detail d ON d.rsale_master_id = m.rsale_master_id\n" . " LEFT OUTER JOIN party p ON p.party_code = m.party_code\n" . " WHERE m.company_ref_id = {$_SESSION['company_id']}\n" . $where . "ORDER BY m.rsale_date, p.party_name";
//dump($sql);
$result = $mysqli->query($sql);
$ddata = array();
while ($row = $result->fetch_assoc()) {
$ddata[] = $row;
}
示例15: session_start
<?php
session_start();
include '../includes/connect.php';
require_once '../includes/funcs.inc.php';
$selected_company_id = $_SESSION['company_id'];
$cash_book_date = date("Y-m-d");
$cash_book_detail = array();
if (isset($_GET['cash_date'])) {
$cash_book_date = my_sql_date($_GET['cash_date']);
}
$sql = "" . " SELECT cb_id, " . " cash_book.account_code, " . " cb_type, " . " cb_amount, " . "\t cb_remarks, " . " account_name " . " FROM cash_book " . " LEFT OUTER JOIN chart_of_account ON chart_of_account.account_code = cash_book.account_code " . " WHERE cb_date = '{$cash_book_date}' " . "ORDER BY cb_id";
$cash_book_search = mysql_query($sql);
while ($row = mysql_fetch_array($cash_book_search)) {
$arr = array();
$arr['cash_book_id'] = $row[0];
$arr['account_code_hidden'] = $row[1];
$arr['cash_book_type'] = $row[2];
$arr['cash_book_amount'] = $row[3];
$arr['cash_book_remarks'] = $row[4];
$arr['account_code'] = $row[5];
$cash_book_detail[] = $arr;
}
$cb_balance = '<div id="cb_balance"';
$cb = getValue("IFNULL(sum(debit_amount - credit_amount), 0)", "voucher_detail", "account_code = (SELECT code FROM sys_codes WHERE description = 'CASH ACCOUNT' AND company_ref_id = {$selected_company_id})");
if ($cb < 0) {
$cb_balance .= ' style="color:red;"';
}
$cb_balance .= '>' . number_format($cb, 2, ".", ",") . '</div>';
$cb_balance_todate = '<div id="cb_balance"';
$cb = getValue("IFNULL(sum(vd.debit_amount - vd.credit_amount), 0)", "voucher_detail vd INNER JOIN voucher_master vm ON vm.voucher_id = vd.voucher_id", "vd.account_code = (SELECT code FROM sys_codes WHERE description = 'CASH ACCOUNT' AND company_ref_id = {$selected_company_id}) AND TO_DAYS(vm.voucher_date) <= TO_DAYS('{$cash_book_date}')");