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
035e4388
Commit
035e4388
authored
Jul 07, 2021
by
Anthony.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Advertisement Uploader Enhancement [Edit Banner Fix]
parent
bce3af96
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
44 deletions
+69
-44
tmp_advertisements_manager_detail.php
system/en/template/tmp_advertisements_manager_detail.php
+3
-7
sql.xml
system/lib/sql.xml
+3
-2
controller.php
system/logic/advertisements/controller.php
+9
-7
logic.php
system/logic/advertisements/logic.php
+13
-6
model.php
system/logic/advertisements/model.php
+41
-22
No files found.
system/en/template/tmp_advertisements_manager_detail.php
View file @
035e4388
...
...
@@ -25,23 +25,19 @@ include_once('template/base_head.php');
<h2>
<?php
echo
$page_title
;
?>
</h2>
</div>
<?php
// $this -> echoMessage(); ?>
<
form
id
=
"acForm"
action
=
""
method
=
"post"
>
<
form
id
=
"acForm"
action
=
""
method
=
"post"
enctype
=
"multipart/form-data"
>
<
div
class
=
"container-fluid"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12 col-md-12 col-lg-6"
>
<
img
src
=
"<?=SITE_PROTOCOL?>://<?=SITE_DOMAIN_FULL?>/documents/ads/<?php
$this
-> echoFileName(); ?>"
style
=
"margin-left: auto;margin-right: auto; display: block;"
alt
=
"Cinque Terre"
width
=
"800"
class
=
"img-fluid"
>
<
label
for
=
"img1"
>
Change
Image
:</
label
>
<
input
type
=
"file"
accept
=
"image/jpeg,image/png,image/jpg,image/gif,application/pdf"
id
=
"img1"
name
=
"img1"
value
=
""
class
=
"w100p"
>
<
label
for
=
"img1"
>
Change
Image
:</
label
>
<
input
type
=
"file"
accept
=
"image/jpeg,image/png,image/jpg,image/gif,application/pdf"
id
=
"img1"
name
=
"img1"
value
=
""
class
=
"w100p"
>
</
div
>
<
div
class
=
"col-sm-12 col-md-12 col-lg-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"email"
>
File
Name
:</
label
>
<
input
type
=
"text"
class
=
"form-control"
value
=
"<?php
$this
-> echoFileName(); ?>"
readonly
=
""
>
</
div
>
<!--
<
div
class
=
"form-group"
>
<
label
for
=
"alt"
>
Alternative
Info
:</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"alt"
>
</
div
>
-->
<
div
class
=
"form-group"
>
<
label
for
=
"adName"
>
ID
:</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"adName"
name
=
"adName"
value
=
"<?php
$this
-> echoAdName(); ?>"
>
...
...
system/lib/sql.xml
View file @
035e4388
...
...
@@ -13952,9 +13952,10 @@ WHERE
ads_id = '__ELEMENT01__',
redirect_link = '__ELEMENT02__',
ads_location = '__ELEMENT03__',
language = '__ELEMENT04__'
language = '__ELEMENT04__',
file_name = '__ELEMENT05__'
WHERE
id = '__ELEMENT0
5
__'
id = '__ELEMENT0
6
__'
</UPDATE_AD_DETAILS>
<UPDATE_AD_SEQUENCE>
UPDATE
...
...
system/logic/advertisements/controller.php
View file @
035e4388
...
...
@@ -31,18 +31,20 @@ class ControlAdvertisements extends LogicAdvertisements {
// アクション実行
$this
->
logic
();
if
(
$this
->
getType
()
==
NO_STRING
&&
$this
->
getType
()
==
TYPE_SEARCH
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_PATH'
,
$this
->
dispHTML
()
));
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_PATH'
));
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER
||
$this
->
getType
()
==
TYPE_SEARCH
||
$this
->
getType
()
==
'save_sequence'
||
$this
->
getType
()
==
TYPE_DELETE
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'
,
$this
->
dispHTML
()));
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_DETAIL
||
$this
->
getType
()
==
TYPE_UPDATE
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_DETAIL_PATH'
,
$this
->
dispHTML
()));
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'
));
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_DETAIL
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_DETAIL_PATH'
));
}
elseif
(
$this
->
getType
()
==
TYPE_UPDATE
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'
));
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_UPLOAD
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_UPLOAD_PATH'
,
$this
->
dispHTML
()
));
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_UPLOAD_PATH'
));
}
elseif
(
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE
){
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'
,
$this
->
dispHTML
()
));
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'
));
}
else
{
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_PATH'
,
$this
->
dispHTML
()
));
require_once
(
$this
->
getSystemHTML
(
'TEMPLATE_ADVERTISEMENTS_PATH'
));
}
}
catch
(
Exception
$e
)
{
...
...
system/logic/advertisements/logic.php
View file @
035e4388
...
...
@@ -40,6 +40,7 @@ class LogicAdvertisements extends AdvertisementModelClass {
case
TYPE_UPDATE
:
$this
->
insertActivity
();
$this
->
update
();
$this
->
listsImages
();
break
;
case
TYPE_DELETE
:
$this
->
insertActivity
();
...
...
@@ -85,7 +86,17 @@ class LogicAdvertisements extends AdvertisementModelClass {
}
function
update
(){
$this
->
accessModify
(
'UPDATE_AD_DETAILS'
,
$this
->
getUpdateData
());
$result
=
$this
->
getRowData
(
$this
->
accessSelect
(
'SELECT_AD_DETAILS'
,
[
$this
->
getAdID
()]));
if
(
$this
->
isLoopData
(
$result
)){
if
(
$this
->
loadImageAds
())
$this
->
deleteAdImageFile
(
$result
);
else
$this
->
referToExistingDetails
(
$result
);
$this
->
accessModify
(
'UPDATE_AD_DETAILS'
,
$this
->
getUpdateData
());
$this
->
popUpSessionMessage
(
INFO
,
'I_COMPLATE_SAVE'
,
array
());
}
}
function
updateSequence
(){
...
...
@@ -96,11 +107,7 @@ class LogicAdvertisements extends AdvertisementModelClass {
$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
->
deleteAdImageFile
(
$adDetails
);
$this
->
accessModify
(
'DELETE_AD_FILE'
,
$deleteData
,
false
);
}
...
...
system/logic/advertisements/model.php
View file @
035e4388
...
...
@@ -377,6 +377,15 @@ class AdvertisementModelClass extends ModelClassEx {
return
false
;
}
/**
*
* some of existing values will be re-used in update query
*
*/
public
function
referToExistingDetails
(
$result
){
$this
->
saveName
=
$result
[
"file_name"
];
}
public
function
getImageAdRegistData
(){
return
[
VAL_INT_10
,
...
...
@@ -450,7 +459,7 @@ class AdvertisementModelClass extends ModelClassEx {
HTMLTABLE;
}
} else {
$rtn = '
<
tr
><
td
colspan
=
"
6
"
>
' . $this -> getMessage(INFO, '
I_NO_SUCHE_SEARCH_DATA
', array()) . '
</
td
></
tr
>
';
$rtn = '
<
tr
><
td
colspan
=
"
7
"
>
' . $this -> getMessage(INFO, '
I_NO_SUCHE_SEARCH_DATA
', array()) . '
</
td
></
tr
>
';
}
echo $rtn;
}
...
...
@@ -530,9 +539,17 @@ HTMLTABLE;
$rtn[] = $this -> link;
$rtn[] = $this -> location;
$rtn[] = $this -> language;
$rtn[] = $this -> saveName;
$rtn[] = $this -> adID;
return $rtn;
}
public function deleteAdImageFile($result){
$toDelete = SYSTEM_DOCUMENT_ADS."/{$result["file_name"]}";
if(@file_exists($toDelete))
unlink($toDelete);
}
public function getUpdateSequence(){
$rtn = array();
...
...
@@ -550,37 +567,39 @@ HTMLTABLE;
$rtn[] = implode('
WHEN
', $condition);
var_dump($rtn);
//die();
//return $rtn;
}
public function getWhereAds(){
$rtn = array();
$whereStr = NO_STRING;
if($this -> getType() == TYPE_IMAGE_MANAGER || $this -> getType() == TYPE_SEARCH){
if($this -> slocation != NO_STRING){
$whereStr .= '
AND
ads_location
=
(
\
')'
.
$this
->
slocation
.
'(\')'
;
}
else
{
$whereStr
.=
' AND ads_location = (\')login(\')'
;
}
if
(
$this
->
slanguage
!=
NO_STRING
){
$whereStr
.=
' AND language = (\')'
.
$this
->
slanguage
.
'(\')'
;
}
else
{
$whereStr
.=
' AND language = (\')en(\')'
;
}
}
elseif
(
$this
->
getType
()
==
TYPE_DELETE
||
$this
->
getType
()
==
TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE
){
$whereStr
.=
' AND ads_location = (\')'
.
$this
->
location
.
'(\')'
;
$whereStr
.=
' AND language = (\')'
.
$this
->
language
.
'(\')'
;
switch($this -> getType()){
case TYPE_IMAGE_MANAGER:
case TYPE_SEARCH:
if($this -> slocation != NO_STRING){
$whereStr .= '
AND
ads_location
=
(
\
')'
.
$this
->
slocation
.
'(\')'
;
}
else
{
$whereStr
.=
' AND ads_location = (\')login(\')'
;
}
if
(
$this
->
slanguage
!=
NO_STRING
){
$whereStr
.=
' AND language = (\')'
.
$this
->
slanguage
.
'(\')'
;
}
else
{
$whereStr
.=
' AND language = (\')en(\')'
;
}
break
;
case
TYPE_DELETE
:
case
TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE
:
case
TYPE_UPDATE
:
$whereStr
.=
' AND ads_location = (\')'
.
$this
->
location
.
'(\')'
;
$whereStr
.=
' AND language = (\')'
.
$this
->
language
.
'(\')'
;
break
;
}
$rtn
[]
=
$whereStr
;
return
$rtn
;
}
public
function
getDeleteData
(){
...
...
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