Example #1
0
    while ($row = $result->fetch_assoc()) {
        $team = $row['team'];
        if ($team != 'test') {
            echo '<h2>' . $team . '</h2>';
            $sql2 = "SELECT * FROM users WHERE team ='" . $team . "' ORDER BY name  ";
            $result2 = $sql_mysqli_conn->query($sql2);
            while ($row2 = $result2->fetch_assoc()) {
                echo '<a href="temp.php?user='******'code'] . '">' . $row2['name'] . '</a><br />';
            }
        }
    }
    $result->free();
    $result2->free();
} else {
    $timetohighlight = get_form_var('timetohighlight', 'int');
    $this_user_name = get_area_name($user);
    echo "<div id=\"dwm\">\n";
    echo "<h2>" . htmlspecialchars("{$this_user_name}") . "</h2>\n";
    echo "</div>\n";
    $i = mktime(12, 0, 0, $month, $day - 7, $year);
    $yy = date("Y", $i);
    $ym = date("m", $i);
    $yd = date("d", $i);
    $i = mktime(12, 0, 0, $month, $day + 7, $year);
    $ty = date("Y", $i);
    $tm = date("m", $i);
    $td = date("d", $i);
    // Show Go to week before and after links
    $before_after_links_html = "\n<div class=\"screenonly\">\n  <div class=\"date_nav\">\n    <div class=\"date_before\">\n      <a href=\"temp.php?year={$yy}&amp;month={$ym}&amp;day={$yd}&amp;user={$user}\">\n          &lt;&lt;&nbsp;" . get_vocab("weekbefore") . "\n      </a>\n    </div>\n    <div class=\"date_now\">\n      <a href=\"temp.php?user={$user}\">\n          " . get_vocab("gotothisweek") . "\n      </a>\n    </div>\n    <div class=\"date_after\">\n      <a href=\"temp.php?year={$ty}&amp;month={$tm}&amp;day={$td}&amp;user={$user}\">\n          " . get_vocab("weekafter") . "&nbsp;&gt;&gt;\n      </a>\n    </div>\n  </div>\n</div>\n";
    print $before_after_links_html;
    $inner_html = week_table_innerhtml($day, $month, $year, $user, $timetohighlight);
Example #2
0
function print_customer_details_listing()
{
    global $path_to_root;
    $from = $_POST['PARAM_0'];
    $area = $_POST['PARAM_1'];
    $folk = $_POST['PARAM_2'];
    $more = $_POST['PARAM_3'];
    $less = $_POST['PARAM_4'];
    $comments = $_POST['PARAM_5'];
    $orientation = $_POST['PARAM_6'];
    $destination = $_POST['PARAM_7'];
    if ($destination) {
        include_once $path_to_root . "/reporting/includes/excel_report.inc";
    } else {
        include_once $path_to_root . "/reporting/includes/pdf_report.inc";
    }
    $orientation = $orientation ? 'L' : 'P';
    $dec = 0;
    if ($area == ALL_NUMERIC) {
        $area = 0;
    }
    if ($folk == ALL_NUMERIC) {
        $folk = 0;
    }
    if ($area == 0) {
        $sarea = _('All Areas');
    } else {
        $sarea = get_area_name($area);
    }
    if ($folk == 0) {
        $salesfolk = _('All Sales Folk');
    } else {
        $salesfolk = get_salesman_name($folk);
    }
    if ($more != '') {
        $morestr = _('Greater than ') . number_format2($more, $dec);
    } else {
        $morestr = '';
    }
    if ($less != '') {
        $lessstr = _('Less than ') . number_format2($less, $dec);
    } else {
        $lessstr = '';
    }
    $more = (double) $more;
    $less = (double) $less;
    $cols = array(0, 150, 300, 425, 550);
    $headers = array(_('Customer Postal Address'), _('Price/Turnover'), _('Branch Contact Information'), _('Branch Delivery Address'));
    $aligns = array('left', 'left', 'left', 'left');
    $params = array(0 => $comments, 1 => array('text' => _('Activity Since'), 'from' => $from, 'to' => ''), 2 => array('text' => _('Sales Areas'), 'from' => $sarea, 'to' => ''), 3 => array('text' => _('Sales Folk'), 'from' => $salesfolk, 'to' => ''), 4 => array('text' => _('Activity'), 'from' => $morestr, 'to' => $lessstr . " " . get_company_pref("curr_default")));
    $rep = new FrontReport(_('Customer Details Listing'), "CustomerDetailsListing", user_pagesize(), 9, $orientation);
    if ($orientation == 'L') {
        recalculate_cols($cols);
    }
    $rep->Font();
    $rep->Info($params, $cols, $headers, $aligns);
    $rep->NewPage();
    $result = get_customer_details_for_report($area, $folk);
    $carea = '';
    $sman = '';
    while ($myrow = db_fetch($result)) {
        $printcustomer = true;
        if ($more != '' || $less != '') {
            $turnover = getTransactions($myrow['debtor_no'], $myrow['branch_code'], $from);
            if ($more != 0.0 && $turnover <= (double) $more) {
                $printcustomer = false;
            }
            if ($less != 0.0 && $turnover >= (double) $less) {
                $printcustomer = false;
            }
        }
        if ($printcustomer) {
            if ($carea != $myrow['description']) {
                $rep->fontSize += 2;
                $rep->NewLine(2, 7);
                $rep->Font('bold');
                $rep->TextCol(0, 3, _('Customers in') . " " . $myrow['description']);
                $carea = $myrow['description'];
                $rep->fontSize -= 2;
                $rep->Font();
                $rep->NewLine();
            }
            if ($sman != $myrow['salesman_name']) {
                $rep->fontSize += 2;
                $rep->NewLine(1, 7);
                $rep->Font('bold');
                $rep->TextCol(0, 3, $myrow['salesman_name']);
                $sman = $myrow['salesman_name'];
                $rep->fontSize -= 2;
                $rep->Font();
                $rep->NewLine();
            }
            $rep->NewLine();
            // Here starts the new report lines 2010-11-02 Joe Hunt
            $contacts = get_contacts_for_branch($myrow['branch_code']);
            $rep->TextCol(0, 1, $myrow['name']);
            $rep->TextCol(1, 2, _('Price List') . ": " . $myrow['sales_type']);
            $rep->TextCol(2, 3, $myrow['br_name']);
            $rep->NewLine();
            $adr = Explode("\n", $myrow['address']);
            if ($myrow['br_post_address'] == '') {
                $adr2 = Explode("\n", $myrow['br_address']);
            } else {
                $adr2 = Explode("\n", $myrow['br_post_address']);
            }
            $count1 = count($adr);
            $count2 = count($adr2);
            $count1 = max($count1, $count2);
            $count1 = max($count1, 4);
            if (isset($adr[0])) {
                $rep->TextCol(0, 1, $adr[0]);
            }
            $rep->TextCol(1, 2, _('Currency') . ": " . $myrow['curr_code']);
            if (isset($contacts[0])) {
                $rep->TextCol(2, 3, $contacts[0]['name'] . " " . $contacts[0]['name2']);
            }
            if (isset($adr2[0])) {
                $rep->TextCol(3, 4, $adr2[0]);
            }
            $rep->NewLine();
            if (isset($adr[1])) {
                $rep->TextCol(0, 1, $adr[1]);
            }
            if ($myrow['dimension_id'] != 0) {
                $dim = get_dimension($myrow['dimension_id']);
                $rep->TextCol(1, 2, _('Dimension') . ": " . $dim['name']);
            }
            if (isset($contacts[0])) {
                $rep->TextCol(2, 3, _('Ph') . ": " . $contacts[0]['phone']);
            }
            if (isset($adr2[1])) {
                $rep->TextCol(3, 4, $adr2[1]);
            }
            $rep->NewLine();
            if (isset($adr[2])) {
                $rep->TextCol(0, 1, $adr[2]);
            }
            if ($myrow['dimension2_id'] != 0) {
                $dim = get_dimension($myrow['dimension2_id']);
                $rep->TextCol(1, 2, _('Dimension') . " 2: " . $dim['name']);
            }
            if (isset($contacts[0])) {
                $rep->TextCol(2, 3, _('Fax') . ": " . $contacts[0]['fax']);
            }
            if (isset($adr2[2])) {
                $rep->TextCol(3, 4, $adr2[2]);
            }
            if ($more != 0.0 || $less != 0.0) {
                $rep->TextCol(1, 2, _('Turnover') . ": " . number_format2($turnover, $dec));
            }
            for ($i = 3; $i < $count1; $i++) {
                $rep->NewLine();
                if (isset($adr[$i])) {
                    $rep->TextCol(0, 1, $adr[$i]);
                }
                if ($i == 3 && isset($contacts[0]) && isset($contacts[0]['email'])) {
                    $rep->TextCol(2, 3, _('Email') . ": " . $contacts[0]['email']);
                }
                if (isset($adr2[$i])) {
                    $rep->TextCol(3, 4, $adr2[$i]);
                }
            }
            $rep->NewLine();
            /*
            $rep->TextCol(0, 1,	$myrow['name']);
            $adr = Explode("\n", $myrow['address']);
            $count1 = count($adr);
            for ($i = 0; $i < $count1; $i++)
            	$rep->TextCol(0, 1, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
            $count1++;
            $rep->TextCol(1, 2,	_('Price List') . ": " . $myrow['sales_type']);
            if ($more != 0.0 || $less != 0.0)
            	$rep->TextCol(1, 2,	_('Turnover') . ": " . number_format2($turnover, $dec), 0, $rep->lineHeight);
            $rep->TextCol(2, 3,	$myrow['br_name']);
            
            $contacts = get_branch_contacts($myrow['branch_code']);
            if (isset($contacts[0]))
            {
            	$rep->TextCol(2, 3, $contacts[0]['name'], 0, $rep->lineHeight);
            	$rep->TextCol(2, 3, _('Ph') . ": " . $contacts[0]['phone'], 0, 2 * $rep->lineHeight);
            	$rep->TextCol(2, 3, _('Fax') . ": " . $contacts[0]['fax'], 0, 3 * $rep->lineHeight);
            }
            $adr = Explode("\n", $myrow['br_address']);
            $count2 = count($adr);
            for ($i = 0; $i < $count2; $i++)
            	$rep->TextCol(3, 4, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
            //$rep->TextCol(3, 4, $myrow['email'], 0, ($count2 + 1) * $rep->lineHeight);
            $count2++;
            $count1 = Max($count1, $count2);
            $count1 = Max($count1, 4);
            $rep->NewLine($count3);
            */
            $rep->Line($rep->row + 8);
            $rep->NewLine(0, 3);
        }
    }
    $rep->End();
}
Example #3
0
// print the page header
print_header($day, $month, $year, $area, isset($room) ? $room : "");
// Section with areas, rooms, minicals.
echo "<div id=\"dwm_header\" class=\"screenonly\">\n";
// Show all available areas
echo make_area_select_html('week.php', $area, $year, $month, $day);
// Show all available rooms in the current area:
echo make_room_select_html('week.php', $area, $room, $year, $month, $day);
// Draw the three month calendars
if (!$display_calendar_bottom) {
    minicals($year, $month, $day, $area, $room, 'week');
}
echo "</div>\n";
// Show area and room:
// Get the area and room names
$this_area_name = get_area_name($area);
$this_room_name = get_room_name($room);
// The room is invalid if it doesn't exist, or else it has been disabled, either explicitly
// or implicitly because the area has been disabled
if (!isset($this_area_name) || $this_area_name === FALSE) {
    $this_area_name = '';
}
if (!isset($this_room_name) || $this_room_name === FALSE) {
    $this_room_name = '';
}
echo "<div id=\"dwm\">\n";
echo "<h2>" . htmlspecialchars("{$this_area_name} - {$this_room_name}") . "</h2>\n";
echo "</div>\n";
//y? are year, month and day of the previous week.
//t? are year, month and day of the next week.
$i = mktime(12, 0, 0, $month, $day - 7, $year);
Example #4
0
	$smarty->assign('tui_info', $tui_info);
	
	

	$smarty->assign('favourable',     favourable_info(1));//促销活动 墙壁 地板 厨房 浴室卫生间
	
	
	 $smarty->assign('p_num',       get_p_num());
	
	$smarty->assign('zhonghe',       get_area_name(''));
	$smarty->assign('pengding',       get_area_name('棚顶'));
	$smarty->assign('qiangbi',       get_area_name('墙壁'));
	$smarty->assign('diban',       get_area_name('地板'));
	$smarty->assign('chufang',       get_area_name('厨房'));
	$smarty->assign('yushi',       get_area_name('浴室'));
	$smarty->assign('weishengjian',   get_area_name('卫生间'));
	
	
	$arr2['id'] ='223';
	$arr2['num'] ='1';
	
	$smarty->assign('ads_btm',insert_ads12($arr2));
	
	
	//$smarty->assign('best_goods1',      get_recommend_goods2('best',1));
	
	
	/*echo "<pre>";
	print_r(get_recommend_goods('hot',"1"));
	echo "</pre>";
	
Example #5
0
function print_customer_details_listing()
{
    global $path_to_root;
    include_once $path_to_root . "reporting/includes/pdf_report.inc";
    $from = $_REQUEST['PARAM_0'];
    $area = $_REQUEST['PARAM_1'];
    $folk = $_REQUEST['PARAM_2'];
    $more = $_REQUEST['PARAM_3'];
    $less = $_REQUEST['PARAM_4'];
    $comments = $_REQUEST['PARAM_5'];
    $dec = 0;
    if ($area == reserved_words::get_all_numeric()) {
        $area = 0;
    }
    if ($folk == reserved_words::get_all_numeric()) {
        $folk = 0;
    }
    if ($area == 0) {
        $sarea = tr('All Areas');
    } else {
        $sarea = get_area_name($area);
    }
    if ($folk == 0) {
        $salesfolk = tr('All Sales Folk');
    } else {
        $salesfolk = get_salesman_name($folk);
    }
    if ($more != '') {
        $morestr = tr('Greater than ') . number_format2($more, $dec);
    } else {
        $morestr = '';
    }
    if ($less != '') {
        $lessstr = tr('Less than ') . number_format2($less, $dec);
    } else {
        $lessstr = '';
    }
    $more = (double) $more;
    $less = (double) $less;
    $cols = array(0, 150, 300, 400, 550);
    $headers = array(tr('Customer Postal Address'), tr('Price/Turnover'), tr('Branch Contact Information'), tr('Branch Delivery Address'));
    $aligns = array('left', 'left', 'left', 'left');
    $params = array(0 => $comments, 1 => array('text' => tr('Activity Since'), 'from' => $from, 'to' => ''), 2 => array('text' => tr('Sales Areas'), 'from' => $sarea, 'to' => ''), 3 => array('text' => tr('Sales Folk'), 'from' => $salesfolk, 'to' => ''), 4 => array('text' => tr('Activity'), 'from' => $morestr, 'to' => $lessstr));
    $rep = new FrontReport(tr('Customer Details Listing'), "CustomerDetailsListing.pdf", user_pagesize());
    $rep->Font();
    $rep->Info($params, $cols, $headers, $aligns);
    $rep->Header();
    $result = get_customer_details_for_report($area, $folk);
    $carea = '';
    $sman = '';
    while ($myrow = db_fetch($result)) {
        $printcustomer = true;
        if ($more != '' || $less != '') {
            $turnover = getTransactions($myrow['debtor_no'], $myrow['branch_code'], $from);
            if ($more != 0.0 && $turnover <= (double) $more) {
                $printcustomer = false;
            }
            if ($less != 0.0 && $turnover >= (double) $less) {
                $printcustomer = false;
            }
        }
        if ($printcustomer) {
            if ($carea != $myrow['description']) {
                $rep->fontSize += 2;
                $rep->NewLine(2, 7);
                $rep->Font('bold');
                $rep->TextCol(0, 3, tr('Customers in') . " " . $myrow['description']);
                $carea = $myrow['description'];
                $rep->fontSize -= 2;
                $rep->Font();
                $rep->NewLine();
            }
            if ($sman != $myrow['salesman_name']) {
                $rep->fontSize += 2;
                $rep->NewLine(1, 7);
                $rep->Font('bold');
                $rep->TextCol(0, 3, $myrow['salesman_name']);
                $sman = $myrow['salesman_name'];
                $rep->fontSize -= 2;
                $rep->Font();
                $rep->NewLine();
            }
            $rep->NewLine();
            $rep->TextCol(0, 1, $myrow['name']);
            $adr = Explode("\n", $myrow['address']);
            $count1 = count($adr);
            for ($i = 0; $i < $count1; $i++) {
                $rep->TextCol(0, 1, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
            }
            $count1++;
            $rep->TextCol(1, 2, tr('Price List') . ": " . $myrow['sales_type']);
            if ($more != 0.0 || $less != 0.0) {
                $rep->TextCol(1, 2, tr('Turnover') . ": " . number_format2($turnover, $dec), 0, $rep->lineHeight);
            }
            $rep->TextCol(2, 3, $myrow['br_name']);
            $rep->TextCol(2, 3, $myrow['contact_name'], 0, $rep->lineHeight);
            $rep->TextCol(2, 3, tr('Ph') . ": " . $myrow['phone'], 0, 2 * $rep->lineHeight);
            $rep->TextCol(2, 3, tr('Fax') . ": " . $myrow['fax'], 0, 3 * $rep->lineHeight);
            $adr = Explode("\n", $myrow['br_address']);
            $count2 = count($adr);
            for ($i = 0; $i < $count2; $i++) {
                $rep->TextCol(3, 4, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
            }
            $rep->TextCol(3, 4, $myrow['email'], 0, ($count2 + 1) * $rep->lineHeight);
            $count2++;
            $count1 = Max($count1, $count2);
            $count1 = Max($count1, 4);
            $rep->NewLine($count1);
            $rep->Line($rep->row + 8);
            $rep->NewLine(0, 3);
        }
    }
    $rep->End();
}