Current File : /home/inlingua/www/dwarka/icentex/admin_fd/ingl_course.form.php
<?php 
// Copyright, Panalink Infotech Limited. Created on: 27-11-2010
// Include header
include "header_fd.php";
?>
<h3>&nbsp;&nbsp;&nbsp;Add New Course</h3>

<div style="margin-left:10px;">

<?php

echo '<h4>'.$succFailMesg.'</h4>'; 



// Show result of a form submission?

if ($showResult == "Y")

{	//echo "<br><a href='ingl_course.select.php'>Back</a><br>";



header("Location:ingl_course.select.php");

	// Include footer

	include "../footer.php";

	return; 

}

?>
<script type="text/javascript" src="js/student.js"></script>

<script language="javascript">

<!--

function validate(form) 

{	

//var inputFormDiv = document.getElementById('myDiv');

//alert(inputFormDiv.getElementById('email').length);



if (form.recNo.value=="")

	{	alert("recNo cannot be blank. Please enter it.");

		form.recNo.focus(); return false;

	}

	if (form.course_suffix.value=="")

	{	alert("Course ID cannot be blank. Please enter it.");

		form.course_suffix.focus(); return false;

	}

	

	if (form.name_pie.value=="")

	{	alert("Name of PIE cannot be blank. Please enter it.");

		form.name_pie.focus(); return false;

	}

	

	if (form.language.value=="")

	{	alert("Please select language .");

		form.language.focus(); return false;

	}

	if (form.level.value=="")

	{	alert("Please select level.");

		form.level.focus(); return false;

	}

	if (form.startdate.value=="")

	{	alert("Start date cannot be blank. Please enter it.");

		form.startdate.focus(); return false;

	}

	

	if (form.enddate.value=="")

	{	alert("End date cannot be blank. Please enter it.");

		form.enddate.focus(); return false;

	}

	if (form.start_hour.value=="00" && form.end_hour.value=="00")

	{	alert("Please select the timings.");

		//form.startdate.focus();

		 return false;

	}

	

	if(form.end_hour.value<form.start_hour.value)

	{

	    alert("Please enter the time in 24 hour time format ex. 7:00 PM as 19:00 Hrs.");

		//form.startdate.focus();

		 return false;

	}

	

	return true;

}

-->







</script>

<script language="javascript">

	

	function monthDiff(start, end) {

                var tempDate = new Date(start);

                var monthCount = 0;

                while((tempDate.getMonth()+''+tempDate.getFullYear()) != (end.getMonth()+''+end.getFullYear())) {

                    monthCount++;

                    tempDate.setMonth(tempDate.getMonth()+1);

                }

                return monthCount+1;

            }

	

