Example #1
0
 $params_assigned['title'] = 'Owner';
 $params_assigned['return'] = true;
 $table_search->data[1][0] = user_print_autocomplete_input($params_assigned);
 $contracts = get_contracts();
 $manufacturers = get_manufacturers();
 $table_search->data[1][1] = print_select($contracts, 'id_contract', $id_contract, '', __('None'), 0, true, false, false, __('Contract'), '', 'width: 200px;');
 $table_search->data[1][2] = print_select($manufacturers, 'id_manufacturer', $id_manufacturer, '', __('None'), 0, true, false, false, __('Manufacturer'), '', 'width: 200px;');
 $table_search->data[1][3] = print_checkbox_extended('last_update', 1, $last_update, false, '', '', true, __('Last updated'));
 $buttons = '<div style=" text-align: right;">';
 $buttons .= print_input_hidden('search', 1, true);
 $buttons .= print_input_hidden('mode', $mode, true);
 $buttons .= print_submit_button(__('Search'), 'search', false, 'class="sub search"', true);
 $filter["query"] = $sql_search;
 serialize_in_temp($filter, $config["id_user"]);
 $buttons .= print_button(__('Export to CSV'), '', false, 'window.open(\'' . 'include/export_csv.php?export_csv_inventory=1' . '\')', 'class="sub csv"', true);
 $buttons .= print_report_button("index.php?sec=inventory&sec2=operation/inventories/inventory&search=1&params={$params}", __('Export to PDF') . "&nbsp;");
 $buttons .= '</div>';
 $all_inventory_status = inventories_get_inventory_status();
 array_unshift($all_inventory_status, __("All"));
 $table_search->data[2][0] = print_select($all_inventory_status, 'inventory_status', $inventory_status, '', '', '', true, false, false, __('Status'));
 $params_associated['input_id'] = 'text-associated_user';
 $params_associated['input_name'] = 'associated_user';
 $params_associated['input_value'] = $associated_user;
 $params_associated['title'] = __('Associated user');
 $params_associated['return'] = true;
 $table_search->data[2][1] = user_print_autocomplete_input($params_associated);
 $companies = get_companies();
 array_unshift($companies, __("All"));
 $table_search->data[2][2] = print_select($companies, 'id_company', $id_company, '', '', 0, true, false, false, __('Associated company'), '', 'width: 200px;');
 $table_search->data[3][0] = "&nbsp;";
 $table_search->colspan[3][0] = 4;
function print_incident()
{
    global $config, $pdf_output, $pdf_filename;
    $id = (int) get_parameter("id");
    $incident = get_incident($id);
    if (!check_incident_access($id)) {
        return;
    }
    if ($pdf_output) {
        ob_clean();
        $pdf_filename = "incident_{$id}.pdf";
    } else {
        $report_button = print_report_button("index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id={$id}&tab=summary", __('Export'));
        if ($report_button) {
            echo "<div style='padding:7px; float:right;'>";
            echo $report_button;
            echo "</div>";
        }
    }
    echo "<div style='padding-left:7px;'>";
    echo "<table style='font: 1em Verdana, Helvetica, Arial, 'Trebuchet MS', Arial, Sans-serif; color:#505050; width:620px; text-align:left;'>";
    if ($pdf_output) {
        echo "\t<tr>";
        echo "\t\t<td style='text-align:center; font-size:14px; color:#505050;'>";
        echo "\t\t\t<h1>#" . $incident["id_incidencia"] . "&nbsp;&nbsp;" . $incident["titulo"] . "</h1><br><br>";
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["id_creator"]) {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Creator') . "</b> - " . $incident["id_creator"];
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["id_usuario"]) {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Owner') . "</b> - " . $incident["id_usuario"];
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["estado"]) {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Status') . "</b> - " . incidents_get_incident_status_text($incident["id_incidencia"]);
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["inicio"] != "0000-00-00 00:00:00") {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Created on') . "</b> - " . strftime("%e %B %Y (%H:%M)", strtotime($incident["inicio"]));
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["cierre"] != "0000-00-00 00:00:00") {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Closed on') . "</b> - " . strftime("%e %B %Y (%H:%M)", strtotime($incident["cierre"]));
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["descripcion"]) {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Description') . "</b>";
        echo "\t\t\t<div style='width:620px; word-wrap:break-word;'>" . $incident["descripcion"] . "</div>";
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    if ($incident["epilog"]) {
        echo "\t<tr>";
        echo "\t\t<td style='font-size:16px; color:#505050;'>";
        echo "\t\t\t<b>" . __('Epilog') . "</b>";
        echo "\t\t\t<div style='width:620px; word-wrap:break-word;'>" . $incident["epilog"] . "</div>";
        echo "\t\t</td>";
        echo "\t</tr>";
    }
    echo "</table>";
    echo "</div>";
}
Example #3
0
	$where_clause .= sprintf (' AND id_company IN (SELECT id FROM tcompany WHERE manager = "%s")', $search_company_manager);
}
if ($search_contract_number != "") {
	$where_clause .= sprintf (' AND contract_number = "%s"', $search_contract_number);
}

