<?php

if ((!empty($_GET["supplier_id"])) && (!empty($_GET["org_id"]))) {
 $supplier_id = $_GET["supplier_id"];
 $org_id = $_GET["org_id"];

 //find and assign the details to $$class
 $class_values = $$class->findBy_orgId_supplierId($org_id, $supplier_id);
 if (!empty($class_values)) {
	foreach ($class_values as $key => $value) {
	 if ((!empty($value)) && (property_exists($$class, $key))) {
		$$class->$key = $value;
	 }
	}
 } else {
	$$class->supplier_id = $supplier_id;
	$$class->org_id = $org_id;
 }
}

if (!empty($$class->supplier_id)) {
 $supplier = new supplier();
 $supplier_i = $supplier->findBy_id($$class->supplier_id);
 $$class->supplier_name = $supplier_i->supplier_name;
 $$class->supplier_number = $supplier_i->supplier_number;
}

if (!empty($$class->org_id)) {
 $org = org::find_by_id($$class->org_id);
 $$class->org = $org->org;
 $cc = new coa_combination();
}
?>