<?php
session_start();
// ============ this file shows a form for user to create an admission circular
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============
?>
<style type="text/css">
i{
	cursor:pointer;
}
</style>
<script src="module/admission/js/admission_master.js" type="text/javascript"></script>
<?php if($_SESSION['add']=='Y'){ ?>
<div id="load_page">
<div class="row-fluid" style="background-color:#f5f5f5;-webkit-box-shadow: 0 8px 6px -6px black; -moz-box-shadow: 0 8px 6px -6px black; box-shadow: 0 8px 6px -6px black;">

	<form class="form-vertical" >
	<input type="hidden" id="branchid" name="branchid" value="<?php echo $_SESSION['LOGIN_BRANCH'];?>"/>
	<legend>
			<div class="widget-header header-color-green2">
				<h4 class="lighter smaller" style="font-weight:bold;">Admission Master</h4>
			</div>
		</legend>
	
<!--PAGE CONTENT BEGINS-->
<!--<div class="row-fluid">-->
			<div class="row-fluid">
			<div class="span3" style="margin-top: 10px;">
				<div class="control-group" >
					<label class="control-label" for="form-field-1">Session<font color="#FF0000">*</font></label>
					<div class="controls" id="admission_session_holder">
						<select class="select_list" id="admission_session">
							<option value="">---Select---</option>
							<?php
								for ($x = date('Y'); $x <= date('Y')+2; $x++) {
							?>
							<option value="<?php echo $x; ?>"><?php echo $x; ?></option>
							<?php } ?>       
						</select>
					</div>
				</div>
			</div>
			<div class="span3" style="margin-top: 10px;">
			<div class="control-group">
				<label class="control-label" for="form-field-1">Start Date<font color="#FF0000">*</font></label>
				<div class="controls input-append">
					<input class="date-picker" id="start_date_for_admission" style="width: 180px;" type="text" data-date-format="dd-mm-yyyy" placeholder="dd-mm-yyyy"/>
					<span class="add-on">
						<i class="icon-calendar"></i>
					</span>
				</div>
			</div>
		</div>
		<div class="span3" style="margin-top: 10px;">
			<div class="control-group">
				<label class="control-label" for="form-field-1">End Date<font color="#FF0000">*</font></label>
				<div class="controls input-append">
					<input class="date-picker" id="end_date_for_admission" style="width: 180px;" type="text" data-date-format="dd-mm-yyyy" placeholder="dd-mm-yyyy"/>
					<span class="add-on">
						<i class="icon-calendar"></i>
					</span>
				</div>
			</div>
		</div>
		<div class="span3" style="margin-top: 10px;">
			<div class="control-group">
				<label class="control-label" for="form-field-1">Age Calculation Date<font color="#FF0000">*</font></label>
				<div class="controls input-append">
					<input class="date-picker" id="age_calculation_date_for_admission" style="width: 180px;" type="text" data-date-format="dd-mm-yyyy" placeholder="dd-mm-yyyy"/>
					<span class="add-on">
						<i class="icon-calendar"></i>
					</span>
				</div>
			</div>
		</div>
		</div>
		<div class="row-fluid">
			<div class="span3" style="margin-top: 10px;">
				<div class="control-group">
					<label class="control-label"for="form-field-1">Circular Description</label>
					<div class="controls">
						<textarea class="span6" style="width: 500px; height: 90px;" name="circular_text" id="circular_text_for_admission" placeholder="Place circular description here">
						</textarea>
					</div>
				</div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="span3" style="margin-top: -20px; marign-left: 20px;">
				<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_show_fee_collection_data" onclick="insert_admission_circular_entry()">
							<i class="icon-ok bigger-100"></i>
							Save
						</button>
					</div>
				</div>
			</div>
		</div>
			<!--<div class="span3" style="marign-left: 30px; margin-top: 15px; margin-bottom: 10px;">
			<div class="control-group">
				<label class="control-label" for="form-field-1">Circular Attachment</label>
				<img src="assets/avatars/profile-pic.jpg"    id="image" style="height:150px;width:250px;" />
                    <input type="file"  id="upload" style="display:none"  />
                    <p onclick="performClick('upload');" class="photo-button" style="width:190px; background-color:#3a87ad;">Upload Photo</p>
			</div>-->
		</div>
	</form>
</div>
</div>
<?php } ?>
<br/>
<div class="row-fluid" id="admission_master_data_to_show">
</div>

<div id="modal-admission-master-table" class="modal hide fade  " style="overflow-x:show" tabindex="-1">
	<div class="modal-header no-padding">
		<div class="table-header">
			<button type="button" class="close" data-dismiss="modal">&times;</button>
				Edit Admission Master Information
		</div>
	</div>
	<div class="modal-body " id="admission_master_table_value">
	</div>
	<div class="modal-footer">
		<button class="btn btn-small btn-success pull-left" type="button" id="btn_update_admission_master_info" data-dismiss="modal" onclick="perform_update_admission_master_info()">
			<i class="icon-ok bigger-100"></i>
			Save
		</button>
		<button class="btn btn-small btn-danger pull-left" data-dismiss="modal">
			<i class="icon-remove"></i>
			Close
		</button>
	</div>
									
</div>
<div id="modal-delete-admission-master-table" class="modal hide fade  " style="overflow-x:show" tabindex="-1">
	<div class="modal-header no-padding">
		<div class="table-header">
			<button type="button" class="close" data-dismiss="modal">&times;</button>
				Delete Admission Master Information
		</div>
	</div>
	<div class="modal-body " id="delete_admission_master_table_value">
	</div>
	<div class="modal-footer">
		<button class="btn btn-small btn-danger pull-left" type="button" id="btn_delete_admission_master_info" data-dismiss="modal" onclick="perform_delete_admission_master_info()">
			<i class="icon-ok bigger-100"></i>
			Confirm
		</button>
		<button class="btn btn-small btn-danger pull-left" data-dismiss="modal">
			<i class="icon-remove"></i>
				Close
		</button>
	</div>
</div>
<script type="text/javascript">
	/*function performClick(elemId) {
		var elem = document.getElementById(elemId);
		if (elem && document.createEvent) {
			var evt = document.createEvent("MouseEvents");
			evt.initEvent("click", true, false);
			elem.dispatchEvent(evt);
		}
	*/
</script>
<script>
$('#timepicker1').timepicker({
					minuteStep: 1,
					showSeconds: false,
					showMeridian: false
				})		
$('.date-picker').datepicker().next().on(ace.click_event, function(){
	$(this).prev().focus();
});
/*$('#upload').change(function () {
    //fire your ajax call  
    file_upload();
})
var fileInput = $('input[type=file]'),
    button = $('#upload');
    button.on('focusout', function () {
	// Access the files property, which holds
    // an array with the selected files
});
function file_upload() {
    var files = fileInput.prop('files');
    // No file was chosen!
    if (files.length == 0) {
        alert('Please choose a file to upload!');
        return false;
    }
	// Create a new FormData object
    var fd = new FormData();
    fd.append('file', files[0]);

    $.ajax({
        url: 'module/common/upload2.php',
        data: fd,
        contentType: false,
        processData: false,
        type: 'POST',
        success: function (m) {
			var a = JSON.parse(m);
			if (a.status != 'Error') {
				var image_path = 'asset/custom/upload/student/' + a.image;
				$('#image').attr('src', image_path);
				$('#image_name').val(a.image);
            }
            else {
				alert(a.message);
            }
            }
        });
    }*/
</script>