Completed
Push — master ( 0424ea...923121 )
by Michael
03:57
created

modify.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 50 and the first side effect is on line 23.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/*
3
-------------------------------------------------------------------------
4
                     ADSLIGHT 2 : Module for Xoops
5
6
        Redesigned and ameliorate By Luc Bizet user at www.frxoops.org
7
        Started with the Classifieds module and made MANY changes
8
        Website : http://www.luc-bizet.fr
9
        Contact : [email protected]
10
-------------------------------------------------------------------------
11
             Original credits below Version History
12
##########################################################################
13
#                    Classified Module for Xoops                         #
14
#  By John Mordo user jlm69 at www.xoops.org and www.jlmzone.com         #
15
#      Started with the MyAds module and made MANY changes               #
16
##########################################################################
17
 Original Author: Pascal Le Boustouller
18
 Author Website : [email protected]
19
 Licence Type   : GPL
20
-------------------------------------------------------------------------
21
*/
22
23
include_once __DIR__ . '/header.php';
24
$moduleDirName = basename(__DIR__);
25
$main_lang     = '_' . strtoupper($moduleDirName);
26
require_once(XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php');
27
$myts      = MyTextSanitizer::getInstance();
28
$module_id = $xoopsModule->getVar('mid');
29
30
if (is_object($xoopsUser)) {
31
    $groups = $xoopsUser->getGroups();
32
} else {
33
    $groups = XOOPS_GROUP_ANONYMOUS;
34
}
35
$gperm_handler = xoops_getHandler('groupperm');
36
if (isset($_POST['item_id'])) {
37
    $perm_itemid = (int)$_POST['item_id'];
38
} else {
39
    $perm_itemid = 0;
40
}
41
//If no access
42 View Code Duplication
if (!$gperm_handler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
1 ignored issue
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
43
    redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
44
}
45
46
/**
47
 * @param $lid
48
 * @param $ok
49
 */
50
function ListingDel($lid, $ok)
0 ignored issues
show
The function ListingDel() has been defined more than once; this definition is ignored, only the first definition in admin/modify_ads.php (L355-388) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
51
{
52
    global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsTheme, $xoopsLogger, $moduleDirName, $main_lang;
53
54
    $result = $xoopsDB->query('select usid FROM ' . $xoopsDB->prefix('adslight_listing') . ' where lid=' . $xoopsDB->escape($lid) . '');
55
    list($usid) = $xoopsDB->fetchRow($result);
56
57
    $result1 = $xoopsDB->query('select url FROM ' . $xoopsDB->prefix('adslight_pictures') . ' where lid=' . $xoopsDB->escape($lid) . '');
58
59
    if ($xoopsUser) {
60
        $currentid = $xoopsUser->getVar('uid', 'E');
61
        if ($usid == $currentid) {
62
            if ($ok == 1) {
63
                while (list($purl) = $xoopsDB->fetchRow($result1)) {
64
                    if ($purl) {
65
                        $destination = XOOPS_ROOT_PATH . '/uploads/AdsLight';
66
                        if (file_exists("$destination/$purl")) {
67
                            unlink("$destination/$purl");
68
                        }
69
                        $destination2 = XOOPS_ROOT_PATH . '/uploads/AdsLight/thumbs';
70
                        if (file_exists("$destination2/thumb_$purl")) {
71
                            unlink("$destination2/thumb_$purl");
72
                        }
73
                        $destination3 = XOOPS_ROOT_PATH . '/uploads/AdsLight/midsize';
74
                        if (file_exists("$destination3/resized_$purl")) {
75
                            unlink("$destination3/resized_$purl");
76
                        }
77
78
                        $xoopsDB->queryF('delete from ' . $xoopsDB->prefix('adslight_pictures') . ' where lid=' . $xoopsDB->escape($lid) . '');
79
                    }
80
                }
81
                $xoopsDB->queryF('delete from ' . $xoopsDB->prefix('adslight_listing') . ' where lid=' . $xoopsDB->escape($lid) . '');
82
                redirect_header('index.php', 1, _ADSLIGHT_ANNDEL);
83
            } else {
84
                echo "<table width='100%' border='0' cellspacing='1' cellpadding='8'><tr class='bg4'><td valign='top'>\n";
85
                echo '<br><center>';
86
                echo '<strong>' . _ADSLIGHT_SURDELANN . '</strong><br><br>';
87
            }
88
            echo "[ <a href=\"modify.php?op=ListingDel&amp;lid=" . $lid . "&amp;ok=1\">" . _ADSLIGHT_OUI . "</a> | <a href=\"index.php\">" . _ADSLIGHT_NON . '</a> ]<br><br>';
89
            echo '</td></tr></table>';
90
        }
91
    }
92
}
93
94
/**
95
 * @param $r_lid
96
 * @param $ok
97
 */
98
function DelReply($r_lid, $ok)
99
{
100
    global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsTheme, $xoopsLogger, $moduleDirName, $main_lang;
101
102
    $result = $xoopsDB->query('select l.usid, r.r_lid, r.lid, r.title, r.date, r.submitter, r.message, r.tele, r.email, r.r_usid FROM ' .
103
                              $xoopsDB->prefix('adslight_listing') .
104
                              ' l LEFT JOIN ' .
105
                              $xoopsDB->prefix('adslight_replies') .
106
                              ' r ON l.lid=r.lid  where r.r_lid=' .
107
                              $xoopsDB->escape($r_lid) .
108
                              '');
109
    list($usid, $r_lid, $rlid, $title, $date, $submitter, $message, $tele, $email, $r_usid) = $xoopsDB->fetchRow($result);
110
111
    if ($xoopsUser) {
112
        $currentid = $xoopsUser->getVar('uid', 'E');
113
        if ($usid == $currentid) {
114
            if ($ok == 1) {
115
                $xoopsDB->queryF('delete from ' . $xoopsDB->prefix('adslight_replies') . ' where r_lid=' . $xoopsDB->escape($r_lid) . '');
116
                redirect_header('members.php?usid=' . addslashes($usid) . '', 1, _ADSLIGHT_ANNDEL);
117
            } else {
118
                echo "<table width='100%' border='0' cellspacing='1' cellpadding='8'><tr class='bg4'><td valign='top'>\n";
119
                echo '<br><center>';
120
                echo '<strong>' . _ADSLIGHT_SURDELANN . '</strong><br><br>';
121
            }
122
            echo "[ <a href=\"modify.php?op=DelReply&amp;r_lid=" .
123
                 addslashes($r_lid) .
124
                 "&amp;ok=1\">" .
125
                 _ADSLIGHT_OUI .
126
                 "</a> | <a href=\"members.php?usid=" .
127
                 addslashes($usid) .
128
                 "\">" .
129
                 _ADSLIGHT_NON .
130
                 '</a> ]<br><br>';
131
            echo '</td></tr></table>';
132
        }
133
    }
134
}
135
136
/**
137
 * @param $lid
138
 */
139
function ModAd($lid)
140
{
141
    global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsTheme, $myts, $xoopsLogger, $moduleDirName, $main_lang;
142
143
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
144
    include_once XOOPS_ROOT_PATH . '/modules/adslight/include/functions.php';
145
    echo "<script language=\"javascript\">\nfunction CLA(CLA) { var MainWindow = window.open (CLA, \"_blank\",\"width=500,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no\");}\n</script>";
146
147
    include_once(XOOPS_ROOT_PATH . '/modules/adslight/class/classifiedstree.php');
148
    $mytree = new ClassifiedsTree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
149
150
    $result = $xoopsDB->query('select lid, cid, title, status, expire, type, desctext, tel, price, typeprice, typeusure, date, email, submitter, usid, town, country, contactby, premium, valid from ' .
151
                              $xoopsDB->prefix('adslight_listing') .
152
                              ' where lid=' .
153
                              $xoopsDB->escape($lid) .
154
                              '');
155
    list($lid, $cide, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town, $country, $contactby, $premium, $valid) =
156
        $xoopsDB->fetchRow($result);
157
158
    $categories = adslight_MygetItemIds('adslight_submit');
159 View Code Duplication
    if (is_array($categories) && count($categories) > 0) {
160
        if (!in_array($cide, $categories)) {
161
            redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
162
        }
163
    } else {    // User can't see any category
164
        redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
165
    }
166
167
    if ($xoopsUser) {
168
        $calusern = $xoopsUser->uid();
169
        if ($usid == $calusern) {
170
            echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADSLIGHT_MODIFANN . '</legend><br><br>';
171
            $title      = $myts->htmlSpecialChars($title);
172
            $status     = $myts->htmlSpecialChars($status);
173
            $expire     = $myts->htmlSpecialChars($expire);
174
            $type       = $myts->htmlSpecialChars($type);
175
            $desctext   = $myts->displayTarea($desctext, 1);
176
            $tel        = $myts->htmlSpecialChars($tel);
177
            $price      = number_format($price, 2, ',', ' ');
178
            $typeprice  = $myts->htmlSpecialChars($typeprice);
179
            $typeusure  = $myts->htmlSpecialChars($typeusure);
180
            $submitter  = $myts->htmlSpecialChars($submitter);
181
            $town       = $myts->htmlSpecialChars($town);
182
            $country    = $myts->htmlSpecialChars($country);
183
            $contactby  = $myts->htmlSpecialChars($contactby);
184
            $premium    = $myts->htmlSpecialChars($premium);
185
            $useroffset = '';
186 View Code Duplication
            if ($xoopsUser) {
187
                $timezone = $xoopsUser->timezone();
188
                if (isset($timezone)) {
189
                    $useroffset = $xoopsUser->timezone();
190
                } else {
191
                    $useroffset = $xoopsConfig['default_TZ'];
192
                }
193
            }
194
            $dates = ($useroffset * 3600) + $date;
195
            $dates = formatTimestamp($date, 's');
196
197
            echo "<form action=\"modify.php\" method=post enctype=\"multipart/form-data\">
198
    <table><tr class=\"head\" border=\"2\">
199
    <td class=\"head\">" . _ADSLIGHT_NUMANNN . " </td><td class=\"head\" border=\"1\">$lid " . _ADSLIGHT_DU . " $dates</td>
200
    </tr><tr>";
201
202
            if ($xoopsModuleConfig['adslight_diff_name'] == '1') {
203
                echo "<td class=\"head\">" . _ADSLIGHT_SENDBY . " </td><td class=\"head\"><input type=\"text\" name=\"submitter\" size=\"50\" value=\"$submitter\" /></td>";
204
            } else {
205
                echo "<td class=\"head\">" . _ADSLIGHT_SENDBY . " </td><td class=\"head\"><input type=\"hidden\" name=\"submitter\" value=\"$submitter\">$submitter</td>";
206
            }
207
            echo '</tr><tr>';
208
209
            if ($contactby == 1) {
210
                $contactselect = _ADSLIGHT_CONTACT_BY_EMAIL;
211
            }
212
            if ($contactby == 2) {
213
                $contactselect = _ADSLIGHT_CONTACT_BY_PM;
214
            }
215
            if ($contactby == 3) {
216
                $contactselect = _ADSLIGHT_CONTACT_BY_BOTH;
217
            }
218
            if ($contactby == 4) {
219
                $contactselect = _ADSLIGHT_CONTACT_BY_PHONE;
220
            }
221
222
            echo " <td class='head'>" . _ADSLIGHT_CONTACTBY . " </td><td class='head'><select name=\"contactby\">
223
    <option value=\"" . $contactby . "\">" . $contactselect . "</option>
224
    <option value=\"1\">" . _ADSLIGHT_CONTACT_BY_EMAIL . "</option>
225
    <option value=\"2\">" . _ADSLIGHT_CONTACT_BY_PM . "</option>
226
    <option value=\"3\">" . _ADSLIGHT_CONTACT_BY_BOTH . "</option>
227
    <option value=\"4\">" . _ADSLIGHT_CONTACT_BY_PHONE . '</option></select></td></tr>';
228
229
            if ($xoopsModuleConfig['adslight_diff_email'] == '1') {
230
                echo "<tr><td class=\"head\">" . _ADSLIGHT_EMAIL . " </td><td class=\"head\"><input type=\"text\" name=\"email\" size=\"50\" value=\"$email\" /></td>";
231
            } else {
232
                echo "<tr><td class=\"head\">" . _ADSLIGHT_EMAIL . " </td><td class=\"head\">$email<input type=\"hidden\" name=\"email\" value=\"$email\" /></td>";
233
            }
234
            echo "</tr><tr>
235
    <td class=\"head\">" . _ADSLIGHT_TEL . " </td><td class=\"head\"><input type=\"text\" name=\"tel\" size=\"50\" value=\"$tel\" /></td>
236
    </tr>";
237
            echo "<tr>
238
    <td class=\"head\">" . _ADSLIGHT_TOWN . " </td><td class=\"head\"><input type=\"text\" name=\"town\" size=\"50\" value=\"$town\" /></td>
239
    </tr>";
240
            if ($xoopsModuleConfig['adslight_use_country'] == '1') {
241
                echo "<tr>
242
    <td class=\"head\">" . _ADSLIGHT_COUNTRY . " </td><td class=\"head\"><input type=\"text\" name=\"country\" size=\"50\" value=\"$country\" /></td>
243
    </tr>";
244
            } else {
245
                echo "<input type=\"hidden\" name=\"country\" value=\"\">";
246
            }
247
248
            echo "<tr><td class='head'>" . _ADSLIGHT_STATUS . "</td><td class='head'><input type=\"radio\" name=\"status\" value=\"0\"";
249
            if ($status == '0') {
250
                echo 'checked';
251
            }
252
            echo '>' . _ADSLIGHT_ACTIVE . "&nbsp;&nbsp; <input type=\"radio\" name=\"status\" value=\"1\"";
253
            if ($status == '1') {
254
                echo 'checked';
255
            }
256
            echo '>' . _ADSLIGHT_INACTIVE . "&nbsp;&nbsp; <input type=\"radio\" name=\"status\" value=\"2\"";
257
            if ($status == '2') {
258
                echo 'checked';
259
            }
260
            echo '>' . _ADSLIGHT_SOLD . '</td></tr>';
261
            echo "<tr>
262
    <td class=\"head\">" . _ADSLIGHT_TITLE2 . " </td><td class=\"head\"><input type=\"text\" name=\"title\" size=\"50\" value=\"$title\" /></td>
263
    </tr>";
264
            echo "<tr><td class=\"head\">" . _ADSLIGHT_PRICE2 . " </td><td class=\"head\"><input type=\"text\" name=\"price\" size=\"20\" value=\"$price\" /> " . $xoopsModuleConfig['adslight_money'];
265
266
            $result3 = $xoopsDB->query('select nom_price, id_price from ' . $xoopsDB->prefix('adslight_price') . ' order by id_price');
267
            echo " <select name=\"typeprice\">";
268
            while (list($nom_price, $id_price) = $xoopsDB->fetchRow($result3)) {
269
                $sel = '';
270
                if ($id_price == $typeprice) {
271
                    $sel = 'selected';
272
                }
273
                echo "<option value=\"$id_price\" $sel>$nom_price</option>";
274
            }
275
            echo '</select></td></tr>';
276
            $module_id = $xoopsModule->getVar('mid');
277
            if (is_object($xoopsUser)) {
278
                $groups = $xoopsUser->getGroups();
279
            } else {
280
                $groups = XOOPS_GROUP_ANONYMOUS;
281
            }
282
            $gperm_handler = xoops_getHandler('groupperm');
283
            if (isset($_POST['item_id'])) {
284
                $perm_itemid = (int)$_POST['item_id'];
285
            } else {
286
                $perm_itemid = 0;
287
            }
288
            //If no access
289
            if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
290
                echo "<tr>
291
    <td width='30%' class='head'>" . _ADSLIGHT_WILL_LAST . " </td><td class='head'>$expire  " . _ADSLIGHT_DAY . '</td>
292
    </tr>';
293
                echo "<input type=\"hidden\" name=\"expire\" value=\"$expire\" />";
294
            } else {
295
                echo "<tr>
296
    <td width='30%' class='head'>" . _ADSLIGHT_HOW_LONG . " </td><td class='head'><input type=\"text\" name=\"expire\" size=\"3\" maxlength=\"3\" value=\"$expire\" />  " . _ADSLIGHT_DAY . '</td>
297
    </tr>';
298
            }
299
300
            /// Type d'annonce
301
            echo "<tr>
302
    <td class=\"head\">" . _ADSLIGHT_TYPE . " </td><td class=\"head\"><select name=\"type\">";
303
304
            $result5 = $xoopsDB->query('select nom_type, id_type from ' . $xoopsDB->prefix('adslight_type') . ' order by nom_type');
305
            while (list($nom_type, $id_type) = $xoopsDB->fetchRow($result5)) {
306
                $sel = '';
307
                if ($id_type == $type) {
308
                    $sel = 'selected';
309
                }
310
                echo "<option value=\"$id_type\" $sel>$nom_type</option>";
311
            }
312
            echo '</select></td></tr>';
313
314
            /// Etat de l'objet
315
            echo "<tr>
316
    <td class=\"head\">" . _ADSLIGHT_TYPE_USURE . " </td><td class=\"head\"><select name=\"typeusure\">";
317
318
            $result6 = $xoopsDB->query('select nom_usure, id_usure from ' . $xoopsDB->prefix('adslight_usure') . ' order by nom_usure');
319
            while (list($nom_usure, $id_usure) = $xoopsDB->fetchRow($result6)) {
320
                $sel = '';
321
                if ($id_usure == $typeusure) {
322
                    $sel = 'selected';
323
                }
324
                echo "<option value=\"$id_usure\" $sel>$nom_usure</option>";
325
            }
326
            echo '</select></td></tr>';
327
328
            echo "<tr>
329
    <td class=\"head\">" . _ADSLIGHT_CAT . " </td><td class=\"head\">";
330
            $mytree->makeMySelBox('title', 'title', $cide, '', 'cid');
331
            echo "</td>
332
    </tr><tr>
333
    <td class=\"head\">" . _ADSLIGHT_DESC . " </td><td class=\"head\">";
334
            $wysiwyg_text_area = adslight_getEditor(_ADSLIGHT_DESC, 'desctext', $desctext, '100%', '200px');
335
            echo $wysiwyg_text_area->render();
336
            echo "</td></tr>
337
    <td colspan=2><br><input type=\"submit\" value=\"" . _ADSLIGHT_MODIFANN . "\" /></td>
338
    </tr></table>";
339
            echo "<input type=\"hidden\" name=\"op\" value=\"ModAdS\" />";
340
341
            $module_id = $xoopsModule->getVar('mid');
342
            if (is_object($xoopsUser)) {
343
                $groups = $xoopsUser->getGroups();
344
            } else {
345
                $groups = XOOPS_GROUP_ANONYMOUS;
346
            }
347
            $gperm_handler = xoops_getHandler('groupperm');
348
            if (isset($_POST['item_id'])) {
349
                $perm_itemid = (int)$_POST['item_id'];
350
            } else {
351
                $perm_itemid = 0;
352
            }
353
            //If no access
354
            if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
355
                if ($xoopsModuleConfig['adslight_moderated'] == '1') {
356
                    echo "<input type=\"hidden\" name=\"valid\" value=\"No\" />";
357
                    echo '<br>' . _ADSLIGHT_MODIFBEFORE . '<br>';
358
                } else {
359
                    echo "<input type=\"hidden\" name=\"valid\" value=\"Yes\" />";
360
                }
361
            } else {
362
                echo "<input type=\"hidden\" name=\"valid\" value=\"Yes\" />";
363
            }
364
            echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\" />";
365
            echo "<input type=\"hidden\" name=\"premium\" value=\"$premium\" />";
366
            echo "<input type=\"hidden\" name=\"date\" value=\"$date\" />
367
    " . $GLOBALS['xoopsGTicket']->getTicketHtml(__LINE__, 1800, 'token') . '';
368
            echo '</form><br></fieldset><br>';
369
        }
370
    }
