Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
14e476b6
Commit
14e476b6
authored
Jun 30, 2021
by
Anthony.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Advertisement Page Fix [Added Validation and File Deletion]
parent
e63e05c0
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
131 deletions
+116
-131
message.xml
system/lib/message.xml
+3
-0
message_en.xml
system/lib/message_en.xml
+3
-0
logic.php
system/logic/advertisements/logic.php
+45
-33
model.php
system/logic/advertisements/model.php
+65
-98
No files found.
system/lib/message.xml
View file @
14e476b6
...
...
@@ -554,6 +554,9 @@
<E_ERROR_UPLOAD_ADMIN_FAILED>
アップロード失敗。 もう一度お試しください。
</E_ERROR_UPLOAD_ADMIN_FAILED>
<E_ERROR_UPLOAD_ADMIN_INVALID>
無効なアップロードファイル
</E_ERROR_UPLOAD_ADMIN_INVALID>
<E_ERROR_NO_PAGE_ACCESS>
あなたは次のページにアクセスするための権限を持っていません。
</E_ERROR_NO_PAGE_ACCESS>
...
...
system/lib/message_en.xml
View file @
14e476b6
...
...
@@ -556,6 +556,9 @@
<E_ERROR_UPLOAD_ADMIN_FAILED>
Failed to upload file. Please Try Again
</E_ERROR_UPLOAD_ADMIN_FAILED>
<E_ERROR_UPLOAD_ADMIN_INVALID>
Uploaded file is invalid.
</E_ERROR_UPLOAD_ADMIN_INVALID>
<E_ERROR_NAME_REQUIRED>
Name is a mandatory field.
</E_ERROR_NAME_REQUIRED>
...
...
system/logic/advertisements/logic.php
View file @
14e476b6
...
...
@@ -22,34 +22,34 @@ class LogicAdvertisements extends AdvertisementModelClass {
* @return : TRUE:ロジック成功、FALSE:ロジック失敗
-------------------------------------------------------------------------*/
function
logic
()
{
try
{
// 初期データ処理
if
(
$this
->
init
()){
$this
->
lists
();
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE
){
if
(
$this
->
checkChiket
())
{
$this
->
popUpSessionMessage
(
INFO
,
'I_COMPLATE_SAVE'
,
array
());
}
$this
->
insertActivity
();
$this
->
loadImageAds
();
$this
->
listsImages
();
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER
||
$this
->
getType
()
==
TYPE_SEARCH
){
$this
->
listsImages
();
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_DETAIL
){
$this
->
selectAdDetails
();
}
elseif
(
$this
->
getType
()
==
TYPE_UPDATE
){
$this
->
insertActivity
();
$this
->
update
();
}
elseif
(
$this
->
getType
()
==
TYPE_DELETE
){
$this
->
insertActivity
();
$this
->
deleteAd
();
$this
->
listsImages
();
}
else
{
$this
->
lists
();
}
$this
->
init
();
switch
(
$this
->
getType
()){
case
TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE
:
$this
->
insertNewAd
();
$this
->
listsImages
();
break
;
case
TYPE_IMAGE_MANAGER
:
case
TYPE_SEARCH
:
$this
->
listsImages
();
break
;
case
TYPE_IMAGE_MANAGER_DETAIL
:
$this
->
selectAdDetails
();
break
;
case
TYPE_UPDATE
:
$this
->
insertActivity
();
$this
->
update
();
break
;
case
TYPE_DELETE
:
$this
->
insertActivity
();
$this
->
deleteAd
();
$this
->
listsImages
();
break
;
default
:
$this
->
lists
();
break
;
}
}
catch
(
Exception
$e
)
{
throw
$e
;
}
...
...
@@ -61,15 +61,19 @@ class LogicAdvertisements extends AdvertisementModelClass {
* @return : なし
-------------------------------------------------------------------------*/
function
lists
()
{
//set variables
//$where = null;
$where
=
$this
->
getWhere
();
//$this -> getWhere();
$this
->
setResult
(
$this
->
accessSelect
(
'LIST_CLICKED_ADS'
,
$where
));
}
function
insertNewAd
(){
if
(
$this
->
loadImageAds
()){
$this
->
insertActivity
();
$this
->
accessModify
(
'INSERT_ADS'
,
$this
->
getImageAdRegistData
());
$this
->
popUpSessionMessage
(
INFO
,
'I_COMPLATE_SAVE'
,
array
());
}
else
{
$this
->
popUpSessionMessage
(
ERROR
,
'E_ERROR_UPLOAD_ADMIN_INVALID'
,
array
());
}
}
function
listsImages
()
{
$this
->
setImages
(
$this
->
accessSelect
(
'LIST_IMAGES'
,
$this
->
getWhereAds
()));
...
...
@@ -89,7 +93,15 @@ class LogicAdvertisements extends AdvertisementModelClass {
}
function
deleteAd
(){
$this
->
accessModify
(
'DELETE_AD_FILE'
,
$this
->
getDeleteData
(),
false
);
$deleteData
=
$this
->
getDeleteData
();
$adDetails
=
$this
->
getRowData
(
$this
->
accessSelect
(
'SELECT_AD_DETAILS'
,
$deleteData
));
$toDelete
=
SYSTEM_DOCUMENT_ADS
.
"/
{
$adDetails
[
"file_name"
]
}
"
;
if
(
@
file_exists
(
$toDelete
))
unlink
(
$toDelete
);
$this
->
accessModify
(
'DELETE_AD_FILE'
,
$deleteData
,
false
);
}
function
insertActivity
(){
...
...
system/logic/advertisements/model.php
View file @
14e476b6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment