public function get_info()
 {
     $session = new session_supervisor();
     $id = $session->Get_id_user();
     $db = new data_base(tpl_supervisor::supervisor(), array(tpl_supervisor::name(), tpl_supervisor::id_college(), tpl_supervisor::id_university(), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id_college(), tpl_college::name(), tpl_college::college() . '_' . tpl_college::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id_university(), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name())), array(tpl_supervisor::id() => $id));
     return $db->get_where();
 }
 public function find_supervisor()
 {
     $db = new data_base(tpl_supervisor::supervisor(), array(tpl_supervisor::id(), tpl_supervisor::name()), array(tpl_supervisor::active() => 1));
     $data = $db->get_where();
     $w = '';
     foreach ($data as $row) {
         $w = $w . '<option value="' . $row[tpl_supervisor::id()] . '">' . $row[tpl_supervisor::name()] . '</option>';
     }
     return $w;
 }
 public function ajax_onus_designate()
 {
     $db = new data_base(tpl_onus_designate::onus_designate(), array(data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_student(), tpl_students::first_name(), tpl_students::students() . '_' . tpl_students::first_name()), 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()), data_base::select_multiple_table(tpl_department::department(), tpl_department::department() . '.' . tpl_department::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_department()), tpl_department::name(), tpl_department::department() . '_' . tpl_department::name()), data_base::select_multiple_table(tpl_companies::companies(), tpl_companies::companies() . '.' . tpl_companies::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_companies()), tpl_companies::name(), tpl_companies::companies() . '_' . tpl_companies::name()), data_base::select_multiple_table(tpl_section::section(), tpl_section::section() . '.' . tpl_section::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_section()), tpl_section::name(), tpl_section::section() . '_' . tpl_section::name()), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_section::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_supervisor()), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name())));
     echo json_encode($db->get());
 }
 public function ajax_find_students()
 {
     $db = new data_base(tpl_models::models(), array(tpl_models::id(), tpl_models::id_companies(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::first_name(), tpl_students::students() . '_' . tpl_students::first_name()), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::last_name(), tpl_students::students() . '_' . tpl_students::last_name()), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name()), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_college::name(), tpl_college::college() . '_' . tpl_college::name()), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name()), data_base::select_multiple_table(tpl_department::department(), tpl_department::department() . '.' . tpl_department::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_department::name(), tpl_department::department() . '_' . tpl_department::name()), data_base::select_multiple_table(tpl_section::section(), tpl_section::section() . '.' . tpl_section::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_section::name(), tpl_section::section() . '_' . tpl_section::name())), array(tpl_models::id_companies() => $_GET['id']));
     echo json_encode($db->get_where());
 }
                            data-halign="center" data-sortable="true"
                            data-formatter="operate<?php 
echo tpl_students::password();
?>
"> password
                        </th>

                        <th data-field="<?php 
echo tpl_college::college() . '_' . tpl_college::name();
?>
"
                            data-halign="center" data-sortable="true"> college
                        </th>

                        <th data-field="<?php 
echo tpl_supervisor::supervisor() . '_' . tpl_supervisor::name();
?>
"
                            data-halign="center" data-sortable="true"> supervisor
                        </th>

                        <th data-field="<?php 
echo tpl_specialty::specialty() . '_' . tpl_specialty::name();
?>
"
                            data-halign="center" data-sortable="true"> specialty
                        </th>

                        <th data-field="<?php 
echo tpl_university::university() . '_' . tpl_university::name();
?>
 public function find_supervisor()
 {
     if (isset($_POST[tpl_students::id() . '_' . tpl_students::students()])) {
         $id = $_POST[tpl_students::id() . '_' . tpl_students::students()];
         if (!empty($id)) {
             $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::id_supervisor(), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id(), tpl_students::students() . '.' . tpl_students::id_supervisor(), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name())), array(tpl_students::status() => 1, tpl_students::id() => $id));
             $data = $db->get_where();
             $w = '<option></option>';
             foreach ($data as $row) {
                 $w = $w . '<option value="' . $row[tpl_students::id_supervisor()] . '">' . $row[tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()] . '</option>';
             }
             echo $w;
         } else {
             echo 'error empty';
             die;
         }
     } else {
         echo 'error isset';
         exit;
     }
 }
 public function ajax_students()
 {
     $db = new data_base(tpl_supervisor::supervisor(), array(tpl_supervisor::id(), tpl_supervisor::name(), tpl_supervisor::id_university(), tpl_supervisor::id_college(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id_supervisor(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id(), 'COUNT(' . tpl_students::id() . ')', tpl_students::students() . '_' . tpl_students::id()), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id_college(), tpl_college::name(), tpl_college::college() . '_' . tpl_college::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id_university(), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name())));
     echo json_encode($db->get());
 }