$(function() {

	          

		$('#datepicker3').datepicker({

			changeMonth: true,

			changeYear: true,

			

			onSelect: function(date) {

                        date1=$('#datepicker4').datepicker('getDate');

			date2=$.datepicker.formatDate('yy-mm-dd', date1);

			

			

			if(date1!=null)

			{

                             tmonth=1;

			     //alert(tmonth);

			     // Set the date format to something that is easy for our backend to understand...

				Date.format = 'yyyy-mm-dd';

				

				// Save a reference to the hidden input form field...

				var $hiddenInput = $('#selectedDate');

				

				// and a reference to the element we are turning into a date picker...

				var $mm = $('#multimonth');

				

				// initialise the date picker with your chosen settings

				$mm.datePickerMultiMonth(

					{

						startDate: date,

						endDate: date2,

						numMonths: tmonth,

						inline: true,

						selectMultiple: true

					}

				);

				

				// set all of the current dates selected

				var selectedDates = $hiddenInput.val().split(',');

				for (var i=0; i<selectedDates.length; i++) {

					$mm.dpmmSetSelected(  

						selectedDates[i]

					)

				}

				

				// listen for changes in the selected dates status

				$mm.bind( 

					'dateSelected',

					function(event, date, $td, status)

					{

						// and update the hidden field with a comma seperated list of selected dates...

						var selectedDates = $mm.dpmmGetSelected();

						for (var i=0; i<selectedDates.length; i++) {

							selectedDates[i] = selectedDates[i].asString();

						}

						$hiddenInput.val(selectedDates.join(','));

						$('#cancelled_days').html(selectedDates.join(' ,'));

					}

				);

				

				

				// and just for debugging on this page...

				$('#showHiddenValue').bind(

					'click',

					function(e)

					{

						alert($hiddenInput.val());

						return false;

					}

				);



			

			}

                      }

		});

	});

	$(function() {

		$('#datepicker4').datepicker({

			changeMonth: true,

			changeYear: true,

			onSelect: function(date) {

                        date1=$('#datepicker3').datepicker('getDate');

			date2=$.datepicker.formatDate('yy-mm-dd', date1);

			if(date1!=null)

			{

				//alert(date2);

				

			     tmonth=1;

			     //alert(tmonth);

			     // Set the date format to something that is easy for our backend to understand...

				Date.format = 'yyyy-mm-dd';

				

				// Save a reference to the hidden input form field...

				var $hiddenInput = $('#selectedDate');

				

				// and a reference to the element we are turning into a date picker...

				var $mm = $('#multimonth');

				

				// initialise the date picker with your chosen settings

				$mm.datePickerMultiMonth(

					{

						startDate: date2,

						endDate: date,

						numMonths: tmonth,

						inline: true,

						selectMultiple: true

					}

				);

				

				// set all of the current dates selected

				var selectedDates = $hiddenInput.val().split(',');

				for (var i=0; i<selectedDates.length; i++) {

					$mm.dpmmSetSelected(  

						selectedDates[i]

					)

				}

				

				// listen for changes in the selected dates status

				$mm.bind( 

					'dateSelected',

					function(event, date, $td, status)

					{

						// and update the hidden field with a comma seperated list of selected dates...

						var selectedDates = $mm.dpmmGetSelected();

						for (var i=0; i<selectedDates.length; i++) {

							selectedDates[i] = selectedDates[i].asString();

						}

						$hiddenInput.val(selectedDates.join(','));

						$('#cancelled_days').html(selectedDates.join(' ,'));

					}

				);

				

				

				// and just for debugging on this page...

				$('#showHiddenValue').bind(

					'click',

					function(e)

					{

						alert($hiddenInput.val());

						return false;

					}

				);





				

			}

                      }

		});

	});
	$(function() {

		$('#datepicker6').datepicker({

			changeMonth: true,

			changeYear: true,

			onSelect: function(date) {

                        date1=$('#datepicker3').datepicker('getDate');

			date2=$.datepicker.formatDate('yy-mm-dd', date1);

			if(date1!=null)

			{

				//alert(date2);

				

			     tmonth=1;

			     //alert(tmonth);

			     // Set the date format to something that is easy for our backend to understand...

				Date.format = 'yyyy-mm-dd';

				

				// Save a reference to the hidden input form field...

				var $hiddenInput = $('#selectedDate');

				

				// and a reference to the element we are turning into a date picker...

				var $mm = $('#multimonth');

				

				// initialise the date picker with your chosen settings

				$mm.datePickerMultiMonth(

					{

						startDate: date2,

						endDate: date,

						numMonths: tmonth,

						inline: true,

						selectMultiple: true

					}

				);

				

				// set all of the current dates selected

				var selectedDates = $hiddenInput.val().split(',');

				for (var i=0; i<selectedDates.length; i++) {

					$mm.dpmmSetSelected(  

						selectedDates[i]

					)

				}

				

				// listen for changes in the selected dates status

				$mm.bind( 

					'dateSelected',

					function(event, date, $td, status)

					{

						// and update the hidden field with a comma seperated list of selected dates...

						var selectedDates = $mm.dpmmGetSelected();

						for (var i=0; i<selectedDates.length; i++) {

							selectedDates[i] = selectedDates[i].asString();

						}

						$hiddenInput.val(selectedDates.join(','));

						$('#cancelled_days').html(selectedDates.join(' ,'));

					}

				);

				

				

				// and just for debugging on this page...

				$('#showHiddenValue').bind(

					'click',

					function(e)

					{

						alert($hiddenInput.val());

						return false;

					}

				);





				

			}

                      }

		});

	});

