|
134 | 134 | </div> |
135 | 135 | </div> |
136 | 136 |
|
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +<div class="modal fade" id="delorder_modal" tabindex="-1" role="dialog" aria-labelledby="product_modal_title" aria-hidden="true"> |
| 141 | + <div class="modal-dialog modal-lg" role="document"> |
| 142 | + <div class="modal-content"> |
| 143 | + <div class="modal-header"> |
| 144 | + <h5 class="modal-title" id="harvest_modal_title">Delete this Product</h5> |
| 145 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| 146 | + <span aria-hidden="true">×</span> |
| 147 | + </button> |
| 148 | + </div> |
| 149 | + <div class="modal-body"> |
| 150 | + <div class="text-center"> |
| 151 | + <div class="btn-group"> |
| 152 | + <button type="submit" class="btn btn-danger" id="order_delform">Delete</button> |
| 153 | + <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> |
| 154 | + </div> |
| 155 | + </div> |
| 156 | + </div> |
| 157 | + <div class="modal-footer"> |
| 158 | + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | + </div> |
| 162 | +</div> |
137 | 163 | </div> |
138 | 164 | </main> |
139 | 165 | </div> |
|
230 | 256 |
|
231 | 257 |
|
232 | 258 | }); |
| 259 | + |
| 260 | + $(document).on('click', '.delete', function(){ |
| 261 | + var order_ID = $(this).attr("id"); |
| 262 | + $('#delorder_modal').modal('show'); |
| 263 | + $('.submit').hide(); |
| 264 | + |
| 265 | + $('#order_ID').val(order_ID); |
| 266 | + }); |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + $(document).on('click', '#order_delform', function(event){ |
| 272 | + var order_ID = $('#order_ID').val(); |
| 273 | + |
| 274 | + $.ajax({ |
| 275 | + type : 'POST', |
| 276 | + url:"datatable/order/insert.php", |
| 277 | + data : {operation:"delete_order",order_ID:order_ID}, |
| 278 | + dataType : 'json', |
| 279 | + complete : function(data) { |
| 280 | + $('#delorder_modal').modal('hide'); |
| 281 | + alert(data.responseText); |
| 282 | + dataTable.ajax.reload(); |
| 283 | + |
| 284 | + } |
| 285 | + }) |
| 286 | + |
| 287 | + }); |
| 288 | + |
233 | 289 |
|
234 | 290 | } ); |
235 | 291 |
|
|
0 commit comments