예제 #1
0
				".TB_PREFIX."custom_fields
			$where
			ORDER BY
				$sort $dir
			LIMIT
				$start, $limit";

	$sth = dbQuery($sql,':domain_id', $auth_session->domain_id) or die(end($dbh->errorInfo()));
	$count = $sth->rowCount();

	$cfs = null;

	$number_of_rows = 0;
	for($i=0; $cf = $sth->fetch();$i++) {
		$cfs[$i] = $cf;
		$cfs[$i]['field_name_nice'] = get_custom_field_name($cf['cf_custom_field']);
		$number_of_rows = $i;
	}

	$xml .= "<rows>";
	$xml .= "<page>$page</page>";
	$xml .= "<total>$count</total>";

	foreach ($cfs as $row) {
		$xml .= "<row id='".htmlsafe($row['cf_id'])."'>";
		$xml .= "<cell><![CDATA[
			<a class='index_table' title='$LANG[view] $LANG[custom_field] ".htmlsafe($row['field_name_nice'])."' href='index.php?module=custom_fields&view=details&id=$row[cf_id]&action=view'><img src='" . $baseUrl . "images/common/view.png' height='16' border='-5px' padding='-4px' valign='bottom' /></a>
			<a class='index_table' title='$LANG[edit] $LANG[custom_field] ".htmlsafe($row['field_name_nice'])."' href='index.php?module=custom_fields&view=details&id=$row[cf_id]&action=edit'><img src='" . $baseUrl . "images/common/edit.png' height='16' border='-5px' padding='-4px' valign='bottom' /></a>
		]]></cell>";
		$xml .= "<cell><![CDATA[".htmlsafe($row['cf_id'])."]]></cell>";
		$xml .= "<cell><![CDATA[".htmlsafe($row['field_name_nice'])."]]></cell>";
예제 #2
0
<?php

/*
* Script: details.php
* 	Custom fields details page
*
* License:
*	 GPL v3 or above
*
* Website:
* 	http://www.simpleinvoices.org
*/
//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
#table
#get the invoice id
$cf_id = $_GET["id"];
global $dbh;
#customer query
$print_product = "SELECT * FROM " . TB_PREFIX . "custom_fields WHERE cf_id = :id";
$sth = dbQuery($print_product, ':id', $cf_id) or die(end($dbh->errorInfo()));
$cf = $sth->fetch();
$cf['name'] = get_custom_field_name($cf['cf_custom_field']);
$pageActive = "options";
$smarty->assign('pageActive', $pageActive);
$smarty->assign("cf", $cf);
$smarty->assign('pageActive', 'custom_field');
$subPageActive = $_GET['action'] == "view" ? "custom_fields_view" : "custom_fields_edit";
$smarty->assign('subPageActive', $subPageActive);
$smarty->assign('active_tab', '#setting');