Changeset 1949133
- Timestamp:
- 09/29/2018 05:22:52 PM (6 years ago)
- Location:
- kickgogo/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kickgogo/trunk/README.md
r1949118 r1949133 5 5 - Tested up to: 4.9.8 6 6 - Requires PHP: 7.0.0 7 - Stable tag: 1. 5.17 - Stable tag: 1. 8 8 - License: GPLv2 9 9 - License URI: http://www.gnu.org/licenses/gpl-2.0.html -
kickgogo/trunk/inc/options.php
r1949118 r1949133 364 364 $this->deleteTransaction($campaign->name, $_POST['transaction']); 365 365 break; 366 367 368 366 369 } 367 370 … … 470 473 } 471 474 </script> 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 472 512 <?php 473 513 } … … 500 540 } 501 541 502 542 public function handle_add_transaction($campaignId, $data) { 543 global $wpdb; 544 545 if (!is_numeric($data['amount'])) { 546 $this->report_error('Missing donation amount!'); 547 } 548 549 if ($this->has_errors()) 550 return false; 551 552 $tid = $this->getNextTransactionId(); 553 $details = json_encode([ 554 'amount' => $data['amount'], 555 'campaign' => $campaignId, 556 'confirmation' => "manual-$tid", 557 'code' => $tid, 558 'name' => @$data['name'], 559 'email' => @$data['email'], 560 'phone' => @$data['phone'], 561 'orderid' => "manual-$tid", 562 'test' => @$data['test'] ? true : false 563 ]); 564 565 $wpdb->insert($this->transaction_table, [ 566 'campaign_id' => $campaignId, 567 'amount' => $data['amount'], 568 'test' => @$data['test'] ? 1 : 0, 569 'details' => $details, 570 ]); 571 return true; 572 } 503 573 504 574 public function report_error($error) { … … 533 603 global $wpdb; 534 604 $query = "select count(amount) from $this->transaction_table AS tr 535 INNER JOIN $this->campaign_table AS cpg ON tr.campaign_id = cpg.id and cpg.name = '$name'605 INNER JOIN $this->campaign_table AS cpg ON tr.campaign_id = cpg.id and 536 606 WHERE tr.deleted = 0"; 537 607 return $wpdb->get_var($query); 538 608 } 539 609 610 611 612 613 614 615 540 616 public function getTransactions($name) { 541 617 global $wpdb; 542 618 $query = "select tr.* from $this->transaction_table AS tr 543 INNER JOIN $this->campaign_table AS cpg ON tr.campaign_id = cpg.id and cpg.name = '$name'619 INNER JOIN $this->campaign_table AS cpg ON tr.campaign_id = cpg.id and 544 620 WHERE tr.deleted = 0"; 545 621 return $wpdb->get_results($query); -
kickgogo/trunk/kickgogo.php
r1949118 r1949133 4 4 Plugin URI: http://github.com/guss77/kickgogo-wordpress-plugin 5 5 Description: Crowd-funding campaign manager 6 Version: 1. 5.16 Version: 1. 7 7 Author: Oded Arbel 8 8 Author URI: https://github.com/guss77/kickgogo-wordpress-plugin
Note: See TracChangeset
for help on using the changeset viewer.