public function update() { $id = $_POST[tpl_department::department() . '_' . tpl_department::id() . '_update']; $name = $_POST[tpl_department::department() . '_' . tpl_department::name() . '_update']; $id_companies = $_POST[tpl_department::department() . '_' . tpl_department::id_companies() . '_update']; $db = new data_base(tpl_department::department(), array(tpl_department::name() => $name, tpl_department::id_companies() => $id_companies), array(tpl_department::id() => $id)); $results = $db->change(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Update ' . $name)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not Update ' . $name . ', please try again')); } }
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()); }
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 get_all_section() { if (isset($_POST['id_department'])) { $id = $_POST['id_department']; if (!empty($id)) { $db = new data_base(tpl_section::section(), array(tpl_section::id(), tpl_section::name()), array(tpl_section::id_department() => $id, tpl_section::active() => 1)); $data = $db->get_where(); $w = ' <option></option>'; foreach ($data as $row) { $w = $w . '<option value="' . $row[tpl_department::id()] . '">' . $row[tpl_department::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')); } }
public function find_department() { if (isset($_POST[tpl_companies::id() . '_' . tpl_companies::companies()])) { $id = $_POST[tpl_companies::id() . '_' . tpl_companies::companies()]; if (!empty($id)) { $db = new data_base(tpl_department::department(), array(tpl_department::id(), tpl_department::name()), array(tpl_department::active() => 1, tpl_department::id_companies() => $id)); $data = $db->get_where(); $w = '<option></option>'; foreach ($data as $row) { $w = $w . '<option value="' . $row[tpl_department::id()] . '">' . $row[tpl_department::name()] . '</option>'; } echo $w; } else { echo 'error'; exit; } } else { echo 'error'; exit; } }
?> "/> </div> <div class="form-group"> <label for=""><?php echo tpl_department::name() . ' ' . tpl_department::department(); ?> : </label> <input type="text" class="form-control" id="<?php echo tpl_department::department() . '_' . tpl_department::name() . '_update'; ?> " name="<?php echo tpl_department::department() . '_' . tpl_department::name() . '_update'; ?> "/> </div> <div class="form-group"> <label>College <?php echo tpl_department::department(); ?> : </label> <select name="<?php echo tpl_department::department() . '_' . tpl_department::id_companies() . '_update'; ?> " id="<?php echo tpl_department::department() . '_' . tpl_department::id_companies() . '_update';
public function find_department() { $db = new data_base(tpl_department::department(), array(tpl_department::id(), tpl_department::active(), tpl_department::name()), array(tpl_department::active() => 1)); $data = $db->get_where(); $w = ''; foreach ($data as $row) { $w = $w . '<option value="' . $row[tpl_department::id()] . '">' . $row[tpl_department::name()] . '</option>'; } return $w; }
public function find_all_ajax() { $db = new data_base(tpl_trainer::trainer(), array(tpl_trainer::id(), tpl_trainer::status(), tpl_trainer::name(), data_base::select_multiple_table(tpl_department::department(), tpl_department::department() . '.' . tpl_department::id(), tpl_trainer::trainer() . '.' . tpl_trainer::id_department(), tpl_department::name(), tpl_department::department() . '_' . tpl_department::name()), data_base::select_multiple_table(tpl_section::section(), tpl_section::section() . '.' . tpl_section::id(), tpl_trainer::trainer() . '.' . tpl_trainer::id_section(), tpl_section::name(), tpl_section::section() . '_' . tpl_section::name()), data_base::select_multiple_table(tpl_companies::companies(), tpl_companies::companies() . '.' . tpl_companies::id(), tpl_trainer::trainer() . '.' . tpl_trainer::id_companies(), tpl_companies::name(), tpl_companies::companies() . '_' . tpl_companies::name()))); echo json_encode($db->get()); }
</h4> <h4>College : <?php echo $data[tpl_college::college() . '_' . tpl_college::name()]; ?> </h4> </div> <div class="col-sm-6"> <h4>companies : <?php echo $data_co[tpl_companies::companies() . '_' . tpl_companies::name()]; ?> </h4> <h4>Department : <?php echo $data_co[tpl_department::department() . '_' . tpl_department::name()]; ?> </h4> <h4>Section : <?php echo $data_co[tpl_section::section() . '_' . tpl_section::name()]; ?> </h4> </div> <div class="row"> <table class="table table-bordered"> <thead> <tr> <td>onus name</td> <td>onus description</td> <td>degree name</td>
<thead> <tr> <th data-field="<?php echo tpl_department::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"> Student Name <th data-field="<?php echo tpl_companies::companies() . '_' . tpl_companies::name(); ?> " data-halign="center" data-sortable="true"> companies Name <th data-field="<?php echo tpl_department::department() . '_' . tpl_department::name(); ?> " data-halign="center" data-sortable="true">department Name <th data-field="<?php echo tpl_section::section() . '_' . tpl_section::name(); ?> " data-halign="center" data-sortable="true">section Name <th data-field="<?php echo tpl_supervisor::supervisor() . '_' . tpl_supervisor::name(); ?> " data-halign="center" data-sortable="true">supervisor Name </tr> </thead> </table> </div>