<?php
require(DIR_WS_CLASSES.'class.notiz.php');
$id = xtc_db_input($_GET['id']);
$notiz = new notiz($id);
$notiz->get_data();
switch($_GET['action']){
	case 'delete_confirm':
		$smarty->assign('BOX_TITLE', $notiz->capt );
		$contents = array();
		$contents[] = array('align'=>'center','text' => DELETE_ENTRY );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_DELETE,xtc_href_link(FILENAME_NOTIZ,xtc_get_all_get_params(array('action')).'action=delete'),$access='notiz','width:100px;').'&nbsp;'.yes_draw_href_button(IMAGE_CANCEL,"javascript:ajax_box_action('".$id."','');",$access='notiz','width:100px;') );
		
		break;
	default:
		$smarty->assign('BOX_TITLE', $notiz->capt );
		$contents = array();
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(VIEW_NOTICE,xtc_href_link(FILENAME_NOTIZ,'action=view&id='.$notiz->id),'notiz','width:180px;','button','lbOn_1') );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_EDIT,xtc_href_link(FILENAME_NOTIZ,'action=change&id='.$notiz->id),'notiz','width:180px;','button','lbOn_1') );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(FORWARD,xtc_href_link(FILENAME_NOTIZ,'action=forward_select&id='.$notiz->id),'notiz','width:180px;','button','lbOn_1') );
		$contents[] = array('align'=>'center','text' => yes_draw_href_button(IMAGE_DELETE,"javascript:ajax_box_action('".$id."','delete_confirm');",'notiz','width:180px;') );
		$rec_arr = $notiz->get_recipients();
		$rec = '';
		if(sizeOf($rec_arr)>0){
			foreach($rec_arr as $k=>$v){
				$rec .= $v.'<br />';
			}
			$contents[] = array('align'=>'left','text'=>'<br /><b>'.RECIPIENTS.':</b><br />'.$rec);
		}
		break;
}

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

