Student Performance Management System

Source: Internet
Author: User
Basic functions: 1, to achieve the maintenance of basic information of students (increase and deletion), 2, to achieve the maintenance of course information (increase and deletion), 3, to achieve the management of elective courses (elective courses, withdrawal); 4. Achieve Results Management (entry), statistical students and average grade of the course
  1. $conn =mysql_connect ("localhost", "root", "123456") or Die (' Connection failed ');//Connection server
  2. mysql_select_db ("Yggl", $conn) or Die (' connection database failed ');//Select Database
  3. mysql_query ("Set NAMES ' gb2312 '");//Set character sets
  4. $Number =@$_get[' number ']; Get number
  5. $Name =@$_get[' Name ']; Get Name
  6. $Depart =@$_get[' depart ']; Get Department Name
  7. GetSQL function for generating query statements
  8. function GetSQL ($Num, $Na, $DEP)
  9. {
  10. $sql = "SELECT * from Employees where";
  11. $note = 0;
  12. if ($Num)
  13. {
  14. Set the query condition after the WHERE clause if the number is filled in
  15. $sql. = "EmployeeID like '% $Num% '";
  16. $note = 1;
  17. }
  18. if ($Na)
  19. {
  20. If you fill in your name, connect the query criteria after $sql
  21. if ($note ==1)
  22. $sql. = "and Name like '% $Na% '";
  23. Else
  24. $sql. = "Name like '% $Na% '";
  25. $note = 1;
  26. }
  27. if ($Dep && ($Dep! = "All Departments"))
  28. {
  29. if ($note ==1)
  30. $sql. = "and departmentid= (select DepartmentID from departments
  31. where departmentname= ' $Dep ') ";
  32. Else
  33. {
  34. $sql. = "departmentid= (select DepartmentID from departments
  35. where departmentname= ' $Dep ') ";
  36. $note = 1;
  37. }
  38. }
  39. if ($note ==0)
  40. {
  41. Query all records If none of the conditions are set
  42. $sql = "SELECT * from Employees";
  43. }
  44. return $sql;//Returns SQL statement
  45. }
  46. $sql =getsql ($Number, $Name, $Depart);//Get query statement
  47. $result =mysql_query ($sql);
  48. $total =mysql_num_rows ($result);
  49. $page =isset ($_get[' page ')? $_get[' page ']:1; Gets the value of the page in the Address bar, set to 1 if it does not exist
  50. $num = 5; Show 5 records per page
  51. $url = ' 8_1.php '; Page URL
  52. Page Count
  53. $pagenum =ceil ($total/$num);//Get total pages and last page
  54. $page =min ($pagenum, $page);//Get home
  55. $PREPG = $page -1;//Previous page
  56. $NEXTPG = ($page = = $pagenum? 0: $page + 1); Next page
  57. $new _sql= $sql. "Limit". ($page-1) * $num. ",". $num;//Find query statements for $num Records
  58. $new _result=mysql_query ($new _sql);
  59. if ($new _row=mysql_fetch_array ($new _result))
  60. {
  61. Output employee information in tabular format if query results are available
  62. echo "
  63. Employee Information Query Results
  64. ";
  65. echo "
  66. echo "
  67. echo "
  68. echo "
  69. echo "
  70. echo "
  71. echo "
  72. Do
  73. echo "
  74. echo "
  75. if ($sex = = ' 1 ')
  76. Else
  77. $timeTemp =strtotime ($birthday); Resolves a datetime to a UNIX timestamp
  78. echo "
  79. echo "
  80. }while ($new _row=mysql_fetch_array ($new _result));
  81. {
  82. List ($number, $name, $edu, $birthday, $sex, $workyear, $phone, $add, $depid) = $new _row;
  83. SQL statement to find the department name
  84. $d _sql= "Select Departmentname from departments where departmentid= $depid"; $d _result=mysql_query ($d _sql);
  85. $d _row=mysql_fetch_row ($d _result);
  86. echo "
  87. echo "
  88. echo "
  89. $date =date ("Y-n-j", $timeTemp); Convert time to "year-month-day" form with the date function
  90. echo "
  91. echo "
  92. "; "; "; "; "; "; "; ";//Output number ";//Output name ";//Output education "; "; ";//output Date of birth ";//The name of the department where the output is ";
    NumberNameDegreeGenderDate of birthDepartment in which
    $number$name$eduManWoman$date$d _row[0]
    ";
  93. Start Page navigation bar code
  94. $pagenav = "";
  95. if ($PREPG)
  96. $pagenav. = "
  97. Previous Page ";
  98. for ($i =1; $i <= $pagenum; $i + +)
  99. {
  100. if ($page = = $i) $pagenav. = $i. " ";
  101. Else
  102. $pagenav. = "
  103. $i ";
  104. }
  105. if ($NEXTPG)
  106. $pagenav. = "
  107. Next Page ";
  108. $pagenav. = "Total (". $pagenum. ") Page ";
  109. Output Paging navigation
  110. echo "
    " . $pagenav.";
  111. }
  112. Else
  113. echo "";
  114. ?>
Copy Code
    1. Employee Information Enquiry
    2. Employee Information Enquiry
    3. @include "sy8_1_search.php";//contains sy8_1_search.php page
    4. ?>
Copy Code
    1. Employee Income Page
    2. Employee Income Status
    3. @include "sy8_2_pro.php";//contains sy8_2_pro.php page
    4. ?>
Copy Code
  1. $Number =$_post[' number '];
  2. $conn =mysql_connect (' localhost ', ' root ', ') or Die ("Connection failed");
  3. mysql_select_db ("Yggl", $conn);//Open database
  4. $s _sql= "select * from Salary where employeeid= ' $Number '";
  5. $s _result=mysql_query ($s _sql, $conn);
  6. $s _row=mysql_fetch_array ($s _result);
  7. $id =@ $s _row[' EmployeeID ';
  8. $in =@ $s _row[' InCome ';
  9. $out =@ $s _row[' outcome ';
  10. @ $realcom = $in-$out;
  11. ?>
  12. if (isset ($_post[' Update '))
  13. {
  14. $EmployeeID =$_post[' number '];
  15. $income =$_post[' income '];
  16. $outcome =$_post[' outcome '];
  17. if (Is_numeric ($income) &&is_numeric ($outcome))//Determine if the input is a numeric string
  18. {
  19. if ($EmployeeID)
  20. {
  21. Modifying SQL statements for table salary
  22. $u _sql= "Update salary set Income= $income, Outcome= $outcome
  23. where employeeid= ' $EmployeeID ';
  24. $u _result=mysql_query ($u _sql);
  25. if (mysql_rows_affected ($conn)!=0)
  26. echo "";
  27. }
  28. Else
  29. echo "";
  30. }
  31. Else
  32. echo "";
  33. }
  34. ?>
Copy Code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.