371
}
372
373
/**
374
 * @param $lid
375
 * @param $cat
376
 * @param $title
377
 * @param $status
378
 * @param $expire
379
 * @param $type
380
 * @param $desctext
381
 * @param $tel
382
 * @param $price
383
 * @param $typeprice
384
 * @param $typeusure
385
 * @param $date
386
 * @param $email
387
 * @param $submitter
388
 * @param $town
389
 * @param $country
390
 * @param $contactby
391
 * @param $premium
392
 * @param $valid
393
 */
394
function ModAdS($lid, $cat, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $town, $country, $contactby, $premium, $valid)
395
{
396
    global $xoopsDB, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsLogger, $moduleDirName, $main_lang, $xoopsGTicket;
397
398
    if (!$xoopsGTicket->check(true, 'token')) {
399
        redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, $xoopsGTicket->getErrors());
400
    }
401
    $title     = $myts->addSlashes($title);
402
    $status    = $myts->addSlashes($status);
403
    $expire    = $myts->addSlashes($expire);
404
    $type      = $myts->addSlashes($type);
405
    $desctext  = $myts->displayTarea($desctext, 1, 1, 1, 1, 1);
406
    $tel       = $myts->addSlashes($tel);
407
    $price     = str_replace(array(' '), '', $price);
408
    $typeprice = $myts->addSlashes($typeprice);