echo "<h2>" . __('Invoice') . "</h2>";
echo "<h4>" . __('Invoice listing');
	echo integria_help ("invoice_detail", true);
	echo "<div id='button-bar-title'>";
		echo "<ul>";
			echo "<li>";
				$where_clause = str_replace(array("\r", "\n"), '', $where_clause);
				echo print_button(__('Export to CSV'), '', false, 'window.open(\'include/export_csv.php?export_csv_invoices=1&where_clause=' .
					str_replace('"', "\'", $where_clause) . '\')', 'class="sub csv"', true);
				echo print_report_button ("index.php?sec=customers&sec2=operation/invoices/invoice_detail&$search_params", __('Export to PDF')."&nbsp;");
			echo "</li>";
			echo "<li>";
				echo "<a href='index.php?sec=customers&sec2=operation/invoices/invoice_stats".$search_params."'>" .
					print_image ("images/chart_bar_dark.png", true, array("title" => __("Invoices report"))) .
					"</a>";
			echo "</li>";
		echo "</ul>";
	echo "</div>";
echo "</h4>";


if ($clean_output == 0){

	$form = '<form method="post">';
Example #4
0
    $table->data[1][0] = print_select_from_sql($sql, 'search_company_role', $search_company_role, '', __('Any'), 0, true, false, false, __('Company Role'));
    $table->data[0][1] = get_last_date_control($search_last_date, 'search_last_date', __('Date'), $search_date_begin, 'search_date_begin', __('From'), $search_date_end, 'search_date_end', __('To'));
    $invoice_types = array('Submitted' => 'Submitted', 'Received' => 'Received');
    $table->data[0][2] = print_select($invoice_types, 'search_invoice_type', $search_invoice_type, '', '', 0, true, 0, false, __('Invoice type'), false, 'width:150px;');
    $table->data[1][2] = print_input_text_extended('search_company_manager', $search_company_manager, 'text-search_company_manager', '', 20, 50, false, '', array(), true, '', __("Manager")) . print_help_tip(__("Type at least two characters to search"), true);
    $table->data[1][3] = print_input_text("search_contract_number", $search_contract_number, "", 20, 100, true, __('Contract number'));
    $invoice_status_ar = array();
    $invoice_status_ar['active'] = __("Active");
    $invoice_status_ar['pending'] = __("Pending");
    $invoice_status_ar['paid'] = __("Paid");
    $invoice_status_ar['canceled'] = __("Canceled");
    $table->data[0][3] = print_select($invoice_status_ar, 'search_invoice_status', $search_invoice_status, '', __("Any"), '', true, 0, false, __('Invoice status'), false, 'width:150px;');
    $table->data[2][0] = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
    $where_clause = str_replace(array("\r", "\n"), '', $where_clause);
    $table->data[2][0] .= print_button(__('Export to CSV'), '', false, 'window.open(\'include/export_csv.php?export_csv_invoices=1&where_clause=' . str_replace('"', "\\'", $where_clause) . '\')', 'class="sub csv"', true);
    $table->data[2][0] .= print_report_button("index.php?sec=customers&sec2=operation/invoices/invoice_detail&{$search_params}", __('Export to PDF') . "&nbsp;");
    print_table($table);
    echo '</form>';
}
$invoices = crm_get_all_invoices($where_clause, $order_by);
// NO pagination for PDF output
if ($clean_output == 1) {
    $config["block_size"] = 5000;
}
$invoices = print_array_pagination($invoices, "index.php?sec=customers&sec2=operation/invoices/invoice_detail{$search_params}");
if ($invoices != false) {
    $url_id_order = 'index.php?sec=customers&sec2=operation/invoices/invoice_detail' . $search_params . '&order_by=bill_id';
    $url_create_order = 'index.php?sec=customers&sec2=operation/invoices/invoice_detail' . $search_params . '&order_by=invoice_create_date';
    switch ($order_by) {
        case "bill_id":
            $id_img = "&nbsp;<a href='{$url_id_order}'><img src='images/arrow_down_orange.png'></a>";