+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: php calendar??

  1. #1
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Unhappy php calendar??

    I have looked around for ages for a free php calendar with reasonable interface.

    The trouble is, the good ones tend to have user functions and back end database already set up.

    I already have an event db table and all I need is a bit of Javascript to produce a dynamic event calendar showing these events.

    Something like Supercali

    It has to be relatively simple to alter the db references and customise the .css to integrate it to my site.

    Anyone got any ideas?

  2. #2
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

  3. #3
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    Quote Originally Posted by kbjradmin View Post
    Thanks kbjradmin.

    Unforunately, this is one page in thousands that contain basic date/time pickers. The only true event calendar here isn't free and is again - complex.

  4. #4
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Re: php calendar??

    sorry i couldn't be more helpful.
    good luck finding a script. ;)

  5. #5
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    np - I didn't expect this to be a quick fix!

  6. #6
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    Any help on this would be appreciated and I will offer credits to someone who can point me in the right direction.

    ALL my credits for someone who fancies writing the script for me! ;) (although I would prefer to understand and create it myself).

  7. #7
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: php calendar??

    wow, all your credits...
    Well I don't have time to script one I'm afraid. What you are looking for is potentially pretty complicated (if anything like supercal).
    What do you have in your table? What views are required? It would save a lot of work if, say only a monthly view was needed. Is it necessary to have the seven-day layout? Or would a simple date-organised list of events do?
    Are you sure you want javascript? If so, will you need AJAX, or download the whole database into javascript when the page first loads?
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

  8. #8
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    Thanks for the response Matt.

    All I'm after are two views - Month view and day view. (with navigation) or even just month, but a simple list is not what I'm after (I could do this fairly simply). Each cell would have the event title (EVTITLE) with a link carrying the EVID in the URL.

    JS isn't critical although I'm not aware of a php system that can create calendar views.

    I don't know much about AJAX so couldn't comment.

    The .css should be relatively easy to alter to suit my colour scheme

    http://www.freecrm.x10hosting.com/csstest.php

    Each page would have user authentication (easy to add by referencing table:CONTACTS)

    The table I am referencing is [EVENTS]

    with the following field definitions

    Code:
    EVID (int,20 autoincrement, primary)
    EVCONTIDL (varchar,20, null:yes) relational link
    EVOPIDL (varchar,20, null:yes) relational link
    EVGROUPCODE (varchar, 50,  null:no) workgroup id to seperate groups
    EVCREATEDBY (varchar, 50, null:no)
    EVCREATEDWHEN (varchar,30, null:no) epoch created with time()
    EVEDITEDBY (varchar, 50, null:yes) 
    EVEDITEDWHEN (varchar, 30, null:yes) epoch created with time()
    EVTYPE (varchar, 30, null:yes) meeting, phone, todo etc.
    EVTITLE (varchar, 50, null:yes) title.. duh
    EVDESCRIPTION (longtext, null:yes)
    EVMANAGER (varchar, 50, null:no) associated to a user
    EVPRIORITY (varchar, 2, null:no) self-explanatory
    EVSTART (varchar, 30, null:no) when the event starts in epoch format
    EVDURATION (varchar, 30, null:no) how long is the event
    EVCOMPLETED (varchar, 1, null:no, default "N") checkbox
    All recordsets will use EVGROUPCODE to only see those records that match a session variable loaded on login.

    The only filters I need are by EVMANAGER (drop-down list), EVCOMPLETED (Y or N) and EVTYPE (only about 5 options here from drop-down menu)

    Don't want much do I? :laugh:

    I'm prepared to do the ground work but I do need quite a bit of guidance on this as my knowledge of JS is like... zero!
    Edit:
    OK Credit offer has now increased to 500
    Last edited by freecrm; 10-08-2008 at 06:58 AM. Reason: Automerged Doublepost

  9. #9
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: php calendar??

    Ok, if nobody else does it in the meantime, I might look into this at the weekend. Unfortunately I'm working long hours these days... (on damned complicated c++ code)
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

  10. #10
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    Quote Originally Posted by mattura View Post
    Ok, if nobody else does it in the meantime, I might look into this at the weekend. Unfortunately I'm working long hours these days... (on damned complicated c++ code)
    c++ is scary!

    Fortunately, I have done quite a bit of groundwork here and managed to get a month view created in php - but no dynamic links and no navigation yet...

    The calendar page is at http://www.freecrm.x10hosting.com/cr...calendar_m.php

    The code so far is

    PHP Code:
    <?php 
    session_start
    ();
    //set page timezone
    if ($_SESSION['MM_UTZ'] == NULL){
    $_SESSION['MM_UTZ']="UTC";}
    putenv ("TZ=".$_SESSION['MM_UTZ']);
    //set page timeformat
    if ($_SESSION['MM_UTF'] == NULL){
    $_SESSION['MM_UTF']="Y-m-d H:i:s";
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/fullpagetemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="EditRegionhead" -->
    <title>Welcome to Free CRM</title>
    <meta name="Description" content="Free CRM (Customer Relations Management) provides an unlimited fully functional online multi user CRM system." />
    <meta name="Keywords" content="CRM, Customer Relations Management, PRM, Contact Management, Contact Database, Online, Opportunity, Tasks, Calendar, To Do, Reports" />
    <style type="text/css">
    .calday 
    {
    font-family: Arial;
    border: 1px solid #006666;
    background-color:#E3E9F1;
    padding: 2px;
    border-collapse: collapse;
    empty-cells:show;
    }
    .caltoday {
    font-family: Arial;
    color:#FF3300;
    border: 3px solid #006666;
    background-color:#E3E9F1;
    padding: 2px;
    border-collapse: collapse;
    empty-cells:show;
    }
    </style>
    <?php
    class Calendar

     function 
    generate_calendar($year$month$day_func NULL$day_heading_length 3)
     {
      
    $first_of_month mktime (0,0,0$month1$year);
      static 
    $day_headings = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
      
    $maxdays   date('t'$first_of_month); #number of days in the month
      
    $date_info getdate($first_of_month);   #get info about the first day of the month
      
    $month     $date_info['mon'];
      
    $year      $date_info['year'];
      
    $calendar  "<br /><table width='100%' class='datatable'>";
      
    $calendar .= "<tr><td colspan='7' class='databox'>$date_info[month] $year</td></tr>";
      
    $calendar .= "
       <tr class='dataheading'>
        <td class='databox'>Sun</td>
        <td class='databox'>Mon</td>
        <td class='databox'>Tue</td>
        <td class='databox'>Wed</td>
        <td class='databox'>Thu</td>
        <td class='databox'>Fri</td>
        <td class='databox'>Sat</td>
       </tr>"

       
    $calendar .= "<tr>";
       
    $class  "";
       
    $weekday $date_info['wday']; #weekday (zero based) of the first day of the month
       
    $day 1#starting day of the month
       #take care of the first "empty" days of the month
       
    if($weekday 0)
       {
        
    $calendar .= "<td colspan='$weekday'> </td>";
       } 
    #print the days of the month
       
    while ($day <= $maxdays)
       {
                 if(
    $weekday == 7)
        { 
    #start a new week
         
    $calendar .= "</tr><tr>";
         
    $weekday 0;
        }
        
    $linkDate =  mktime (0,0,0$month$day$year);
        if(((
    $day<10 AND "0$day"==date('d')) OR ($day>=10 AND "$day"==date('d'))) AND (($month<10 AND "0$month"==date('m')) OR ($month>=10 AND "$month"==date('m'))) AND $year==date('Y'))
        {
         
    $class="caltoday";
        } 
        else
        {
         
    $d date('m/d/Y'$linkDate);
         
    $class "calday";            
        }            
         
    $link "dates.php?date=$linkDate";
         
    $calendar .= "<td class='$class'>$day</td>";            
         
    $day++;            
         
    $weekday++;        
        }        
        if(
    $weekday != 7)
        {            
         
    $calendar .= "<td colspan='" . ($weekday) . "'> </td>";        
        }        
        return 
    $calendar "</tr></table>";   
     }
    }
    ?>
    <!-- InstanceEndEditable -->
    <link href="../css/page.css" rel="stylesheet" type="text/css" />
    <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
    </head>
    <?php include ("../includes/googleanalytics.php");?>
    <body class="oneColFixCtr">
    <div id="container">
    <td>
    <?php include ("../includes/header.php");?>
    </td>
     <div id="mainContent">
     <!-- InstanceBeginEditable name="EditRegionmaincontent" -->
       <h1>Calendar</h1>
       <p>
          <?php 
     $MCal 
    = new Calendar;
     echo 
    $MCal -> generate_calendar(date('Y'), date('m'), $day_func NULL$day_heading_length 3);
     
    ?>
        </p>
            
       <!-- InstanceEndEditable -->
       <!-- end #mainContent -->
    </div>
    <td>
    <?php include("../includes/footer.php");?>
    </td>
    <!-- end #container -->
    </div>
    </body>
    <!-- InstanceEnd --></html>

+ Reply to Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. Important PHP Information
    By Bryon in forum News and Announcements
    Replies: 0
    Last Post: 11-21-2007, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers