PluginProbe ʕ •ᴥ•ʔ
Event Tickets with Ticket Scanner / 3.1.2
Event Tickets with Ticket Scanner v3.1.2
3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.4 trunk 2.6.0 2.7.0 2.7.1 2.7.10 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.10 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3
event-tickets-with-ticket-scanner / sasoEventtickets_Base.php
event-tickets-with-ticket-scanner Last commit date
3rd 1 week ago css 1 week ago img 1 week ago includes 1 week ago js 1 week ago languages 1 week ago ticket 1 week ago vendors 1 week ago SASO_EVENTTICKETS.php 1 week ago backend.js 1 week ago changelog-features.json 1 week ago changelog.txt 1 week ago db.php 1 week ago index.php 1 week ago init_file.php 1 week ago order_details.js 1 week ago pwa-sw.js 1 week ago readme.txt 1 week ago saso-eventtickets-validator.js 1 week ago sasoEventtickets_AdminSettings.php 1 week ago sasoEventtickets_Authtoken.php 1 week ago sasoEventtickets_Base.php 1 week ago sasoEventtickets_Core.php 1 week ago sasoEventtickets_Frontend.php 1 week ago sasoEventtickets_Messenger.php 1 week ago sasoEventtickets_Options.php 1 week ago sasoEventtickets_PDF.php 1 week ago sasoEventtickets_Seating.php 1 week ago sasoEventtickets_Ticket.php 1 week ago sasoEventtickets_TicketBadge.php 1 week ago sasoEventtickets_TicketDesigner.php 1 week ago sasoEventtickets_TicketQR.php 1 week ago ticket_events.js 1 week ago ticket_scanner.js 1 week ago validator.js 1 week ago version-notices.json 1 week ago vollstart-cross-promo.php 1 week ago wc_backend.js 1 week ago wc_frontend.js 1 week ago woocommerce-hooks.php 1 week ago
sasoEventtickets_Base.php
61 lines
1 <?php
2 include_once(plugin_dir_path(__FILE__)."init_file.php");
3 class sasoEventtickets_Base {
4 private $_isPremInitialized = false;
5 private $_maxValues = [];
6
7 private $MAIN = null;
8
9 public function __construct($MAIN) {
10 $this->MAIN = $MAIN;
11 }
12 private function initPrem() {
13 if (count($this->_maxValues) == 0) {
14 $this->_maxValues = $this->MAIN->getMV();
15 }
16 if ($this->_isPremInitialized == false) {
17 $prem = $this->MAIN->getPremiumFunctions();
18 if ($prem != null) {
19 if ($this->MAIN->isPremium() && method_exists($this->MAIN->getPremiumFunctions(), 'maxValues')) {
20 $this->_maxValues = $prem->maxValues();
21 }
22 }
23 $this->_isPremInitialized = true;
24 }
25 }
26 public function increaseGlobalTicketCounter($a=1) {
27 $mvct = $this->getOverallTicketCounterValue() + $a;
28 update_option($this->MAIN->getPrefix()."mvct", $mvct);
29 do_action( $this->MAIN->_do_action_prefix.'base_increaseGlobalTicketCounter', $mvct );
30 }
31 public function getOverallTicketCounterValue() {
32 return intval(get_option( $this->MAIN->getPrefix()."mvct" ));
33 }
34 public function getMaxValues() {
35 $this->initPrem();
36 return $this->_maxValues;
37 }
38 public function getMaxValue($key, $def = 1) {
39 $maxValues = $this->getMaxValues();
40 if (isset($maxValues[$key])) return $maxValues[$key];
41 return $def;
42 }
43 public function _isMaxReachedForList($total) {
44 if ($this->getMaxValue('lists') == 0) return true;
45 if ($total > $this->getMaxValue('lists')) return false;
46 return true;
47 }
48 public function _isMaxReachedForTickets($total) {
49 if ($this->getMaxValue('codes_total') == 0) return true;
50 if ($total > $this->getMaxValue('codes_total')) return false;
51 $mvct = $this->getOverallTicketCounterValue();
52 if ($mvct > 0 && $mvct > ($total + 150)) return false;
53 return true;
54 }
55 public function _isMaxReachedForAuthtokens($total) {
56 if ($this->getMaxValue('authtokens_total', 0) == 0) return true;
57 if ($total > $this->getMaxValue('authtokens_total')) return false;
58 return true;
59 }
60 }
61 ?>