Example #1
0
require_once('includes/SI_Company.php');
require_once('includes/SI_RateStructure.php');
$title = '';
$company = new SI_Company();

if($_REQUEST['mode'] == 'add'){
	$title = "Add Company";
	
	if($_POST['save']){
		$company->updateFromAssocArray($_POST);
		if($company->add() !== false){
			goBack();
		}else{
			$error_msg .= "Error adding Company!\n";
			debug_message($company->getLastError());
		}
	}
}else if($_REQUEST['mode'] == 'edit'){
	$title = "Edit Company";
	if(empty($_REQUEST['id'])){
		$error_msg .= "Error: No ID specified!\n";
	}else{
		if(!$company->get($_REQUEST['id'])){
			$error_msg .= "Error retrieving company information!\n";
			debug_message($company->getLastError());
		}
	}

	if($_POST['save']){
		$company->updateFromAssocArray($_POST);
Example #2
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());
	}
}elseif(strtolower($_REQUEST['mode']) == 'payment'){
	$payment = new SI_Payment();
Example #3
0
	function getCompany(){
		if($this->_company == FALSE && $this->company_id > 0){
			$company = new SI_Company();
			if($company->get($this->company_id) === FALSE){
				$this->error = "SI_Project::getCompany(): Error getting company: ".$company->getLastError();
				return FALSE;
			}
			$this->_company =& $company;
		}

		return $this->_company;
	}
Example #4
0
	function getName(){
    	$company = new SI_Company();
    	if($company->get($this->company_id) === FALSE){
	      $this->error = "SI_Invoice::getName(): Error getting company: ".$company->getLastError();
    	  return "";
    	}

    	return $company->name;
	}