409
    $typeusure = $myts->addSlashes($typeusure);
410
    $submitter = $myts->addSlashes($submitter);
411
    $town      = $myts->addSlashes($town);
412
    $country   = $myts->addSlashes($country);
413
    $contactby = $myts->addSlashes($contactby);
414
    $premium   = $myts->addSlashes($premium);
415
416
    $xoopsDB->query('update ' .
417
                    $xoopsDB->prefix('adslight_listing') .
418
                    " set cid='$cat', title='$title', status='$status',  expire='$expire', type='$type', desctext='$desctext', tel='$tel', price='$price', typeprice='$typeprice', typeusure='$typeusure', email='$email', submitter='$submitter', town='$town', country='$country', contactby='$contactby', premium='$premium', valid='$valid' where lid=$lid");
419
420
    redirect_header('index.php', 1, _ADSLIGHT_ANNMOD2);
421
}
422
423
####################################################
424
foreach ($_POST as $k => $v) {
425
    ${$k} = $v;
426
}
427
$ok = isset($_GET['ok']) ? $_GET['ok'] : '';
428
429
if (!isset($_POST['lid']) && isset($_GET['lid'])) {
430
    $lid = $_GET['lid'];
431
}
432
if (!isset($_POST['r_lid']) && isset($_GET['r_lid'])) {
433
    $r_lid = $_GET['r_lid'];
434
}
435
if (!isset($_POST['op']) && isset($_GET['op'])) {
436
    $op = $_GET['op'];
437
}
438
switch ($op) {
439
440
    case 'ModAd':
441
        include(XOOPS_ROOT_PATH . '/header.php');
442
        ModAd($lid);
443
        include(XOOPS_ROOT_PATH . '/footer.php');
444
        break;
445
446
    case 'ModAdS':
447
        ModAdS($lid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $town, $country, $contactby, $premium, $valid);
448
        break;
449
450
    case 'ListingDel':
451
        include(XOOPS_ROOT_PATH . '/header.php');
452
        ListingDel($lid, $ok);
453
        include(XOOPS_ROOT_PATH . '/footer.php');
454
        break;
455
456
    case 'DelReply':
457
        include(XOOPS_ROOT_PATH . '/header.php');
458
        DelReply($r_lid, $ok);
459
        include(XOOPS_ROOT_PATH . '/footer.php');
460
        break;
461
462
    default:
463
        redirect_header('index.php', 1, '' . _RETURNANN . '');
464
        break;
465
}
466