9a041cbc2155d7518a561a6dccf84c006756a49a.svn-base
4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/comm/Common.php";?>
<?
if (! class_exists("AdminBase"))
{
class AdminBase extends Common
{
function __construct($req)
{
parent::__construct($req);
}
function wrapParam()
{
$this->req['page'] = ($this->req['page'] == "") ? 1 : $this->req['page'];
}
function getAddQuery()
{
$addQuery = "";
$addQuery .= $this->getSearchQuery();
return $addQuery;
}
/**
* *************************************************************************
* 제 목 : 이미지 파일 사이즈 구하기
* 함수명 : fileUpload
* 작성일 : 2013-07-22
* 작성자 : dev.Na
* 설 명 :
* 수 정 :
* '**************************************************************************
*/
function getImageSize($imgUrl)
{
$imgUrl = $this->fileSavePath . $imgUrl;
$imgExtension = Array(
'GIF',
'JPG',
'PNG',
'PSD',
'BMP'
);
if (in_array(strtoupper($this->getFileExtension($imgUrl)), $imgExtension))
{
$sizeInfo = getimagesize($imgUrl);
$file_width = $sizeInfo[0];
$file_height = $sizeInfo[1];
}
else
{
$file_width = "0";
$file_height = "0";
}
$retArr = Array(
"file_name" => str_replace($this->fileSavePath, "", $imgUrl),
"file_width" => $file_width,
"file_height" => $file_height
);
return $retArr;
}
// 파일명중 확장자를 분리해준다.
function getFileExtension($imgUrl)
{
$Tmp = explode(".", $imgUrl);
return $Tmp[count($Tmp) - 1];
}
function imagePreUpload()
{
$Extension = array(
"txt",
"html",
"asp",
"php"
);
$Upload = new Upload($_FILES["file"], $this->fileSavePath, $Extension, 1);
$imgData = $Upload->processing();
$imagePath = "";
if (strcmp($imgData[0]['re_name'], ""))
{
$imagePath = $Upload->GetDate() . "/" . $imgData[0]['re_name'];
$image = new SimpleImage();
$assoc = array(
$this->fileSavePath_720,
$this->fileSavePath_640,
$this->fileSavePath_480,
$this->fileSavePath_320,
$this->fileSavePath_100
);
$image->check($assoc);
$image->processing($this->fileSavePath . $Upload->GetDate() . "/", $this->fileSavePath_720, 720, $imgData[0]['re_name']);
$image->processing($this->fileSavePath . $Upload->GetDate() . "/", $this->fileSavePath_640, 640, $imgData[0]['re_name']);
$image->processing($this->fileSavePath . $Upload->GetDate() . "/", $this->fileSavePath_480, 480, $imgData[0]['re_name']);
$image->processing($this->fileSavePath . $Upload->GetDate() . "/", $this->fileSavePath_320, 320, $imgData[0]['re_name']);
$image->processing($this->fileSavePath . $Upload->GetDate() . "/", $this->fileSavePath_100, 100, $imgData[0]['re_name']);
}
$imagePath = ($imagePath != "") ? "/upload_img/" . $imagePath : $imagePath;
return $imagePath;
}
/**
* 그룹 검색
*
* @param unknown $name
*/
function getListOfGroupForEntity($name)
{
$sql = "
SELECT *
FROM tbl_user_group
WHERE status = 'Y' AND name LIKE '%{$name}%'
ORDER BY name ASC
";
$result = $this->getArray($sql);
return $result;
}
/**
* 상점 검색
* @param unknown $name
*/
function getListOfShopForEntity($name)
{
$sql = "
SELECT *
FROM tbl_shop
WHERE status = 'Y' AND name LIKE '%{$name}%'
ORDER BY name ASC
";
$result = $this->getArray($sql);
return $result;
}
/**
* 상점 카테고리 코드 검색
*/
function getShopCategoryCodeList()
{
$sql = "
SELECT *
FROM tbl_category
WHERE `status` = 'Y'
ORDER BY `no` ASC
";
$result = $this->getArray($sql);
return $result;
}
/**
* 그룹 정보 조회
* @param unknown $groupNo
* @return NULL
*/
function getGroupData($groupNo)
{
$sql = "
SELECT *
FROM tbl_user_group
WHERE `no` = '{$groupNo}'
LIMIT 1
";
$result = $this->getRow($sql);
return $result;
}
} // class 종료
}
?>