File "enrollment_form.php"

Full Path: /home/ichhrkpd/public_html/idcm/application/views/enrollment_form.php
File size: 8.91 KB
MIME-type: text/html
Charset: utf-8

 <?php 
	 $sl =1;

     $msg = isset($msg)?$msg:'';
	 $msg_type = isset($msg_type)?$msg_type:'';
	 $this->session->UnsetFlashData();	 

 ?>
 

 
       <div class="content-wrapper">
        <section class="content-header">
          <h1>
            <?php 
                echo $title; 
                
            ?>
          </h1>
          
        </section>
 
        <section class="content">
          <div class="row">
            <div class="col-xs-12">
              <div class="box">
                <div class="box-header">
                    <a href="<?php echo base_url().'admin/std_list/batch_id/'.$batch_id;?>" class="btn-sm btn-info"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back</a> 
                </div>
                <div class="box-body">
                   <div class="row"> 
                   <form id="contactForm" action="<?php echo base_url()."admin/do_enrollment"?>" class="contact-form" method="post" role="form" >
                       <input type="hidden" name="std_reg" id="std_reg" value="<?php echo $stdObj->std_reg; ?>">
                       <input type="hidden" name="year_no" id="year_no" value="<?php echo $year_no; ?>">
                       <input type="hidden" name="batch_id" id="batch_id" value="<?php echo $batch_id; ?>">
                        <div class="col-md-6">
                       		<div class="controls">
                            	<div class="row">
							        <div class="col-md-12">  
	                                    
	                                   <table id="example" class="table table-bordered table-hover">
                                        <thead>
                                          <tr>
                                          	<th>Name</th>
                                          	<th >Registration No.</th>
                                            <th>Roll No</th>
                                          	<th>Session</th>
                                          </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td ><?php echo $stdObj->name; ?></td>
                                                <td><?php echo $stdObj->std_reg; ?></td>
                                              	<td><?php echo $stdObj->std_roll; ?></td>
                                              	<td><?php echo $stdObj->std_session; ?></td>
                                          </tr>
                                      </tbody>
                                    </table>
                                    
                                    <button type="button" name="button" onclick="Firstpaper()">1st Paper  </button>
                                    <button type="button" name="button" onclick="Secondpaper()">2nd Paper  </button>
                                     
                                    <!--<p id="par"></p>-->
                                    
	                                   <table id="example" class="table table-bordered table-hover">
                                        <thead>
                                          <tr>
                                          	<th class="text-center">Select</th>
                                            <th>Code</th>
                                            <th>Title</th>
                                            <th>Status</th>
                                            <th>Action</th>
                                          </tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                        $id=1;
                                        foreach($subArr as $sa){ ?>
                                        
                                        <tr>
                                              <td class="text-center"><input checked="checked" type="checkbox" <?php echo $sa->sub_found == 'Y' ? 'disabled' : '';  ?> value="<?php echo $sa->sub_id; ?>" name="subArr[]" id='<?php echo 's'.$id; ?>' class="subCode"></td>
                                              <td><?php echo $sa->sub_id; ?></td>
                                              <td><?php echo $sa->sub_title; ?></td>
                                              <td>
                                              	    <?php if($sa->sub_found == 'Y'){ ?>
                                              	        <i class="fa fa-check-square" style="color:green"></i>
                                              	    <?php } ?>
                                              </td>
                                              <td>
                                                <?php if($sa->sub_found == 'Y'){ ?>
                                                    <a href="<?php echo base_url().'admin/delete_enrollment/ss_id/'.$sa->ss_id . '/batch_id/' . $batch_id . '/std_reg/' . $stdObj->std_reg;?>" ><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> 
                                                <?php } ?>
                                              </td>
                                        </tr>
                                        
                                        <?php $id++;} ?>
                                            
                                      </tbody>
                                    </table>                                    
                                    
                                    
									 <div class="text-center"> <button type="submit" name="submit" id="submit" class="btn btn-success" id="confirm">Submit</button></div>
						            </div>
						        </div>
						    </div>
						</div>
                   
                   
                   
					 
					 </form>
					
                </div>	                    
              </div>

             </div>
            </div>
          </div>
        </section>
      </div>  
      
   
 <script>
	$(document).ready(function() {
	    
	     $('#contactForm').validator();
	    
	    
		var toast_msg = '<?php echo $msg;?>';
		var msg_type = '<?php echo $msg_type;?>';
		if(toast_msg !== null && toast_msg !== '') {
            var shortCutFunction = msg_type;
            toastr.options = {
                positionClass: 'toast-bottom-right'
            };
            var $toast = toastr[shortCutFunction](toast_msg);
	    }	    
	    
	} );

	
</script>           
        



<script>
$(document).ready(function(){
    $(".check").click(function(){
        $("#myCheck").prop("checked", true);
    });
    $(".uncheck").click(function(){
        $("#myCheck").prop("checked", false);
    });
    
   
    
});
</script>

<script type="text/javascript">
        //var k = "The respective values are :";
        function Firstpaper() {
            var input = document.getElementsByName('subArr[]');
 
            for (var i = 0; i < input.length; i++) {
                var a = input[i];
                if(a.value%2==1){
                    
                   $("#s"+i).prop("checked", false);
                       
                    
                     //$(".subCode").prop("checked", false);
                      //k = k + "array[" + i + "].value= " + a.value + " ";
                }else if(a.value=='275'){
                   $("#s"+i).prop("checked", true); 
                }
                else{
                     $("#s"+i).prop("checked", true);
                }
             
                
              // k = k + "array[" + i + "].value= " + a.value + " ";
            }
 
            //document.getElementById("par").innerHTML = k;
            //document.getElementById("po").innerHTML = "Output";
        }
        
        function Secondpaper() {
            var input = document.getElementsByName('subArr[]');
 
            for (var i = 0; i < input.length; i++) {
                var a = input[i];
                
                if(a.value%2==0){
                    
                   $("#s"+i).prop("checked", false);
                       
                    
                     //$(".subCode").prop("checked", false);
                      //k = k + "array[" + i + "].value= " + a.value + " ";
                }else if(a.value=='275'){
                   $("#s"+i).prop("checked", true); 
                }
                
                else{
                     $("#s"+i).prop("checked", true);
                }
             
                
              // k = k + "array[" + i + "].value= " + a.value + " ";
            }
 
            //document.getElementById("par").innerHTML = k;
            //document.getElementById("po").innerHTML = "Output";
        }
    </script>