1function isset(obj) {if (typeof obj === 'undefined' || obj === null ){return false;} else {return true;}} 2function modal_close(){var modal = $('.modal');modal.modal('hide');modal.on('hidden.bs.modal', function(e){e.target.remove();})} 3 4function page_history(url,id){ 5 if(isset(id)){ 6 history.pushState({'url':url,'id':id}, null, '/client/' + url + '/' + id); 7 } else history.pushState({'url':url}, null, '/client/' + url); 8} 9 10window.onpopstate = function(event) { 11 if(isset(event.state)){ 12 var url = event.state['url']; 13 var id = event.state['id']; 14 if(url === 'users'){users_aside();users();} 15 if(url === 'user' && id){user_aside();user(id);} 16 if(url === 'products'){users_products();products();} 17 if(url === 'productbrand' && id){products_aside();productbrand(id);} 18 if(url === 'productdiscount' && id){products_aside();productdiscount(id);} 19 if(url === 'productdepartmentgroup' && id){products_aside();productdepartmentgroup(id);} 20 if(url === 'productdepartment' && id){products_aside();productdepartment(id);} 21 if(url === 'product' && id){products_aside();product(id);} 22 if(url === 'productcarts'){productcarts_aside();productcarts();} 23 if(url === 'productcart' && id){productcart_aside();productcart(id);} 24 if(url === 'usercart'){usercart_aside();usercart();} 25 if(url === 'productorders'){productorders_aside();productorders();} 26 if(url === 'productorder' && id){productorder_aside(id);productorder(id);} 27 if(url === 'userorders'){userorders_aside();userorders();} 28 if(url === 'userorder' && id){userorder_aside();userorder(id);} 29 if(url === 'posts'){posts_aside();posts();} 30 if(url === 'post' && id){post_modal(id);} 31 32 } 33} 34 35// LOAD IN APP 36 function users_load() {users();page_history('users');} 37 function user_load(id) {user(id);page_history('user',id);} 38 function products_load() {products();page_history('products');} 39 function productbrand_load(id) {productbrand(id);page_history('productbrand',id);} 40 function productdiscount_load(id) {productdiscount(id);page_history('productdiscount',id);} 41 function productdepartmentgroup_load(id) {productdepartmentgroup(id);page_history('productdepartmentgroup',id);} 42 function productdepartment_load(id) {productdepartment(id);page_history('productdepartment',id);} 43 function product_load(id) {product(id);page_history('product',id);} 44 function productcarts_load() {productcarts();page_history('productcarts');} 45 function productcart_load(id) {productcart(id);page_history('productcart',id);} 46 function usercart_load(id) {usercart();page_history('usercart');} 47 function productorders_load() {productorders();page_history('productorders');} 48 function productorder_load(id) {productorder(id);page_history('productorder',id);} 49 function userorders_load() {userorders();page_history('userorders');} 50 function userorder_load(id) {userorder(id);page_history('userorder',id);} 51 function posts_load() {posts();page_history('posts');} 52 function post_modal_load(id) {post_modal(id);page_history('post',id);} 53 54 55 function users_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-users/users-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 56 function users() {jQuery.ajax({type: "POST",url: "/client/php/app-users/users.php",dataType: "text",data: {"url": 0},success: function(data) {$('#kt_content_container').html(data);},});} 57 58 function products_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-products/products-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 59 function products() {jQuery.ajax({type: "POST",url: "/client/php/app-products/products.php",dataType: "text",data: {"url": 0},success: function(data) {$('#kt_content_container').html(data);},});} 60 function productbrand(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productbrand/productbrand.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 61 function productdiscount(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productdiscount/productdiscount.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 62 function productdepartmentgroup(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productdepartmentgroup/productdepartmentgroup.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 63 function productdepartment(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productdepartment/productdepartment.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 64 function product(id) {jQuery.ajax({type: "POST",url: "/client/php/app-product/product.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 65 66 function productcarts_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-productcarts/productcarts-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 67 function productcarts() {jQuery.ajax({type: "POST",url: "/client/php/app-productcarts/productcarts.php",dataType: "text",data: {"url": 0},success: function(data) {$('#kt_content_container').html(data);},});} 68 function productcart_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-productcart/productcart-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 69 function productcart(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productcart/productcart.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 70 71 function usercart_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-usercart/usercart-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 72 function usercart() {jQuery.ajax({type: "POST",url: "/client/php/app-usercart/usercart.php",dataType: "text",data: {"id": 0},success: function(data) {$('#kt_content_container').html(data);},});} 73 74 function productorders_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-productorders/productorders-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 75 function productorders() {jQuery.ajax({type: "POST",url: "/client/php/app-productorders/productorders.p
75hp",dataType: "text",data: {"url": 0},success: function(data) {$('#kt_content_container').html(data);},});} 76 function productorder_aside(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productorder/productorder-aside.php",dataType: "text",data: {"id": id},success: function(data) {$('#aside-secondary').html(data);},});} 77 function productorder(id) {jQuery.ajax({type: "POST",url: "/client/php/app-productorder/productorder.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 78 79 function userorders_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-userorders/userorders-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 80 function userorders() {jQuery.ajax({type: "POST",url: "/client/php/app-userorders/userorders.php",dataType: "text",data: {"url": 0},success: function(data) {$('#kt_content_container').html(data);},});} 81 function userorder_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-userorder/userorder-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 82 function userorder(id) {jQuery.ajax({type: "POST",url: "/client/php/app-userorder/userorder.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 83 84 function user_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-user/user-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 85 function user(id) {jQuery.ajax({type: "POST",url: "/client/php/app-user/user.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 86 87 function posts_aside() {jQuery.ajax({type: "POST",url: "/client/php/app-posts/posts-aside.php",dataType: "text",data: {"url": 0},success: function(data) {$('#aside-secondary').html(data);},});} 88 function posts() {jQuery.ajax({type: "POST",url: "/client/php/app-posts/posts.php",dataType: "text",data: {"url": 0},success: function(data) {$('#kt_content_container').html(data);},});} 89 //function post_modal(id) {jQuery.ajax({type: "POST",url: "/client/php/app-post/post-modal.php",dataType: "text",data: {"id": id},success: function(data) {$('#kt_content_container').html(data);},});} 90 91 function post_modal(id) { 92 93 var url_prev = document.location.href; 94 var state_prev = history.state; 95 var title_prev = $(document).attr("title"); 96 97 jQuery.ajax({ 98 type: 'POST', 99 url: '/client/php/app-post/post-modal.php', 100 dataType: 'text', 101 data: { 102 'url': "post", 103 'id': id, 104 'url_prev': url_prev, 105 'state_prev': state_prev, 106 'title_prev': title_prev 107 }, 108 success: function(data) { 109 $('body').append(data); 110 var modal = $('#post_modal'); 111 modal.modal('show'); 112 modal.on('shown.bs.modal', function(e) { 113 //$('#productdiscount_title').trigger('focus'); 114 }); 115 modal.on('hidden.bs.modal', function(e) { 116 e.target.remove(); 117 $('div').remove('.note-modal'); 118 }); 119 document.querySelector('.modal').addEventListener('click', function(e) { 120 if (e.target === e.currentTarget) { 121 history.pushState(state_prev, null, url_prev); 122 $(document).attr('title', title_prev); 123 124 } 125 }); 126 }, 127 }); 128 } 129 130 131// PRODUCT DISCOUNT 132 function productdiscount_create_modal(user_id) { 133 jQuery.ajax({ 134 type: 'POST', 135 url: '/client/php/app-productdiscount/productdiscount-create-modal.php', 136 dataType: 'text', 137 data: { 138 'user_id': user_id 139 }, 140 success: function(data) { 141 $('body').append(data); 142 var modal = $('#productdiscount_create_modal'); 143 modal.modal('show'); 144 modal.on('shown.bs.modal', function(e) { 145 $('#productdiscount_title').trigger('focus'); 146 }); 147 modal.on('hidden.bs.modal', function(e) { 148 e.target.remove(); 149 $('div').remove('.note-modal'); 150 }); 151 }, 152 }); 153 } 154 function productdiscount_edit_modal(id) { 155 jQuery.ajax({ 156 type: 'POST', 157 url: '/client/php/app-productdiscount/productdiscount-edit-modal.php', 158 dataType: 'text', 159 data: { 160 'id': id 161 }, 162 success: function(data) { 163 $('body').append(data); 164 var modal = $('#productdiscount_edit_modal'); 165 modal.modal('show'); 166 modal.on('shown.bs.modal', function(e) { 167 $('#productdiscount_title').trigger('focus'); 168 }); 169 modal.on('hidden.bs.modal', function(e) { 170 e.target.remove(); 171 $('div').remove('.note-modal'); 172 }); 173 }, 174 }); 175 } 176 function productdiscount_del_modal(id) { 177 jQuery.ajax({ 178 type: 'POST', 179 url: '/client/php/app-productdiscount/productdiscount-del-modal.php', 180 dataType: 'text', 181 data: { 182 'id': id 183 }, 184 success: function(data) { 185 $('body').append(data); 186 var modal = $('#productdiscount_del_modal'); 187 modal.modal('show'); 188 modal.on('hidden.bs.modal', function(e) { 189 e.target.remove(); 190 $('div').remove('.note-modal'); 191 }); 192 }, 193 }); 194 } 195// PRODUCT DISCOUNT 196 197// PRODUCT BRAND 198 function productbrand_create_modal(user_id) { 199 jQuery.ajax({ 200 type: 'POST', 201 url: '/client/php/app-productbrand/productbrand-create-modal.php', 202 dataType: 'text', 203 data: { 204 'user_id': user_id 205 }, 206 success: function(data) { 207 $('body').append(data); 208 var modal = $('#productbrand_create_modal'); 209 modal.modal('show'); 210 modal.on('shown.bs.modal', function(e) { 211 $('#productbrand_title').trigger('focus'); 212 }); 213 modal.on('hidden.bs.modal', function(e) { 214 e.target.remove(); 215 $('div').remove('.note-modal'); 216 }); 217 }, 218 }); 219 } 220 function productbrand_edit_modal(id) { 221 jQuery.ajax({ 222 type: 'POST', 223 url: '/client/php/app-productbrand/productbrand-edit-modal.php', 224 dataType: 'text', 225 data: { 226 'id': id 227 }, 228 success: function(data) { 229 $('body').append(data); 230 var modal = $('#productbrand_edit_modal'); 231 modal.modal('show'); 232 modal.on('shown.bs.modal', function(e) { 233 $('#productbrand_title').trigger('focus'); 234 }); 235 modal.on('hidden.bs.modal', function(e) { 236 e.target.remove(); 237 $('div').remove('.note-modal'); 238 }); 239 }, 240 }); 241 } 242 function productbrand_del_modal(id) { 243 jQuery.ajax({ 244 type: 'POST', 245 url: '/client/php/app-productbrand/productbrand-del-modal.php', 246 dataType: 'text', 247 data: { 248 'id': id 249 }, 250 success: function(data) { 251 $('body').append(data); 252 var modal = $('#productbrand_del_modal'); 253 modal.modal('show'); 254 modal.on('hidden.bs.modal', function(e) { 255 e.target.remove(); 256 $('div').remove('.note-modal'); 257 }); 258 }, 259 }); 260 } 261// PRODUCT BRAND 262 263// PRODUCT DEPARTMENT GROUP 264 function productdepartmentgroup_create_modal(user_id) { 265 jQuery.ajax({ 266 type: 'POST', 267 url: '/client/php/app-productdepartmentgroup/productdepartmentgroup-create-modal.php', 268 dataType: 'text', 269 data: { 270 'user_id': user_id 271 }, 272 success: function(data) { 273 $('body').append(data); 274 var modal = $('#productdepartmentgroup_create_modal'); 275 modal.modal('show'); 276 modal.on('shown.bs.modal', function(e) { 277 $('#productdepartmentgroup_title').trigger('focus'); 278 }); 279 modal.on('hidden.bs.modal', function(e) { 280 e.target.remove(); 281 $('div').remove('.note-modal'); 282 }); 283 }, 284 }); 285 } 286 function productdepartmentgroup_edit_modal(id) { 287 jQuery.ajax({ 288 type: 'POST', 289 url: '/client/php/app-productdepartmentgroup/productdepartmentgroup-edit-modal.php', 290 dataType: 'text', 291 data: { 292 'id': id 293 }, 294 success: function(data) { 295 $('body').append(data); 296 var modal = $('#productdepartmentgroup_edit_modal'); 297 modal.modal('show'); 298 modal.on('shown.bs.modal', function(e) { 299 $('#productdepartmentgroup_title').trigger('focus'); 300 }); 301 modal.on('hidden.bs.modal', function(e) { 302 e.target.remove(); 303 $('div').remove('.note-modal'); 304 }); 305 }, 306 }); 307 } 308 function productdepartmentgroup_del_modal(id) { 309 jQuery.ajax({ 310 type: 'POST', 311 url: '/client/php/app-productdepartmentgroup/productdepartmentgroup-del-modal.php', 312 dataType: 'text', 313 data: { 314 'id': id 315 }, 316 success: function(data) { 317 $('body').append(data); 318 var modal = $('#productdepartmentgroup_del_modal'); 319 modal.modal('show'); 320 modal.on('hidden.bs.modal', function(e) { 321 e.target.remove(); 322 $('div').remove('.note-modal'); 323 }); 324 }, 325 }); 326 } 327// PRODUCT DEPARTMENT GROUP 328 329// PRODUCT DEPARTMENT 330 function productdepartment_create_modal(productdepartmentgroup_id) { 331 jQuery.ajax({ 332 type: 'POST', 333 url: '/client/php/app-productdepartment/productdepartment-create-modal.php', 334 dataType: 'text', 335 data: { 336 'productdepartmentgroup_id': productdepartmentgroup_id 337 }, 338 success: function(data) { 339 $('body').append(data); 340 var modal = $('#productdepartment_create_modal'); 341 modal.modal('show'); 342 modal.on('shown.bs.modal', function(e) { 343 $('#productdepartment_title').trigger('focus'); 344 }); 345 modal.on('hidden.bs.modal', function(e) { 346 e.target.remove(); 347 $('div').remove('.note-modal'); 348 }); 349 }, 350 }); 351 } 352 function productdepartment_edit_modal(id) { 353 jQuery.ajax({ 354 type: 'POST', 355 url: '/client/php/app-productdepartment/productdepartment-edit-modal.php', 356 dataType: 'text', 357 data: { 358 'id': id 359 }, 360 success: function(data) { 361 $('body').append(data); 362 var modal = $('#productdepartment_edit_modal'); 363 modal.modal('show'); 364 modal.on('shown.bs.modal', function(e) { 365 $('#productdepartment_title').trigger('focus'); 366 }); 367 modal.on('hidden.bs.modal', function(e) { 368 e.target.remove(); 369 $('div').remove('.note-modal'); 370 }); 371 }, 372 }); 373 } 374 function productdepartment_del_modal(id) { 375 jQuery.ajax({ 376 type: 'POST', 377 url: '/client/php/app-productdepartment/productdepartment-del-modal.php', 378 dataType: 'text', 379 data: { 380 'id': id 381 }, 382 success: function(data) { 383 $('body').append(data); 384 var modal = $('#productdepartment_del_modal'); 385 modal.modal('show'); 386 modal.on('hidden.bs.modal', function(e) { 387 e.target.remove(); 388 $('div').remove('.note-modal'); 389 }); 390 }, 391 }); 392 } 393// PRODUCT DEPARTMENT 394 395// PRODUCT 396 function product_create_modal(dep_group_id,dep_id,brand_id,discount_id) { 397 jQuery.ajax({ 398 type: 'POST', 399 url: '/client/php/app-product/product-create-modal.php', 400 dataType: 'text', 401 data: { 402 'dep_group_id': dep_group_id, 403 'dep_id': dep_id, 404 'brand_id': brand_id, 405 'discount_id': discount_id 406 }, 407 success: function(data) { 408 $('body').append(data); 409 var modal = $('#product_create_modal'); 410 modal.modal('show'); 411 modal.on('shown.bs.modal', function(e) { 412 //$('#product_title').trigger('focus'); 413 }); 414 modal.on('hidden.bs.modal', function(e) { 415 e.target.remove(); 416 $('div').remove('.note-modal'); 417 }); 418 }, 419 }); 420 } 421 function product_edit_modal(id) { 422 jQuery.ajax({ 423 type: 'POST', 424 url: '/client/php/app-product/product-edit-modal.php', 425 dataType: 'text', 426 data: { 427 'id': id 428 }, 429 success: function(data) { 430 $('body').append(data); 431 var modal = $('#product_edit_modal'); 432 modal.modal('show'); 433 modal.on('shown.bs.modal', function(e) { 434 //$('#product_title').trigger('focus'); 435 }); 436 modal.on('hidden.bs.modal', function(e) { 437 e.target.remove(); 438 $('div').remove('.note-modal'); 439 }); 440 }, 441 }); 442 } 443 function product_del_modal(id) { 444 jQuery.ajax({ 445 type: 'POST', 446 url: '/client/php/app-product/product-del-modal.php', 447 dataType: 'text', 448 data: { 449 'id': id 450 }, 451 success: function(data) { 452 $('body').append(data); 453 var modal = $('#product_del_modal'); 454 modal.modal('show'); 455 modal.on('hidden.bs.modal', function(e) { 456 e.target.remove(); 457 $('div').remove('.note-modal'); 458 }); 459 }, 460 }); 461 } 462 463 function product_order_modal(id) { 464 jQuery.ajax({ 465 type: 'POST', 466 url: '/client/php/app-product/product-order-modal.php', 467 dataType: 'text', 468 data: { 469 'id': id 470 }, 471 success: function(data) { 472 $('body').append(data); 473 var modal = $('#product_order_modal'); 474 modal.modal('show'); 475 modal.on('shown.bs.modal', function(e) { 476 $('#product_order_name').trigger('focus'); 477 }); 478 modal.on('hidden.bs.modal', function(e) { 479 e.target.remove(); 480 $('div').remove('.note-modal'); 481 }); 482 }, 483 }); 484 } 485
486// PRODUCT 487 488 489// USERCART 490 491 function usercart_drawer_load() { 492 jQuery.ajax({ 493 type: "POST", 494 url: '/client/php/app-usercart/usercart-drawer-load.php', 495 dataType: "text", 496 data: { 497 "id": 0 498 }, 499 success: function(data) { 500 if(data != ""){ 501 $('#usercart_drawer_table').html(data); 502 $('#kt_activities_footer').load('/client/php/_include/drawer-cart-footer.php'); 503 } else { 504 $('#usercart_drawer_table').load('/client/php/_include/drawer-cart-empty.php') 505 $('#kt_activities_footer').html(''); 506 } 507 usercart_drawer_sum(); 508 KTComponents.init(); 509 }, 510 }); 511 } 512 513 function usercart_drawer_sum() { 514 jQuery.ajax({ 515 type: 'POST', 516 url: '/client/php/app-usercart/usercart-drawer-sum.php', 517 dataType: 'text', 518 data: { 519 'id': 0 520 }, 521 success: function(data) { 522 $('#usercart_drawer_sum').html(data); 523 }, 524 }); 525 } 526 527 528 function usercart_aside_count() { 529 jQuery.ajax({ 530 type: "POST", 531 url: '/client/php/app-usercart/usercart-aside-count.php', 532 dataType: "text", 533 data: { 534 "id": 0 535 }, 536 success: function(data) { 537 $('#aside_usercart_count').html(data); 538 }, 539 }); 540 } 541 542 function usercart_item(id) { 543 jQuery.ajax({ 544 type: 'POST', 545 url: '/client/php/app-usercart/usercart-item-temp.php', 546 dataType: 'text', 547 data: { 548 'id': id 549 }, 550 success: function(data) { 551 $('#usercart_item_btn_add_' + id).html(data); 552 usercart_drawer_load(); 553 usercart_aside_count(); 554 }, 555 }); 556 } 557 558 function usercart_item_quantity_minus(id) { 559 jQuery.ajax({ 560 type: 'POST', 561 url: '/client/php/app-usercart/usercart-item-quantity-minus.php', 562 dataType: 'text', 563 data: { 564 'id': id 565 }, 566 success: function(data) { 567 $('#usercart_item_quantity_' + id).val(data); 568 $('#usercart_drawer_item_quantity_' + id).val(data); 569 usercart_item_update_drawer(id); 570 usercart_drawer_sum(); 571 }, 572 }); 573 } 574 575 function usercart_item_quantity_plus(id) { 576 jQuery.ajax({ 577 type: 'POST', 578 url: '/client/php/app-usercart/usercart-item-quantity-plus.php', 579 dataType: 'text', 580 data: { 581 'id': id 582 }, 583 success: function(data) { 584 $('#usercart_item_quantity_' + id).val(data); 585 $('#usercart_drawer_item_quantity_' + id).val(data); 586 usercart_item_update_drawer(id); 587 usercart_drawer_sum(); 588 }, 589 }); 590 } 591 592 function usercart_item_quantity(id) { 593 var quantity = document.getElementById('usercart_item_quantity_' + id).value; 594 jQuery.ajax({ 595 type: 'POST', 596 url: '/client/php/app-usercart/usercart-item-quantity.php', 597 dataType: 'text', 598 data: { 599 'id': id, 600 'quantity': quantity 601 }, 602 success: function(data) { 603 $('#usercart_item_quantity_' + id).val(data); 604 $('#usercart_drawer_item_quantity_' + id).val(data); 605 usercart_item_update_drawer(id); 606 usercart_drawer_sum(); 607 }, 608 }); 609 } 610 611 function usercart_drawer_item_quantity(id) { 612 var quantity = document.getElementById('usercart_drawer_item_quantity_' + id).value; 613 jQuery.ajax({ 614 type: 'POST', 615 url: '/client/php/app-usercart/usercart-item-quantity.php', 616 dataType: 'text', 617 data: { 618 'id': id, 619 'quantity': quantity 620 }, 621 success: function(data) { 622 $('#usercart_item_quantity_' + id).val(data); 623 $('#usercart_drawer_item_quantity_' + id).val(data); 624 usercart_item_update_drawer(id); 625 usercart_drawer_sum(); 626 }, 627 }); 628 } 629 630 function usercart_product_del(id) { 631 $('#usercart_product_' + id).remove(); 632 usercart_info(); 633 } 634 635 function usercart_item_del_drawer(id) { 636 $('#usercart_drawer_product_' + id).remove(); 637 usercart_product_del(id); 638 } 639 640 641 642 function usercart_item_update(id) { 643 jQuery.ajax({ 644 type: 'POST', 645 url: '/client/php/app-usercart/usercart-item-update.php', 646 dataType: 'text', 647 data: { 648 'id': id 649 }, 650 success: function(data) { 651 $('#usercart_product_' + id).html(data); 652 usercart_info(); 653 }, 654 }); 655 } 656 657 function usercart_item_update_drawer(id) { 658 jQuery.ajax({ 659 type: 'POST', 660 url: '/client/php/app-usercart/usercart-item-update-drawer.php', 661 dataType: 'text', 662 data: { 663 'id': id 664 }, 665 success: function(data) { 666 $('#usercart_drawer_product_' + id).html(data); 667 usercart_item_update(id); 668 }, 669 }); 670 } 671 672 function usercart_info() { 673 jQuery.ajax({ 674 type: 'POST', 675 url: '/client/php/app-usercart/usercart-info.php', 676 dataType: 'text', 677 data: { 678 'id': 0 679 }, 680 success: function(data) { 681 $('#usercart_info').html(data); 682 }, 683 }); 684 } 685 686 function productcart_info(id) { 687 jQuery.ajax({ 688 type: 'POST', 689 url: '/client/php/app-productcart/productcart-info.php', 690 dataType: 'text', 691 data: { 692 'id': id 693 }, 694 success: function(data) { 695 $('#productcart_info').html(data); 696 }, 697 }); 698 } 699// USERCART 700 701// ORDER 702 function productorder_modal(id) { 703 jQuery.ajax({ 704 type: 'POST', 705 url: '/client/php/app-productorder/productorder-modal.php', 706 dataType: 'text', 707 data: { 708 'id': id 709 }, 710 success: function(data) { 711 $('body').append(data); 712 var modal = $('#productorder_modal'); 713 modal.modal('show'); 714 modal.on('shown.bs.modal', function(e) { 715 //$('#productdepartmentgroup_title').trigger('focus'); 716 }); 717 modal.on('hidden.bs.modal', function(e) { 718 e.target.remove(); 719 $('div').remove('.note-modal'); 720 }); 721 }, 722 }); 723 } 724 725 function userorder_modal(id) { 726 jQuery.ajax({ 727 type: 'POST', 728 url: '/client/php/app-userorder/userorder-modal.php', 729 dataType: 'text', 730 data: { 731 'id': id 732 }, 733 success: function(data) { 734 $('body').append(data); 735 var modal = $('#userorder_modal'); 736 modal.modal('show'); 737 modal.on('shown.bs.modal', function(e) { 738 //$('#productdepartmentgroup_title').trigger('focus'); 739 }); 740 modal.on('hidden.bs.modal', function(e) { 741 e.target.remove(); 742 $('div').remove('.note-modal'); 743 }); 744 }, 745 }); 746 } 747// ORDER 748 749// USER 750 function user_edit_modal(user_id) { 751 jQuery.ajax({ 752 type: 'POST', 753 url: '/client/php/app-user/user-edit-modal.php', 754 dataType: 'text', 755 data: { 756 'user_id': user_id 757 }, 758 success: function(data) { 759 $('body').append(data); 760 var modal = $('#user_edit_modal'); 761 modal.modal('show'); 762 modal.on('shown.bs.modal', function(e) { 763 $('#user_title').trigger('focus'); 764 }); 765 modal.on('hidden.bs.modal', function(e) { 766 e.target.remove(); 767 $('div').remove('.note-modal'); 768 }); 769 }, 770 }); 771 } 772// USER 773 774 775 776// POST 777 function post_create_modal() { 778 jQuery.ajax({ 779 type: 'POST', 780 url: '/client/php/app-post/post-create-modal.php', 781 dataType: 'text', 782 data: { 783 'id': 0 784 }, 785 success: function(data) { 786 $('body').append(data); 787 var modal = $('#post_create_modal'); 788 modal.modal('show'); 789 modal.on('shown.bs.modal', function(e) { 790 $('#post_title').trigger('focus'); 791 }); 792 modal.on('hidden.bs.modal', function(e) { 793 e.target.remove(); 794 $('div').remove('.note-modal'); 795 }); 796 }, 797 }); 798 } 799 function post_edit_modal(id) { 800 jQuery.ajax({ 801 type: 'POST', 802 url: '/client/php/app-post/post-edit-modal.php', 803 dataType: 'text', 804 data: { 805 'id': id 806 }, 807 success: function(data) { 808 $('body').append(data); 809 var modal = $('#post_edit_modal'); 810 modal.modal('show'); 811 modal.on('shown.bs.modal', function(e) { 812 $('#post_title').trigger('focus'); 813 }); 814 modal.on('hidden.bs.modal', function(e) { 815 e.target.remove(); 816 $('div').remove('.note-modal'); 817 }); 818 }, 819 }); 820 } 821 function post_del_modal(id) { 822 jQuery.ajax({ 823 type: 'POST', 824 url: '/client/php/app-post/post-del-modal.php', 825 dataType: 'text', 826 data: { 827 'id': id 828 }, 829 success: function(data) { 830 $('body').append(data); 831 var modal = $('#post_del_modal'); 832 modal.modal('show'); 833 modal.on('hidden.bs.modal', function(e) { 834 e.target.remove(); 835 $('div').remove('.note-modal'); 836 }); 837 }, 838 }); 839 } 840// POST
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.