当前位置: 首页>>代码示例>>PHP>>正文


PHP DeletePrompt函数代码示例

本文整理汇总了PHP中DeletePrompt函数的典型用法代码示例。如果您正苦于以下问题:PHP DeletePrompt函数的具体用法?PHP DeletePrompt怎么用?PHP DeletePrompt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DeletePrompt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ErrorMessage

            $error = ErrorMessage(array(_('Please enter a valid Sort Order.')));
        }
    }
    unset($_REQUEST['tables']);
}
if ($_REQUEST['modfunc'] == 'delete' && AllowEdit()) {
    if ($_REQUEST['id']) {
        if (DeletePrompt(_('Address Field'))) {
            $id = $_REQUEST['id'];
            DBQuery("DELETE FROM ADDRESS_FIELDS WHERE ID='{$id}'");
            DBQuery("ALTER TABLE ADDRESS DROP COLUMN CUSTOM_{$id}");
            $_REQUEST['modfunc'] = '';
            unset($_REQUEST['id']);
        }
    } elseif ($_REQUEST['category_id']) {
        if (DeletePrompt(_('Address Field Category') . ' ' . _('and all fields in the category'))) {
            $fields = DBGet(DBQuery("SELECT ID FROM ADDRESS_FIELDS WHERE CATEGORY_ID='{$_REQUEST['category_id']}'"));
            foreach ($fields as $field) {
                DBQuery("DELETE FROM ADDRESS_FIELDS WHERE ID='{$field['ID']}'");
                DBQuery("ALTER TABLE ADDRESS DROP COLUMN CUSTOM_{$field['ID']}");
            }
            DBQuery("DELETE FROM ADDRESS_FIELD_CATEGORIES WHERE ID='{$_REQUEST['category_id']}'");
            $_REQUEST['modfunc'] = '';
            unset($_REQUEST['category_id']);
        }
    }
}
if (empty($_REQUEST['modfunc'])) {
    //modif Francois: fix SQL bug invalid sort order
    if (isset($error)) {
        echo $error;
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:AddressFields.php

示例2: array

$extra['SELECT'] = ',LAST_LOGIN';
$extra['columns_after'] = array('LAST_LOGIN' => 'Last Login');
$extra['functions'] = array('LAST_LOGIN' => 'makeLogin');
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    if ($_REQUEST['staff_id'] == 'new') {
        DrawBC("Users > Add a User");
    } else {
        DrawBC("Users > " . ProgramTitle());
    }
    SearchStaff('staff_id', $extra);
} else {
    DrawHeader('Create Account');
}
if ($_REQUEST['modfunc'] == 'delete' && basename($_SERVER['PHP_SELF']) != 'index.php' && AllowEdit()) {
    # ------------------------------------  For Certification Start ------------------------------------------- #
    if (DeletePrompt('certification')) {
        DBQuery("DELETE FROM staff_certification WHERE STAFF_CERTIFICATION_ID='{$_REQUEST['certification_id']}'");
        unset($_REQUEST['modfunc']);
        $_REQUEST['certification_id'] = 'new';
    }
}
if ((UserStaffID() || $_REQUEST['staff_id'] == 'new') && (basename($_SERVER['PHP_SELF']) != 'index.php' || !$_REQUEST['staff']['USERNAME']) && $_REQUEST['modfunc'] != 'delete' && $_SESSION['fn'] != 'user' && $_REQUEST['modfunc'] != 'remove') {
    if ($_REQUEST['modfunc'] != 'delete' || $_REQUEST['delete_ok'] == '1') {
        if ($_REQUEST['staff_id'] != 'new') {
            $sql = "SELECT * FROM staff  WHERE STAFF_ID='" . UserStaffID() . "'";
            $QI = DBQuery($sql);
            $staff = DBGet($QI);
            $staff = $staff[1];
            $email = $staff[EMAIL];
            echo "<FORM name=staff id=staff action=Modules.php?modname={$_REQUEST['modname']}&custom=staff&include={$_REQUEST['include']}&category_id={$_REQUEST['category_id']}&staff_id=" . UserStaffID() . "&modfunc=update method=POST >";
        } elseif (basename($_SERVER['PHP_SELF']) != 'index.php') {
开发者ID:jicheng17,项目名称:fenghua,代码行数:31,代码来源:Staff.php

示例3: 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,
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:Define.php

示例4: DBQuery

            DBQuery($sql);
        }
    }
    unset($_REQUEST['tables']);
}
if ($_REQUEST['modfunc'] == 'delete') {
    if ($_REQUEST['id']) {
        if (DeletePrompt('address field')) {
            $id = $_REQUEST['id'];
            DBQuery("DELETE FROM ADDRESS_FIELDS WHERE ID='{$id}'");
            DBQuery("ALTER TABLE ADDRESS DROP COLUMN CUSTOM_{$id}");
            $_REQUEST['modfunc'] = '';
            unset($_REQUEST['id']);
        }
    } elseif ($_REQUEST['category_id']) {
        if (DeletePrompt('address field category and all fields in the category')) {
            $fields = DBGet(DBQuery("SELECT ID FROM ADDRESS_FIELDS WHERE CATEGORY_ID='{$_REQUEST['category_id']}'"));
            foreach ($fields as $field) {
                DBQuery("DELETE FROM ADDRESS_FIELDS WHERE ID='{$field['ID']}'");
                DBQuery("ALTER TABLE ADDRESS DROP COLUMN CUSTOM_{$field['ID']}");
            }
            DBQuery("DELETE FROM ADDRESS_FIELD_CATEGORIES WHERE ID='{$_REQUEST['category_id']}'");
            $_REQUEST['modfunc'] = '';
            unset($_REQUEST['category_id']);
        }
    }
}
if (!$_REQUEST['modfunc']) {
    // CATEGORIES
    $sql = "SELECT ID,TITLE,SORT_ORDER FROM ADDRESS_FIELD_CATEGORIES ORDER BY SORT_ORDER,TITLE";
    $QI = DBQuery($sql);
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:AddressFields.php

示例5: elseif

        $sql[] = "DELETE FROM schedule_requests WHERE COURSE_ID='{$_REQUEST['course_id']}'";
    } elseif ($_REQUEST['subject_id']) {
        $table = 'subject';
        $sql[] = "DELETE FROM course_subjects WHERE SUBJECT_ID='{$_REQUEST['subject_id']}'";
        $courses = DBGet(DBQuery("SELECT COURSE_ID FROM courses WHERE SUBJECT_ID='{$_REQUEST['subject_id']}'"));
        if (count($courses)) {
            foreach ($courses as $course) {
                $sql[] = "DELETE FROM courses WHERE COURSE_ID='{$course['COURSE_ID']}'";
                $sql[] = "UPDATE course_periods SET PARENT_ID=NULL WHERE PARENT_ID IN (SELECT COURSE_PERIOD_ID FROM course_periods WHERE COURSE_ID='{$course['COURSE_ID']}')";
                $sql[] = "DELETE FROM course_periods WHERE COURSE_ID='{$course['COURSE_ID']}'";
                $sql[] = "DELETE FROM schedule WHERE COURSE_ID='{$course['COURSE_ID']}'";
                $sql[] = "DELETE FROM schedule_requests WHERE COURSE_ID='{$course['COURSE_ID']}'";
            }
        }
    }
    if (DeletePrompt($table)) {
        foreach ($sql as $query) {
            DBQuery($query);
        }
        unset($_REQUEST['modfunc']);
    }
}
if ((!$_REQUEST['modfunc'] || $_REQUEST['modfunc'] == '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";
    $QI = DBQuery($sql);
    $subjects_RET = DBGet($QI);
    if ($_REQUEST['modfunc'] != 'choose_course') {
        if (AllowEdit()) {
开发者ID:SysBind,项目名称:opensis-ml,代码行数:31,代码来源:CoursesforWindow.php

示例6: IN

            $extra[] = "DELETE FROM SCHOOL_PROGRESS_PERIODS WHERE QUARTER_ID IN (SELECT MARKING_PERIOD_ID FROM SCHOOL_QUARTERS WHERE SEMESTER_ID='{$_REQUEST['marking_period_id']}')";
            $extra[] = "DELETE FROM SCHOOL_QUARTERS WHERE SEMESTER_ID='{$_REQUEST['marking_period_id']}'";
            break;
        case 'SCHOOL_QUARTERS':
            $name = 'quarter';
            $parent_term = 'SEM';
            $parent_id = $_REQUEST['semester_id'];
            $extra[] = "DELETE FROM SCHOOL_PROGRESS_PERIODS WHERE QUARTER_ID='{$_REQUEST['marking_period_id']}'";
            break;
        case 'SCHOOL_PROGRESS_PERIODS':
            $name = 'progress period';
            $parent_term = 'QTR';
            $parent_id = $_REQUEST['quarter_id'];
            break;
    }
    if (DeletePrompt($name)) {
        foreach ($extra as $sql) {
            DBQuery($sql);
        }
        DBQuery("DELETE FROM {$table} WHERE MARKING_PERIOD_ID='{$_REQUEST['marking_period_id']}'");
        unset($_REQUEST['modfunc']);
        $_REQUEST['mp_term'] = $parent_term;
        $_REQUEST['marking_period_id'] = $parent_id;
    }
    unset($_SESSION['_REQUEST_vars']['modfunc']);
}
if (!$_REQUEST['modfunc']) {
    if ($_REQUEST['marking_period_id'] != 'new') {
        $delete_button = "<INPUT type=button class=btn_medium value=Delete onClick='javascript:window.location=\"Modules.php?modname={$_REQUEST['modname']}&modfunc=delete&mp_term={$_REQUEST['mp_term']}&year_id={$_REQUEST['year_id']}&semester_id={$_REQUEST['semester_id']}&quarter_id={$_REQUEST['quarter_id']}&marking_period_id={$_REQUEST['marking_period_id']}\"'>";
    }
    // ADDING & EDITING FORM
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:MarkingPeriods.php

示例7: Copyright

#  Copyright (C) 2007-2008, Open Solutions for Education, Inc.
#
#*************************************************************************
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, version 2 of the License. See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#**************************************************************************
DrawHeader(ProgramTitle());
if ($_REQUEST['modfunc'] == 'remove') {
    if (DeletePrompt('request')) {
        DBQuery("DELETE FROM SCHEDULE_REQUESTS WHERE STUDENT_ID='{$_REQUEST['student_id']}' AND COURSE_ID='{$_REQUEST['course_id']}' AND COURSE_WEIGHT='{$_REQUEST['course_weight']}' AND SYEAR='" . UserSyear() . "'");
        unset($_REQUEST['modfunc']);
    }
}
if (!$_REQUEST['modfunc']) {
    $sql = "SELECT \n\t\t\t\ts.LAST_NAME||', '||s.FIRST_NAME AS FULL_NAME,r.STUDENT_ID,c.TITLE||' - '||r.COURSE_WEIGHT as COURSE,r.COURSE_ID,r.COURSE_WEIGHT \n\t\t\tFROM\n\t\t\t\tSCHEDULE_REQUESTS r,COURSES c,STUDENTS s\n\t\t\tWHERE\n\t\t\t\ts.STUDENT_ID = r.STUDENT_ID AND r.COURSE_ID = c.COURSE_ID\n\t\t\t\tAND r.SYEAR = '" . UserSyear() . "' AND r.SCHOOL_ID = '" . UserSchool() . "'\n\t\t\t\tAND NOT EXISTS (SELECT '' FROM SCHEDULE ss WHERE ss.STUDENT_ID=r.STUDENT_ID AND ss.COURSE_ID=r.COURSE_ID AND ss.COURSE_WEIGHT=r.COURSE_WEIGHT)\n\t\t\t";
    $RET = DBGet(DBQuery($sql), array(), array('STUDENT_ID'));
    $columns = array('FULL_NAME' => 'Student', 'STUDENT_ID' => 'Student ID', 'COURSE' => 'Course');
    //$link['remove']['link'] = "Modules.php?modname=$_REQUEST[modname]&modfunc=remove";
    $link['remove']['link'] = "#" . " onclick='check_content(\"ajax.php?modname={$_REQUEST['modname']}&modfunc=remove\");'";
    $link['remove']['variables'] = array('student_id' => 'STUDENT_ID', 'course_id' => 'COURSE_ID', 'course_weight' => 'COURSE_WEIGHT');
    ListOutput($RET, $columns, 'Unscheduled Request', 'Unscheduled Requests', $link, array(array('FULL_NAME', 'STUDENT_ID')));
}
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:__SchedulingReport.php

示例8: User

         $assYr = $_REQUEST['year_assigned'];
         $dueMon = $_REQUEST['month_due'];
         $dueDay = $_REQUEST['day_due'];
         $dueYr = $_REQUEST['year_due'];
         $username = User('USERNAME');
         $monthnames = array(1 => 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC');
         $dueMon = array_search($dueMon, $monthnames);
         $dueDate = $dueMon . '/' . $dueDay . '/' . $dueYr;
         $assMon = array_search($assMon, $monthnames);
         $assignedDate = $assMon . '/' . $assDay . '/' . $assYr;
         Fee::addFee($amount, $title, $studentId, $dueDate, $assignedDate, $comment, $module, $username);
     }
     echo '<SCRIPT language=javascript>opener.document.location = "Modules.php?modname=' . $_REQUEST['modname'] . "&student_id={$studentId}" . '"; window.close();</script>';
 } else {
     if ($_REQUEST['modfunc'] == 'remove') {
         if (DeletePrompt(_('fee'), _('waive'))) {
             include 'modules/Billing/classes/Auth.php';
             include 'modules/Billing/classes/Fee.php';
             $auth = new Auth();
             $staffId = User('STAFF_ID');
             $profile = User('PROFILE');
             if ($auth->checkAdmin($profile, $staffId)) {
                 $feeId = $_REQUEST['fee_id'];
                 $username = User('USERNAME');
                 Fee::waiveFee($feeId, $username);
             }
             $displayList = true;
         }
     } else {
         if (isset($_REQUEST['student_id'])) {
             $displayList = true;
开发者ID:linil,项目名称:centreSIS,代码行数:31,代码来源:fees.php

示例9: mb_substr

                if ($value) {
                    $fields .= $column . ',';
                    $values .= "'" . $value . "',";
                    $go = true;
                }
            }
            $sql .= '(' . mb_substr($fields, 0, -1) . ') values(' . mb_substr($values, 0, -1) . ')';
            if ($go) {
                DBQuery($sql);
            }
        }
    }
}
DrawHeader(ProgramTitle());
if ($_REQUEST['modfunc'] == 'remove') {
    if (DeletePrompt(_('Activity'))) {
        DBQuery("DELETE FROM ELIGIBILITY_ACTIVITIES WHERE ID='{$_REQUEST['id']}'");
        unset($_REQUEST['modfunc']);
    }
}
if ($_REQUEST['modfunc'] != 'remove') {
    $sql = "SELECT ID,TITLE,START_DATE,END_DATE FROM ELIGIBILITY_ACTIVITIES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY TITLE";
    $QI = DBQuery($sql);
    $activities_RET = DBGet($QI, array('TITLE' => 'makeTextInput', 'START_DATE' => 'makeDateInput', 'END_DATE' => 'makeDateInput'));
    $columns = array('TITLE' => _('Title'), 'START_DATE' => _('Begins'), 'END_DATE' => _('Ends'));
    $link['add']['html'] = array('TITLE' => makeTextInput('', 'TITLE'), 'START_DATE' => makeDateInput('', 'START_DATE'), 'END_DATE' => makeDateInput('', 'END_DATE'));
    $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove";
    $link['remove']['variables'] = array('id' => 'ID');
    echo '<FORM action="Modules.php?modname=' . $_REQUEST[modname] . '&modfunc=update" method="POST">';
    DrawHeader('', SubmitButton(_('Save')));
    ListOutput($activities_RET, $columns, 'Activity', 'Activities', $link);
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:Activities.php

示例10: substr

                }
            }
            $sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
            if ($go) {
                DBQuery($sql);
            }
        }
    }
    unset($_REQUEST['values']);
    unset($_SESSION['_REQUEST_vars']['values']);
    unset($_REQUEST['profiles']);
    unset($_SESSION['_REQUEST_vars']['profiles']);
}
DrawHeader(ProgramTitle());
if ($_REQUEST['modfunc'] == 'remove' && AllowEdit()) {
    if (DeletePrompt(_('message'))) {
        DBQuery("DELETE FROM PORTAL_NOTES WHERE ID='{$_REQUEST['id']}'");
        unset($_REQUEST['modfunc']);
    }
}
if ($_REQUEST['modfunc'] != 'remove') {
    $sql = "SELECT ID,SORT_ORDER,TITLE,CONTENT,START_DATE,END_DATE,PUBLISHED_PROFILES,CASE WHEN END_DATE IS NOT NULL AND END_DATE<CURRENT_DATE THEN 'Y' ELSE NULL END AS EXPIRED FROM PORTAL_NOTES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY EXPIRED DESC,SORT_ORDER,PUBLISHED_DATE DESC";
    $QI = DBQuery($sql);
    $notes_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'CONTENT' => '_makeContentInput', 'SORT_ORDER' => '_makeTextInput', 'START_DATE' => '_makePublishing'));
    $columns = array('TITLE' => _('Title'), 'CONTENT' => _('Note'), 'SORT_ORDER' => _('Sort Order'), 'START_DATE' => _('Publishing Options'));
    //,'START_TIME'=>'Start Time','END_TIME'=>'End Time'
    $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'CONTENT' => _makeContentInput('', 'CONTENT'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'START_DATE' => _makePublishing('', 'START_DATE'));
    $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove";
    $link['remove']['variables'] = array('id' => 'ID');
    echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>";
    DrawHeader('', SubmitButton(_('Save')));
