<?php
$pgMod="service";
$pgAct="view";
if(isset($_GET['action']) && trim($_GET['action'])!='')
		$pgAct=strtolower($_GET['action']);


if($pgAct=="delete" && isset($_GET['id']) && trim($_GET['id'])!='')
{
	 $res=$db->delete($_GET['tbl'],"where  id='".$_GET['id']."'");
	if(!is_null($res)) { $_SESSION['msg']='Deleted Successfully'; }
	else { array_push($alert_err,$db->getErMsg()); }
	redirect(URL_ADMIN_HOME.getQueryString(array("page_id"=>"service","id"=>$_GET['sid'])));
} 




if(isset($_SESSION['msg']) && $_SESSION['msg']!="")
{
	?>
	<div class="alert alert-success">
	  <a class="close" data-dismiss="alert">×</a>
	  <i class="icon icon-thumbs-up-alt"></i> <b>Notice</b><?php echo $_SESSION['msg'] ?></i>
	</div>
	<?php
	unset($_SESSION["msg"]);
}
if(is_array($alert_err) && count($alert_err)>0)
{
	?>
	<div class="alert alert-error">
	  <a class="close" data-dismiss="alert">×</a>
	  <i class="icon icon-warning-sign"></i> <b>Notice</b> <?php echo $alert_err[0] ?></i>
	</div>
	<?php
}
?>
<!-- Forms --> 
<style>.top-bar-minimize{display:none;}
thead, tfoot {display: table-header-group;}
.top-bar+.well,.accordion .accordion-heading+.accordion-body{display: inline-block !important;width: 96.7% !important;overflow: inherit !important;} 
.classList{cursor:pointer;text-decoration:none;display:block;border:1px solid #666;margin: 5px 0;padding: 5px 11px;}
.selected{background-color: #ccc;color: #fff;font-weight: bolder;box-shadow: 5px 5px 16px #000;}
.imgs{float:left;height: 60px;margin-right: 10px;}
.classList span{color:#F00; font-weight:bolder;}
.driverDetail { border: 1px solid #000;padding: 5px 10px;background-color: #ccc;box-shadow: 0 0 10px #2B2929;font-weight: bolder;font-size: 14px;margin: 10px 5px;}

.textboxclass {
height: 10px;
width: 30px;
}
</style>
<form method="post" action="" enctype="multipart/form-data">
     <div class="row-fluid">
        <div class="span12">
            <div class="top-bar">
                <h3><i class="icon-cog"></i>Data base name</h3>
            </div>
            <div class="well">
			<!-- Forms: Box -->
			<div class="span3">

				<!-- Forms: Top Bar -->
				<div class="top-bar">
                    <h3><i class="icon-cog"></i> Select Data Base</h3>
                    <div style="float:right; margin-top:5px">
                </div>
                </div>
				<!-- / Forms: Top Bar -->

				<!-- Forms: Content -->
				<div class="well no-padding">

						
                        
                        <div class="control-group">
                        	<ul>
						
								
					
						                 
						                  <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','installment_fine')">
												installment_fine
                                            </li>
						                 
						                  <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','installment_time')">
												installment_time
                                            </li>  
						                 
						                  <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','reff_receipt')">
												reff_receipt
                                            </li>     
						                  
						                  <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','receipt')">
												receipt
                                            </li>        
						                  <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','transaction')">
												transaction
                                            </li>
                                        <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','hostel_receipt')">
												hostle receipt
                                        </li>              
                                     
                                 <li class="classList" onClick="resetclassfee('<?php echo $_GET['id'] ?>','installment')">
												installment
                                        </li>      
                                            
                            </ul>
						</div>
                          
                        
						
				</div>
				<!-- / Forms: Content -->

			</div>
			<!-- / Forms: Box -->
			<!-- Forms: Box -->
			<div class="span9">

				<!-- Forms: Top Bar -->
				
				<!-- / Forms: Top Bar -->

				<!-- Forms: Content -->
				<div class="well no-padding">

					<!-- Forms: Form -->
                        <div class="control-group" id="fetchStudent">
							detail
						</div>
						<!-- Forms: Form Actions -->
						
						<!-- / Forms: Form Actions -->
	 
					<!-- / Forms: Form -->           

				</div>
				<!-- / Forms: Content -->

			</div>
			<!-- / Forms: Box -->
            </div>
        </div>
        
	</div>
</form>
<!-- / Forms -->
<script>
var urlroot='<?php echo URL_ROOT; ?>';
function selectClass(id,root,tis){

	alert(tis);
	$(".classList").removeClass('selected');
	$(tis).addClass('selected');
	$("#fetchStudent").html('<center><img src="'+urlroot+'assets/icon/load.gif" /></enter>');
	$.post( "<?php echo URL_ROOT ?>Promote/ajax.php", { 
				type: "fetchStudent", 
				id: root,
				name: id
	} , function( data ) {
		$("#fetchStudent").html(data);
	});
}
</script>
<script>
    
    function resetclassfee(id,dbname){
       
	$("#fetchStudent").html('<center><img src="'+urlroot+'assets/icon/load.gif" /></enter>');
	$.post( "<?php echo URL_ROOT ?>Promote/service_ajax.php", { 
				type: "fetchStudent", 
				id: id,
				dbname: dbname
	} , function( data ) {
		$("#fetchStudent").html(data);
	});
}


function getStudentfinePopup(name){
 
	var arr = [];
		$(".checkboxes").each(function(){
			if($(this).prop('checked')==true){
			    
			     arr.push($(this).val());	
		
		
		$.post( "<?php echo URL_ROOT ?>Promote/service_ajax.php", { 
				type: "deleterecords", 
			    dbname: name,
				id: arr
			
	} , function( data ) {
getStudentfinePopup();
	});		
				
			}
		})
		//var month=$(".month").val();
		//url+="&month="+month;
	
	}




function getupdaterecords(name){
 alert(asdga);
		  var datastring = $("#contactForm").serialize();
		   alert(data);
		$.post( "<?php echo URL_ROOT ?>Promote/service_ajax.php", { 
				type: "updaterecords", 
			    dbname: name,
				id: arr
			
	} , function( data ) {
;
	});		
				
			}
	
	
	
</script>