$(function() {

		$('#datepicker5').datepicker({

			changeMonth: true,

			changeYear: true,

			onSelect: function(date) {

                        date1=$('#datepicker3').datepicker('getDate');

			date2=$.datepicker.formatDate('yy-mm-dd', date1);

			if(date1!=null)

			{

				//alert(date2);

				

			     tmonth=1;

			     //alert(tmonth);

			     // Set the date format to something that is easy for our backend to understand...

				Date.format = 'yyyy-mm-dd';

				

				// Save a reference to the hidden input form field...

				var $hiddenInput = $('#selectedDate');

				

				// and a reference to the element we are turning into a date picker...

				var $mm = $('#multimonth');

				

				// initialise the date picker with your chosen settings

				$mm.datePickerMultiMonth(

					{

						startDate: date2,

						endDate: date,

						numMonths: tmonth,

						inline: true,

						selectMultiple: true

					}

				);

				

				// set all of the current dates selected

				var selectedDates = $hiddenInput.val().split(',');

				for (var i=0; i<selectedDates.length; i++) {

					$mm.dpmmSetSelected(  

						selectedDates[i]

					)

				}

				

				// listen for changes in the selected dates status

				$mm.bind( 

					'dateSelected',

					function(event, date, $td, status)

					{

						// and update the hidden field with a comma seperated list of selected dates...

						var selectedDates = $mm.dpmmGetSelected();

						for (var i=0; i<selectedDates.length; i++) {

							selectedDates[i] = selectedDates[i].asString();

						}

						$hiddenInput.val(selectedDates.join(','));

						$('#cancelled_days').html(selectedDates.join(' ,'));

					}

				);

				

				

				// and just for debugging on this page...

				$('#showHiddenValue').bind(

					'click',

					function(e)

					{

						alert($hiddenInput.val());

						return false;

					}

				);





				

			}

                      }

		});

	});
	
	
function getclass(type,value){

if(value !=''){	
$.ajax({
  type: "POST", 
  url:"class_ajax.php",
  dataType: 'json',
  data: {location:value},
  success: function(msg){     
$('#class_id').html(msg[0].name);  
$('#name_pie').html(msg[1].name);  
$('#course_suffix').val(msg[2].name);  
  } 
});    
}
}	
function getlevel(value){

if(value !=''){	
$.ajax({
  type: "POST", 
  url:"level_ajax.php",
  dataType: 'text',
  data: {location:value},
  success: function(msg){     
$('#level').html(msg);  
  
  } 
});    
}
}	


</script>



<!-- page specific scripts -->

		

		<style type="text/css">

		#multimonth {

			border: 2px solid #000;

			overflow: auto;

			float: left;

			

		}

		.dp-applied {

			float: left;

		}

		table.jCalendar {

			border: none;

		}

		.dp-popup-inline {

			height: 180px;

		}

		 #h1   {width:2%; height:23px; text-align:left; float:left; border: #F0F0F0 solid 1px;}

				  #h2   {width:35%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}

				  #h3   {width:35%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}

				  #h4   {width:26%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}

		</style>



<form method='post' action='ingl_course.main.php' onsubmit="return validate(this)">

<input type='hidden' name='recNo' value="<?php echo $dbObject->getDbField('recNo');?>">

<input type='hidden' name='kV' value="<?php echo $_REQUEST['kV'];?>">

<table boder='1' class='pa-nor' width="100%" border="0">

<tr valign='top'><td>Course ID</td><td>