开发者ID:linil,项目名称:centreSIS,代码行数:31,代码来源:PortalNotes.php

示例11: substr

                     }
                     $go = true;
                 }
             }
             $sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
             if ($go) {
                 DBQuery($sql);
             }
         }
         echo '<SCRIPT language=javascript>opener.document.location = "Modules.php?modname=' . $_REQUEST['modname'] . '&year=' . $_REQUEST['year'] . '&month=' . MonthNWSwitch($_REQUEST['month'], 'tochar') . '"; window.close();</script>';
         unset($_REQUEST['values']);
         unset($_SESSION['_REQUEST_vars']['values']);
     }
     echo '<SCRIPT language=javascript> window.close();</script>';
 } elseif (clean_param($_REQUEST['button'], PARAM_ALPHAMOD) == 'Delete') {
     if (DeletePrompt('event', 'delete', 'y')) {
         DBQuery("DELETE FROM calendar_events WHERE ID='" . paramlib_validation($column = EVENT_ID, $_REQUEST[event_id]) . "'");
         echo '<SCRIPT language=javascript>opener.document.location = "Modules.php?modname=' . $_REQUEST['modname'] . '&year=' . $_REQUEST['year'] . '&month=' . MonthNWSwitch($_REQUEST['month'], 'tochar') . '"; window.close();</script>';
         unset($_REQUEST['values']);
         unset($_SESSION['_REQUEST_vars']['values']);
         unset($_REQUEST['button']);
         unset($_SESSION['_REQUEST_vars']['button']);
     }
 } else {
     if ($_REQUEST['event_id']) {
         if ($_REQUEST['event_id'] != 'new') {
             $RET = DBGet(DBQuery("SELECT TITLE,DESCRIPTION,SCHOOL_DATE,CALENDAR_ID FROM calendar_events WHERE ID='{$_REQUEST['event_id']}'"));
             $title = $RET[1]['TITLE'];
         } else {
             $title = 'New Event';
             $RET[1]['SCHOOL_DATE'] = date('Y-m-d', strtotime($_REQUEST['school_date']));
开发者ID:26746647,项目名称:openSIS,代码行数:31,代码来源:Calendar.php

示例12: DBQuery

            if ($go) {
                DBQuery($sql);
            }
        }
    }
    unset($_REQUEST['values']);
}
if ($_REQUEST['modfunc'] == 'remove' & AllowEdit()) {
    if (DeletePrompt(_('Fee'))) {
        DBQuery("DELETE FROM BILLING_FEES WHERE ID='" . $_REQUEST['id'] . "'");
        DBQuery("DELETE FROM BILLING_FEES WHERE WAIVED_FEE_ID='" . $_REQUEST['id'] . "'");
        unset($_REQUEST['modfunc']);
    }
}
if ($_REQUEST['modfunc'] == 'waive' & AllowEdit()) {
    if (DeletePrompt(_('Fee'), _('Waive'))) {
        $fee_RET = DBGet(DBQuery("SELECT TITLE,AMOUNT FROM BILLING_FEES WHERE ID='{$_REQUEST['id']}'"));
        DBQuery("INSERT INTO BILLING_FEES (ID,SYEAR,SCHOOL_ID,TITLE,AMOUNT,WAIVED_FEE_ID,STUDENT_ID,ASSIGNED_DATE,COMMENTS) values(" . db_seq_nextval('BILLING_FEES_SEQ') . ",'" . UserSyear() . "','" . UserSchool() . "','" . str_replace("'", "''", $fee_RET[1]['TITLE']) . " " . _('Waiver') . "','" . $fee_RET[1]['AMOUNT'] * -1 . "','{$_REQUEST['id']}','" . UserStudentID() . "','" . DBDate() . "','" . _('Waiver') . "')");
        unset($_REQUEST['modfunc']);
    }
}
if (UserStudentID() && !$_REQUEST['modfunc']) {
    $fees_total = 0;
    $functions = array('REMOVE' => '_makeFeesRemove', 'ASSIGNED_DATE' => 'ProperDate', 'DUE_DATE' => '_makeFeesDateInput', 'COMMENTS' => '_makeFeesTextInput', 'AMOUNT' => '_makeFeesAmount');
    $waived_fees_RET = DBGet(DBQuery("SELECT '' AS REMOVE,f.ID,f.TITLE,f.ASSIGNED_DATE,f.DUE_DATE,f.COMMENTS,f.AMOUNT,f.WAIVED_FEE_ID FROM BILLING_FEES f WHERE f.STUDENT_ID='" . UserStudentID() . "' AND f.SYEAR='" . UserSyear() . "' AND f.WAIVED_FEE_ID IS NOT NULL"), $functions, array('WAIVED_FEE_ID'));
    $fees_RET = DBGet(DBQuery("SELECT '' AS REMOVE,f.ID,f.TITLE,f.ASSIGNED_DATE,f.DUE_DATE,f.COMMENTS,f.AMOUNT,f.WAIVED_FEE_ID FROM BILLING_FEES f WHERE f.STUDENT_ID='" . UserStudentID() . "' AND f.SYEAR='" . UserSyear() . "' AND (f.WAIVED_FEE_ID IS NULL OR f.WAIVED_FEE_ID='') ORDER BY f.ASSIGNED_DATE"), $functions);
    $i = 1;
    $RET = array();
    foreach ($fees_RET as $fee) {
        $RET[$i] = $fee;
        if ($waived_fees_RET[$fee['ID']]) {
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:StudentFees.php

示例13: DBGet

#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#**************************************************************************
if ($_REQUEST['modfunc'] == 'save' && AllowEdit()) {
    $current_RET = DBGet(DBQuery("SELECT STAFF_ID FROM STUDENTS_JOIN_USERS WHERE STUDENT_ID='" . UserStudentID() . "'"), array(), array('STAFF_ID'));
    foreach ($_REQUEST['staff'] as $staff_id => $yes) {
        if (!$current_RET[$staff_id]) {
            $sql = "INSERT INTO STUDENTS_JOIN_USERS (STAFF_ID,STUDENT_ID) values('" . $staff_id . "','" . UserStudentID() . "')";
            DBQuery($sql);
        }
    }
    unset($_REQUEST['modfunc']);
    $note = "The selected user's profile now includes access to the selected students.";
}
DrawBC("Students > " . ProgramTitle());
if ($_REQUEST['modfunc'] == 'delete' && AllowEdit()) {
    if (DeletePrompt('student from that user', 'remove access to')) {
        DBQuery("DELETE FROM STUDENTS_JOIN_USERS WHERE STAFF_ID='{$_REQUEST['staff_id']}' AND STUDENT_ID='" . UserStudentID() . "'");
        unset($_REQUEST['modfunc']);
    }
}
if ($note) {
    DrawHeader('<IMG SRC=assets/check.gif>' . $note);
}
if ($_REQUEST['modfunc'] != 'delete') {
    $extra['SELECT'] = ",(SELECT count(u.STAFF_ID) FROM STUDENTS_JOIN_USERS u,STAFF st WHERE u.STUDENT_ID=s.STUDENT_ID AND st.STAFF_ID=u.STAFF_ID AND st.SYEAR=ssm.SYEAR) AS ASSOCIATED";
    $extra['columns_after'] = array('ASSOCIATED' => '# Associated');
    Search('student_id', $extra);
    if (UserStudentID()) {
        if ($_REQUEST['modfunc'] == 'list') {
            echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save method=POST>";
            #DrawHeader('',SubmitButton('Add Selected Parents'));
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:AddUsers.php

示例14: ErrorMessage

            $error = ErrorMessage(array(_('Please enter a valid Sort Order.')));
        }
    }
    unset($_REQUEST['tables']);
}
if ($_REQUEST['modfunc'] == 'delete' && AllowEdit()) {
    if ($_REQUEST['id']) {
        if (DeletePrompt(_('User Field'))) {
            $id = $_REQUEST['id'];
            DBQuery("DELETE FROM STAFF_FIELDS WHERE ID='{$id}'");
            DBQuery("ALTER TABLE STAFF DROP COLUMN CUSTOM_{$id}");
            $_REQUEST['modfunc'] = '';
            unset($_REQUEST['id']);
        }
    } elseif ($_REQUEST['category_id']) {
        if (DeletePrompt(_('User Field Category') . ' ' . _('and all fields in the category'))) {
            $fields = DBGet(DBQuery("SELECT ID FROM STAFF_FIELDS WHERE CATEGORY_ID='{$_REQUEST['category_id']}'"));
            foreach ($fields as $field) {
                DBQuery("DELETE FROM STAFF_FIELDS WHERE ID='{$field['ID']}'");
                DBQuery("ALTER TABLE STAFF DROP COLUMN CUSTOM_{$field['ID']}");
            }
            DBQuery("DELETE FROM STAFF_FIELD_CATEGORIES WHERE ID='{$_REQUEST['category_id']}'");
            // remove from profiles and permissions
            DBQuery("DELETE FROM PROFILE_EXCEPTIONS WHERE MODNAME='Users/User.php&category_id={$_REQUEST['category_id']}'");
            DBQuery("DELETE FROM STAFF_EXCEPTIONS WHERE MODNAME='Users/User.php&category_id={$_REQUEST['category_id']}'");
            $_REQUEST['modfunc'] = '';
            unset($_REQUEST['category_id']);
        }
    }
}
if (empty($_REQUEST['modfunc'])) {
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:UserFields.php

示例15: str_replace

                         $values .= "'" . str_replace("\\'", "''", $value) . "',";
                     }
                     $go = true;
                 }
             }
             $sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')';
             if ($go) {
                 DBQuery($sql);
             }
         }
         echo '<SCRIPT language=javascript>opener.document.location = "Modules.php?modname=' . $_REQUEST['modname'] . '&year=' . $_REQUEST['year'] . '&month=' . MonthNWSwitch($_REQUEST['month'], 'tochar') . '"; window.close();</script>';
         unset($_REQUEST['values']);
         unset($_SESSION['_REQUEST_vars']['values']);
     }
 } elseif ($_REQUEST['button'] == 'Delete') {
     if (DeletePrompt('event')) {
         DBQuery("DELETE FROM CALENDAR_EVENTS WHERE ID='{$_REQUEST['event_id']}'");
         echo '<SCRIPT language=javascript>opener.document.location = "Modules.php?modname=' . $_REQUEST['modname'] . '&year=' . $_REQUEST['year'] . '&month=' . MonthNWSwitch($_REQUEST['month'], 'tochar') . '"; window.close();</script>';
         unset($_REQUEST['values']);
         unset($_SESSION['_REQUEST_vars']['values']);
         unset($_REQUEST['button']);
         unset($_SESSION['_REQUEST_vars']['button']);
     }
 } else {
     if ($_REQUEST['event_id']) {
         if ($_REQUEST['event_id'] != 'new') {
             $RET = DBGet(DBQuery("SELECT TITLE,DESCRIPTION,DATE_FORMAT(SCHOOL_DATE,'%d-%b-%y') AS SCHOOL_DATE FROM CALENDAR_EVENTS WHERE ID='{$_REQUEST['event_id']}'"));
             $title = $RET[1]['TITLE'];
         } else {
             $title = 'New Event';
             $RET[1]['SCHOOL_DATE'] = $_REQUEST['school_date'];
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:Calendar.php


注:本文中的DeletePrompt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。