Example #1
0
 *
 */
require_once('includes/common.php');
require_once('includes/SI_Company.php');
require_once('includes/SI_ItemCode.php');
require_once('includes/SI_Account.php');
require_once('includes/SI_Payment.php');
require_once('includes/SI_Invoice.php');

checkLogin();

if(!isset($_REQUEST['mode']) || empty($_REQUEST['mode'])){
	fatal_error("Export mode must be specified!");
}elseif(strtolower($_REQUEST['mode']) == 'company'){
	$company = new SI_Company();
	$output = $company->exportQB();
	if($output === FALSE){
		fatal_error("Error getting company export data!\n".$company->getLastError());
	}
}elseif(strtolower($_REQUEST['mode']) == 'item_code'){
	$code = new SI_ItemCode();
	$output = $code->exportQB();
	if($output === FALSE){
		fatal_error("Error getting item code export data!\n".$code->getLastError());
	}
}elseif(strtolower($_REQUEST['mode']) == 'account'){
	$account = new SI_Account();
	$output = $account->exportQB();
	if($output === FALSE){
		fatal_error("Error getting account export data!\n".$account->getLastError());
	}
Example #2
0
	$error_msg .= "Error getting invoices updated since ".date('m-d-Y', $last_update_ts);
	debug_message($invoice->getLastError());
}

$payment = new SI_Payment();
$payments = $payment->retrieveSet("WHERE updated_ts > $last_update_ts");
if($payments === FALSE){
	$error_msg .= "Error getting invoices updated since ".date('m-d-Y', $last_update_ts);
	debug_message($payment->getLastError());
}

if(isset($_POST['save2'])){
	$output = '';
	if(isset($_POST['export_companies']) && is_array($_POST['export_companies'])){
		$company = new SI_Company();
		$company_output = $company->exportQB("WHERE id IN (".join(',', $_POST['export_companies']).")");
		if($company_output === FALSE){
			fatal_error("Error getting company export data!\n".$company->getLastError());
		}else{
			$output .= $company_output;
		}
	}
	
	if(isset($_POST['export_item_codes']) && is_array($_POST['export_item_codes'])){
		$item_code = new SI_ItemCode();
		$item_code_output = $item_code->exportQB("WHERE id IN (".join(',', $_POST['export_item_codes']).")");
		if($item_code_output === FALSE){
			fatal_error("Error getting item_code export data!\n".$item_code->getLastError());
		}else{
			$output .= $item_code_output;
		}