<?php

$course_id="select recNo from ingl_course order by recNo desc limit 0,1";

$rescourse_id=mysqli_query($conn,$course_id) or die(mysqli_query($conn));

$cid=mysqli_fetch_array($rescourse_id);



$queryloc="select * from course_id order by course_code asc";

$resultloc=mysqli_query($conn,$queryloc) or die(mysqli_query($conn));

?>

<select name='course_prefix' required onchange="getclass('manager',this.value);" >
<option value="">Select</option>
<?php

while($num=mysqli_fetch_array($resultloc))

{

echo"<option value='".$num[course_code]."' ";

if($dbObject->getDbField('course_prefix')==$num[course_code])

{

echo"selected";

}

echo">".$num[course_code]."</option>";

}



$ncid=$dbObject->getDbField('course_suffix');

if(empty($ncid))

{

	$ncid=$cid['recNo']+1;

}

?>

</select>



<input type='text' name='course_suffix' id="course_suffix" readonly  value="<?php echo $ncid; ?>" size='20' maxlength='250'></td></tr>



<tr valign='top'><td>Name Of PIE</td><td>
<?php echo getInstructor($conn,$dbObject->getDbField('name_pie'),$dbObject->getDbField('course_prefix')) ?></td></tr>

<tr valign='top'><td>Class Room</td><td>

<?php
if(isset($_REQUEST['aC']) && $_REQUEST['aC'] =='sM')
{
if($dbObject->getDbField('course_prefix')=='C')
{
	/*  
$course_id="select recNo,location from timesheet_location where code_prefix='C'";
$rescourse_id=mysqli_query($conn,$course_id) or die(mysqli_query($conn,));

$cid=mysqli_fetch_array($rescourse_id);	
	
$location=$cid['recNo'];	
$center=$cid['location'];	
*/
$queryloc = "select * from ingl_class where is_active=1 order by c_name";	
		
}else {
$course_id="select recNo,location from timesheet_location where code_prefix='".$dbObject->getDbField('course_prefix')."'";
$rescourse_id=mysqli_query($conn,$course_id) or die(mysqli_query($conn));

$cid=mysqli_fetch_array($rescourse_id);	
	
$location=$cid['recNo'];	
$center=$cid['location'];	
$queryloc = "select * from ingl_class where c_location='".$location."'  ";	
		
}
 	
 


//$queryloc="select * from ingl_class where c_location='".$dbObject->getDbField('class_id')."'";	
}else{
 $queryloc="select * from ingl_class";
}
//echo $queryloc;

$resultloc=mysqli_query($conn,$queryloc) or die(mysqli_query($conn));

?>

<select name='class_id' id="class_id">

<option value="">Select Class</option>

<?php

while($num=mysqli_fetch_array($resultloc))

{

echo"<option value='".$num[id]."' ";

if($dbObject->getDbField('class_id')==$num[id])

{

echo"selected";

}

echo">".$num[c_name].'-'.$num[c_capacity]."</option>";

}

?>

</select>







</td></tr>



<tr valign='top'><td>Select Language</td><td><select  name="language" onchange="getlevel(this.value);"  >

<option  value="" selected >Select Language</option>

<option  value="English" <?php if($dbObject->getDbField('language')=='English') echo"selected"; ?>>English</option>

<option value="French" <?php if($dbObject->getDbField('language')=='French') echo"selected"; ?>>French</option>

<option value="German" <?php if($dbObject->getDbField('language')=='German') echo"selected"; ?>>German</option>

<option value="Hindi" <?php if($dbObject->getDbField('language')=='Hindi') echo"selected"; ?>>Hindi</option>

<option value="Spanish" <?php if($dbObject->getDbField('language')=='Spanish') echo"selected"; ?>>Spanish</option>
<option value="IOL" <?php if($dbObject->getDbField('language')=='IOL') echo"selected"; ?>>IOL</option>
<option value="Eng- Workshop" <?php if($dbObject->getDbField('language')=='Eng- Workshop') echo"selected"; ?>>Eng- Workshop</option>

