Code Duplication    Length = 14-15 lines in 8 locations

admin/martin.auction.php 1 location

@@ 105-118 (lines=14) @@
102
103
        redirect_header($redirect_to, 2, $redirect_msg);
104
        break;
105
    case "del":
106
        if (!$confirm) {
107
            xoops_confirm(array('op' => 'del', 'id' => $auctionObj->auction_id(), 'confirm' => 1, 'name' => $auctionObj->auction_name()), '?action=del', "删除 '" . $auctionObj->auction_name() . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_THE_BID, _DELETE);
108
        } else {
109
            if ($auction_handler->delete($auctionObj)) {
110
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
111
                $redirect_to  = "martin.auction.php";
112
            } else {
113
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
114
                $redirect_to  = "javascript:history.go(-1);";
115
            }
116
            redirect_header($redirect_to, 2, $redirect_msg);
117
        }
118
        break;
119
    case "list":
120
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_AUCTION_LIST, _AM_MARTIN_AUCTION_LIST);
121
        CreateButton();

admin/martin.group.php 1 location

@@ 107-120 (lines=14) @@
104
105
        redirect_header($redirect_to, 2, $redirect_msg);
106
        break;
107
    case "del":
108
        if (!$confirm) {
109
            xoops_confirm(array('op' => 'del', 'id' => $GroupObj->group_id(), 'confirm' => 1, 'name' => $GroupObj->group_name()), '?action=del', "删除 '" . $GroupObj->group_name() . "'. <br /> <br /> 确定删除该团购吗?", _DELETE);
110
        } else {
111
            if ($group_handler->delete($GroupObj)) {
112
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
113
                $redirect_to  = "martin.group.php";
114
            } else {
115
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
116
                $redirect_to  = "javascript:history.go(-1);";
117
            }
118
            redirect_header($redirect_to, 2, $redirect_msg);
119
        }
120
        break;
121
    case "list":
122
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_CUSTOMERS_LIST, _AM_MARTIN_CUSTOMERS_LIST);
123
        CreateButton();

admin/martin.hotel.city.php 1 location

@@ 76-89 (lines=14) @@
73
        }
74
        redirect_header($redirect_to, 2, $redirect_msg);
75
        break;
76
    case "del":
77
        if (!$confirm) {
78
            xoops_confirm(array('op' => 'del', 'id' => $HotelCityObj->city_id(), 'confirm' => 1, 'name' => $HotelCityObj->city_name()), '?action=del', _DELETE . " '" . $HotelCityObj->city_name() . "'. <br /> <br />"._AM_MARTIN_OK_TO_DELETE_THE_DISTRICTS, _DELETE);
79
        } else {
80
            if ($hotelcity_handler->delete($HotelCityObj)) {
81
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
82
                $redirect_to  = "martin.hotel.city.php";
83
            } else {
84
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
85
                $redirect_to  = "javascript:history.go(-1);";
86
            }
87
            redirect_header($redirect_to, 2, $redirect_msg);
88
        }
89
        break;
90
    case "list":
91
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_ADD_CITY, _AM_MARTIN_ADD_CITY);
92
        Create_button(array('addcity' => array('url' => 'martin.hotel.city.php?action=add', 'value' => _AM_MARTIN_CITY_NAME)));

admin/martin.hotel.php 1 location

@@ 201-215 (lines=15) @@
198
            unlink($FullImg);
199
        }
200
        break;
201
    case "del":
202
        if (!$confirm) {
203
            xoops_confirm(array('op' => 'del', 'id' => $id, 'confirm' => 1, 'name' => $HotelObj->hotel_name()), '?action=del', _DELETE . " '" . $HotelObj->hotel_name() . "'. <br /> <br />". _AM_MARTIN_OK_TO_DELETE_HOTEL, _DELETE);
204
        } else {
205
            if ($hotel_handler->delete($HotelObj)) {
206
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
207
                $redirect_to  = "martin.hotel.php";
208
            } else {
209
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
210
                $redirect_to  = "javascript:history.go(-1);";
211
            }
212
            redirect_header($redirect_to, 2, $redirect_msg);
213
        }
214
215
        break;
216
    case "list":
217
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_HOTEL_LIST, _AM_MARTIN_HOTEL_LIST);
218
        Create_button(array('addhotel' => array('url' => 'martin.hotel.php?action=add', 'value' => _AM_MARTIN_ADD_HOTEL)));

