本文整理汇总了PHP中db_seq_nextval函数的典型用法代码示例。如果您正苦于以下问题:PHP db_seq_nextval函数的具体用法?PHP db_seq_nextval怎么用?PHP db_seq_nextval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_seq_nextval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMassPayment
public static function addMassPayment($amount, $type_, $studentIds, $date_, $comment, $user)
{
$amount = mysql_escape_string($amount);
$comment = mysql_escape_string($comment);
$type_ = mysql_escape_string($type_);
foreach ($studentIds as $id) {
$query = "INSERT INTO BILLING_PAYMENT\r\n\t\t\t\t\t\t\t (payment_id, student_id, amount, payment_type, payment_date, comment, inserted_by)\r\n\t\t\t\t\t\t\t VALUES\r\n\t\t\t\t\t\t\t (" . db_seq_nextval('BILLING_PAYMENT_SEQ') . ",\r\n\t\t\t\t\t\t\t {$id},\r\n\t\t\t\t\t\t\t '{$amount}',\r\n\t\t\t\t\t\t\t '{$type_}',\r\n '" . date('Y-m-d', strtotime($date_)) . "',\r\n\t\t\t\t\t\t\t '{$comment}',\r\n\t\t\t\t\t\t\t '{$user}');";
DBQuery($query);
}
}
示例2: addType
public static function addType($desc)
{
$desc = mysql_escape_string($desc);
$query = "INSERT INTO BILLING_PAYMENT_TYPE (type_id,type_desc) values (" . db_seq_nextval('BILLING_PAYMENT_TYPE_SEQ') . ",'{$desc}')";
if (DBQuery($query)) {
return true;
} else {
return false;
}
}
示例3: addFee
public static function addFee($amount, $title, $studentId, $dueDate, $assignedDate, $comment, $module, $username)
{
$amount = mysql_escape_string($amount);
$title = mysql_escape_string($title);
$comment = mysql_escape_string($comment);
$module = mysql_escape_string($module);
$username = mysql_escape_string($username);
$query = "INSERT INTO BILLING_FEE\r\n (fee_id, student_id, amount, title, assigned_date, due_date, comment, module, inserted_by, inserted_date)\r\n VALUES\r\n (" . db_seq_nextval('BILLING_FEE_SEQ') . ",\r\n {$studentId},\r\n {$amount},\r\n '{$title}',\r\n '" . date('Y-m-d', strtotime($assignedDate)) . "',\r\n '" . date('Y-m-d', strtotime($dueDate)) . "',\r\n '{$comment}',\r\n '{$module}',\r\n '{$username}',\r\n current_timestamp);";
if (DBQuery($query)) {
return true;
} else {
return false;
}
}
示例4: _rollover
function _rollover($table)
{
global $id;
switch ($table) {
//modif Francois: copy School Configuration
case 'CONFIG':
DBQuery("INSERT INTO CONFIG (SCHOOL_ID,TITLE,CONFIG_VALUE) SELECT '{$id}' AS SCHOOL_ID,TITLE,CONFIG_VALUE FROM CONFIG WHERE SCHOOL_ID='" . UserSchool() . "';");
DBQuery("INSERT INTO PROGRAM_CONFIG (SCHOOL_ID,SYEAR,PROGRAM,VALUE,TITLE) SELECT '{$id}' AS SCHOOL_ID,SYEAR,PROGRAM,VALUE,TITLE FROM PROGRAM_CONFIG WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "';");
break;
case 'SCHOOL_PERIODS':
DBQuery("INSERT INTO SCHOOL_PERIODS (PERIOD_ID,SYEAR,SCHOOL_ID,SORT_ORDER,TITLE,SHORT_NAME,LENGTH,ATTENDANCE,ROLLOVER_ID) SELECT nextval('SCHOOL_PERIODS_SEQ'),SYEAR,'{$id}' AS SCHOOL_ID,SORT_ORDER,TITLE,SHORT_NAME,LENGTH,ATTENDANCE,PERIOD_ID FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'SCHOOL_GRADELEVELS':
$table_properties = db_properties($table);
$columns = '';
foreach ($table_properties as $column => $values) {
if ($column != 'ID' && $column != 'SCHOOL_ID' && $column != 'NEXT_GRADE_ID') {
$columns .= ',' . $column;
}
}
DBQuery("INSERT INTO {$table} (ID,SCHOOL_ID" . $columns . ") SELECT nextval('" . $table . "_SEQ'),'{$id}' AS SCHOOL_ID" . $columns . " FROM {$table} WHERE SCHOOL_ID='" . UserSchool() . "'");
break;
case 'SCHOOL_MARKING_PERIODS':
DBQuery("INSERT INTO SCHOOL_MARKING_PERIODS (MARKING_PERIOD_ID,PARENT_ID,SYEAR,MP,SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_COMMENTS,ROLLOVER_ID) SELECT " . db_seq_nextval('MARKING_PERIOD_SEQ') . ",PARENT_ID,SYEAR,MP,'{$id}' AS SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_COMMENTS,MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
DBQuery("UPDATE SCHOOL_MARKING_PERIODS SET PARENT_ID=(SELECT mp.MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS mp WHERE mp.SYEAR=school_marking_periods.SYEAR AND mp.SCHOOL_ID=school_marking_periods.SCHOOL_ID AND mp.ROLLOVER_ID=school_marking_periods.PARENT_ID) WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='{$id}'");
break;
case 'REPORT_CARD_GRADES':
DBQuery("INSERT INTO REPORT_CARD_GRADE_SCALES (ID,SYEAR,SCHOOL_ID,TITLE,COMMENT,HR_GPA_VALUE,HHR_GPA_VALUE,SORT_ORDER,ROLLOVER_ID) SELECT " . db_seq_nextval('REPORT_CARD_GRADE_SCALES_SEQ') . ",SYEAR,'{$id}',TITLE,COMMENT,HR_GPA_VALUE,HHR_GPA_VALUE,SORT_ORDER,ID FROM REPORT_CARD_GRADE_SCALES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
DBQuery("INSERT INTO REPORT_CARD_GRADES (ID,SYEAR,SCHOOL_ID,TITLE,COMMENT,BREAK_OFF,GPA_VALUE,GRADE_SCALE_ID,SORT_ORDER) SELECT " . db_seq_nextval('REPORT_CARD_GRADES_SEQ') . ",SYEAR,'{$id}',TITLE,COMMENT,BREAK_OFF,GPA_VALUE,(SELECT ID FROM REPORT_CARD_GRADE_SCALES WHERE ROLLOVER_ID=report_card_grades.GRADE_SCALE_ID AND SCHOOL_ID='{$id}'),SORT_ORDER FROM REPORT_CARD_GRADES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'REPORT_CARD_COMMENTS':
DBQuery("INSERT INTO REPORT_CARD_COMMENTS (ID,SYEAR,SCHOOL_ID,TITLE,SORT_ORDER,CATEGORY_ID,COURSE_ID) SELECT " . db_seq_nextval('REPORT_CARD_COMMENTS_SEQ') . ",SYEAR,'{$id}',TITLE,SORT_ORDER,NULL,NULL FROM REPORT_CARD_COMMENTS WHERE COURSE_ID IS NULL AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'ELIGIBILITY_ACTIVITIES':
case 'ATTENDANCE_CODES':
$table_properties = db_properties($table);
$columns = '';
foreach ($table_properties as $column => $values) {
if ($column != 'ID' && $column != 'SYEAR' && $column != 'SCHOOL_ID') {
$columns .= ',' . $column;
}
}
DBQuery("INSERT INTO {$table} (ID,SYEAR,SCHOOL_ID" . $columns . ") SELECT nextval('" . $table . "_SEQ'),SYEAR,'{$id}' AS SCHOOL_ID" . $columns . " FROM {$table} WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
}
}
示例5: _rollover
function _rollover($table)
{
global $id;
switch ($table) {
case 'SCHOOL_PERIODS':
DBQuery("INSERT INTO SCHOOL_PERIODS (PERIOD_ID,SYEAR,SCHOOL_ID,SORT_ORDER,TITLE,SHORT_NAME,LENGTH,ROLLOVER_ID) SELECT fn_school_periods_seq(),SYEAR,'{$id}' AS SCHOOL_ID,SORT_ORDER,TITLE,SHORT_NAME,LENGTH,ROLLOVER_ID FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'SCHOOL_GRADELEVELS':
$table_properties = db_properties($table);
$columns = '';
foreach ($table_properties as $column => $values) {
if ($column != 'ID' && $column != 'SCHOOL_ID' && $column != 'NEXT_GRADE_ID') {
$columns .= ',' . $column;
}
}
DBQuery("INSERT INTO {$table} (ID,SCHOOL_ID" . $columns . ") SELECT fn_" . strtolower($table) . "_seq(),'{$id}' AS SCHOOL_ID" . $columns . " FROM {$table} WHERE SCHOOL_ID='" . UserSchool() . "'");
break;
case 'SCHOOL_YEARS':
DBQuery("INSERT INTO SCHOOL_YEARS (MARKING_PERIOD_ID,SYEAR,SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,ROLLOVER_ID) SELECT fn_marking_period_seq()+MARKING_PERIOD_ID,SYEAR,'{$id}' AS SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,MARKING_PERIOD_ID FROM SCHOOL_YEARS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
DBQuery("INSERT INTO SCHOOL_SEMESTERS (MARKING_PERIOD_ID,YEAR_ID,SYEAR,SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,ROLLOVER_ID) SELECT fn_marking_period_seq()+MARKING_PERIOD_ID,(SELECT MARKING_PERIOD_ID FROM SCHOOL_YEARS y WHERE y.SYEAR=s.SYEAR AND y.ROLLOVER_ID=s.YEAR_ID AND y.SCHOOL_ID='{$id}') AS YEAR_ID,SYEAR,'{$id}' AS SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,MARKING_PERIOD_ID FROM SCHOOL_SEMESTERS s WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
DBQuery("INSERT INTO SCHOOL_QUARTERS (MARKING_PERIOD_ID,SEMESTER_ID,SYEAR,SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,ROLLOVER_ID) SELECT fn_marking_period_seq()+MARKING_PERIOD_ID,(SELECT MARKING_PERIOD_ID FROM SCHOOL_SEMESTERS s WHERE s.SYEAR=q.SYEAR AND s.ROLLOVER_ID=q.SEMESTER_ID AND s.SCHOOL_ID='{$id}') AS SEMESTER_ID,SYEAR,'{$id}' AS SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,MARKING_PERIOD_ID FROM SCHOOL_QUARTERS q WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
DBQuery("INSERT INTO SCHOOL_PROGRESS_PERIODS (MARKING_PERIOD_ID,QUARTER_ID,SYEAR,SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,ROLLOVER_ID) SELECT fn_marking_period_seq()+MARKING_PERIOD_ID,(SELECT MARKING_PERIOD_ID FROM SCHOOL_QUARTERS q WHERE q.SYEAR=p.SYEAR AND q.ROLLOVER_ID=p.QUARTER_ID AND q.SCHOOL_ID='{$id}'),SYEAR,'{$id}' AS SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,MARKING_PERIOD_ID FROM SCHOOL_PROGRESS_PERIODS p WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'REPORT_CARD_GRADES':
DBQuery("INSERT INTO REPORT_CARD_GRADE_SCALES (ID,SYEAR,SCHOOL_ID,TITLE,COMMENT,SORT_ORDER,ROLLOVER_ID) SELECT " . db_seq_nextval('REPORT_CARD_GRADE_SCALES_SEQ') . ",SYEAR,'{$id}',TITLE,COMMENT,SORT_ORDER,ID FROM REPORT_CARD_GRADE_SCALES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
DBQuery("INSERT INTO REPORT_CARD_GRADES (ID,SYEAR,SCHOOL_ID,TITLE,COMMENT,BREAK_OFF,GPA_VALUE,GRADE_SCALE_ID,SORT_ORDER) SELECT " . db_seq_nextval('REPORT_CARD_GRADES_SEQ') . ",SYEAR,'{$id}',TITLE,COMMENT,BREAK_OFF,GPA_VALUE,(SELECT ID FROM REPORT_CARD_GRADE_SCALES WHERE ROLLOVER_ID=REPORT_CARD_GRADES.GRADE_SCALE_ID AND SCHOOL_ID=REPORT_CARD_GRADES.SCHOOL_ID),SORT_ORDER FROM REPORT_CARD_GRADES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'REPORT_CARD_COMMENTS':
DBQuery("INSERT INTO REPORT_CARD_COMMENTS (ID,SYEAR,SCHOOL_ID,TITLE,SORT_ORDER,COURSE_ID) SELECT " . db_seq_nextval('REPORT_CARD_COMMENTS_SEQ') . ",SYEAR,'{$id}',TITLE,SORT_ORDER,NULL FROM REPORT_CARD_COMMENTS WHERE COURSE_ID IS NULL AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
case 'ELIGIBILITY_ACTIVITIES':
case 'ATTENDANCE_CODES':
$table_properties = db_properties($table);
$columns = '';
foreach ($table_properties as $column => $values) {
if ($column != 'ID' && $column != 'SYEAR' && $column != 'SCHOOL_ID') {
$columns .= ',' . $column;
}
}
DBQuery("INSERT INTO {$table} (ID,SYEAR,SCHOOL_ID" . $columns . ") SELECT fn_" . strtolower($table) . "_seq(),SYEAR,'{$id}' AS SCHOOL_ID" . $columns . " FROM {$table} WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'");
break;
}
}
示例6: DrawHeader
<?php
DrawHeader('Pre-Defined Student Billing Fees');
if ($_REQUEST[modfunc] == 'update') {
$_REQUEST['date'] = $_REQUEST['day'] . '-' . $_REQUEST['month'] . '-' . $_REQUEST['year'];
if ($_REQUEST['date'] == '--') {
$_REQUEST['date'] = '';
}
$effective_date = DBDate();
$sql = "INSERT INTO STU_BILLING_DEFINED_FEES (ID,ACCOUNT_ID,TITLE,AMOUNT,DUE_DATE,SYEAR,SCHOOL,GRADE) \n\t\t\tvalues(" . db_seq_nextval('STU_BILLING_DEFINED_FEES_SEQ') . ",'{$_REQUEST['account_id']}','{$_REQUEST['title']}','{$_REQUEST['amount']}','{$_REQUEST['date']}','{$_REQUEST['syear']}','{$_REQUEST['school']}','{$_REQUEST['grade']}')";
DBQuery($sql);
$note[] = 'That Pre-Defined Fee has been added';
unset($_REQUEST[modfunc]);
}
if ($_REQUEST[modfunc] == 'delete') {
if (DeletePrompt('pre-defined fee')) {
DBQuery("DELETE FROM STU_BILLING_DEFINED_FEES WHERE ID='{$_REQUEST['id']}'");
$note[] = "That Pre-Defined Fee has been Deleted";
unset($_REQUEST[modfunc]);
}
}
if (!$_REQUEST[modfunc]) {
// LIST
if ($note) {
echo '<TABLE width=100%><TR><TD bgcolor=#E8E8E9><font size=-1>';
ErrorMessage($note, 'note');
echo '</font></TD></TR></TABLE>';
}
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update METHOD=POST>";
$functions = array('AMOUNT' => 'Currency', 'ACCOUNT_ID' => 'getAccount', 'DUE_DATE' => 'ProperDate', 'SYEAR' => 'DispYear', 'SCHOOL' => 'GetSchool', 'GRADE' => 'GetGrade');
$RET = DBGet(DBQuery('SELECT DISTINCT sb.ID,sb.TITLE,sb.AMOUNT,
示例7: DBQuery
DBQuery("ALTER TABLE STUDENTS ADD CUSTOM_{$id} NUMERIC(10,2)");
break;
case 'date':
DBQuery("ALTER TABLE STUDENTS ADD CUSTOM_{$id} DATE");
break;
case 'textarea':
DBQuery("ALTER TABLE STUDENTS ADD CUSTOM_{$id} VARCHAR(5000)");
$create_index = false;
//modif Francois: SQL bugfix index row size exceeds maximum 2712 for index
break;
}
if ($create_index) {
DBQuery("CREATE INDEX CUSTOM_IND{$id} ON STUDENTS (CUSTOM_{$id})");
}
} elseif ($table == 'STUDENT_FIELD_CATEGORIES') {
$id = DBGet(DBQuery("SELECT " . db_seq_nextval('STUDENT_FIELD_CATEGORIES_SEQ') . ' AS ID ' . FROM_DUAL));
$id = $id[1]['ID'];
$fields = "ID,";
$values = $id . ",";
$_REQUEST['category_id'] = $id;
// add to profile or permissions of user creating it
if (User('PROFILE_ID')) {
DBQuery("INSERT INTO PROFILE_EXCEPTIONS (PROFILE_ID,MODNAME,CAN_USE,CAN_EDIT) values('" . User('PROFILE_ID') . "','Students/Student.php&category_id={$id}','Y','Y')");
} else {
DBQuery("INSERT INTO STAFF_EXCEPTIONS (USER_ID,MODNAME,CAN_USE,CAN_EDIT) values('" . User('STAFF_ID') . "','Students/Student.php&category_id={$id}','Y','Y')");
}
}
$go = false;
foreach ($columns as $column => $value) {
if ($value) {
$fields .= $column . ',';
示例8: foreach
// ---------------------- Insert & Update Start ------------------------------ //
foreach ($_REQUEST['tables'] as $id => $columns) {
if ($id != 'new') {
$sql = "UPDATE {$table} SET ";
foreach ($columns as $column => $value) {
if ($column == 'START_DATE' || $column == 'END_DATE' || $column == 'POST_START_DATE' || $column == 'POST_END_DATE') {
if (!VerifyDate($value) && $value != '') {
BackPrompt('Not all of the dates were entered correctly.');
}
}
$sql .= $column . "='" . str_replace("\\'", "''", $value) . "',";
}
$sql = substr($sql, 0, -1) . " WHERE MARKING_PERIOD_ID='{$id}'";
$go = true;
} else {
$id_RET = DBGet(DBQuery('SELECT ' . db_seq_nextval('MARKING_PERIOD_SEQ') . ' AS ID' . FROM_DUAL));
$sql = "INSERT INTO {$table} ";
$fields = "MARKING_PERIOD_ID,SYEAR,SCHOOL_ID,";
$values = "'" . $id_RET[1]['ID'] . "','" . UserSyear() . "','" . UserSchool() . "',";
$_REQUEST['marking_period_id'] = $id_RET[1]['ID'];
switch ($_REQUEST['mp_term']) {
case 'SEM':
$fields .= "YEAR_ID,";
$values .= "'{$_REQUEST['year_id']}',";
break;
case 'QTR':
$fields .= "SEMESTER_ID,";
$values .= "'{$_REQUEST['semester_id']}',";
break;
case 'PRO':
$fields .= "QUARTER_ID,";
示例9: DBQuery
$update .= "CAN_USE=NULL";
}
$update .= " WHERE PROFILE_ID='{$_REQUEST['profile_id']}' AND MODNAME='{$modname}';";
DBQuery($update);
}
}
}
}
$exceptions_RET = DBGet(DBQuery("SELECT MODNAME,CAN_USE,CAN_EDIT FROM PROFILE_EXCEPTIONS WHERE PROFILE_ID='{$_REQUEST['profile_id']}'"), array(), array('MODNAME'));
unset($tmp_menu);
unset($_REQUEST['modfunc']);
unset($_REQUEST['can_edit']);
unset($_REQUEST['can_use']);
}
if ($_REQUEST['new_profile_title'] && AllowEdit()) {
$id = DBGet(DBQuery("SELECT " . db_seq_nextval('USER_PROFILES_SEQ') . " AS ID" . FROM_DUAL));
$id = $id[1]['ID'];
$exceptions_RET = array();
DBQuery("INSERT INTO USER_PROFILES (ID,TITLE,PROFILE) values('{$id}','" . $_REQUEST['new_profile_title'] . "','" . $_REQUEST['new_profile_type'] . "')");
$_REQUEST['profile_id'] = $id;
$xprofile = $_REQUEST['new_profile_type'];
unset($_REQUEST['new_profile_title']);
unset($_REQUEST['new_profile_type']);
unset($_SESSION['_REQUEST_vars']['new_profile_title']);
unset($_SESSION['_REQUEST_vars']['new_profile_type']);
}
if ($_REQUEST['modfunc'] != 'delete') {
PopTable('header', 'Permissions');
echo "<FORM name=pref_form id=pref_form action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update&profile_id={$_REQUEST['profile_id']} method=POST>";
DrawHeaderHome('Select the programs that users of this profile can use and which programs those users can use to save information.');
echo '<BR>';
示例10: foreach
if ($_POST['button'] == 'Save' && AllowEdit()) {
if ($_REQUEST['values']) {
if ($_REQUEST['event_id'] != 'new') {
$sql = "UPDATE CALENDAR_EVENTS SET ";
foreach ($_REQUEST['values'] as $column => $value) {
$sql .= $column . "='" . str_replace("\\'", "''", $value) . "',";
}
$sql = substr($sql, 0, -1) . " WHERE ID='{$_REQUEST['event_id']}'";
DBQuery($sql);
} else {
if (!$_REQUEST['values']['SCHOOL_DATE']) {
$_REQUEST['values']['SCHOOL_DATE'] = $_REQUEST['dd'];
}
$sql = "INSERT INTO CALENDAR_EVENTS ";
$fields = 'ID,SYEAR,SCHOOL_ID,';
$values = db_seq_nextval('CALENDAR_EVENTS_SEQ') . ",'" . UserSyear() . "','" . UserSchool() . "',";
$go = 0;
foreach ($_REQUEST['values'] as $column => $value) {
if ($value) {
$fields .= $column . ',';
if ($column == "SCHOOL_DATE") {
$values .= "'" . date('Y-m-d', strtotime($value)) . "',";
} else {
$values .= "'" . str_replace("\\'", "''", $value) . "',";
}
$go = true;
}
}
$sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
if ($go) {
DBQuery($sql);
示例11: substr
$sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
DBQuery($sql);
if ($CentreModules['Food_Service']) {
// create default food service account for this student
$sql = "INSERT INTO FOOD_SERVICE_ACCOUNTS (ACCOUNT_ID,BALANCE,TRANSACTION_ID) values('{$student_id}','0.00','0')";
DBQuery($sql);
// associate with default food service account and assign other defaults
$sql = "INSERT INTO FOOD_SERVICE_STUDENT_ACCOUNTS (STUDENT_ID,DISCOUNT,BARCODE,ACCOUNT_ID) values('{$student_id}','','','{$student_id}')";
DBQuery($sql);
}
$_SESSION['student_id'] = $_REQUEST['student_id'] = $student_id;
$new_student = true;
}
}
if ($_REQUEST['values'] && $_REQUEST['include'] == 'Medical') {
SaveData(array('STUDENT_MEDICAL_ALERTS' => "ID='__ID__'", 'STUDENT_MEDICAL' => "ID='__ID__'", 'STUDENT_MEDICAL_VISITS' => "ID='__ID__'", 'fields' => array('STUDENT_MEDICAL' => 'ID,STUDENT_ID,', 'STUDENT_MEDICAL_ALERTS' => 'ID,STUDENT_ID,', 'STUDENT_MEDICAL_VISITS' => 'ID,STUDENT_ID,'), 'values' => array('STUDENT_MEDICAL' => db_seq_nextval('STUDENT_MEDICAL_SEQ') . ",'" . UserStudentID() . "',", 'STUDENT_MEDICAL_ALERTS' => db_seq_nextval('STUDENT_MEDICAL_ALERTS_SEQ') . ",'" . UserStudentID() . "',", 'STUDENT_MEDICAL_VISITS' => db_seq_nextval('STUDENT_MEDICAL_VISITS_SEQ') . ",'" . UserStudentID() . "',")));
}
if ($_REQUEST['include'] != 'General_Info' && $_REQUEST['include'] != 'Address' && $_REQUEST['include'] != 'Medical' && $_REQUEST['include'] != 'Other_Info') {
if (!strpos($_REQUEST['include'], '/')) {
include 'modules/Students/includes/' . $_REQUEST['include'] . '.inc.php';
} else {
include 'modules/' . $_REQUEST['include'] . '.inc.php';
}
}
unset($_REQUEST['modfunc']);
// SHOULD THIS BE HERE???
if (!UserStudentID()) {
unset($_REQUEST['values']);
}
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_SESSION['_REQUEST_vars']['values']);
示例12: substr
}
if ($_REQUEST['tab_id'] != 'new') {
$sql = substr($sql, 0, -1) . " WHERE MENU_ITEM_ID='{$id}'";
} else {
$sql = substr($sql, 0, -1) . " WHERE ITEM_ID='{$id}'";
}
DBQuery($sql);
} else {
if ($_REQUEST['tab_id'] != 'new') {
$sql = 'INSERT INTO FOOD_SERVICE_MENU_ITEMS ';
$fields = 'MENU_ITEM_ID,MENU_ID,SCHOOL_ID,';
$values = db_seq_nextval('FOOD_SERVICE_MENU_ITEMS_SEQ') . ',\'' . $_REQUEST['tab_id'] . '\',\'' . UserSchool() . '\',';
} else {
$sql = 'INSERT INTO FOOD_SERVICE_ITEMS ';
$fields = 'ITEM_ID,SCHOOL_ID,';
$values = db_seq_nextval('FOOD_SERVICE_ITEMS_SEQ') . ',\'' . UserSchool() . '\',';
}
$go = false;
foreach ($columns as $column => $value) {
if ($value) {
$fields .= $column . ',';
$values .= '\'' . str_replace("\\'", "''", $value) . '\',';
$go = true;
}
}
$sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
if ($go) {
DBQuery($sql);
}
}
}
示例13: substr
$sql = substr($sql, 0, -1) . " WHERE " . substr($table, 10, -1) . "_ID='{$id}'";
$go = true;
} 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 = $id[1]['ID'];
$fields = "ASSIGNMENT_ID,ASSIGNMENT_TYPE_ID,STAFF_ID,MARKING_PERIOD_ID,";
$values = $id . ",'" . $_REQUEST['assignment_type_id'] . "','" . User('STAFF_ID') . "','" . UserMP() . "',";
$_REQUEST['assignment_id'] = $id;
} elseif ($table == 'GRADEBOOK_ASSIGNMENT_TYPES') {
$id = DBGet(DBQuery("SELECT " . db_seq_nextval('GRADEBOOK_ASSIGNMENT_TYPES_SEQ') . ' AS ID ' . FROM_DUAL));
$id = $id[1]['ID'];
$fields = "ASSIGNMENT_TYPE_ID,STAFF_ID,COURSE_ID,";
$values = $id . ",'" . User('STAFF_ID') . "','{$course_id}',";
$_REQUEST['assignment_type_id'] = $id;
}
$go = false;
if (!$columns['COURSE_ID'] && $_REQUEST['table'] == 'GRADEBOOK_ASSIGNMENTS') {
$columns['COURSE_ID'] = 'N';
}
foreach ($columns as $column => $value) {
if ($column == 'DUE_DATE' || $column == 'ASSIGNED_DATE') {
if (!VerifyDate($value)) {
BackPrompt(_('Some dates were not entered correctly.'));
}
} elseif ($column == 'COURSE_ID' && $value == 'Y') {
示例14: foreach
foreach ($person as $column => $value) {
if ($value) {
$fields .= $column . ',';
$values .= "'" . str_replace("\\'", "''", $value) . "',";
$go = true;
}
}
$sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
if ($go) {
DBQuery($sql);
if ($key == 1 || $key == 2) {
DBQuery("INSERT INTO STUDENTS_JOIN_PEOPLE (ID,STUDENT_ID,PERSON_ID,ADDRESS_ID,CUSTODY) values(" . db_seq_nextval('STUDENTS_JOIN_PEOPLE_SEQ') . ",'" . UserStudentID() . "','" . $person_id . "','" . $address_id[$key] . "','Y')");
} elseif ($address_id[$key]) {
DBQuery("INSERT INTO STUDENTS_JOIN_PEOPLE (ID,STUDENT_ID,PERSON_ID,ADDRESS_ID) values(" . db_seq_nextval('STUDENTS_JOIN_PEOPLE_SEQ') . ",'" . UserStudentID() . "','" . $person_id . "','" . $address_id[$key] . "')");
} else {
DBQuery("INSERT INTO STUDENTS_JOIN_PEOPLE (ID,STUDENT_ID,PERSON_ID,ADDRESS_ID,EMERGENCY) values(" . db_seq_nextval('STUDENTS_JOIN_PEOPLE_SEQ') . ",'" . UserStudentID() . "','" . $person_id . "','" . $address_id[1] . "','Y')");
}
}
}
}
}
if ($_REQUEST['values']['STUDENTS']) {
$sql = "UPDATE STUDENTS SET ";
foreach ($_REQUEST['values']['STUDENTS'] as $column_name => $value) {
$sql .= "{$column_name}='" . str_replace("\\'", "''", $value) . "',";
}
$sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "'";
DBQuery($sql);
}
$student = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM STUDENTS WHERE STUDENT_ID='" . UserStudentID() . "'"));
mail('mgamson@tampabay.rr.com', 'New Registration', $student[1]['FIRST_NAME'] . ' ' . $student[1]['LAST_NAME'] . ' (' . UserStudentID() . ') has been registered by ' . User('NAME') . '.');
示例15: DBGet
if ($_SESSION['MassRequests.php']) {
$current_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM SCHEDULE_REQUESTS WHERE COURSE_ID='" . $_SESSION['MassRequests.php']['course_id'] . "' AND SYEAR='" . UserSyear() . "'"), array(), array('STUDENT_ID'));
$mp_id = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_YEARS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
$mp_id = $mp_id[1]['MARKING_PERIOD_ID'];
$get_teacher = DBGet(DBQuery("SELECT TEACHER_ID FROM COURSE_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND COURSE_ID='" . $_SESSION['MassRequests.php']['course_id'] . "' AND TEACHER_ID='" . $_REQUEST['with_teacher_id'] . "'"));
$get_teacher = $get_teacher[1]['TEACHER_ID'];
$get_period = DBGet(DBQuery("SELECT PERIOD_ID FROM COURSE_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND COURSE_ID='" . $_SESSION['MassRequests.php']['course_id'] . "' AND PERIOD_ID='" . $_REQUEST['with_period_id'] . "'"));
$get_period = $get_period[1]['PERIOD_ID'];
if ($get_teacher) {
if ($get_period) {
foreach ($_REQUEST['student'] as $student_id => $yes) {
$check_dup = DBGet(DBQuery("SELECT COUNT(STUDENT_ID) AS DUPLICATE FROM SCHEDULE_REQUESTS WHERE COURSE_ID='" . $_SESSION['MassRequests.php']['course_id'] . "' AND SYEAR='" . UserSyear() . "' AND STUDENT_ID='" . $student_id . "' AND WITH_TEACHER_ID='" . $_REQUEST['with_teacher_id'] . "' AND WITH_PERIOD_ID='" . $_REQUEST['with_period_id'] . "'"));
$check_dup = $check_dup[1]['DUPLICATE'];
if ($check_dup < 1) {
if ($current_RET[$student_id] != $student_id) {
$sql = "INSERT INTO SCHEDULE_REQUESTS (REQUEST_ID,SYEAR,SCHOOL_ID,STUDENT_ID,SUBJECT_ID,COURSE_ID,MARKING_PERIOD_ID,WITH_TEACHER_ID,NOT_TEACHER_ID,WITH_PERIOD_ID,NOT_PERIOD_ID)\n\t\t\t\t\t\t\t\t\tvalues(" . db_seq_nextval('SCHEDULE_REQUESTS_SEQ') . ",'" . UserSyear() . "','" . UserSchool() . "','" . $student_id . "','" . $_SESSION['MassRequests.php']['subject_id'] . "','" . $_SESSION['MassRequests.php']['course_id'] . "','" . $mp_id . "','" . $_REQUEST['with_teacher_id'] . "','" . $_REQUEST['without_teacher_id'] . "','" . $_REQUEST['with_period_id'] . "','" . $_REQUEST['without_period_id'] . "')";
DBQuery($sql);
}
} else {
$duplicate = "<span class=red>Duplicate Entry.Request already exists</span>";
unset($_REQUEST['modfunc']);
}
}
if (!$duplicate) {
unset($_REQUEST['modfunc']);
$note = "That course has been added as a request for the selected students.";
}
} else {
$period_error = "<span class=red>Wrong Period Selection</span>";
unset($_REQUEST['modfunc']);
}