</select></td></tr>

<tr valign='top'><td>Level</td><td><select  name="level" id="level" >

<option  value="" selected >Select Level</option>
<?php
$lang = array("English"=>"14","French"=>"17","German"=>"18","Spanish"=>"19","Hindi"=>"20","IOL"=>"12","Eng- Workshop"=>"23");

if(isset($_REQUEST['aC']) && $_REQUEST['aC'] =='sM')
{
	$val=$dbObject->getDbField('language');
	
$querylevel="SELECT * FROM `ingl_billing_main` WHERE bill_category='".$lang[$val]."' and is_active='1'";	
}else{
 $querylevel="SELECT * FROM `ingl_billing_main` WHERE `bill_category` in (14,17,18,19,23,20,12) and recNo not in (1,98,100,99,101) and is_active='1'";
}
$resultlevel=mysqli_query($conn,$querylevel) or die(mysqli_query($conn));
//$abc=mysqli_fetch_array($resultlevel);

while($level=mysqli_fetch_array($resultlevel))

{

echo"<option value='".$level['bill_details']."' ";

if($dbObject->getDbField('level')==$level['bill_details'])

{

echo"selected";

}

echo">".$level['bill_details']."</option>";

}

?>

</select></td></tr>

<tr valign='top'><td>Start Date</td><td><input type='text' name='startdate' value="<?php echo $dbObject->getDbField('startdate');?>" autocomplete="off" size='10' maxlength='10' id="datepicker3"></td></tr>
<tr valign='top'><td>End Date</td><td><input type='text' name='enddate' value="<?php echo $dbObject->getDbField('enddate');?>" autocomplete="off" size='10' maxlength='10' id="datepicker4"></td></tr>
<tr valign='top'><td>Mid End Date</td><td><input type='text' name='mid_enddate' value="<?php echo $dbObject->getDbField('mid_enddate');?>" autocomplete="off" size='10' maxlength='10' id="datepicker6"></td></tr>
<tr valign='top'><td>Timings</td><td><?php echo createHours('start_hour', $dbObject->getDbField('start_hour')); ?>:<?php echo createMinutes('start_minute', $dbObject->getDbField('start_minute')); ?> To <?php echo createHours('end_hour', $dbObject->getDbField('end_hour')); ?>:<?php echo createMinutes('end_minute', $dbObject->getDbField('end_minute')); ?>
<br />
<font color="#B30000" style="font-size:12px">(*Please enter the time in 24 hour time format ex. 7:00 PM as 19:00 Hrs)</font>
</td></tr>
<tr valign='top'><td>Day</td><td>
<?php $ArrcourseDay=explode(',',$dbObject->getDbField('courseday'));?>

