import{j as e}from"./tanstack-1.0.74-aU0azVkW.js";import{r as a}from"./redux-1.0.74-D8bIc6ki.js";import{n as d}from"./index-1.0.74-DxwH6OqZ.js";import{D as o}from"./DynamicModeEnum-1.0.74-BXuL5kgA.js";import{b as l}from"./TextField-1.0.74-BW9Byijb.js";import{L as r}from"./Link-1.0.74-Cr-Ob-AP.js";import{B as s}from"./Box-1.0.74-DEbuVvGV.js";const w=({target:n})=>{const[i,t]=a.useState(!1);return e.jsxs(l,{component:"div",sx:{"& svg":{width:"15px",height:"15px",verticalAlign:"text-bottom"}},children:[e.jsx(d,{}),"Only valid SQL. ",i?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:e.jsx(r,{sx:{cursor:"pointer"},underline:"none",onClick:()=>{t(!1)},children:"(hide examples)"})}),e.jsxs("ul",{style:{listStyle:"disc",padding:"0 20px"},children:[e.jsx("li",{children:"where first_name like 'Sacha%'"}),e.jsx("li",{children:"where product_id = httpPost['my_product_id'] and httpPost['my_product_id'] is not null"}),e.jsx("li",{children:"where user_id = @wpda_wp_user_id"}),e.jsx("li",{children:"where user_id in (select user_id from wp_usermeta where meta_key = 'wp_capabilities' and meta_value like '%coach%')"}),e.jsx("li",{children:"where order_date between date_sub(now(), interval 1 week) and now()"}),e.jsx("li",{children:"where status = 'send' and order_date > date_sub(now(), interval 1 week)"})]}),e.jsx("div",{children:e.jsx("strong",{children:"Advanced features:"})}),e.jsxs("ul",{style:{listStyle:"disc",padding:"0 20px",marginBottom:0},children:[e.jsxs("li",{children:["Session variable ",e.jsx("strong",{children:"@wpda_wp_user_id"})," is available to access the WordPress user ID.",e.jsx(r,{href:"https://docs.rad.wpdataaccess.com/wpda_wp_user_id.html",target:"_blank",style:{marginLeft:"5px",textDecoration:"none"},children:"(read more...)"})]}),e.jsxs("li",{children:["The functions ",e.jsx("strong",{children:"httpGet"}),", ",e.jsx("strong",{children:"httpPost"})," and ",e.jsx("strong",{children:"httpRequest"})," can be used to access HTTP GET and POST parameters. All functions return null when the requested parameter was not provided.",e.jsx(r,{href:"https://docs.rad.wpdataaccess.com/app-manager/running-apps/shortcodes/url-parameters.html",target:"_blank",style:{marginLeft:"5px",textDecoration:"none"},children:"(read more...)"}),e.jsx("br",{}),"The following condition returns no rows if no parameter was provided:",e.jsx("br",{}),e.jsx(s,{sx:{margin:"5px 20px"},children:e.jsxs("strong",{children:["where product_id = httpPost['my_product_id']",e.jsx("br",{}),"and httpPost['my_product_id'] is not null"]})}),"The condition below returns all rows if no parameter was provided:",e.jsx(s,{sx:{margin:"5px 20px"},children:e.jsxs("strong",{children:["where product_id = httpPost['my_product_id']",e.jsx("br",{}),"or httpPost['my_product_id'] is null"]})})]}),e.jsxs("li",{children:["The function ",e.jsx("strong",{children:"shortcodeParam"})," can be used to access shortcode parameters. The function return null when the requested parameter was not provided.",e.jsx(r,{href:"https://docs.rad.wpdataaccess.com/app-manager/running-apps/shortcodes/shortcode-parameters.html",target:"_blank",style:{marginLeft:"5px",textDecoration:"none"},children:"(read more...)"}),e.jsx("br",{}),"Example using shortcode parameter student_id:",e.jsx(s,{sx:{margin:"5px 20px"},children:e.jsx("strong",{children:"where student_id = shortcodeParam['student_id']"})})]}),n===o.FORM&&e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Example using a column value in the same table:",e.jsx(s,{sx:{margin:"5px 20px"},children:e.jsx("strong",{children:"where deptno = {:deptno}"})})]}),e.jsxs("li",{children:["Example using a column value in the parent table:",e.jsx(s,{sx:{margin:"5px 20px"},children:e.jsx("strong",{children:"where deptno = {:parent.deptno}"})})]})]})]})]}):e.jsx("span",{children:e.jsx(r,{sx:{cursor:"pointer"},underline:"none",onClick:()=>{t(!0)},children:"(show examples)"})})]})};export{w as D};
