$parts = explode('/', $_POST['popup_endDate']); $endDate = addslashes("{$parts['2']}-{$parts['1']}-{$parts['0']}"); // change date format to yyyy-mm-dd(for mysql) //$secretCode = addslashes($_POST['popup_secretCode']); //$courseId = addslashes($_POST['popup_forCourse']); //$duration = addslashes($_POST['popup_duration']); //$examId = addslashes($_POST['popup_selectedExamId']); InstructorObject::UpdateExam(addslashes($_POST['popup_examName']), addslashes($_POST['popup_examTypeRadios']), addslashes($_POST['popup_forCourse']), $startDate, $endDate, addslashes($_POST['popup_duration']), addslashes($_POST['popup_secretCode']), addslashes($_POST['popup_selectedExamId'])); //$completeSql = "UPDATE exam " . "SET examtype='$examType',examname='$examName',courseid='$courseId',StartDate='$startDate',EndDate='$endDate',Duration='$duration',secretcode='$secretCode' " . // "WHERE examid='$examId';"; //mysql_query($completeSql) or die (mysql_error()); $_GLOBALS['message'] = "Edit completed successfully"; } //$query = "SELECT exam.examid,examtype,examname,courseid,StartDate,EndDate,Duration,secretcode FROM exam,instructor_exam WHERE exam.examid=instructor_exam.examid AND UserId='".$currentUserId."'"; //$resultSet = mysql_query($query) or die (mysql_error()); $resultSet = InstructorObject::listExams($currentUserId); $num_rows = mysql_num_rows($resultSet); if ($num_rows > 0) { echo "<br><table id='myExamsTable' class='table-hover table-bordered table-striped table col-xs-offset-1' align='center' ><tr><th>Course Id</th><th>Exam Name</th>" . "<th>Exam Type</th><th>Start Date</th><th>End Date</th><th>Duration</th><th>Secret Code</th><th>Operation</th></tr>"; $counter = 0; while ($result = mysql_fetch_array($resultSet)) { ?> <tr class="col-xs-offset-1" align="left"> <td class="contact-name"><?php echo $result['courseid']; ?> </td> <td id="examName" class="contact-firstname" value="<?php echo $result['examname']; ?> "><?php