コード例 #1
0
 public function update()
 {
     $id = $_POST[tpl_category::category() . '_' . tpl_category::id() . '_update'];
     $id_student = $_POST[tpl_models::models() . '_' . tpl_models::id_student() . '_update'];
     $id_companies = $_POST[tpl_models::models() . '_' . tpl_models::id_companies() . '_update'];
     $id_department = $_POST[tpl_models::models() . '_' . tpl_models::id_department() . '_update'];
     $id_section = $_POST[tpl_models::models() . '_' . tpl_models::id_section() . '_update'];
     $id_supervisor = $_POST[tpl_models::models() . '_' . tpl_models::id_supervisor() . '_update'];
     $db = new data_base(tpl_models::models(), array(tpl_models::id_student() => $id_student, tpl_models::id_companies() => $id_companies, tpl_models::id_department() => $id_department, tpl_models::id_section() => $id_section, tpl_models::id_supervisor() => $id_supervisor, tpl_models::date_in() => date_time::Date_time_24()), array(tpl_models::id() => $id));
     $results = $db->change();
     if ($results) {
         echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Update ' . $id_student));
     } else {
         echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not Update ' . $id_student . ', please try again'));
     }
 }
コード例 #2
0
 public function new_students()
 {
     if (isset($_POST[tpl_students::students() . '_' . tpl_students::first_name()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::last_name()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::password()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::password() . '_re']) && isset($_POST[tpl_students::students() . '_' . tpl_students::id_university()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::id_college()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::id_specialty()]) && isset($_POST[tpl_category::category() . '_' . tpl_category::id()]) && isset($_POST[tpl_companies::companies() . '_' . tpl_companies::id()]) && isset($_POST[tpl_department::department() . '_' . tpl_department::id()]) && isset($_POST[tpl_section::section() . '_' . tpl_section::id()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::username()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::email()])) {
         if (!empty($_POST[tpl_students::students() . '_' . tpl_students::first_name()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::last_name()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::password()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::password() . '_re']) && !empty($_POST[tpl_students::students() . '_' . tpl_students::id_university()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::id_college()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::id_specialty()]) && !empty($_POST[tpl_category::category() . '_' . tpl_category::id()]) && !empty($_POST[tpl_companies::companies() . '_' . tpl_companies::id()]) && !empty($_POST[tpl_department::department() . '_' . tpl_department::id()]) && !empty($_POST[tpl_section::section() . '_' . tpl_section::id()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::username()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::email()])) {
             if ($_POST[tpl_students::students() . '_' . tpl_students::password()] == $_POST[tpl_students::students() . '_' . tpl_students::password() . '_re']) {
                 $db = new data_base(tpl_students::students(), array(tpl_students::first_name() => $_POST[tpl_students::students() . '_' . tpl_students::first_name()], tpl_students::last_name() => $_POST[tpl_students::students() . '_' . tpl_students::last_name()], tpl_students::password() => $this->hash_password($_POST[tpl_students::students() . '_' . tpl_students::password()]), tpl_students::id_university() => $_POST[tpl_students::students() . '_' . tpl_students::id_university()], tpl_students::id_college() => $_POST[tpl_students::students() . '_' . tpl_students::id_college()], tpl_students::id_specialty() => $_POST[tpl_students::students() . '_' . tpl_students::id_specialty()], tpl_students::id_supervisor() => $_POST[tpl_students::students() . '_' . tpl_students::id_supervisor()], tpl_students::username() => $_POST[tpl_students::students() . '_' . tpl_students::username()], tpl_students::email() => $_POST[tpl_students::students() . '_' . tpl_students::email()]));
                 $id_student = $db->add();
                 $db = new data_base(tpl_models::models(), array(tpl_models::id_student() => $id_student, tpl_models::id_companies() => $_POST[tpl_companies::companies() . '_' . tpl_companies::id()], tpl_models::id_department() => $_POST[tpl_department::department() . '_' . tpl_department::id()], tpl_models::id_section() => $_POST[tpl_section::section() . '_' . tpl_section::id()], tpl_models::id_supervisor() => $_POST[tpl_students::students() . '_' . tpl_students::id_specialty()]));
                 $session = new session_students();
                 $session->new_login_students();
                 $session->set_id_user($id_student);
                 echo json_encode(array('valid' => true, 'title' => 'yes !!', 'massage' => $db->add()));
             } else {
                 echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'password not combated'));
             }
         } else {
             echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'Was not username & password, please try again'));
         }
     } else {
         echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'Was not username & password, please try again'));
     }
 }
コード例 #3
0
 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());
 }
コード例 #4
0
//$new = new models_lib_ad(); echo $new->find_section()
?>
                        </select>
                    </div>

                    <div class="form-group">
                        <label>Supervisor <?php 
echo tpl_models::models();
?>
 : </label>
                        <select name="<?php 
echo tpl_models::models() . '_' . tpl_models::id_supervisor() . '_update';
?>
"
                                id="<?php 
echo tpl_models::models() . '_' . tpl_models::id_supervisor() . '_update';
?>
"
                                class="form-control">
                            <?php 
//$new = new models_lib_ad(); echo $new->find_supervisor()
?>
                        </select>
                    </div>

                    <button type="submit" class="btn btn-success" id="update" name="update">Save</button>
                </form>
                </br>
                </br>
                <div class="" id="result_massages_update"></div>
            </div>