</dl>
					  </dl>
                     <dl class="submit">
                    <input type="submit" name="btnsubmit" id="btnsubmit" value="บันทึก" class="btn"/>
                     </dl>   
		 </fieldset>  
		 </form> 
</div>  
<?php 
if ($_POST['btnsubmit'] != '') {
    $T_id = $_POST['id_teacher'];
    for ($p = 0; $p < $l; $p++) {
        if ($tpc_th[$p] == $T_id) {
            $sql = "delete from {$table_aptitude} where T_id='{$T_id}' ";
            mysql_query($sql) or die("Error sql delete");
        }
    }
    for ($i = 0; $i < count($_POST["interests"]); $i++) {
        if (trim($_POST["interests"][$i]) != "") {
            $Topic_id = $_POST["interests"][$i];
            $id = '';
            adddata($table_aptitude);
        }
    }
    fn_alert('แก้ไขข้อมูลเสร็จเรียบร้อย');
    window_location("index.php?frm=edit_aptitude");
}
?>
</body>
</html>
Exemple #2
0
    }
    if ($result_edit_teacher) {
        fn_alert('แก้ไขข้อมูลเสร็จเรียบร้อย');
        window_location("index.php?frm=edit_teacher");
    }
    if ($result_add_teacher) {
        fn_alert('บันทึกข้อมูลเสร็จเรียบร้อย');
        window_location("index.php?frm=add_teacher");
    }
    if ($result_aptitude) {
        fn_alert('บันทึกข้อมูลเสร็จเรียบร้อย');
        window_location("index.php?frm=add_aptitude");
    }
    if ($result_edit_aptitude) {
        fn_alert('แก้ไขข้อมูลเสร็จเรียบร้อย');
        window_location("index.php?frm=edit_aptitude");
    }
    if ($result_add_schedule) {
        fn_alert('จัดตารางสอนเสร็จเรียบร้อย');
        window_location("index.php?frm=show_schedule_follow_place");
    }
    if ($_REQUEST['logount'] != '') {
        session_destroy();
        echo "<meta http-equiv='refresh' content='0;url=login.php'>";
    }
}
// if close teacher
?>
	
</body>
</html>
Exemple #3
0
                    $sqlO2 = "select * from s_admin  ";
                    $queryO2 = mysql_query($sqlO2);
                    $rowO2 = mysql_fetch_array($queryO2);
                    $status_s2 = $rowO2['s_status'];
                    if ($status_s2 == "1") {
                        echo '<SCRIPT language=JavaScript>  alert("ปิดปรับปรุง!! กรุณาลองใหม่ทุก 1 ขั่วโมง...");  </script>';
                        session_destroy();
                        break;
                    }
                    $condition = "(T_username ='******') AND (T_password ='******')";
                    $query = select_condition($type_user, $condition);
                    $row = mysql_fetch_array($query);
                    $name_login = "******" . $row['T_name'] . " " . $row['T_surname'];
                    $_SESSION['s_teacher_id'] = $row['ID'];
                    $_SESSION['s_type'] = $row['T_Type'];
                    $_SESSION['type_user'] = '******';
                }
            }
        }
    }
    $num = mysql_num_rows($query);
    if ($num != '') {
        $_SESSION['user_login'] = $name_login;
        fn_refresh(0, "index.php");
    } else {
        fn_alert("รหัสผ่านไม่ถูกต้อง");
    }
}
?>
</body>
</html>