$up_cpv_sql = substr($up_cpv_sql, 0, -1); $up_cpv_sql .= " WHERE ID='" . $period['ID'] . "'"; // echo '<br>'; if ($not_pass_update == false) { DBQuery($up_cpv_sql); } } } } if ($error) { echo $error; } } if (($scheduleAssociation || $gradeAssociation) && is_array($asso_err)) { foreach ($asso_err as $err) { ShowErrPhp($err); } } } } else { echo "<font color=red><b>Cannot Modify this course period as it has association. </b></font>"; } } else { $update = false; $sql = "INSERT INTO {$table_name} "; if ($table_name == 'course_subjects') { $id = DBGet(DBQuery("SHOW TABLE STATUS LIKE 'course_subjects'")); $id[1]['ID'] = $id[1]['AUTO_INCREMENT']; $fields = 'SCHOOL_ID,SYEAR,'; $values = "'" . UserSchool() . "','" . UserSyear() . "',"; $_REQUEST['subject_id'] = $id[1]['ID'];
} } } if ($_REQUEST['values'][$note_id]['PUBLISHED_PROFILES']) { $_REQUEST['values'][$note_id]['PUBLISHED_PROFILES'] .= ','; } } } if (clean_param($_REQUEST['values'], PARAM_NOTAGS) && ($_POST['values'] || $_REQUEST['ajax']) && AllowEdit() && !$_REQUEST['portal_search']) { foreach ($_REQUEST['values'] as $id => $columns) { if (!(isset($columns['TITLE']) && trim($columns['TITLE']) == '')) { if ($id != 'new') { $portal_RET = DBGet(DBQuery('SELECT START_DATE,END_DATE FROM portal_notes WHERE ID=\'' . $id . '\'')); $portal_RET = $portal_RET[1]; if (strtotime($columns['START_DATE']) > strtotime($columns['END_DATE']) && $columns['END_DATE'] != '' || strtotime($columns['START_DATE']) > strtotime($portal_RET['END_DATE']) && $portal_RET['END_DATE'] != '' || strtotime($portal_RET['START_DATE']) > strtotime($columns['END_DATE']) && $columns['END_DATE'] != '' || isset($columns['START_DATE']) && $columns['START_DATE'] == '' && $columns['END_DATE'] != '') { ShowErrPhp('Data not saved because date range is not valid'); } else { $sql = 'UPDATE portal_notes SET '; if ($allschool == 'Y') { $sql .= 'SCHOOL_ID=NULL, '; } #################### code differ for windows and Linux machine ######################## foreach ($columns as $column => $value) { $value = paramlib_validation($column, $value); // if(stripos($_SERVER['SERVER_SOFTWARE'], 'linux')){ $value = str_replace("'", "\\'", $value); // } #$sql .= $column."='".str_replace("'", "\'",$value)."',"; // for linux Machine $sql .= $column . "='" . trim($value) . "',"; // for Windows Machine #$values .= "'".$value."',";
$extra['ORDER'] = ' ,sa.ID'; $RET = GetStuList($extra); if (count($RET)) { $column_name = array('STUDENT_ID' => 'Student ID', 'ALT_ID' => 'Alternate ID', 'FULL_NAME' => 'Student', 'CONTACT_TYPE' => 'Type', 'RELATION' => 'Relation', 'RELATION_NAME' => 'Relation\'s Name', 'STREET' => 'Street', 'ADDRESS' => 'Address', 'CITY' => 'City', 'STATE' => 'State', 'ZIP' => 'Zip', 'WORK_PHONE' => 'Work Phone', 'HOME_PHONE' => 'Home Phone', 'CELL_PHONE' => 'Cell Phone', 'EMAIL_ID' => 'Email Address'); $singular = 'Student Contact'; $plural = 'Student Contacts'; $options = array('search' => false); echo '<div style="overflow:auto; width:820px; overflow-x:scroll;">'; ListOutput($RET, $column_name, $singular, $plural, $link = false, $group = false, $options); echo '</div>'; } else { ShowErrPhp('No Contacts were found.'); for_error(); } } else { ShowErrPhp('You must choose at least one student.'); for_error(); } unset($_SESSION['student_id']); $_REQUEST['modfunc'] = true; } if (!$_REQUEST['modfunc']) { DrawBC("Students >> " . ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_search_all_schools={$_REQUEST['_search_all_schools']} method=POST>"; } $extra['link'] = array('FULL_NAME' => false); $extra['SELECT'] = ',s.STUDENT_ID AS CHECKBOX'; $extra['functions'] = array('CHECKBOX' => '_makeChooseCheckbox'); $extra['columns_before'] = array('CHECKBOX' => '</A><INPUT type=checkbox value=Y name=controller checked onclick="checkAll(this.form,this.form.controller.checked,\'st_arr\');"><A>'); $extra['options']['search'] = false;
$values = '\'' . UserSyear() . '\','; $go = 0; foreach ($columns as $column => $value) { if (trim($value)) { $value = paramlib_validation($column, $value); $fields .= $column . ','; $values .= '\'' . str_replace("'", " \\'", $value) . '\','; $go = true; } } $sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')'; if ($go) { DBQuery($sql); } } else { ShowErrPhp('You can\'t add any enrollment code in this type'); } } } } DrawBC("Students > " . ProgramTitle()); if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'remove') { $select_enroll = DBGet(DBQuery('SELECT TYPE FROM student_enrollment_codes WHERE ID=\'' . $_REQUEST[id] . '\'')); if ($select_enroll[1][TYPE] != 'Roll' && $select_enroll[1][TYPE] != 'TrnD' && $select_enroll[1][TYPE] != 'TrnE') { $has_assigned_RET = DBGet(DBQuery('SELECT COUNT(*) AS TOTAL_ASSIGNED FROM student_enrollment WHERE ENROLLMENT_CODE=\'' . $_REQUEST[id] . '\'')); $has_assigned = $has_assigned_RET[1]['TOTAL_ASSIGNED']; if ($has_assigned > 0) { UnableDeletePrompt('Cannot delete because enrollment codes are associated.'); } else { if (DeletePromptMod('enrollment code', $_REQUEST['modname'])) { DBQuery('DELETE FROM student_enrollment_codes WHERE ID=\'' . $_REQUEST[id] . '\'');
} elseif ($column == 'COURSE_ID' && $table == 'gradebook_assignments') { $column = 'COURSE_PERIOD_ID'; $value = $course_period_id; $sql .= 'COURSE_ID=NULL,'; } $value = paramlib_validation($column, $value); if (stripos($_SERVER['SERVER_SOFTWARE'], 'linux')) { $value = mysql_real_escape_string($value); $value = str_replace('%u201D', "\"", $value); } $sql .= $column . '=\'' . $value . ' \','; } $sql = substr($sql, 0, -1) . ' WHERE ' . substr($table, 10, -1) . '_ID=\'' . $id . '\''; $go = true; } else { ShowErrPhp(_('Title Cannot be Blank')); } } else { $sql = 'INSERT INTO ' . $table . ' '; if ($table == 'gradebook_assignments') { if ($columns['ASSIGNMENT_TYPE_ID']) { $_REQUEST['assignment_type_id'] = $columns['ASSIGNMENT_TYPE_ID']; unset($columns['ASSIGNMENT_TYPE_ID']); } //$id = DBGet(DBQuery("SELECT ".db_seq_nextval('GRADEBOOK_ASSIGNMENTS_SEQ').' AS ID '.FROM_DUAL)); $id = DBGet(DBQuery('SHOW TABLE STATUS LIKE \'gradebook_assignments\'')); $id[1]['ID'] = $id[1]['AUTO_INCREMENT']; $id = $id[1]['ID']; $fields = 'ASSIGNMENT_TYPE_ID,STAFF_ID,MARKING_PERIOD_ID,'; $values = "'" . $_REQUEST['assignment_type_id'] . "','" . User('STAFF_ID') . "','" . UserMP() . "',"; $_REQUEST['assignment_id'] = $id;
DBQuery('INSERT INTO teacher_reassignment(course_period_id,teacher_id,assign_date,pre_teacher_id,modified_date,modified_by)VALUES(\'' . $id . '\',\'' . $staff_id . '\',\'' . $assign_date . '\',\'' . $pre_staff_id . '\',\'' . $today . '\',\'' . User('STAFF_ID') . '\')'); $_SESSION['undo'] = 'DELETE FROM teacher_reassignment WHERE course_period_id=\'' . $id . '\' AND teacher_id=\'' . $staff_id . '\' AND assign_date=\'' . $assign_date . '\''; } $undo_possible = true; $title_RET = DBGet(DBQuery('SELECT TITLE FROM course_periods WHERE COURSE_PERIOD_ID=\'' . $id . '\'')); $_SESSION['undo_title'] = $title_RET[1]['TITLE']; DBQuery('CALL TEACHER_REASSIGNMENT()'); //UpdateMissingAttendance($id); } else { ShowErrPhp(_('There is no associations in this Course Period. You can delete it from School Set Up>> Course Manager')); } } else { ShowErrPhp(_('Assigned date cannot be lesser than today\'s date')); } } else { ShowErrPhp(_('Please enter proper date')); } } if ($_REQUEST['action'] == 'undo') { DBQuery($_SESSION['undo']); DBQuery('UPDATE course_periods set title=\'' . $_SESSION['undo_title'] . '\',teacher_id=\'' . $_SESSION['undo_teacher'] . '\' WHERE course_period_id=\'' . $_REQUEST['course_period_id'] . '\''); //UpdateMissingAttendance($_REQUEST['course_period_id']); unset($_SESSION['undo']); unset($_SESSION['undo_teacher']); unset($_SESSION['undo_title']); } if ((!$_REQUEST['modfunc'] || clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'choose_course') && !$_REQUEST['course_modfunc']) { if ($_REQUEST['modfunc'] != 'choose_course') { DrawBC("" . _('Scheduling') . " > " . ProgramTitle()); } $sql = 'SELECT SUBJECT_ID,TITLE FROM course_subjects WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' ORDER BY TITLE';