public function info_onus_designate()
 {
     $session = new session_students();
     $id = $session->Get_id_user();
     $db = new data_base(tpl_onus_designate::onus_designate(), array(tpl_onus_designate::id(), tpl_onus_designate::id_degree(), tpl_onus_designate::id_models(), tpl_onus_designate::id_student(), tpl_onus_designate::id_onus(), data_base::select_multiple_table(tpl_onus::onus(), tpl_onus::onus() . '.' . tpl_onus::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_onus(), tpl_onus::name(), tpl_onus::onus() . '_' . tpl_onus::name()), data_base::select_multiple_table(tpl_onus::onus(), tpl_onus::onus() . '.' . tpl_onus::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_onus(), tpl_onus::description(), tpl_onus::onus() . '_' . tpl_onus::description()), data_base::select_multiple_table(tpl_degree::degree(), tpl_degree::degree() . '.' . tpl_degree::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_degree(), tpl_degree::name(), tpl_degree::degree() . '_' . tpl_degree::name())), array(tpl_onus_designate::id_student() => $id, tpl_onus_designate::status() => 1));
     return $db->get_where();
 }
 public function update_status()
 {
     $id = $_POST[tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id()];
     $status = $_POST[tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::status()];
     $db = new data_base(tpl_onus_designate::onus_designate(), array(tpl_onus_designate::status() => $status), array(tpl_onus_designate::id() => $id));
     $results = $db->change();
     $status_data = $status == 1 ? 'active' : 'dative';
     if ($results) {
         echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Update ' . $status_data));
     } else {
         echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not Update ' . $status_data . ', please try again'));
     }
 }
            </div>
            <div class="modal-body">
                <form class="form" id="update_form" method="post"
                      action="<?php 
echo site_url('admin/' . tpl_onus_designate::onus_designate() . '/update');
?>
">

                    <div class="form-group">
                        <input type="hidden"
                               name="<?php 
echo tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id() . '_update';
?>
"
                               id="<?php 
echo tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id() . '_update';
?>
"/>
                    </div>


                    <div class="form-group">
                        <label>students <?php 
echo tpl_onus_designate::onus_designate();
?>
 : </label>
                        <select name="<?php 
echo tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id_student() . '_update';
?>
"
                                id="<?php 
 public function count_onus_designate()
 {
     $db = new data_base(tpl_onus_designate::onus_designate(), array(tpl_onus_designate::id()));
     return count($db->get());
 }
 public function info_onus_designate($id = null)
 {
     $db = new data_base(tpl_onus_designate::onus_designate(), array(tpl_onus_designate::id(), tpl_onus_designate::id_degree(), tpl_onus_designate::id_models(), tpl_onus_designate::id_student(), tpl_onus_designate::id_onus(), data_base::select_multiple_table(tpl_onus::onus(), tpl_onus::onus() . '.' . tpl_onus::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_onus(), tpl_onus::name(), tpl_onus::onus() . '_' . tpl_onus::name()), data_base::select_multiple_table(tpl_onus::onus(), tpl_onus::onus() . '.' . tpl_onus::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_onus(), tpl_onus::description(), tpl_onus::onus() . '_' . tpl_onus::description()), data_base::select_multiple_table(tpl_degree::degree(), tpl_degree::degree() . '.' . tpl_degree::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_degree(), tpl_degree::name(), tpl_degree::degree() . '_' . tpl_degree::name())), array(tpl_onus_designate::id_student() => $id));
     return $db->get_where();
 }