<?php
require(DIR_WS_CLASSES.'companies.php');
$id = xtc_db_input($_GET['id']);
$companies = new companies();
$company = $companies->get_company($id);

switch($_GET['action']){
	case 'delete_confirm':
		$smarty->assign('BOX_TITLE', $company->data->name );
		$contents = array();
		$contents[] = array('align'=>'center','text' => DELETE_ENTRY );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_DELETE,xtc_href_link(FILENAME_COMPANIES,xtc_get_all_get_params(array('action')).'action=delete'),$access='func_companies_delete','width:100px;').'&nbsp;'.yes_draw_href_button(IMAGE_CANCEL,"javascript:ajax_box_action('".$id."','');",$access='companies','width:100px;') );
		
		break;
	default:
		$smarty->assign('BOX_TITLE', $company->data->name );
		$contents = array();
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_OVERVIEW,xtc_href_link(FILENAME_COMPANIES,'id='.$id.'&action=overview'),$access='companies','width:180px;') );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_EDIT,xtc_href_link(FILENAME_COMPANIES_EDIT,'id='.$id),$access='companies_edit','width:180px;') );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_DELETE,"javascript:ajax_box_action('".$id."','delete_confirm');",$access='func_companies_delete','width:180px;') );
				
		break;
}

$box = new box;
$smarty->assign('BOX_CONTENT', $box->infoBox($contents) );