" rel="stylesheet">
        <script src="<?php 
echo site_url('include/ext/bootstrap-table.js');
?>
"></script>
        <?php 
$use = new class_loader();
$use->use_lib('site/supervisor/supervisor_lib');
$lib = new supervisor_lib();
$data = array_shift($lib->get_info());
?>
        <div class="col-sm-12 main">
            <div class="row">
            <div class="col-sm-6">
                <h4>Name : <?php 
echo $data[tpl_supervisor::name()];
?>
</h4>
                <h4>University : <?php 
echo $data[tpl_university::university() . '_' . tpl_university::name()];
?>
</h4>
                <h4>College : <?php 
echo $data[tpl_college::college() . '_' . tpl_college::name()];
?>
</h4>
            </div>
            </div>
            <?php 
foreach ($lib->info_students() as $row) {
    ?>
 public function get_all_supervisor()
 {
     if (isset($_POST['id_university']) && isset($_POST['id_college'])) {
         $id_university = $_POST['id_university'];
         $id_college = $_POST['id_university'];
         if (!empty($id_university) && !empty($id_college)) {
             $db = new data_base(tpl_supervisor::supervisor(), array(tpl_supervisor::id(), tpl_supervisor::name()), array(tpl_supervisor::id_university() => $id_university, tpl_supervisor::id_college() => $id_college, tpl_supervisor::active() => 1));
             $data = $db->get_where();
             $w = '   <option></option>';
             foreach ($data as $row) {
                 $w = $w . '<option value="' . $row[tpl_specialty::id()] . '">' . $row[tpl_specialty::name()] . '</option>';
             }
             echo $w;
         } else {
             echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'error empty'));
         }
     } else {
         echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'error isset'));
     }
 }
                <table id="table_srudent" data-toggle="table"
                       data-url="<?php 
echo site_url('admin/supervisor/ajax_students');
?>
"
                       data-cache="false" data-height="400" data-show-refresh="true" data-show-toggle="true"
                       data-show-columns="true" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
                       data-search="true" data-flat="true" data-toolbar="#toolbar">
                    <thead>
                    <tr>
                        <th data-field="<?php 
echo tpl_supervisor::id();
?>
" data-halign="center" data-sortable="true"> id</th>
                        <th data-field="<?php 
echo tpl_supervisor::name();
?>
"
                            data-formatter="operate<?php 
echo tpl_supervisor::supervisor();
?>
"
                            data-halign="center" data-sortable="true"> name
                        </th>

                        <th data-field="<?php 
echo tpl_college::college() . '_' . tpl_college::name();
?>
"
                            data-halign="center"
                            data-formatter="operate<?php 
?>
"/>
                    </div>

                    <div class="form-group">
                        <label for=""><?php 
echo tpl_supervisor::name() . ' ' . tpl_supervisor::supervisor();
?>
 : </label>
                        <input type="text" class="form-control"
                               id="<?php 
echo tpl_supervisor::supervisor() . '_' . tpl_supervisor::name() . '_update';
?>
"
                               name="<?php 
echo tpl_supervisor::supervisor() . '_' . tpl_supervisor::name() . '_update';
?>
"/>
                    </div>

                    <div class="form-group">
                        <label>College <?php 
echo tpl_supervisor::supervisor();
?>
 : </label>
                        <select name="<?php 
echo tpl_supervisor::supervisor() . '_' . tpl_supervisor::id_college() . '_update';
?>
"
                                id="<?php 
echo tpl_supervisor::supervisor() . '_' . tpl_supervisor::id_college() . '_update';
        <?php 
$use = new class_loader();
$use->use_lib('site/students/students_lib');
$lib = new students_lib();
$data = array_shift($lib->get_info());
$data_co = array_shift($lib->info_companies());
?>
        <div class="col-sm-12 main">
            <div class="col-sm-6">

                    <h4>Name : <?php 
echo $data[tpl_students::first_name()] . ' ' . $data[tpl_students::last_name()];
?>
</h4>
                    <h4>Supervisor : <?php 
echo $data[tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()];
?>
</h4>
                    <h4>Specialty : <?php 
echo $data[tpl_specialty::specialty() . '_' . tpl_specialty::name()];
?>
</h4>
                    <h4>University : <?php 
echo $data[tpl_university::university() . '_' . tpl_university::name()];
?>
</h4>
                    <h4>College : <?php 
echo $data[tpl_college::college() . '_' . tpl_college::name()];
?>
</h4>