コード例 #1
0
        if (mysql_num_rows($res) > 0) {
            while ($row = mysql_fetch_assoc($res)) {
                $type[strtoupper($row['payment'])] = 0;
            }
        }
        foreach ($type as $paytype => $amount) {
            $res = mysql_query("SELECT SUM(if(paid='no',total,partial)) AS total FROM invoices WHERE {$datefilter} AND type = 'invoice' AND payment = '{$paytype}';") or die(mysql_error());
            if (mysql_num_rows($res) > 0) {
                $row = mysql_fetch_assoc($res);
                $type[$paytype] += floatval($row['total']);
            }
            $res = mysql_query("SELECT SUM(partial) AS total FROM invoices_multi WHERE {$datefilter} AND payment = '{$paytype}';") or die(mysql_error());
            if (mysql_num_rows($res) > 0) {
                $row = mysql_fetch_assoc($res);
                $type[$paytype] += floatval($row['total']);
            }
        }
        $return = "";
        foreach ($type as $paytype => $amount) {
            $return .= pad_amount($amount, $paytype . ' $') . "<br/>";
        }
        $return .= $ret;
    }
    return $return;
}
$sales['d'] = get_total_sales(mktime(0, 0, 0, date('m'), date('d'), date('Y')), '', true);
$sales['w'] = get_total_sales(strtotime('monday ' . (date('D') == 'Sun' ? 'last' : 'this') . ' week'), strtotime('sunday ' . (date('D') == 'Sun' ? 'last' : 'this') . ' week'));
$sales['m'] = get_total_sales(mktime(0, 0, 0, date('m'), 1, date('Y')), mktime(0, 0, 0, date('m'), date('t'), date('Y')));
$sales['y'] = get_total_sales(mktime(0, 0, 0, 7, 1, date('Y') - (date('m') < 7 ? 1 : 0)), mktime(0, 0, 0, 6, 30, date('Y') + (date('m') < 7 ? 0 : 1)));
echo "<b>Print Arana Sales Report</b><br>";
echo "<i>Generated @ " . date('d/m/Y H:i:s') . "</i>\n\t\t<table border='0'>\n\t\t<tr>\n\t\t\t<td valign=top>Daily  </td><td valign=top>:</td><td style='font-family:courier new; text-align:right;'>{$sales['d']}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign=top>Weekly </td><td valign=top>:</td><td style='font-family:courier new; text-align:right;'>{$sales['w']}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign=top>Monthly</td><td valign=top>:</td><td style='font-family:courier new; text-align:right;'>{$sales['m']}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign=top>Yearly </td><td valign=top>:</td><td style='font-family:courier new; text-align:right;'>{$sales['y']}</td>\n\t\t</tr>\n\t\t</table>";
コード例 #2
0
ファイル: welcome.php プロジェクト: engrmudasir/my-crm
-(<?php 
echo get_cashier_sales(6, $date);
?>
)</li>
                                <li><span class="bar-legend-pointer black-b"></span> <?php 
echo getId('ac_batch', 'batch_id', 7, 'name');
?>
-(<?php 
echo get_cashier_sales(7, $date);
?>
)</li>-->
                                
                            </ul>
                           <!-- <div class="daily-sales-info">
                                <span class="sales-count"><?php 
echo get_total_sales($date);
?>
 </span> <span class="sales-label">Total Sales</span>
                            </div>-->
                        </div>
                    </div>
                </div>
            </section>
			</div>
		</div>
        </div>

	<div id="dashboard-log">
		<div id="dashboard-recent-log" class="dashboard-log-item">
			<div class="dashboard-log-title">Recent Activity</div>
			<div class="dashboard-log-content">