Re: [WebDNA] Calendar Examples

This WebDNA talk-list message is from

2019


It keeps the original formatting.
numero = 114582
interpreted = N
texte = 2202 --0000000000002439d60589b439a8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Steve, Hi - a late response to this sorry. A lot going on in my world recently. Here's a calendar I worked up for one of our clients: https://www.youngfoe.ie/events/ The code that generates the monthly table is based on code posted on the WebDNA site years ago. Snippets below. I store dates in [math{[date]}[/math] format and use Irish formatting - dd/mm/yyyy. Anyhow it might help as a starting pint. - Tom *calendar.inc* [!] ------------------------------------ ### Set up days and months tables ### [/!][table name=3Ddays&fields=3DNUMBER,DAY,SKIP] 0 Saturday 5 1 Sunday 6 2 Monday 0 3 Tuesday 1 4 Wednesday 2 5 Thursday 3 6 Friday 4 [/table][!] [/!][table name=3Dmonths&fields=3DNUMBER,NAME] 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December [/table][!] [/!][text secure=3Df]varYEAR=3D[format days_to_date %Y][math]{[date]}[/math][/format][/text][!] [/!][text secure=3Df]varMONTH=3D[format days_to_date %m][math]{[date]}[/math][/format][/text][!] [/!][text secure=3Df]varPREVYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}-{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]varPREVMONTH=3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}-{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]varNEXTYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}+{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]varNEXTMONTH=3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}+{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]the_contents=3Dc_cell.inc[/text][!] ------------------------------------ ### initialize the month offset and days variables ### [/!][math show=3Df]offset=3D[lookup table=3Ddays&lookinfield=3Dnumber&value=3D[math]({01/[varMONTH]/[varYEAR]})= %7[/math]&returnfield=3Dskip][/math][!] [/!][math show=3Df]days=3D({01/[varMONTH]/[varYEAR]}+{00/01/0000})-{1/[varMONTH]/[var= YEAR]}[/math]

[search table=3Ddays&neSKIPdata=3Dfind_all&asSKIPsort=3D1][founditems] [/founditems][/search] [loop start=3D1&end=3D[offset]] [/loop][loop start=3D1&end=3D[days]] [/showif][text]daytot=3D[index][/text][/loop][math show=3Df]y=3D[daytot]+[offset][/math][showif [y]<35][math show=3Df]z=3D35-[y][/math][/showif][showif [y]>35][math show=3Df]z=3D42-[y][/math][/showif][loop start=3D1&end=3D[z]] [/loop]
[!] [/!]List events for [format days_to_date %B %Y][math]{01/[varPREVMONTH]/[varPREVYEAR]}[/math][/format][!] [/!] [lookup table=3Dmonths&lookinfield=3Dnumber&value=3D[varMONTH]&returnfield=3Dname&n= otfound=3D[varMONTH]] [varYEAR] [!] [/!]List events for [format days_to_date %B %Y][math]{01/[varNEXTMONTH]/[varNEXTYEAR]}[/math][/format][!] [/!]
[get= chars start=3D1&end=3D1][day][/getchars] [day]
 [showif [math]([index]+[offset])%7[/math]=3D0]
 
