示例#1
0
	function get($id = NULL){
		global $db_conn;

		if(!isset($id)){
			$id = $this->id;
		}

		if(!isset($id)){
			$this->error = "SI_Payment::get() : Payment id not set\n";
			return FALSE;
		}

		$Payment = SI_Payment::retrieveSet("WHERE id = $id", TRUE);
		if($Payment === FALSE){
			return FALSE;
		}

		if(isset($Payment[0])){
			$this->updateFromAssocArray($Payment[0]);
			$this->stripSlashes();
			if($this->_populateInvoices() === FALSE)
				return FALSE;
		}else{
			$this->error = "SI_Payment::get() : No data retrieved from query\n";
			return FALSE;
		}
		return TRUE;
	}
示例#2
0
$account = new SI_Account();
$accounts = $account->retrieveSet("WHERE updated_ts > $last_update_ts");
if($accounts === FALSE){
	$error_msg .= "Error getting accounts updated since ".date('m-d-Y', $last_update_ts);
	debug_message($account->getLastError());
}

$invoice = new SI_Invoice();
$invoices = $invoice->retrieveSet("WHERE updated_ts > $last_update_ts");
if($invoices === FALSE){
	$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;
		}