<input type='checkbox' <?php if(in_array('Sun',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Sun" size='10'>Sun &nbsp;

<input type='checkbox' <?php if(in_array('Mon',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Mon" size='10'>Mon&nbsp;

<input type='checkbox' <?php if(in_array('Tue',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Tue" size='10'>Tue&nbsp;

<input type='checkbox' <?php if(in_array('Wed',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Wed" size='10'>Wed &nbsp;

<input type='checkbox' <?php if(in_array('Thu',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Thu" size='10'>Thu &nbsp;

<input type='checkbox' <?php if(in_array('Fri',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Fri" size='10'>Fri &nbsp;

<input type='checkbox' <?php if(in_array('Sat',$ArrcourseDay))echo "checked";?> name='courseday[]' value="Sat" size='10'>Sat

</td></tr>


<tr><td valign="top">Cancelled Classes</td><td><input type="hidden" name="selectedDate" id="selectedDate" value="<?php echo $dbObject->getDbField('selectedDate');?>" />

				<div id="multimonth" style="margin-right: 3px;">Select Start date & End date fro above.</div>

				

				<table><tr><td valign="top">

				Selected Dates:<td><td><div id="cancelled_days"><?php echo str_replace(","," , ",$dbObject->getDbField('selectedDate'));?></div>

				</td></tr></table>

				</td></tr>
				
				


<tr valign='top'><td>Description</td><td><textarea name='description' cols="25" rows="2"><?php echo $dbObject->getDbField('description');?></textarea> </td></tr>



<tr valign='top'><td>Report Send To</td><td><textarea name='report_send' cols="25" rows="2"><?php echo $dbObject->getDbField('report_send');?></textarea> </td></tr>


<tr><td>Company</td><td><input type='text' name='company' value="<?php echo $dbObject->getDbField('company');?>" size='30' maxlength='255'></td></tr>

<tr><td>Company Location</td><td><input type='text' name='company_loc' value="<?php echo $dbObject->getDbField('company_loc');?>" size='30' maxlength='255'></td></tr>

<tr valign='top'><td>First Week Feedback</td><td><input type='text' name='fw_feedback' value="<?php echo $dbObject->getDbField('fw_feedback');?>" size='10' maxlength='10' id="datepicker5"></td></tr>



<tr>

<!--<td><input type="radio" class="Serch" name="Search" id="Name" value="Name"  onchange="invoice_customerSerch(this.value)"/>Name</td>-->

<td><input type="radio" class="Serch" name="Search" id="ref_No" value="ref_No" onchange="invoice_customerSerch(this.value)"/>Ref. No &nbsp;&nbsp;

<input type="radio" class="Serch" name="Search" id="mobile" value="mobile" onchange="invoice_customerSerch(this.value)"/>Mobile &nbsp;

<input type="radio" class="Serch" name="Search" id="Email" value="Email" onchange="invoice_customerSerch(this.value)"/>Email

</td>

<td>

<input list="SerchOption" placeholder="Search" class="Searchtext" id="Browsers" onchange="invoice_customer(this.value)"><datalist id="SerchOption"  name="Browsers"></datalist>

</td></tr>





<tr><td></td><td  id="student_display_id"></td></tr>

<tr>

<td colspan="2">

<?php $r=rand(111111,999999); ?>

<div id="myDiv" style="width:100%"><div align="center" style=" width:100%; background:#CCCCCC">

                <div id="h1"><br>

                </div>

                <div id="h2">&nbsp;<b>Student Name</b><br>

                </div>

                <div id="h3">&nbsp;<b>Email</b></div>				

				<div id="h4">Drop Out&nbsp;</div>                

                <br>

                </div>

                  <div align="center" style=" width:100%;">

                  <div id="h1">&nbsp;<br>

                  </div>

                  <div id="h2"><input type="text" readonly="readonly" name="studentName[]" id="studentName"><br>

                  </div>

                  <div id="h3"><input type="text" name="email[]" id="email">

                   <input type="hidden" name="ref_No[]" id="ref_No" value="ED201504-10340">

                  <input type="hidden" name="login[]" id="login" value="">

                  <input type="hidden" name="mobile[]" id="mobile" value="

"></div>	
<input name="oldrecNo[]" value="0" type="hidden"></div>			

                  <input type="hidden" name="password[]" value="<? echo $r; ?>" id="password">				

                   <div id="h4"> &nbsp;</div>                

                  <br>

 </div>



 

				</div>

				<br>

<? if($_REQUEST['kV'] !=''){

$querynew="select * from ingl_student where courseId='".$_REQUEST['kV']."'";

$resultn=mysqli_query($conn,$querynew) or die(mysqli_query($conn));



while($rnum=mysqli_fetch_array($resultn))

{



?>				

<div id="<? echo $rnum['recNo']; ?>"><div style=" width:100%;" align="center">

                <div id="h1">

                </div>

                <div id="h2"><input name="studentName[]" value="<? echo $rnum['studentName']; ?>" type="text"><br>

                </div>

                <div id="h3"><input name="email[]" value="<? echo $rnum['email']; ?>" id="email" type="text">

                <input name="ref_No[]" id="ref_No" value="<? echo $rnum['ref_No']; ?>" type="hidden">

                <input name="login[]" value="<? echo $rnum['login']; ?>" type="hidden">

                 <input name="mobile[]" value="<? echo $rnum['mobile']; ?>" type="hidden"></div>
<input name="oldrecNo[]" value="<? echo $rnum['recNo']; ?>" type="hidden"></div>

				 <div id="h4">
				 <input type='checkbox' name="drop_up[]" value="<? echo $rnum['recNo']; ?>" <? if($rnum['drop_up']==0){ echo 'checked'; } ?> type="text">
				 </div>

                <input name="password[]" value="<? echo $rnum['password']; ?>" id="password" type="hidden">

                <br>



                </div>

</div>	

<? } } ?>			

				<input type="hidden" value="2" id="theValue">

				<div id="sub"><a href='javascript:displayStu("1")'>Add New Student</a></div>

	<div id="sub1" style="display:none;"><font color="red">Please Wait</font></div>

</td></tr>



<tr valign='top'><td></td><td><input type='hidden' name='createdBy' value="<?php echo $_SESSION['id'] ;?>" size='20' maxlength='250'></td></tr>

<tr valign='top'><td></td><td><input type='hidden' name='createDate' value="<?php echo date('Y-m-d H:i:s');?>" size='19' maxlength='19'>
<?
if(isset($_REQUEST['aC']) && $_REQUEST['aC'] =='sM')
{
?>
	
<input type='hidden' name='branch' value='<?php echo $dbObject->getDbField('branch');?>' size='19' maxlength='19'>
<?	
}else{ ?>
 <input type='hidden' name='branch' value='<?=$_SESSION['branch']; ?>' size='19' maxlength='19'>
<? }
?>


</td></tr>















<tr><td colspan='2'><input class="submit1" type='submit' name='aC' value='<?php echo $currentMode;?>'></td></tr>

</table>

</form>



</div>

<div style="margin-top:100px">&nbsp;</div>

<?php

// Include footer

include "footer_fd.php";

?>

<?php

if($currentMode=="Update")

{

?>

	<script type="text/javascript" charset="utf-8">

            $(function()

            {

				// Set the date format to something that is easy for our backend to understand...

				Date.format = 'yyyy-mm-dd';

				

				// Save a reference to the hidden input form field...

				var $hiddenInput = $('#selectedDate');

				

				// and a reference to the element we are turning into a date picker...

				var $mm = $('#multimonth');

				

				// initialise the date picker with your chosen settings

				$mm.datePickerMultiMonth(

					{

						startDate: '<?php echo $dbObject->getDbField('startdate');?>',

						endDate: '<?php echo $dbObject->getDbField('enddate');?>',

						numMonths: 1,

						

						inline: true,

						selectMultiple: true,

						

					}

				);

				

				// set all of the current dates selected

				var selectedDates = $hiddenInput.val().split(',');

				for (var i=0; i<selectedDates.length; i++) {

					$mm.dpmmSetSelected(  

						selectedDates[i]

					)

				}

				

				// listen for changes in the selected dates status

				$mm.bind( 
					'dateSelected',
					function(event, date, $td, status)
					{

						// and update the hidden field with a comma seperated list of selected dates...

						var selectedDates = $mm.dpmmGetSelected();

						for (var i=0; i<selectedDates.length; i++) {

							selectedDates[i] = selectedDates[i].asString();
						}
						$hiddenInput.val(selectedDates.join(','));
						$('#cancelled_days').html(selectedDates.join(', '));
					}

				);

				

				

				// and just for debugging on this page...

				$('#showHiddenValue').bind(

					'click',

					function(e)

					{

						alert($hiddenInput.val());

						return false;

					}

				);

            });

		</script>



<?php

}

?>