*c_cell.inc* [!] ### Pull in front end functions ### [/!][include file=3D^siteminder/1.0.0/functions/smFrontEnd-functions.inc][!= ] [/!][search db=3D/data/db_events/events.db[!] [/!]&max=3D1[!] [/!]&ledEVSDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][!] [/!]&gedEVFDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][!] [/!]&allreqd=3DT][!] [/!][hideif [numfound]=3D0][!] [/!]class=3D"day-active">[math][varDAY][/math][founditems]
  • [sTITLE][/founditems]">[!] [/!][math][varDAY][/math][!] [/!]List the [numfound] event[showif [numfound]>1]s[/showif] taking place on [format days_to_date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/format][!] [/!][!] [/!]
      [founditems]
    • [sTITLE]" data-content=3D'[!] [/!]

      [!] [/!][math][format days_to_date %d][dEVSDATE][/format][/math] [format days_to_date %B %Y][dEVSDATE][/format] [math][format seconds_to_time %I][math]{[tEVSTIME]}[/math][/format][/math][lowercase][format seconds_to_time :%M%p][math]{[tEVSTIME]}[/math][/format][/lowercase][!] [/!][hideif [url][dEVSDATE][tEVSTIME][/url]=3D[url][dEVFDATE][tEVFTIME][/url]][!] [/!] - [!] [/!][hideif [url][dEVSDATE][/url]=3D[url][dEVFDATE][/url]][math][!] [/!][format days_to_date %d][dEVFDATE][/format][/math] [format days_to_date %B %Y][dEVFDATE][/format] [!] [/!][/hideif][!] [/!][math][format seconds_to_time %I][math]{[tEVFTIME]}[/math][/format][/math][lowercase][format seconds_to_time :%M%p][math]{[tEVFTIME]}[/math][/format][/lowercase][!] [/!][/hideif][!] [/!]

      [smImageInclude imageId=3D[sIMAGE]&imageSize=3Dth&imageCaption=3DT&imageContainer=3Ddiv&ima= geClass=3Dright photo]
      [grep search=3D'&replace=3D'][smLimitwordstoMaxchars inputText=3D[url][xBTEXT][/url]&maxChars=3D100][/grep]
      [!] [/!]'>[sTITLE]
    • [/founditems]
    [!] [/!][/hideif][!] [/!][showif [numfound]=3D0]class=3D"day-inactive">[math][varDAY][/math][/showif][!] [/!][/search] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D On Thu, 28 Feb 2019 at 22:25, Steve Craig wrote: > Hi All > > I=E2=80=99m in the middle of producing a kind of basic CRM to track my co= mpanies > sales and construction jobs etc but I now have to add a kind of work diar= y > to it and I=E2=80=99m wondering if anyone has any examples of something I= could > integrate any code from. > > I seem to remember from years ago that there was some example code > snippets somewhere showing a basic calendar but I can=E2=80=99t seem to f= ind > anything now. > > Basically I will just have a db with various job names allocated to days > and I need to show them on a calendar, each job would be in blocks of a d= ay > long so it just has to be a basic thing. > > Any help or old code would be much appreciated. > > Cheers > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Steve Craig - Forest Products (Leisure) Ltd > Tel +44 1330 860505 Mob +44 7778 007607 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > http://www.forestlogcabins.com > Email: steve@forestlogcabins.com > Skype: s.craig - iChat: steve.craig > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Standard terms and conditions available here > http://forestlogcabins.com/Terms.html > Any sketches or illustrations supplied are subject to possible small > changes on the final factory plans. > > > > > > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list talk@webdna.us > To unsubscribe, E-mail to: talk-leave@webdna.us archives: > http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.u= s --0000000000002439d60589b439a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
    Steve,

    Hi - a late response to this sorry.=C2= =A0 A lot going on in my world recently.

    Here'= s a calendar I worked up for one of our clients:

    =

    The code that generates the monthly table is based on code posted o= n the WebDNA site years ago.=C2=A0 Snippets below.=C2=A0 I store dates in [= math{[date]}[/math] format and use Irish formatting - dd/mm/yyyy.

    Anyhow it might help as a starting pint.

    - Tom


    calendar.inc

    [!]


    -------= -----------------------------
    ### =C2=A0Set up days and months tables= =C2=A0###

    [/!][table name=3Ddays&fields=3DNUM= BER,DAY,SKIP]
    0Saturday5
    1Sunday6
    2Monday0
    3Tuesday1
    4Wednes= day2=
    5= Thursday3
    6Friday4
    [/table][!]

    [/!= ][table name=3Dmonths&fields=3DNUMBER,NAME]
    01January
    0= 2Feb= ruary
    03March
    04April
    05May
    06June
    07July
    08<= /span>August
    09September
    10October
    11November
    1= 2Dec= ember
    [/table][!]

    [/!][text secure=3Df]v= arYEAR=3D[format days_to_date %Y][math]{[date]}[/math][/format][/text][!]
    [/!][text secure=3Df]varMONTH=3D[format days_to_date %m][math]{[da= te]}[/math][/format][/text][!]

    [/!][text secure=3D= f]varPREVYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}-{00= /01/0000}[/math][/format][/text][!]
    [/!][text secure=3Df]varPREVM= ONTH=3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}-{00/01/0000}= [/math][/format][/text][!]

    [/!][text secure=3Df]va= rNEXTYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}+{00/01/= 0000}[/math][/format][/text][!]
    [/!][text secure=3Df]varNEXTMONTH= =3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}+{00/01/0000}[/ma= th][/format][/text][!]

    [/!][text secure=3Df]the_co= ntents=3Dc_cell.inc[/text][!]


    ---------= ---------------------------
    ### =C2=A0initialize the month offset and= days variables =C2=A0###

    [/!][math show=3Df]offse= t=3D[lookup table=3Ddays&lookinfield=3Dnumber&value=3D[math]({01/[v= arMONTH]/[varYEAR]})%7[/math]&returnfield=3Dskip][/math][!]
    [= /!][math show=3Df]days=3D({01/[varMONTH]/[varYEAR]}+{00/01/0000})-{1/[varMO= NTH]/[varYEAR]}[/math]

    <br /><br />
    <table summary=3D"Events Calendar" class=3D"table= table-bordered table-responsive events-module-calendar">
    <= ;caption class=3D"text-center">[!]
    [/!]<a tabindex= =3D"0" class=3D"calendar-nav pull-left" data-year=3D&qu= ot;[varPREVYEAR]" data-month=3D"[varPREVMONTH]" href=3D"= ;[levelPATH]/[varPREVYEAR]/[varPREVMONTH]/"><i class=3D"fa = fa-chevron-left"></i><span class=3D"sr-only">= List events for [format days_to_date %B %Y][math]{01/[varPREVMONTH]/[varPRE= VYEAR]}[/math][/format]</span></a>[!]

    = [/!= ] [lookup table=3Dmonths&lookinfield=3Dnumber&value=3D[varMONTH]&am= p;returnfield=3Dname&notfound=3D[varMONTH]] [varYEAR] [!]
    = [/!]<a tabindex=3D"0" class=3D"calendar-nav pull= -right" data-year=3D"[varNEXTYEAR]" data-month=3D"[varN= EXTMONTH]" href=3D"#[!]/yfoe/events/calendar/[varNEXTYEAR]/[varNE= XTMONTH]/[/!]"><span class=3D"sr-only">List events = for [format days_to_date %B %Y][math]{01/[varNEXTMONTH]/[varNEXTYEAR]}[/mat= h][/format]</span><i class=3D"fa fa-chevron-right">&l= t;/i></a>[!]
    [/!]</caption>
    <thead>
    =
    <tr>[search table=3Ddays&neSKIPdata=3Dfind_all&asSKIPsort= =3D1][founditems]
    <th>
    <abbr title=3D"[day]&= quot; aria-hidden=3D"true" class=3D"visible-xs-inline"&= gt;[getchars start=3D1&end=3D1][day][/getchars]</abbr>
    = &= lt;span class=3D"hidden-xs">[day]</span>
    </th= >[/founditems][/search]
    </tr>
    </thead>

    <tbody>
    <tr>[loop start=3D1&end=3D[offs= et]]
    <td class=3D"day-blank">&nbsp;</td>[= /loop][loop start=3D1&end=3D[days]]
    <td [include file=3D/dat= a/db_events/[the_contents]&varDAY=3D[format .2d][index][/format]&va= rMONTH=3D[varMONTH]&varYEAR=3D[varYEAR]]</td>[showif [math]([inde= x]+[offset])%7[/math]=3D0]
    </tr>

    <tr&= gt;[/showif][text]daytot=3D[index][/text][/loop][math show=3Df]y=3D[daytot]= +[offset][/math][showif [y]<35][math show=3Df]z=3D35-[y][/math][/showif]= [showif [y]>35][math show=3Df]z=3D42-[y][/math][/showif][loop start=3D1&= amp;end=3D[z]]
    <td class=3D"day-blank">&nbsp;&l= t;/td>[/loop]
    </tr>
    </tbody>
    </tab= le>


    c_cell.inc
    <= /div>

    [!]

    ### =C2=A0Pull in fr= ont end functions =C2=A0###

    [/!][include file=3D^s= iteminder/1.0.0/functions/smFrontEnd-functions.inc][!]

    =
    [/!][search db=3D/data/db_events/events.db[!]
    [/!]&max=3D1[!= ]
    = [/!]&ledEVSDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varYEAR]}[/= math][!]
    [/!]&gedEVFDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varY= EAR]}[/math][!]
    [/!]&allreqd=3DT][!]
    [/!][hideif [numfound]= =3D0][!]


    [/!]class=3D"day-active&= quot;><span class=3D"hidden-xs">[math][varDAY][/math]<= ;/span><a [!]href=3D"#[levelPATH]/[the_year]/[the_month]/[the_da= y]/"[/!] tabindex=3D"0" class=3D"visible-xs-inline-bloc= k btn btn-sm btn-success" role=3D"button" data-toggle=3D&quo= t;popover" data-trigger=3D"focus" data-html=3D"true&quo= t; data-placement=3D"top" title=3D"Events on [format days_to= _date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/format]" = data-content=3D"<ul>[founditems]<li><a href=3D'[lev= elPATH]/[varYEAR]/[varMONTH]/[varDAY]/[sSLUG]/'>[sTITLE]</a>&l= t;/li>[/founditems]</ul>">[!]

    [/!]&l= t;span aria-hidden=3D"true">[math][varDAY][/math]</span>= [!]

    [/!]<span class=3D"sr-only">List = the [numfound] event[showif [numfound]>1]s[/showif] taking place on [for= mat days_to_date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/for= mat]</span>[!]

    [/!]</a>[!]

    =
    = [/!]<ul class=3D"hidden-xs">[founditems]
    =
    <li><a [!]href=3D"[levelPATH]/[varYEAR]/[varMONT= H]/[varDAY]/[sSLUG]/"[/!] tabindex=3D"0" role=3D"button= " data-toggle=3D"popover" data-trigger=3D"focus" d= ata-html=3D"true" data-placement=3D"top" title=3D"= <a href=3D'[levelPATH]/[varYEAR]/[varMONTH]/[varDAY]/[sSLUG]/'&g= t;[sTITLE]</a>" data-content=3D'[!]

    = [/!]<p class=3D"time small"><i class=3D"fa fa-clock= -o"></i> [!]
    [/!][math][format days_to_date %d][dE= VSDATE][/format][/math] [format days_to_date %B %Y][dEVSDATE][/format] [mat= h][format seconds_to_time %I][math]{[tEVSTIME]}[/math][/format][/math][lowe= rcase][format seconds_to_time :%M%p][math]{[tEVSTIME]}[/math][/format][/low= ercase][!]
    [/!][hideif [url][dEVSDATE][tEVSTIME][/url]=3D[url][= dEVFDATE][tEVFTIME][/url]][!]
    [/!] - [!]
    [/!][hid= eif [url][dEVSDATE][/url]=3D[url][dEVFDATE][/url]][math][!]
    [= /!][format days_to_date %d][dEVFDATE][/format][/math] [format days_to_date = %B %Y][dEVFDATE][/format] [!]
    [/!][/hideif][!]
    [/= !][math][format seconds_to_time %I][math]{[tEVFTIME]}[/math][/format][/math= ][lowercase][format seconds_to_time :%M%p][math]{[tEVFTIME]}[/math][/format= ][/lowercase][!]
    [/!][/hideif][!]
    [/!]</p>

    [smImageInclude imageId=3D[sIMAGE]&imageSize=3Dth&= amp;imageCaption=3DT&imageContainer=3Ddiv&imageClass=3Dright photo]=

    <div class=3D"news-content"> [grep= search=3D'&replace=3D&#39;][smLimitwordstoMaxchars inputText= =3D[url][xBTEXT][/url]&maxChars=3D100][/grep]</div>[!]
    =
    [/!]'>[sTITLE]</a></li>

    [/founditems]</ul>[!]

    [/!][/hideif][!]
    <= div>
    [/!][showif [numfound]=3D0]class=3D"day-inactive"&= gt;[math][varDAY][/math][/showif][!]

    [/!][/search]=




    =3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
    Digital Rev= olutionaries
    1st Floor, Castleriver House
    14-15 Parliament Street
    = Temple Bar,Dublin 2
    Ireland
    -----------------------------------------= -----
    [t]: + 353 1 4403907
    [e]: <mailto:tom@revolutionaries.ie>
    [w]: &l= t;http://www.r= evolutionaries.ie/>
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D


    On Thu, 28 Feb 2019 at 22:25, Steve Craig <steve@asylumweb.com> wrote:
    Hi All
    I=E2=80=99m in the middle of producing a kind of basic CRM to = track my companies sales and construction jobs etc but I now have to add a = kind of work diary to it and I=E2=80=99m wondering if anyone has any exampl= es of something I could integrate any code from.

    I= seem to remember from years ago that there was some example code snippets = somewhere showing a basic calendar but I can=E2=80=99t seem to find anythin= g now.

    Basically I will just have a db with variou= s job names allocated to days and I need to show them on a calendar, each j= ob would be in blocks of a day long so it just has to be a basic thing.

    Any help or old code would be much appreciated.
    =

    Cheers
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
    Steve Craig - Forest Products (Leisure)=C2=A0Ltd
    Tel +44 13= 30 860505 Mob +44 7778=C2=A0007607
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
    h= ttp://www.forestlogcabins.com
    Email: steve@forestlogcabins.com
    Skype: s.c= raig - iChat: steve.craig
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

    Standard terms and conditions available=C2=A0here=C2=A0http://forestlogcab= ins.com/Terms.html
    Any sketches or illustrations supplied are=C2=A0s= ubject to possible small changes on the=C2=A0final factory plans.





    --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@w= ebdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: suppo= rt@webdna.us
    --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --0000000000002439d60589b439a8-- . Associated Messages, from the most recent to the oldest:

        
    1. Re: [WebDNA] Calendar Examples (Olin Lagon 2019)
    2. Re: [WebDNA] Calendar Examples (Tom Duke 2019)
    3. Re: [WebDNA] Calendar Examples (Olin Lagon 2019)
    4. Re: [WebDNA] Calendar Examples (Tom Duke 2019)
    5. [WebDNA] Calendar Examples (Steve Craig 2019)
    2202 --0000000000002439d60589b439a8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Steve, Hi - a late response to this sorry. A lot going on in my world recently. Here's a calendar I worked up for one of our clients: https://www.youngfoe.ie/events/ The code that generates the monthly table is based on code posted on the WebDNA site years ago. Snippets below. I store dates in [math{[date]}[/math] format and use Irish formatting - dd/mm/yyyy. Anyhow it might help as a starting pint. - Tom *calendar.inc* [!] ------------------------------------ ### Set up days and months tables ### [/!][table name=3Ddays&fields=3DNUMBER,DAY,SKIP] 0 Saturday 5 1 Sunday 6 2 Monday 0 3 Tuesday 1 4 Wednesday 2 5 Thursday 3 6 Friday 4 [/table][!] [/!][table name=3Dmonths&fields=3DNUMBER,NAME] 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December [/table][!] [/!][text secure=3Df]varYEAR=3D[format days_to_date %Y][math]{[date]}[/math][/format][/text][!] [/!][text secure=3Df]varMONTH=3D[format days_to_date %m][math]{[date]}[/math][/format][/text][!] [/!][text secure=3Df]varPREVYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}-{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]varPREVMONTH=3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}-{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]varNEXTYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}+{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]varNEXTMONTH=3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}+{00/01/0000}[/math][/format][/text][!] [/!][text secure=3Df]the_contents=3Dc_cell.inc[/text][!] ------------------------------------ ### initialize the month offset and days variables ### [/!][math show=3Df]offset=3D[lookup table=3Ddays&lookinfield=3Dnumber&value=3D[math]({01/[varMONTH]/[varYEAR]})= %7[/math]&returnfield=3Dskip][/math][!] [/!][math show=3Df]days=3D({01/[varMONTH]/[varYEAR]}+{00/01/0000})-{1/[varMONTH]/[var= YEAR]}[/math]

    [search table=3Ddays&neSKIPdata=3Dfind_all&asSKIPsort=3D1][founditems] [/founditems][/search] [loop start=3D1&end=3D[offset]] [/loop][loop start=3D1&end=3D[days]] [/showif][text]daytot=3D[index][/text][/loop][math show=3Df]y=3D[daytot]+[offset][/math][showif [y]<35][math show=3Df]z=3D35-[y][/math][/showif][showif [y]>35][math show=3Df]z=3D42-[y][/math][/showif][loop start=3D1&end=3D[z]] [/loop]
    [!] [/!]List events for [format days_to_date %B %Y][math]{01/[varPREVMONTH]/[varPREVYEAR]}[/math][/format][!] [/!] [lookup table=3Dmonths&lookinfield=3Dnumber&value=3D[varMONTH]&returnfield=3Dname&n= otfound=3D[varMONTH]] [varYEAR] [!] [/!][!]/yfoe/events/calendar/[varNEXTYEAR]/[varNEXTMONTH]/[/!]">List events for [format days_to_date %B %Y][math]{01/[varNEXTMONTH]/[varNEXTYEAR]}[/math][/format][!] [/!]
    [get= chars start=3D1&end=3D1][day][/getchars] [day]
     [showif [math]([index]+[offset])%7[/math]=3D0]
     
    *c_cell.inc* [!] ### Pull in front end functions ### [/!][include file=3D^siteminder/1.0.0/functions/smFrontEnd-functions.inc][!= ] [/!][search db=3D/data/db_events/events.db[!] [/!]&max=3D1[!] [/!]&ledEVSDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][!] [/!]&gedEVFDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][!] [/!]&allreqd=3DT][!] [/!][hideif [numfound]=3D0][!] [/!]class=3D"day-active">[math][varDAY][/math][!]href=3D"#[levelPATH]/[the_year]/[the_month]/[the_day]/"[/!] tabindex=3D"= 0" class=3D"visible-xs-inline-block btn btn-sm btn-success" role=3D"button" data-toggle=3D"popover" data-trigger=3D"focus" data-html=3D"true" data-placement=3D"top" title=3D"Events on [format days_to_date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/format]" data-content=3D"">[!] [/!][math][varDAY][/math][!] [/!]List the [numfound] event[showif [numfound]>1]s[/showif] taking place on [format days_to_date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/format][!] [/!][!] [/!]
      [founditems]
    • [!]href=3D"[levelPATH]/[varYEAR]/[varMONTH]/[varDAY]/[sSLUG]/"[/!] tabindex=3D"0" role=3D"button" data-toggle=3D"popover" data-trigger=3D"focu= s" data-html=3D"true" data-placement=3D"top" title=3D"[sTITLE]" data-content=3D'[!] [/!]

      [!] [/!][math][format days_to_date %d][dEVSDATE][/format][/math] [format days_to_date %B %Y][dEVSDATE][/format] [math][format seconds_to_time %I][math]{[tEVSTIME]}[/math][/format][/math][lowercase][format seconds_to_time :%M%p][math]{[tEVSTIME]}[/math][/format][/lowercase][!] [/!][hideif [url][dEVSDATE][tEVSTIME][/url]=3D[url][dEVFDATE][tEVFTIME][/url]][!] [/!] - [!] [/!][hideif [url][dEVSDATE][/url]=3D[url][dEVFDATE][/url]][math][!] [/!][format days_to_date %d][dEVFDATE][/format][/math] [format days_to_date %B %Y][dEVFDATE][/format] [!] [/!][/hideif][!] [/!][math][format seconds_to_time %I][math]{[tEVFTIME]}[/math][/format][/math][lowercase][format seconds_to_time :%M%p][math]{[tEVFTIME]}[/math][/format][/lowercase][!] [/!][/hideif][!] [/!]

      [smImageInclude imageId=3D[sIMAGE]&imageSize=3Dth&imageCaption=3DT&imageContainer=3Ddiv&ima= geClass=3Dright photo]
      [grep search=3D'&replace=3D'][smLimitwordstoMaxchars inputText=3D[url][xBTEXT][/url]&maxChars=3D100][/grep]
      [!] [/!]'>[sTITLE]
    • [/founditems]
    [!] [/!][/hideif][!] [/!][showif [numfound]=3D0]class=3D"day-inactive">[math][varDAY][/math][/showif][!] [/!][/search] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D On Thu, 28 Feb 2019 at 22:25, Steve Craig wrote: > Hi All > > I=E2=80=99m in the middle of producing a kind of basic CRM to track my co= mpanies > sales and construction jobs etc but I now have to add a kind of work diar= y > to it and I=E2=80=99m wondering if anyone has any examples of something I= could > integrate any code from. > > I seem to remember from years ago that there was some example code > snippets somewhere showing a basic calendar but I can=E2=80=99t seem to f= ind > anything now. > > Basically I will just have a db with various job names allocated to days > and I need to show them on a calendar, each job would be in blocks of a d= ay > long so it just has to be a basic thing. > > Any help or old code would be much appreciated. > > Cheers > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Steve Craig - Forest Products (Leisure) Ltd > Tel +44 1330 860505 Mob +44 7778 007607 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > http://www.forestlogcabins.com > Email: steve@forestlogcabins.com > Skype: s.craig - iChat: steve.craig > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Standard terms and conditions available here > http://forestlogcabins.com/Terms.html > Any sketches or illustrations supplied are subject to possible small > changes on the final factory plans. > > > > > > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list talk@webdna.us > To unsubscribe, E-mail to: talk-leave@webdna.us archives: > http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.u= s --0000000000002439d60589b439a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
    Steve,

    Hi - a late response to this sorry.=C2= =A0 A lot going on in my world recently.

    Here'= s a calendar I worked up for one of our clients:

    =

    The code that generates the monthly table is based on code posted o= n the WebDNA site years ago.=C2=A0 Snippets below.=C2=A0 I store dates in [= math{[date]}[/math] format and use Irish formatting - dd/mm/yyyy.

    Anyhow it might help as a starting pint.

    - Tom


    calendar.inc



    -------= -----------------------------
    ### =C2=A0Set up days and months tables= =C2=A0###

    [/!][table name=3Ddays&fields=3DNUM= BER,DAY,SKIP]
    0Saturday5
    1Sunday6
    2Monday0
    3Tuesday1
    4Wednes= day2=
    5= Thursday3
    6Friday4
    [/table][!]

    [/!= ][table name=3Dmonths&fields=3DNUMBER,NAME]
    01January
    0= 2Feb= ruary
    03March
    04April
    05May
    06June
    07July
    08<= /span>August
    09September
    10October
    11November
    1= 2Dec= ember
    [/table][!]

    [/!][text secure=3Df]v= arYEAR=3D[format days_to_date %Y][math]{[date]}[/math][/format][/text][!]
    [/!][text secure=3Df]varMONTH=3D[format days_to_date %m][math]{[da= te]}[/math][/format][/text][!]

    [/!][text secure=3D= f]varPREVYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}-{00= /01/0000}[/math][/format][/text][!]
    [/!][text secure=3Df]varPREVM= ONTH=3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}-{00/01/0000}= [/math][/format][/text][!]

    [/!][text secure=3Df]va= rNEXTYEAR=3D[format days_to_date %Y][math]{01/[varMONTH]/[varYEAR]}+{00/01/= 0000}[/math][/format][/text][!]
    [/!][text secure=3Df]varNEXTMONTH= =3D[format days_to_date %m][math]{01/[varMONTH]/[varYEAR]}+{00/01/0000}[/ma= th][/format][/text][!]

    [/!][text secure=3Df]the_co= ntents=3Dc_cell.inc[/text][!]


    ---------= ---------------------------
    ### =C2=A0initialize the month offset and= days variables =C2=A0###

    [/!][math show=3Df]offse= t=3D[lookup table=3Ddays&lookinfield=3Dnumber&value=3D[math]({01/[v= arMONTH]/[varYEAR]})%7[/math]&returnfield=3Dskip][/math][!]
    [= /!][math show=3Df]days=3D({01/[varMONTH]/[varYEAR]}+{00/01/0000})-{1/[varMO= NTH]/[varYEAR]}[/math]

    <br /><br />
    <table summary=3D"Events Calendar" class=3D"table= table-bordered table-responsive events-module-calendar">
    <= ;caption class=3D"text-center">[!]
    [/!]<a tabindex= =3D"0" class=3D"calendar-nav pull-left" data-year=3D&qu= ot;[varPREVYEAR]" data-month=3D"[varPREVMONTH]" href=3D"= ;[levelPATH]/[varPREVYEAR]/[varPREVMONTH]/"><i class=3D"fa = fa-chevron-left"></i><span class=3D"sr-only">= List events for [format days_to_date %B %Y][math]{01/[varPREVMONTH]/[varPRE= VYEAR]}[/math][/format]</span></a>[!]

    = [/!= ] [lookup table=3Dmonths&lookinfield=3Dnumber&value=3D[varMONTH]&am= p;returnfield=3Dname&notfound=3D[varMONTH]] [varYEAR] [!]
    = [/!]<a tabindex=3D"0" class=3D"calendar-nav pull= -right" data-year=3D"[varNEXTYEAR]" data-month=3D"[varN= EXTMONTH]" href=3D"#[!]/yfoe/events/calendar/[varNEXTYEAR]/[varNE= XTMONTH]/[/!]"><span class=3D"sr-only">List events = for [format days_to_date %B %Y][math]{01/[varNEXTMONTH]/[varNEXTYEAR]}[/mat= h][/format]</span><i class=3D"fa fa-chevron-right">&l= t;/i></a>[!]
    [/!]</caption>
    <thead>
    =
    <tr>[search table=3Ddays&neSKIPdata=3Dfind_all&asSKIPsort= =3D1][founditems]
    <th>
    <abbr title=3D"[day]&= quot; aria-hidden=3D"true" class=3D"visible-xs-inline"&= gt;[getchars start=3D1&end=3D1][day][/getchars]</abbr>
    = &= lt;span class=3D"hidden-xs">[day]</span>
    </th= >[/founditems][/search]
    </tr>
    </thead>

    <tbody>
    <tr>[loop start=3D1&end=3D[offs= et]]
    <td class=3D"day-blank">&nbsp;</td>[= /loop][loop start=3D1&end=3D[days]]
    <td [include file=3D/dat= a/db_events/[the_contents]&varDAY=3D[format .2d][index][/format]&va= rMONTH=3D[varMONTH]&varYEAR=3D[varYEAR]]</td>[showif [math]([inde= x]+[offset])%7[/math]=3D0]
    </tr>

    <tr&= gt;[/showif][text]daytot=3D[index][/text][/loop][math show=3Df]y=3D[daytot]= +[offset][/math][showif [y]<35][math show=3Df]z=3D35-[y][/math][/showif]= [showif [y]>35][math show=3Df]z=3D42-[y][/math][/showif][loop start=3D1&= amp;end=3D[z]]
    <td class=3D"day-blank">&nbsp;&l= t;/td>[/loop]
    </tr>
    </tbody>
    </tab= le>


    c_cell.inc
    <= /div>


    ### =C2=A0Pull in fr= ont end functions =C2=A0###

    [/!][include file=3D^s= iteminder/1.0.0/functions/smFrontEnd-functions.inc][!]

    =
    [/!][search db=3D/data/db_events/events.db[!]
    [/!]&max=3D1[!= ]
    = [/!]&ledEVSDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varYEAR]}[/= math][!]
    [/!]&gedEVFDATEdatarq=3D[math]{[varDAY]/[varMONTH]/[varY= EAR]}[/math][!]
    [/!]&allreqd=3DT][!]
    [/!][hideif [numfound]= =3D0][!]


    [/!]class=3D"day-active&= quot;><span class=3D"hidden-xs">[math][varDAY][/math]<= ;/span><a [!]href=3D"#[levelPATH]/[the_year]/[the_month]/[the_da= y]/"[/!] tabindex=3D"0" class=3D"visible-xs-inline-bloc= k btn btn-sm btn-success" role=3D"button" data-toggle=3D&quo= t;popover" data-trigger=3D"focus" data-html=3D"true&quo= t; data-placement=3D"top" title=3D"Events on [format days_to= _date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/format]" = data-content=3D"<ul>[founditems]<li><a href=3D'[lev= elPATH]/[varYEAR]/[varMONTH]/[varDAY]/[sSLUG]/'>[sTITLE]</a>&l= t;/li>[/founditems]</ul>">[!]

    [/!]&l= t;span aria-hidden=3D"true">[math][varDAY][/math]</span>= [!]

    [/!]<span class=3D"sr-only">List = the [numfound] event[showif [numfound]>1]s[/showif] taking place on [for= mat days_to_date %d %B %Y][math]{[varDAY]/[varMONTH]/[varYEAR]}[/math][/for= mat]</span>[!]

    [/!]</a>[!]

    =
    = [/!]<ul class=3D"hidden-xs">[founditems]
    =
    <li><a [!]href=3D"[levelPATH]/[varYEAR]/[varMONT= H]/[varDAY]/[sSLUG]/"[/!] tabindex=3D"0" role=3D"button= " data-toggle=3D"popover" data-trigger=3D"focus" d= ata-html=3D"true" data-placement=3D"top" title=3D"= <a href=3D'[levelPATH]/[varYEAR]/[varMONTH]/[varDAY]/[sSLUG]/'&g= t;[sTITLE]</a>" data-content=3D'[!]

    = [/!]<p class=3D"time small"><i class=3D"fa fa-clock= -o"></i> [!]
    [/!][math][format days_to_date %d][dE= VSDATE][/format][/math] [format days_to_date %B %Y][dEVSDATE][/format] [mat= h][format seconds_to_time %I][math]{[tEVSTIME]}[/math][/format][/math][lowe= rcase][format seconds_to_time :%M%p][math]{[tEVSTIME]}[/math][/format][/low= ercase][!]
    [/!][hideif [url][dEVSDATE][tEVSTIME][/url]=3D[url][= dEVFDATE][tEVFTIME][/url]][!]
    [/!] - [!]
    [/!][hid= eif [url][dEVSDATE][/url]=3D[url][dEVFDATE][/url]][math][!]
    [= /!][format days_to_date %d][dEVFDATE][/format][/math] [format days_to_date = %B %Y][dEVFDATE][/format] [!]
    [/!][/hideif][!]
    [/= !][math][format seconds_to_time %I][math]{[tEVFTIME]}[/math][/format][/math= ][lowercase][format seconds_to_time :%M%p][math]{[tEVFTIME]}[/math][/format= ][/lowercase][!]
    [/!][/hideif][!]
    [/!]</p>

    [smImageInclude imageId=3D[sIMAGE]&imageSize=3Dth&= amp;imageCaption=3DT&imageContainer=3Ddiv&imageClass=3Dright photo]=

    <div class=3D"news-content"> [grep= search=3D'&replace=3D&#39;][smLimitwordstoMaxchars inputText= =3D[url][xBTEXT][/url]&maxChars=3D100][/grep]</div>[!]
    =
    [/!]'>[sTITLE]</a></li>

    [/founditems]</ul>[!]

    [/!][/hideif][!]
    <= div>
    [/!][showif [numfound]=3D0]class=3D"day-inactive"&= gt;[math][varDAY][/math][/showif][!]

    [/!][/search]=




    =3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
    Digital Rev= olutionaries
    1st Floor, Castleriver House
    14-15 Parliament Street
    = Temple Bar,Dublin 2
    Ireland
    -----------------------------------------= -----
    [t]: + 353 1 4403907
    [e]: <mailto:tom@revolutionaries.ie>
    [w]: &l= t;http://www.r= evolutionaries.ie/>
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D


    On Thu, 28 Feb 2019 at 22:25, Steve Craig <steve@asylumweb.com> wrote:
    Hi All
    I=E2=80=99m in the middle of producing a kind of basic CRM to = track my companies sales and construction jobs etc but I now have to add a = kind of work diary to it and I=E2=80=99m wondering if anyone has any exampl= es of something I could integrate any code from.

    I= seem to remember from years ago that there was some example code snippets = somewhere showing a basic calendar but I can=E2=80=99t seem to find anythin= g now.

    Basically I will just have a db with variou= s job names allocated to days and I need to show them on a calendar, each j= ob would be in blocks of a day long so it just has to be a basic thing.

    Any help or old code would be much appreciated.
    =

    Cheers
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
    Steve Craig - Forest Products (Leisure)=C2=A0Ltd
    Tel +44 13= 30 860505 Mob +44 7778=C2=A0007607
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
    h= ttp://www.forestlogcabins.com
    Email: steve@forestlogcabins.com
    Skype: s.c= raig - iChat: steve.craig
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

    Standard terms and conditions available=C2=A0here=C2=A0http://forestlogcab= ins.com/Terms.html
    Any sketches or illustrations supplied are=C2=A0s= ubject to possible small changes on the=C2=A0final factory plans.





    --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@w= ebdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: suppo= rt@webdna.us
    --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --0000000000002439d60589b439a8-- . Tom Duke

    DOWNLOAD WEBDNA NOW!

    Top Articles:

    Talk List

    The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

    Related Readings:

    [NT] ie 4.0 required (1997) PCS Frames (1997) 2 databases problem (1997) Summary layout (1997) Emailer again (1997) multi-paragraph fields (1997) Web Logs (1998) url .. (2003) Which GUI HTML editors work with WC ? (1997) HUGE DATABASES (1998) Not really WebCat (1997) Further tests with the infamous shipCost (1997) YACBQ.....(Yet another checkbox question) (2000) PDF Example (2003) Duplicate Email (2003) UPDATE PROBLEM (1997) WebCat2 Append problem (B14Macacgi) (1997) WC2.0 Memory Requirements (1997) HTTP Header info (1997) Using Cookie for client specific info? (1997)