<?php 
require "inc.php";
if(!isset($get_type)) $get_type="";

if(!isset($get_obj_id)) $get_obj_id="";
if(!isset($get_obj_src)) $get_obj_src="";
if(!isset($get_style_bg)) $get_style_bg="";

$arr_config["upload_count"]=1;
if($obj_tab_sys_config->get_val("other","upload_count")!="") $arr_config["upload_count"]=intval($obj_tab_sys_config->get_val("other","upload_count"));

if(isset($_POST["isupload"])&&$_POST["isupload"]=="1"){
	$obj_tab_upload_attatch=new cls_tab_other_upload_attatch();
	$arr_return=$obj_tab_upload_attatch->on_upload();
	if($arr_return["err"]=="")
	{
		$obj_msg->js("obj_id=parent.document.getElementById('".$get_obj_id."');if(obj_id){obj_id.value='".$arr_return["path"]."';}");
		if($get_obj_src!=""){
				$str_pic_url=get_html_url($arr_return["path"]);			
				$obj_msg->js("obj_src=parent.document.getElementById('".$get_obj_src."');if(obj_src){obj_src.src='".$str_pic_url."';}");
		}
	}else{
		$obj_msg->alert($arr_return["err"]);
		$obj_msg->on_history_back();
	}
}
include 'tpl/upload_attatch.tpl.php';
?>