⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calendar.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>

<html>
<head>
<title>日程安排查询</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script>
my_top=50;
my_left=50;

function my_note(CAL_ID)
{
  my_top+=25;
  my_left+=15;

  window.open("note.php?CAL_ID="+CAL_ID,"note_win"+CAL_ID,"height=170,width=180,status=0,toolbar=no,menubar=no,location=no,scrollbars=auto,top="+ my_top +",left="+ my_left +",resizable=no");
}

function My_Submit()
{
  document.form1.submit();
}

function set_year(op)
{
  if(op==-1 && document.form1.YEAR.selectedIndex==0)
     return;
  if(op==1 && document.form1.YEAR.selectedIndex==(document.form1.YEAR.options.length-1))
     return;
  document.form1.YEAR.selectedIndex=document.form1.YEAR.selectedIndex+op;

  My_Submit();
}

function set_mon(op)
{
  if(op==-1 && document.form1.MONTH.selectedIndex==0)
     return;
  if(op==1 && document.form1.MONTH.selectedIndex==(document.form1.MONTH.options.length-1))
     return;
  document.form1.MONTH.selectedIndex=document.form1.MONTH.selectedIndex+op;

  My_Submit();
}

function user_list(str)
{
  parent.user_list.location=str+"&DEPT_ID="+document.form1.DEPT_ID.value;
}

function cur_month(str)
{
  location=str+"&DEPT_ID="+document.form1.DEPT_ID.value;
}

</script>
</head>

<body class="bodycolor" topmargin="5">
	
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
	<form action="calendar.php"  method="post" name="form1">
  <tr>
    <td class="Big3"><img src="/images/menu/calendar.gif" WIDTH="22" HEIGHT="20" align="absmiddle"> 日程安排查询

<?
$CUR_YEAR = date('Y');
$CUR_MON = date('m');
$CUR_DAY = date('d');

$DATE=1;
$DAY=1;

if(!$YEAR)
   $YEAR = $CUR_YEAR;
if(!$MONTH)
   $MONTH = $CUR_MON;

if($YEAR>9999 or $YEAR<0){
  echo  "<script>
    alert('年份超出范围!')
    history.go(-1)
    </script>
  ";
  exit;
}

if($MONTH>12 or $MONTH<0){
  echo  "<script>
    alert('月份超出范围!')
    history.go(-1)
    </script>
  ";
  exit;
}

while (checkdate($MONTH,$DATE,$YEAR))
  $DATE++;
?>

        <select name="DEPT_ID" class="BigSelect" onchange="parent.user_list.location='blank.php'">
<?
        echo my_dept_tree(0,$DEPT_ID,1);
?>
        </select>&nbsp;

<!-------------- 年 ------------>
        <input type="button" value="〈" class="BigButton" title="上一年" onclick="set_year(-1);"><select name="YEAR" class="BigSelect" onchange="My_Submit();">
<?
        for($I=2000;$I<=2015;$I++)
        {
?>
          <option value="<?=$I?>" <? if($I==$YEAR) echo "selected";?>><?=$I?></option>
<?
        }
?>
        </select><input type="button" value="〉" class="BigButton" title="下一年" onclick="set_year(1);"> <b>年</b>

<!-------------- 月 ------------>
        <input type="button" value="〈" class="BigButton" title="上一月" onclick="set_mon(-1);"><select name="MONTH" class="BigSelect" onchange="My_Submit();">
<?
        for($I=1;$I<=12;$I++)
        {
          if($I<10)
             $I="0".$I;
?>
          <option value="<?=$I?>" <? if($I==$MONTH) echo "selected";?>><?=$I?></option>
<?
        }
?>
        </select><input type="button" value="〉" class="BigButton" title="下一月" onclick="set_mon(1);"> <b>月</b>&nbsp;
        <input type="button" value="本月" class="BigButton" title="本月" onclick="javascript:cur_month('calendar.php?YEAR=<?=$CUR_YEAR?>&MONTH=<?=$CUR_MONTH?>');">
    </td>
  </tr>
  </form>
</table>

  <table border="0" cellspacing="1" class="small" bgcolor="#000000" cellpadding="3" align="center">
    <tr align="center" class="TableHeader">
      <td width="30" bgcolor="#FFCCFF"><b>日</b></td>
      <td width="30"><b>一</b></td>
      <td width="30"><b>二</b></td>
      <td width="30"><b>三</b></td>
      <td width="30"><b>四</b></td>
      <td width="30"><b>五</b></td>
      <td width="30" bgcolor="#CCFFCC"><b>六</b></td>
      <td width="50"><b>周次</b></td>
    </tr>

<?
$WEEK_COUNT=0;

while ($DAY<$DATE)
{
  if($DAY == $CUR_DAY && $YEAR == $CUR_YEAR && $MONTH == $CUR_MON)
     $DAY_COLOR = "TableContent";
  else
     $DAY_COLOR = "TableData";

  $WEEK=date("w",mktime(0,0,0,$MONTH,$DAY,$YEAR));

  if ($WEEK==0 || $DAY==1)
  {
?>
   <tr>
<?
  }

  if($DAY==1)
  {
    for($I=0;$I<$WEEK;$I++)
    {
?>
     <td class="TableData" width="30">&nbsp;</td>
<?
    }
  }
?>
     <td class="<?=$DAY_COLOR?>" width="30" align="center">
       <b><a href="javascript:user_list('user_list.php?YEAR=<?=$YEAR?>&MONTH=<?=$MONTH?>&BEGIN_DAY=<?=$DAY?>&END_DAY=<?=$DAY?>');"><?=$DAY?></a></b>
     </td>
<?
  if ($WEEK==6)
  {

      $WEEK_COUNT++;

      $BEGIN_DAY=$DAY-6;
      if($BEGIN_DAY<0)
         $BEGIN_DAY=1;
?>
     <td class="TableData" width="50" align="center"><a href="javascript:user_list('user_list.php?YEAR=<?=$YEAR?>&MONTH=<?=$MONTH?>&BEGIN_DAY=<?=$BEGIN_DAY?>&END_DAY=<?=$DAY?>');">第<?=$WEEK_COUNT?>周</a></td>
   </tr>
<?
  }

  $DAY++;
}//while

//------------- 补结尾空格 -------------
if($WEEK!=6)
{
  for($I=$WEEK;$I<6;$I++)
  {
?>
     <td class="TableData" width="30">&nbsp;</td>
<?
  }

  $WEEK_COUNT++;

  $DAY--;
  $BEGIN_DAY=$DAY-$WEEK;
  if($BEGIN_DAY<0)
     $BEGIN_DAY=1;
?>
     <td class="TableData" width="50" align="center"><a href="javascript:user_list('user_list.php?YEAR=<?=$YEAR?>&MONTH=<?=$MONTH?>&BEGIN_DAY=<?=$BEGIN_DAY?>&END_DAY=<?=$DAY?>');">第<?=$WEEK_COUNT?>周</a></td>
   </tr>
<?
}
?>
</table>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -