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

📄 appointment.tmp.html.en.php

📁 FP2 CRM code+Mysql DB
💻 PHP
字号:
<link rel="stylesheet" href="dhtmlgoodies_calendar/dhtmlgoodies_calendar.css?random=20051112" media="screen"></LINK>
<SCRIPT type="text/javascript" src="dhtmlgoodies_calendar/dhtmlgoodies_calendar.js?random=20060118">
</script>
<script language ="Javascript">
/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	//var strMonth=dtStr.substring(0,pos1)
	//alert(strMonth)
	//var strDay=dtStr.substring(pos1+1,pos2)
	var strDay=dtStr.substring(0,pos1)
	//alert(strMonth)
	var strMonth=dtStr.substring(pos1+1,pos2)

	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function ValidateForm(date){
	//var dt=document.getElementById("start");
	if (isDate(date.value)==false){
		date.focus()
		return false
	}
    return true
 }

</script>


<script>

function validatform()
{
	if(document.getElementById("subject").value == ""){
		alert("Please Enter Subject");
		document.getElementById("subject").focus();
		return false;
	}
	if(document.getElementById("start").value == ""){
		alert("Please Enter Appointment Start date");
		document.getElementById("start").focus();
		return false;
	} 
	if(ValidateForm(document.getElementById("start")) == false)
	{
	    return false;
	}
	if(document.getElementById("shour").value == ""){
		alert("Please Enter Appoint Start Time");
		document.getElementById("shour").focus();
		return false;
	}
	if(document.getElementById("smin").value == ""){
		alert("Please Enter Complete Appointment Start Time");
		document.getElementById("smin").focus();
		return false;
	}
	
	if(document.getElementById("end").value == ""){
		alert("Please Enter Appointment End date");
		document.getElementById("end").focus();
		return false;
	}
	if(ValidateForm(document.getElementById("end")) == false)
	{
	    return false;
	}
	if(document.getElementById("ehour").value == ""){
		alert("Please Enter Appoint End Time");
		document.getElementById("ehour").focus();
		return false;
	}
	if(document.getElementById("emin").value == ""){
		alert("Please Enter Complete Appointment End Time");
		document.getElementById("emin").focus();
		return false;
	}
	if(document.getElementById("description").value == ""){
		alert("Please Enter description");
		document.getElementById("description").focus();
		return false;
	}
	return true;
}

</script>

<style type="text/css">
<!--
.style1 {color: #ECE9D8}
-->
</style>
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td><?php echo $this->elements['form1']->toHtmlnoClose();?>
      <table width="65%" border="0" align="center" cellpadding="3">
        <tr>
          <td width="28%" class="fromLabel"><div align="right">Subject:*</div></td>
          <td colspan="3"><input name="subject" type="text" class="textbox" id="subject" value="<?php echo htmlspecialchars($t->subject);?>" size="50" maxlength="100">
            </td>
          <td width="7%">&nbsp;</td>
        </tr>
        <tr>
          <td class="fromLabel"><div align="right">Location:</div></td>
          <td colspan="3"><input name="location" type="text" class="textbox" id="location" value="<?php echo htmlspecialchars($t->location);?>" size="50" maxlength="100">
            </td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td rowspan="2" valign="top" class="fromLabel"><div align="right">Start:*</div></td>
          <td colspan="3"><input name="start" type="text" id="start" value="<?php echo htmlspecialchars($t->startdate);?>">&nbsp;<img src="templates/images/calendar.gif" alt="Calandar" height="16" width="16" onClick="displayCalendar(document.forms[0].start,'dd/mm/yyyy',this)" style="vertical-align:middle "></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td width="9%"><input name="hdn_hour" type="hidden" value="<?php echo htmlspecialchars($t->shour);?>">
		  <script>
		  function showhour(txt){
		  
		  if(document.form1.hdn_hour.value != '')
		  	txt.selected.option[document.form1.hdn_hour.value];
			
		  
		  }
		  </script>
		  <?php echo $this->elements['shour']->toHtml();?></td>
          <td width="10%">
		  <?php echo $this->elements['smin']->toHtml();?>
		  </td>
          <td width="46%">
		  <?php echo $this->elements['sampm']->toHtml();?>
		  </td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td rowspan="2" valign="top" class="fromLabel"><div align="right">End:*</div></td>
          <td colspan="3"><input name="end" type="text" id="end" value="<?php echo htmlspecialchars($t->enddate);?>">&nbsp;<img src="templates/images/calendar.gif" alt="Calandar" height="16" width="16" onClick="displayCalendar(document.forms[0].end,'dd/mm/yyyy',this)" style="vertical-align:middle "></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>
		  <?php echo $this->elements['ehour']->toHtml();?>
		  </td>
          <td>
		  <?php echo $this->elements['emin']->toHtml();?>
		  </td>
          <td>
		  <?php echo $this->elements['eampm']->toHtml();?>
		  </td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td colspan="3">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td valign="top" class="fromLabel"><div align="right">Description:*</div></td>
          <td colspan="3"><?php echo $this->elements['description']->toHtml();?>
          </td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="fromLabel"><div align="right">Alert Time Before : </div></td>
          <td colspan="2"><?php echo $this->elements['alert_time']->toHtml();?></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="fromLabel">&nbsp;</td>
          <td colspan="3"><?php echo $this->elements['btn_save']->toHtml();?>
            <?php echo $this->elements['btn_add']->toHtml();?>
            <?php echo $this->elements['btnback']->toHtml();?>
            <input name="id" type="hidden" id="id" value="<?php echo htmlspecialchars($t->id);?>"></td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>

⌨️ 快捷键说明

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