public function get_info()
 {
     $session = new session_students();
     $id_students = $session->Get_id_user();
     $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::first_name(), tpl_students::last_name(), tpl_students::email(), tpl_students::id_college(), tpl_students::id_specialty(), tpl_students::id_supervisor(), tpl_students::id_university(), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_college::name(), tpl_college::college() . '_' . tpl_college::name()), 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()), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), tpl_students::students() . '.' . tpl_students::id_specialty(), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), tpl_students::students() . '.' . tpl_students::id_university(), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name())), array(tpl_students::id() => $id_students));
     return $db->get_where();
 }
 public function ajax_find_students()
 {
     $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::first_name(), tpl_students::last_name(), tpl_students::id_specialty(), tpl_students::id_college(), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), tpl_students::students() . '.' . tpl_students::id_specialty(), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name()), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_college::name(), tpl_college::college() . '_' . tpl_specialty::name())), array(tpl_students::id_specialty() => $_GET['id']));
     echo json_encode($db->get_where());
 }
                            data-halign="center" data-sortable="true"> name
                        </th>
                        <th data-field="<?php 
echo tpl_university::phone();
?>
" data-halign="center" data-sortable="true">
                            phone
                        </th>
                        <th data-field="<?php 
echo tpl_university::address();
?>
" data-halign="center" data-sortable="true">
                            address
                        </th>
                        <th data-field="<?php 
echo tpl_students::students() . '_' . tpl_students::id();
?>
"
                            data-halign="center"
                            data-formatter="operate<?php 
echo tpl_university::university();
?>
"
                            data-sortable="true"># students
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="col-sm-6">
                    <tr>

                        <th data-field="<?php 
echo tpl_category::id();
?>
" data-halign="center" data-sortable="true"> id</th>

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

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

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

                        <th data-field="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::name();
?>
 public function count_students()
 {
     $db = new data_base(tpl_students::students(), array(tpl_students::id()));
     return count($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());
 }
?>
"
                               name="<?php 
echo tpl_students::students() . '_' . tpl_students::password() . '_update_password';
?>
"/>
                    </div>

                    <div class="form-group">
                        <label for="">Retype New Password <?php 
echo tpl_students::students();
?>
 : </label>
                        <input type="text" class="form-control"
                               id="<?php 
echo tpl_students::students() . '_' . tpl_students::password() . '_r_update_password';
?>
"
                               name="<?php 
echo tpl_students::students() . '_' . tpl_students::password() . '_r_update_password';
?>
"/>
                    </div>
                    <button type="submit" class="btn btn-success" id="update" name="update">Save</button>
                </form>
                </br>
                <div class="" id="result_massages_update_password"></div>
            </div>
        </div>
    </div>
</div>
?>
"
                                class="form-control">

                        </select>
                    </div>


                    <div class="form-group Supervisor" style="display: none">
                        <label>Supervisor : </label>
                        <select name="<?php 
echo tpl_students::students() . '_' . tpl_students::id_supervisor();
?>
"
                                id="<?php 
echo tpl_students::students() . '_' . tpl_students::id_supervisor();
?>
"
                                class="form-control">

                        </select>
                    </div>


                    <div class="form-group Category" style="display: none">
                        <label>Category : </label>
                        <select name="<?php 
echo tpl_category::category() . '_' . tpl_category::id();
?>
"
                                id="<?php 
 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;
     }
 }
Exemplo n.º 10
0
                    <thead>
                    <tr>
                        <th data-field="<?php 
echo tpl_models::id();
?>
" data-halign="center" data-sortable="true"> id</th>

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

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

                        <th data-field="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::name();
?>
"
                            data-halign="center" data-sortable="true"> Companies
                        </th>
                        <th data-field="<?php 
echo tpl_university::university() . '_' . tpl_university::name();
?>
"
 public function find_models()
 {
     $db = new data_base(tpl_models::models(), array(tpl_models::id(), 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())), array(tpl_models::active() => 1));
     $data = $db->get();
     $w = '';
     foreach ($data as $row) {
         $w = $w . '<option value="' . $row[tpl_models::id()] . '">' . $row[tpl_students::students() . '_' . tpl_students::first_name()] . '</option>';
     }
     return $w;
 }
 public function update_status()
 {
     $id = $_POST[tpl_students::students() . '_' . tpl_students::id()];
     $status = $_POST[tpl_students::students() . '_' . tpl_students::status()];
     $db = new data_base(tpl_students::students(), array(tpl_students::status() => $status), array(tpl_students::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'));
     }
 }