thanx for quick reply…
here are the code of 3 files from which events & calendar loaded
--------------calendar.php----------------
<?php
include("inc/connection.php");
session_start();
$_SESSION['username'];
$_SESSION['access_level'];
$_SESSION['id'];
if($_SESSION['username']=='')
{
echo("");
}
if(isset($_REQUEST["Submit4"])=="Save")
{
extract($_POST);
$cquery=mysql_query("select * from event_manage where username='".$_SESSION["username"]."'");
$RowuserId=mysql_fetch_assoc($cquery);
if(mysql_num_rows($cquery)>0)
{
$query=mysql_query("update event_manage set
Month='".$Month."',
Week='".$Week."',
Day='".$Day."',
Next4Days='".$Next4Days."',
WorkWeek='".$WorkWeek."',
Agenda='".$Agenda."',
StartTime='".$StartTime."',
EndTime='".$EndTime."',
StartWeek='".$StartWeek."',
timeformat='".$timeformat."',
DEF_VIEW='".$DEF_VIEW."'
where username='".$_SESSION["username"]."'
" );
}
else {
$query=mysql_query("insert into event_manage set
username='".$_SESSION["username"]."',
Month='".$Month."',
Week='".$Week."',
Day='".$Day."',
Next4Days='".$Next4Days."',
WorkWeek='".$WorkWeek."',
Agenda='".$Agenda."',
StartTime='".$StartTime."',
EndTime='".$EndTime."',
StartWeek='".$StartWeek."',
timeformat='".$timeformat."',
DEF_VIEW='".$DEF_VIEW."'
" );
}
}
?>
TMS : Calendar
<script src="codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<script src="codebase/ext/dhtmlxscheduler_agenda_view.js" type="text/javascript" charset="utf-8">/*for agends*/</script>
<script src="codebase/ext/dhtmlxscheduler_editors.js" type="text/javascript" charset="utf-8"></script>
<script src="codebase/ext/dhtmlxscheduler_readonly.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="dhtmlxcombo/codebase/dhtmlxcombo.css">
<script src="dhtmlxcombo/codebase/dhtmlxcommon.js"></script>
<script src="dhtmlxcombo/codebase/dhtmlxcombo.js"></script>
<script src="dhtmlxcombo/codebase/ext/dhtmlxcombo_extra.js"></script>
html, body{
margin:0px;
padding:0px;
height:100%;
overflow:auto;
}
.dhx_tooltip {
border:1px solid #BBB;
background-image:url(./imgs/databg.png);
position:absolute;
z-index:9998;
width:300px;
height:auto;
font-family:Tahoma;
font-size:14pt;
overflow:hidden;}
.dhx_tooltip_line{
line-height:20px;
height:20px;
overflow:hidden;}
.dhx_tooltip_line .dhx_event_icon{
width:20px;
height:20px;
padding-right:10px;
float:left;
border-width:0;
position:relative;
background:url(./imgs/icon.png) no-repeat;
background-position:5px 4px;cursor:pointer;}
.dhx_tooltip_date{
float:left;
width:auto;padding-left:5px;
text-align:right;}
.dhtmlXTooltip.tooltip{
-moz-box-shadow:3px 3px 3px #888;
-khtml-box-shadow:3px 3px 3px #888;
border-left:1px dotted #887A2E;
border-top:1px dotted #887A2E;
color:#887A2E;cursor:default;padding:10px;740606
position:absolute;z-index:500;}
.dhx_tooltip{
-moz-box-shadow:2px 2px 2px #888; /*Doesn't work in IE*/
-khtml-box-shadow: 2px 2px 2px #888;
}
.dhx_tooltip {
background-image:url("codebase/imgs/databg.png");
}
.dhx_tooltip_line {
color:#FF0000;
}
.dhx_tooltip {
background-image:url("codebase/imgs/databg.png");
}
.dhtmlXTooltip.tooltip{
border-left:1px dotted #FFFFFF;
border-top:1px dotted #FFFFFF;
background-color:white;
font-family:Verdana;
font-size:8pt;
color:#5e5e5e;
}
<?php
$qry=mysql_query("select * from event_manage where username='".$_SESSION["username"]."' ");
if(mysql_num_rows($qry)>0)
{
$row=mysql_fetch_array($qry);
}
$qry1=mysql_query("select * from events_rec where assigned_user='".$_SESSION["username"]."' ");
if(mysql_num_rows($qry1)>0)
{
$row1=mysql_fetch_array($qry1);
}
?>
<?php include("inc/header.php"); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td width="10%" align="center" valign="middle"> <strong>Search Tasks: </strong> </td>
<td width="27%" align="left" valign="middle"><input type="text" size="50" /></td>
<td width="11%" align="left" valign="middle"> <input type="image" id="submit" src="images/subit.png" /></td>
<td width="52%" align="right" valign="middle"><strong>Legend: <img src="images/not_started.png" alt="Not Started" width="16" height="16" /> Not Started
In
Progress
Completed
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td>
<div class="left-heading">Organize By </div>
<div class="left-t-cnt">
<form action="" id="Organize" name="Organize" method="post">
<table width="96%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><strong>Priorities:</strong>
<input type='checkbox' name='checkpriority' onclick='checkAll(Organize);' checked>
<strong>Check/Uncheck All </strong>
<div class="left-scr">
<input type="checkbox" name="checkpriority" checked>
<label for="organizePriority0">Low </label>
<input type="checkbox" value="1"
name="checkpriority" checked>
<label for="organizePriority1">Medium</label>
<br>
<input type="checkbox" name="checkpriority" checked>
<label for="organizePriority2">High</label> <br>
<div style="height:19px; overflow:hidden;">
<input type="checkbox"
name="checkpriority" checked>
<label for="organizePriority3">Alert</label>
<br>
<tr>
Status:
<input type="checkbox" onclick="doFilter(this)" value="NST" checked name="organizeStatus" id="organizeStatusNST"><label for="organizePriorityNST">Not Started</label>
In Progress
Completed
<BR/>
Assigned By:
<input name="" type="text" /> </td>
</tr>
</table> </form>
</div> </td>
|
<td> </td>
<td valign="top">
<div class="left-heading"><a href="#TB_inline?height=450&width=650&inlineId=NewCalender" title="Add / Remove Calender" class="thickbox">New Calender</a></div>
<form id="AddCalendar" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="left-scr2">
<table width="100%">
<?php
// echo "select c.*,u.* from calendar_sharing c inner join users u on c.user_id=u.id where user_id='".$_SESSION['id']."";
$calShared=mysql_query("select c.*,u.firstname,u.lastname,u.id,u.profile_color from calendar_sharing c inner join users u on c.calendar_id_shared=u.id where user_id='".$_SESSION['id']."'");
if(mysql_num_rows($calShared)>0)
{
while ($row=mysql_fetch_array($calShared))
{
?>
<tr bgcolor="<?php echo $row['profile_color'];?>">
<td height="25" align="left" valign="middle">
<input type="checkbox" name="chk2" checked="checked" value="<?php echo $row['calendar_id_shared'];?>"/>
<?php echo $row['firstname'];?> </tr><?php }
}
$mycal=mysql_query("select * from calendar where user_id='".$_SESSION['id']."'");
if(mysql_num_rows($mycal)>0)
{
$row=mysql_fetch_array($mycal);
}?>
<tr bgcolor="<?php echo $row['color'];?>">
<td height="25" align="left" valign="middle">
<input type="checkbox" name="chk2" checked="checked" value="<?php echo $row['user_id'];?>"/>
<?php echo "My Calendar";?> </td>
</tr></table>
</div>
</tr>
<tr bgcolor="#99CCFF">
<td height="30"> <input type='checkbox' name='checkall' checked="checked" onclick='checkedAll(AddCalendar);'> <strong>Check/Uncheck All</strong></td>
</tr>
</table> </form></td>
<div id="scheduler_here" class="dhx_cal_container" style='width:84%; height:95%; float:left'>
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button"> </div>
<div class="dhx_cal_next_button"> </div>
<div class="dhx_minical_icon" id="dhx_minical_icon" onClick="show_minical()"> </div>
<div class="dhx_cal_setting">
<img src="codebase/imgs/setting.png">
<a href="#TB_inline?height=300&width=600&inlineId=hiddenSearchBox" title="Change Calendar Setting" class="thickbox">Settings</a></div>
<?php
$UsreCheck=mysql_query("select * from event_manage where username='".$_SESSION["username"]."'");
$RowUserquery=mysql_fetch_assoc($UsreCheck);
$RowCount=mysql_num_rows($UsreCheck);
if($RowCount>0)
{
?>
<?php
if($RowUserquery["Day"]=="Day")
{
?>
<div class="dhx_cal_tab" name="day_tab" style="right:230px;"></div>
<?php } ?>
<?php
if($RowUserquery["Week"]=="Week")
{
?>
<div class="dhx_cal_tab" name="week_tab" style="right:300px;"></div>
<?php } ?>
<?php
if($RowUserquery["WorkWeek"]=="WorkWeek")
{
?>
<div class="dhx_cal_tab" name="workweek_tab" style="right:90px;"></div>
<?php } ?>
<?php
if($RowUserquery["Next4Days"]=="Next4Days")
{
?>
<div class="dhx_cal_tab" name="decade_tab" style="right:160px; "></div>
<?php } ?>
<?php
if($RowUserquery["Month"]=="Month")
{
?>
<div class="dhx_cal_tab" name="month_tab" style="right:370px;"></div>
<?php } ?>
<?php
if($RowUserquery["Agenda"]=="Agenda")
{
?>
<div class="dhx_cal_tab" name="agenda_tab" style="right:20px;"></div>
<?php } ?>
<?php } else {?>
<div class="dhx_cal_tab" name="day_tab" style="right:230px;"></div>
<div class="dhx_cal_tab" name="week_tab" style="right:300px;"></div>
<div class="dhx_cal_tab" name="workweek_tab" style="right:90px;"></div>
<div class="dhx_cal_tab" name="decade_tab" style="right:160px; "></div>
<div class="dhx_cal_tab" name="month_tab" style="right:370px;"></div>
<div class="dhx_cal_tab" name="agenda_tab" style="right:20px;"></div>
<?php } ?></div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
</div>
<?php include("inc/footer.php");?>
<?php include("SettingCalendar.php");?>
<?php include("NewCalender.php");?>
-------------------------events_rec.php--------------------------
<?php
include ('../codebase/connector/scheduler_connector.php');
include ('../common/config.php');
$res=mysql_connect($server, $user, $pass);
mysql_select_db($db_name);
$user_id = $_GET['user'];
function delete_related($action){
global $scheduler;
$status = $action->get_status();
$type =$action->get_value("rec_type");
$pid =$action->get_value("event_pid");
//when serie changed or deleted we need to remove all linked events
if (($status == "deleted" || $status == "updated") && $type!=""){
$scheduler->sql->query("DELETE FROM events_rec WHERE event_pid='".$scheduler->sql->escape($action->get_id())."'");
}
if ($status == "deleted" && $pid !=0){
$scheduler->sql->query("UPDATE events_rec SET rec_type='none' WHERE event_id='".$scheduler->sql->escape($action->get_id())."'");
$action->success();
}
}
function insert_related($action){
$status = $action->get_status();
$type =$action->get_value("rec_type");
if ($status == "inserted" && $type=="none")
$action->set_status("deleted");
}
$scheduler = new schedulerConnector($res);
$scheduler->enable_log("log.txt",true);
function default_values($action){
global $user_id;
$user_id = $action->get_value("userId");
if ($user_id == "") $user_id = $_GET['user'];
$action->set_value("userId",$user_id);
}
$scheduler->event->attach("beforeProcessing","delete_related");
$scheduler->event->attach("afterProcessing","insert_related");
$scheduler->event->attach("beforeProcessing","default_values");
if ($scheduler->is_select_mode())
$scheduler->render_sql("SELECT e.*, c.color,c.user_id,c.calendar_name FROM `events_rec` e INNER JOIN calendar c ON e.for_user = c.calendar_name WHERE c.user_id = '".$user_id."' ",
"event_id","start_date,end_date,event_name,event_type,rec_type,event_pid,event_length,department,for_user,status,priority,description,color,userId");
else
// $scheduler->render_table("events_rec","event_id","start_date,end_date,event_name,event_type,rec_type,event_pid,event_length,department,for_user,status,priority,assigned_user,description");
$scheduler->render_table("events_rec","event_id","start_date,end_date,event_name,event_type,rec_type,event_pid,event_length,department,for_user,status,priority,description,userId");
?>
-------------events_rec_shared.php------------------
<?php
include ('../codebase/connector/scheduler_connector.php');
include ('../common/config.php');
$res=mysql_connect($server, $user, $pass);
mysql_select_db($db_name);
$user_id = $_GET['user'];
function delete_related($action){
global $scheduler;
$status = $action->get_status();
$type =$action->get_value("rec_type");
$pid =$action->get_value("event_pid");
//when serie changed or deleted we need to remove all linked events
if (($status == "deleted" || $status == "updated") && $type!=""){
$scheduler->sql->query("DELETE FROM events_rec WHERE event_pid='".$scheduler->sql->escape($action->get_id())."'");
}
if ($status == "deleted" && $pid !=0){
$scheduler->sql->query("UPDATE events_rec SET rec_type='none' WHERE event_id='".$scheduler->sql->escape($action->get_id())."'");
$action->success();
}
}
function insert_related($action){
$status = $action->get_status();
$type =$action->get_value("rec_type");
if ($status == "inserted" && $type=="none")
$action->set_status("deleted");
}
$scheduler = new schedulerConnector($res);
$scheduler->enable_log("log.txt",true);
function default_values($action){
global $user_id;
$user_id = $action->get_value("userId");
if ($user_id == "") $user_id = $_GET['user'];
$action->set_value("userId",$user_id);
}
$scheduler->event->attach("beforeProcessing","delete_related");
$scheduler->event->attach("afterProcessing","insert_related");
$scheduler->event->attach("beforeProcessing","default_values");
if ($scheduler->is_select_mode())
$scheduler->render_sql("SELECT e.*, c.color,c.user_id FROM `events_rec` e INNER JOIN calendar c ON e.for_user = c.calendar_name WHERE e.event_type='1' and c.user_id != '".$user_id."' ",
"event_id","start_date,end_date,event_name,event_type,rec_type,event_pid,event_length,department,for_user,status,priority,description,color,userId");
else
$scheduler->render_table("events_rec","event_id","start_date,end_date,event_name,event_type,rec_type,event_pid,event_length,department,for_user,status,priority,description ");
?>