?
Current Path : /home1/savoy/public_html/savoyglobal.net/koolkids/school/application/views/Settings/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/koolkids/school/application/views/Settings/editsubject.php |
<script type="text/javascript"> function remove_subject(subject_id) { $.ajax({ type: "POST", url: "<?= site_url('settings/remove_subject') ?>/" +subject_id, success: function(res){ if(res==1) { alert("Subject removed successfully"); $('#' + subject_id).remove(); } else { alert("Subject cannot be removed from class"); } } }); } </script> <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $subject=$this->mastermodel->getdatas('subject_master'); $class_subject=$this->mastermodel->get_data('subject',$viewinfo->classlevel_id,'classlevel_id'); if(!empty ($class_subject)) { foreach($class_subject as $subj) { $subj_name[]=$subj['subject_name']; $subj_code[]=$subj['subject_code']; } } else { $subj_name[]=''; $subj_code[]=''; } ?> <span class="section_content_top"></span> <div class="section_content_inner"> <?php $attributes=array('class'=>'search_form','id'=>'validateform'); echo form_open('settings/addinsettings/insert_subject_class/viewsubject/1/',$attributes); ?> <!--[if !IE]>start fieldset<![endif]--> <fieldset> <!--[if !IE]>start forms<![endif]--> <div class="forms"> <div class="backicon"> <a href="#" onclick="viewdata('settings','viewinsettingssearch','searchsubject','viewsubject','<?=$_SESSION['pagenum'];?>')"> <img src="<?=base_url()?>assets/images/backicon.png" alt="back-icon" title="Back"/> </a> </div> <h3>Update Subject</h3> <div class="row"> <label>Class Code</label> <div class="inputs"> <span class="input_wrapper "> <?php echo $viewinfo->classlevel_code; ?> </span> </div> </div> <div class="row"> <label>Select Subjects</label> <div class="inputs"> <span class="input_wrapper select_wrapper"> <select name="subject_id[]" id="subject_id" multiple > <?php foreach ($subject as $row) { if(!in_array($row['subject_master_name'],$subj_name)&& !in_array($row['subject_master_code'], $subj_code)) { ?> <option value="<?=$row['subject_master_name'].'~'.$row['subject_master_code']?>"><?=$row['subject_master_name']. '-'.$row['subject_master_code']?></option> <?php } } ?> </select> </span> </div> <!-- <div class="inputs"> <span class="input_wrapper"><input class="text required" name="subject_name" id="subject_name" type="text" value="" /></span> </div>--> </div> <!--[if !IE]>start row<![endif]--> <div class="row"> <div class="table_wrapper"> <div class="table_wrapper_inner"> <table id="stud_table" cellpadding="0" cellspacing="0" width="70%"> <tbody id="studinfodet"> <tr> <th><span>Subject Name</span></th> <th><span>Subject Code</span></th> <th><span> Remove</span></th> </tr> <?php foreach($class_subject as $subj) { echo "<tr id='".$subj['subject_id']."'> <td>".$subj['subject_name']."</td> <td>".$subj['subject_code']."</td> <td><img src='".base_url()."assets/images/delete_icon.png' title='Remove Student' onclick='remove_subject(".$subj['subject_id'].")' class='clickimage'/></td> </tr>"; } ?> </tbody></table> </div> <!-- <div class="inputs"> <span class="input_wrapper"><input class="text required" name="subject_name" id="subject_name" type="text" value="" /></span> </div>--> </div> </div> <input type="hidden" name="tab_name" value="subject"/> <input type="hidden" name="resfunction" value="searchsubject"/> <input type="hidden" name="tab_field" value="subject_id"/> <input type="hidden" name="classlevel_id" value="<?=$viewinfo->classlevel_id;?>"/> <div class="row"> <div class="inputs"> <span class="button blue_button search_button" onclick="addformdata('validateform')"><span><span><em>Update Subject</em></span></span><input name="" type="submit" /></span> </div> </div> <!--[if !IE]>end row<![endif]--> </div> <div id="subject_content"></div> </fieldset> <!--[if !IE]>end fieldset<![endif]--> <?php echo form_close(); ?> </div> <span class="section_content_bottom"></span>