admin/martin.hotel.promotion.php 1 location

@@ 75-88 (lines=14) @@
72
73
        redirect_header($redirect_to, 2, $redirect_msg);
74
        break;
75
    case "del":
76
        if (!$confirm) {
77
            xoops_confirm(array('op' => 'del', 'id' => $PromotionObj->promotion_id(), 'confirm' => 1, 'name' => $PromotionObj->hotel_name()), '?action=del', "删除 '" . $PromotionObj->hotel_name() . "'. <br /> <br /> 确定删除该促销吗?", _DELETE);
78
        } else {
79
            if ($promotion_handler->delete($PromotionObj)) {
80
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
81
                $redirect_to  = "martin.hotel.promotion.php";
82
            } else {
83
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
84
                $redirect_to  = "javascript:history.go(-1);";
85
            }
86
            redirect_header($redirect_to, 2, $redirect_msg);
87
        }
88
        break;
89
    case "list":
90
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_PROMO_LIST, _AM_MARTIN_PROMO_LIST);
91
        CreateButton();

admin/martin.hotel.service.php 2 locations

@@ 125-138 (lines=14) @@
122
        redirect_header($redirect_to, 2, $redirect_msg);
123
124
        break;
125
    case "del":
126
        if (!$confirm) {
127
            xoops_confirm(array('op' => 'del', 'id' => $id, 'confirm' => 1, 'name' => $HotelServiceObj->service_name()), '?action=del', _DELETE . " '" . $HotelServiceObj->service_name() . "'. <br /> <br /> ". _AM_MARTIN_OK_TO_DELETE_SERVICE, _DELETE);
128
        } else {
129
            if ($hotelservice_handler->delete($HotelServiceObj)) {
130
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
131
                $redirect_to  = "martin.hotel.service.php";
132
            } else {
133
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
134
                $redirect_to  = "javascript:history.go(-1);";
135
            }
136
            redirect_header($redirect_to, 2, $redirect_msg);
137
        }
138
        break;
139
    case "typedel":
140
        if (!$confirm) {
141
            xoops_confirm(array('op' => 'del', 'typeid' => $typeid, 'confirm' => 1, 'name' => $HotelServiceTypeObj->service_type_name()), '?action=typedel', _DELETE . " '" . $HotelServiceTypeObj->service_type_name() . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_SERVICE_CATEGORY, _DELETE);
@@ 139-152 (lines=14) @@
136
            redirect_header($redirect_to, 2, $redirect_msg);
137
        }
138
        break;
139
    case "typedel":
140
        if (!$confirm) {
141
            xoops_confirm(array('op' => 'del', 'typeid' => $typeid, 'confirm' => 1, 'name' => $HotelServiceTypeObj->service_type_name()), '?action=typedel', _DELETE . " '" . $HotelServiceTypeObj->service_type_name() . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_SERVICE_CATEGORY, _DELETE);
142
        } else {
143
            if ($hotelservicetype_handler->delete($HotelServiceTypeObj)) {
144
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
145
                $redirect_to  = "martin.hotel.service.php?action=typelist";
146
            } else {
147
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
148
                $redirect_to  = "javascript:history.go(-1);";
149
            }
150
            redirect_header($redirect_to, 2, $redirect_msg);
151
        }
152
        break;
153
    case "hoteldel":
154
        $Relation = $hotelservice_handler->getHotelServiceRelation($hotel_id, $service_id);
155
        if (!$confirm) {

admin/martin.room.php 1 location

@@ 170-183 (lines=14) @@
167
        redirect_header($redirect_to, 2, $redirect_msg);
168
169
        break;
170
    case "del":
171
        if (!$confirm) {
172
            xoops_confirm(array('op' => 'del', 'id' => $id, 'confirm' => 1, 'name' => $RoomObj->room_name()), '?action=del', __DELETE . " '" . $RoomObj->room_name() . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_ROOM, _DELETE);
173
        } else {
174
            if ($room_handler->delete($RoomObj)) {
175
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
176
                $redirect_to  = "martin.room.php";
177
            } else {
178
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
179
                $redirect_to  = "javascript:history.go(-1);";
180
            }
181
            redirect_header($redirect_to, 2, $redirect_msg);
182
        }
183
        break;
184
    case "typedel":
185
        $roomType = $room_handler->getRoomTypeList($typeid);
186
        if (!$confirm) {