Esempio n. 1
0
DrawBC("Attendance >> " . ProgramTitle());
//////////////////////////////For new date picker///////////////////////////////////////////////////////
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
    $start_date = $_REQUEST['year_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['day_start'];
    $start_date = ProperDateMAvr($start_date);
    $start_date_mod = $start_date;
} else {
    $start_date = date('Y-m') . '-01';
    $start_date_mod = $start_date;
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
    $end_date = $_REQUEST['year_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['day_end'];
    $end_date = ProperDateMAvr($end_date);
    $end_date_mod = $end_date;
} else {
    $end_date = ProperDateMAvr();
    $end_date_mod = $end_date;
}
$get_min_start_date = DBGet(DBQuery('SELECT MIN(SCHOOL_DATE) as START_DATE FROM attendance_calendar WHERE SYEAR=' . UserSyear() . ($_REQUEST['_search_all_schools'] != 'Y' ? ' AND SCHOOL_ID=\'' . UserSchool() . '\'' : '')));
if (strtotime($start_date_mod) < strtotime($get_min_start_date[1]['START_DATE']) && $get_min_start_date[1]['START_DATE'] != '') {
    $start_date_mod = $get_min_start_date[1]['START_DATE'];
    $start_date = $start_date_mod;
    echo '<font style="color:red"><b>Start date cannot be before school\'s start date</b></font>';
}
if ($_REQUEST['modfunc'] == 'search') {
    echo '<BR>';
    PopTable('header', 'Advanced');
    echo "<FORM name=percentform action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&list_by_day=" . strip_tags(trim($_REQUEST[list_by_day])) . "&day_start=" . strip_tags(trim($_REQUEST[day_start])) . "&day_end=" . strip_tags(trim($_REQUEST[day_end])) . "&month_start=" . strip_tags(trim($_REQUEST[month_start])) . "&month_end=" . strip_tags(trim($_REQUEST[month_end])) . "&year_start=" . strip_tags(trim($_REQUEST[year_start])) . "&year_end=" . strip_tags(trim($_REQUEST[year_end])) . " method=POST>";
    echo '<TABLE>';
    Search('general_info', $extra['grades']);
    if (!isset($extra)) {
Esempio n. 2
0
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../RedirectModulesInc.php';
DrawBC("tools >> " . ProgramTitle());
if (isset($_REQUEST['del'])) {
    if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
        $start_date = $_REQUEST['year_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['day_start'];
        $start_date = ProperDateMAvr($start_date);
        $org_start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'];
        $conv_st_date = con_date($org_start_date);
    }
    if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
        $end_date = $_REQUEST['year_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['day_end'];
        $end_date = ProperDateMAvr($end_date);
        $org_end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'];
        $conv_end_date = con_date_end($org_end_date);
    }
    # ------------------------------- Deletion Of Log Records ----------------------------- #
    if (isset($conv_st_date) && isset($conv_end_date)) {
        $sql_del = DBQuery('DELETE FROM login_records WHERE LOGIN_TIME >=\'' . $conv_st_date . '\' AND LOGIN_TIME <=\'' . $conv_end_date . '\'');
        echo '<center><font color="red"><b>Log deleted successfully</b></font></center>';
    }
    if (isset($conv_st_date) && !isset($conv_end_date)) {
        $sql_del = DBQuery('DELETE FROM login_records WHERE LOGIN_TIME >=\'' . $conv_st_date . '\'');
        echo '<center><font color="red"><b>Log deleted successfully</b></font></center>';
    }
    if (!isset($conv_st_date) && isset($conv_end_date)) {
        $sql_del = DBQuery('DELETE FROM login_records WHERE LOGIN_TIME <=\'' . $conv_end_date . '\'');
        echo '<center><font color="red"><b>Log deleted successfully</b></font></center>';