예제 #1
0
<?php

$page_security = 10;
$path_to_root = "../..";
include_once $path_to_root . "/includes/session.inc";
page(tr("View Dimension"), true);
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/data_checks.inc";
include_once $path_to_root . "/dimensions/includes/dimensions_db.inc";
include_once $path_to_root . "/dimensions/includes/dimensions_ui.inc";
//-------------------------------------------------------------------------------------------------
if ($_GET['trans_no'] != "") {
    $id = $_GET['trans_no'];
}
display_heading(systypes::name(systypes::dimension()) . " # " . $id);
$myrow = get_dimension($id);
if (strlen($myrow[0]) == 0) {
    echo tr("The work order number sent is not valid.");
    exit;
}
start_table($table_style);
$th = array(tr("#"), tr("Reference"), tr("Name"), tr("Type"), tr("Date"), tr("Due Date"));
table_header($th);
start_row();
label_cell($myrow["id"]);
label_cell($myrow["reference"]);
label_cell($myrow["name"]);
label_cell($myrow["type_"]);
label_cell(sql2date($myrow["date_"]));
label_cell(sql2date($myrow["due_date"]));
end_row();
function show_specs($list, $uploaded_images_count, $color)
{
    $theme_url = get_template_directory_uri();
    $es_dimension = get_dimension();
    ?>

    <ul class="es_my_list_specs clearfix">
        <li class="es_photo">
            <div class="slide_up">
                <img src="<?php 
    echo $theme_url;
    ?>
/images/photo-<?php 
    echo $color;
    ?>
.png"/><br/>
                <?php 
    echo sprintf(_n("%s photo", "%s photos", $uploaded_images_count, 'es-plugin'), $uploaded_images_count);
    ?>
                                    
            </div>
        </li>
        <li class="es_bd">
            <div class="slide_up">
                <img src="<?php 
    echo $theme_url;
    ?>
/images/bed-<?php 
    echo $color;
    ?>
.png"/><br/>
                <?php 
    echo sprintf(_n("%s bed", "%s beds", $list->prop_bedrooms, 'es-plugin'), $list->prop_bedrooms);
    ?>

            </div>
        </li>
        <li class="es_dimen">
            <div class="slide_up">
                <img src="<?php 
    echo $theme_url;
    ?>
/images/area-<?php 
    echo $color;
    ?>
.png"/><br/>
                <?php 
    echo $list->prop_area . ' ' . $es_dimension;
    ?>

            </div>
        </li>
        <li class="es_bth">
            <div class="slide_up">
                <img src="<?php 
    echo $theme_url;
    ?>
/images/shower-<?php 
    echo $color;
    ?>
.png"/><br/>
                <?php 
    if ($list->prop_bathrooms != 0) {
        echo str_replace('.0', '', $list->prop_bathrooms);
        echo _n(" bath", " baths", $list->prop_bathrooms, 'es-plugin');
    }
    ?>

            </div>
        </li>
    </ul>
<?php 
}
예제 #3
0
function print_supplier_details_listing()
{
    global $path_to_root;
    $from = $_POST['PARAM_0'];
    $more = $_POST['PARAM_1'];
    $less = $_POST['PARAM_2'];
    $comments = $_POST['PARAM_3'];
    $orientation = $_POST['PARAM_4'];
    $destination = $_POST['PARAM_5'];
    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 ($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(_('Mailing Address:'), _('Turnover'), _('Contact Information'), _('Physical Address'));
    $aligns = array('left', 'left', 'left', 'left');
    $params = array(0 => $comments, 1 => array('text' => _('Activity Since'), 'from' => $from, 'to' => ''), 2 => array('text' => _('Activity'), 'from' => $morestr, 'to' => $lessstr . " " . get_company_pref("curr_default")));
    $rep = new FrontReport(_('Supplier Details Listing'), "SupplierDetailsListing", user_pagesize(), 9, $orientation);
    if ($orientation == 'L') {
        recalculate_cols($cols);
    }
    $rep->Font();
    $rep->Info($params, $cols, $headers, $aligns);
    $rep->NewPage();
    $result = get_supplier_details_for_report();
    while ($myrow = db_fetch($result)) {
        $printsupplier = true;
        if ($more != '' || $less != '') {
            $turnover = getTransactions($myrow['supplier_id'], $from);
            if ($more != 0.0 && $turnover <= (double) $more) {
                $printsupplier = false;
            }
            if ($less != 0.0 && $turnover >= (double) $less) {
                $printsupplier = false;
            }
        }
        if ($printsupplier) {
            $newrow = 0;
            $rep->NewLine();
            // Here starts the new report lines 2013-01-28 Joe Hunt
            $contacts = get_supplier_contacts($myrow['supplier_id']);
            $rep->TextCol(0, 1, $myrow['supp_name']);
            $rep->TextCol(1, 2, _('Tax_Id') . ": " . $myrow['gst_no']);
            $rep->TextCol(2, 3, $myrow['contact']);
            $rep->NewLine();
            $adr = Explode("\n", $myrow['address']);
            $adr2 = Explode("\n", $myrow['supp_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 ($myrow['notes'] != '') {
                $oldrow = $rep->row;
                $rep->NewLine();
                $rep->TextColLines(1, 2, _("Gereral Notes:") . " " . $myrow['notes'], -2);
                $newrow = $rep->row;
                $rep->row = $oldrow;
            }
            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]);
                }
            }
            if ($newrow != 0 && $newrow < $rep->row) {
                $rep->row = $newrow;
            }
            $rep->NewLine();
            $rep->Line($rep->row + 8);
            $rep->NewLine(0, 3);
        }
    }
    $rep->End();
}
예제 #4
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();
}
예제 #5
0
//-------------------------------------------------------------------------------------
if (isset($_POST['close'])) {
    // update the closed flag
    close_dimension($selected_id);
    meta_forward($_SERVER['PHP_SELF'], "ClosedID={$selected_id}");
}
if (isset($_POST['reopen'])) {
    // update the closed flag
    reopen_dimension($selected_id);
    meta_forward($_SERVER['PHP_SELF'], "ReopenedID={$selected_id}");
}
//-------------------------------------------------------------------------------------
start_form();
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    $myrow = get_dimension($selected_id);
    if (strlen($myrow[0]) == 0) {
        display_error(_("The dimension sent is not valid."));
        display_footer_exit();
    }
    // if it's a closed dimension can't edit it
    //if ($myrow["closed"] == 1)
    //{
    //	display_error(_("This dimension is closed and cannot be edited."));
    //	display_footer_exit();
    //}
    $_POST['ref'] = $myrow["reference"];
    $_POST['closed'] = $myrow["closed"];
    $_POST['name'] = $myrow["name"];
    $_POST['type_'] = $myrow["type_"];
    $_POST['date_'] = sql2date($myrow["date_"]);