<?php
session_start();
// ============
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============

extract($_GET);

$today_date = date("Y-m-d");

$input_text = base64_decode($text);

$input_name = extract("&",$input_text);

$medium_id;
$homework_status_id;
?>

<style type="text/css">
	.input-append, .input-prepend {
		margin-bottom: 0px !important;
	}
	.table td {
		padding: 3px !important;
	}
	.topics-count{
		margin-left:9px !important;
		}
</style>

<script src="module/homework/js/view_and_edit_subj_homework_topics.js" type="text/javascript"></script>
<?php
$det_in = $obj->Details_By_Cond("_int_institute_setup_vw","section_id='$section_id'");

//$tch_id = $obj->Details_By_Cond("_r_class_routine","_section_id='$section_id' AND _teacher_type='CT' AND _teacher_id!='0' GROUP BY _teacher_type");
//$teacher_id =  $tch_id['_teacher_id'];

//$tch_det = $obj->Details_By_Cond("_pf_emp_personal_info","_id='$teacher_id'");
?>

<div class="row-fluid">
<legend>
<!-- 	<button class="btn btn-mini btn-danger" id="back_hw">
    <i class="icon-reply icon-only" id="back_hw"></i>
      Back
</button> -->
<a href="#" id="back_hw" >
<img src="asset/custom/back.png" id="back" >
</a>
	
	Daily Subject Wise Homework Sheet for (<?php echo 'Class: '.$det_in['class'].', Department: '.$det_in['department'].', Student Type: '.$det_in['student_type'].', Section: '.$det_in['section']; ?>).
</legend>



<!-- ==================================== -->
<form class="form-vertical" id="attendance_sheet">

<div class="row-fluid">	
	<input type="hidden" name="homework_status_id" value="<?php echo $homework_status_id; ?>">
	<input type="hidden" id="md_id" name="medium_id" value="<?php echo $medium_id; ?>">
	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">	
    <input type="hidden" id="department_id" name="department_id" value="<?php echo $department_id; ?>">				
    <input type="hidden" id="student_type_id" name="student_type_id" value="<?php echo $student_type_id; ?>">				
    <input type="hidden" id="sft_id" name="shift_id" value="<?php echo $shift_id; ?>">				
    <input type="hidden" id="class_id" name="class_id" value="<?php echo $class_id; ?>">				
    <input type="hidden" id="text" name="text" value="<?php echo $text; ?>">	
	
</div>

<!-- ========================== -->

<div class="row-fluid">	
	<div class="span3">
		<div class="control-group" >
			<label class="control-label" for="form-field-1">Applied Date<font color="#FF0000">*</font></label>

			<div class="controls">
				<input type="text" name="applied_date" id="applied_date" value="<?php echo date('d-m-Y');?>">
			</div>
		</div>
	</div>
 
	<div class="span3">
		<div class="control-group" >
			<label class="control-label" for="form-field-1">Select Teacher<font color="#FF0000">*</font></label>

			<div class="controls">
				<select name="teacher_id" id="teacher_id">
				<?php 
					$table_name = "_pf_emp_personal_info";
					$column = "_id,_full_name name";
					//$where_cond="_section_id=$section_id";
					// $where_cond="_section_id=$section_id";
					$where_cond="_profession_id='T'";
					
					foreach($obj->View_all_data_row_column_By_Cond($table_name,$column,$where_cond) as $value ){
						echo "<option value='".$value['_id']."'>".$value['name']."</option>";
					}
				?>
				</select>
			</div>
		</div>
	</div>
</div>

<div class="row-fluid">		
	<div class="span6">
		<div class="control-group" >
			<label class="control-label" for="form-field-1">Topics Subject<font color="#FF0000">*</font></label>

			<div class="controls">
				<input type="text" name="topics_subject" id="topics_subject" style="width:90%;">
			</div>
		</div>
	</div>	
</div>	

<div class="row-fluid">		
	<div class="span6">
		<div class="control-group" >
			<label class="control-label" for="form-field-1">Homework Topics<font color="#FF0000">*</font></label>

			<div class="controls">
				<textarea name="topics" id="topics" rows="7" style="width:90%;"></textarea>
			</div>
		</div>
	</div>
</div>

<div class="row-fluid">		
	
	<div class="span3">
			<div class="control-group" >
				<label class="control-label" for="form-field-1">Duration From<font color="#FF0000">*</font></label>

				<div class="controls">
					<input type="text" name="date" id="date">
				</div>
			</div>
		</div>
		
		<div class="span3">
			<div class="control-group" >
				<label class="control-label" for="form-field-1">Duration To<font color="#FF0000">*</font></label>

				<div class="controls">
					<input type="text" name="date2" id="date2">
				</div>
			</div>
		</div>	
</div>


<!-- =========================== -->

<div class="row-fluid">									
	<div class="span12">			
		<div class="control-group">
			<label class="control-label" for="form-field-1">&nbsp;</label>

			<div class="controls">
				<button class="btn btn-small btn-success" type="button" id="btn_save_homework">
					<i class="icon-ok bigger-100"></i>Save
				</button>
				
				&nbsp; &nbsp; &nbsp;
				<button class="btn btn-small btn-danger" type="reset" id="btn_reset">
					<i class="icon-undo bigger-100"></i>
					Reset
				</button>
			</div>
		</div>
	</div>
	
</div>


</form>
<script type="text/javascript">
$("#date").datepicker( {
	format: "dd-mm-yyyy"
});
$("#date2").datepicker( {
	format: "dd-mm-yyyy"
});
$("#applied_date").datepicker( {
	format: "dd-mm-yyyy"
});
	
$("#back_hw").click(function(){
	var shift_id = $("#sft_id").val();
	var medium_id = $("#md_id").val();			
	//var dataStr1="medium_id="+medium_id+"&shift_id="+shift_id;
	//var dataStr1="medium_id="+medium_id+"&shift_id="+shift_id+'&class_id='+$("#class_id").val()+'&section_id='+$("#section_id").val();
	
	var dataStr1="medium_id="+medium_id+"&shift_id="+shift_id+'&class_id='+$("#class_id").val()+'&department_id='+$("#department_id").val()+'&section_id='+$("#section_id").val()+'&text='+$('#text').val();
	
	
	$(".data_to_show_atd").load("module/homework/daily_homework_subject_status_view.php",dataStr1);

	$('#first_part').remove();
	$('#second_part').css("display","block");
});

</script>