$f_name .= $name . " ";
                } else {
                    $m_name .= $name . " ";
                }
            }
            $reg_date = date("Y-m-d", strtotime($reg_date));
            #identify gender
            $gender = $gender == "M" ? "Male" : "Female";
            #initialize status
            $status = is_numeric(stripos($status, "regular")) ? "regular" : "irregular";
            $birthdate = NULL;
            $address = NULL;
            //$student_id =get_student_id($db_con, $student_id, $student_name, $gender, $age, $status);
            $student_id = insert_student($db_con, $student_id, $f_name, $m_name, $l_name, $gender, $birthdate, $address, $status);
            //echo $reg_no."<br>";
            $reg_no = insert_reg($db_con, $student_id, $reg_no, $reg_date, $year_level, $program, $sem_id);
        }
        echo "Finnished Uploading File.";
        $_SESSION['kiosk']['error'] = 1;
        header("location: " . $referer);
    } else {
        echo "No file selected <br />";
    }
}
function verify_student_list_file($allDataInSheet, $len)
{
    echo "verifying student load file...<br>";
    $valid = 0;
    $check = ["A" => "RegID", "B" => "Reg.Date", "C" => "Student No.", "D" => "Student's Full Name", "E" => "Gender", "F" => "Age", "G" => "Program", "H" => "YearLevel", "I" => "ValidationDate", "J" => "ORNo", "K" => "Load Status"];
    for ($i = 1; $i <= $len; $i++) {
        $entry = trim($allDataInSheet[$i]["A"]);
Exemplo n.º 2
0
    $status = $row_personnel_src['status'];
    insert_personnel($dest_db_con, $personnel_id, $f_name, $m_name, $l_name, $gender, $academic_rank, $status, $b_day);
    $count++;
}
echo "Copy personnel success :: {$count} entries<br>";
$count = 0;
#Copy Student Registration data
$query_reg_src = mysqli_query($src_db_con, "SELECT * FROM student_registration_t") or die("Error in save_content.php : line 68 :: " . mysql_error($src_db_con));
while ($row_reg_src = mysqli_fetch_array($query_reg_src)) {
    $reg_no = $row_reg_src['reg_no'];
    $student_id = $row_reg_src['student_id'];
    $reg_date = $row_reg_src['reg_date'];
    $sem_id = $row_reg_src['sem_id'];
    $course_code = $row_reg_src['course_code'];
    $year_level = $row_reg_src['year_level'];
    insert_reg($dest_db_con, $student_id, $reg_no, $reg_date, $year_level, $course_code, $sem_id);
    $count++;
}
echo "Copy student registration success :: {$count} entries<br>";
$count = 0;
#Copy class data
$query_class_src = mysqli_query($src_db_con, "SELECT * FROM class_t") or die("Error in save_content.php : line 82 :: " . mysql_error($src_db_con));
while ($row_class_src = mysqli_fetch_array($query_class_src)) {
    $subject_id = $row_class_src['subject_id'];
    $faculty_id = $row_class_src['faculty_id'];
    $block_id = $row_class_src['block_id'];
    $sem_id = $row_class_src['sem_id'];
    insert_class($dest_db_con, $subject_id, $faculty_id, $block_id, $sem_id);
    $count++;
}
echo "Copy class success :: {$count} entries<br>";