Esempio n. 1
0
 function IsChecked($chkname, $connection)
 {
     if (!empty($_POST[$chkname])) {
         foreach ($_POST[$chkname] as $value) {
             $delsql = "delete from TheatreRooms where RoomNumber='" . $value . "'";
             deleteRoom($delsql, $connection, $value);
         }
     }
 }
Esempio n. 2
0
require_once 'lib.php';
if (isset($_SESSION["last_acted_on"]) && time() - $_SESSION["last_acted_on"] > 60 * 15 || !isset($_SESSION['user_name'])) {
    session_unset();
    // unset $_SESSION variable for the run-time
    session_destroy();
    // destroy session data in storage
    header('Location:index.php');
} else {
    session_regenerate_id(true);
    $_SESSION["last_acted_on"] = time();
    require_once 'library/admin-dashboard.php';
    if (isset($_POST['delete'])) {
        $data = $_POST['room'];
        for ($i = 0; $i < count($data); $i++) {
            deleteRoom($data[$i]);
        }
    }
    if (isset($_POST['bill'])) {
        $items = $_POST['item'];
        $quantity = $_POST['quantity'];
        $section = $_POST['section'];
        $date = date_create($_POST['order_date']);
        $order_date = date_format($date, "Y-m-d");
        $query = "select * from orders where order_date='" . $order_date . "' and room_no='" . $_POST['room'] . "'";
        $state = getData($query);
        $query = "select * from orders";
        $x = count(getData($query)) + 1;
        if (count($state) == 0) {
            $qry = "insert into orders (order_id,order_date, room_no,amount) values('" . $x . "','" . $order_date . "','" . $_POST['room'] . "','" . $_POST['amount'] . "')";
            mysql_query($qry);
Esempio n. 3
0
 function delroom()
 {
     require_once $GLOBALS['where_scs'] . '/lib/lib.room.php';
     $re = deleteRoom(importVar('id_room', true, 0));
     Util::jump_to('index.php?modname=room&amp;op=room&amp;result=' . ($re ? 'ok' : 'err'));
 }
Esempio n. 4
0
function removeCourse($id_course)
{
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    require_once _base_ . '/lib/lib.upload.php';
    $acl_man =& Docebo::user()->getAclManager();
    $course_man = new Man_Course();
    //remove course subscribed------------------------------------------
    $levels =& $course_man->getCourseIdstGroupLevel($id_course);
    foreach ($levels as $lv => $idst) {
        $acl_man->deleteGroup($idst);
    }
    $alluser = getIDGroupAlluser($id_course);
    $acl_man->deleteGroup($alluser);
    $course_man->removeCourseRole($id_course);
    $course_man->removeCourseMenu($id_course);
    if (!sql_query("\r\n\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_courseuser\r\n\tWHERE idCourse = '{$id_course}'")) {
        return false;
    }
    //remove course-----------------------------------------------------
    $query_course = "\r\n\tSELECT imgSponsor, img_course, img_material, img_othermaterial, course_demo\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course\r\n\tWHERE idCourse = '" . $id_course . "'";
    list($file_sponsor, $file_logo, $file_material, $file_othermaterial, $file_demo) = sql_fetch_row(sql_query($query_course));
    require_once _base_ . '/lib/lib.upload.php';
    $path = '/appLms/' . Get::sett('pathcourse');
    if (substr($path, -1) != '/' && substr($path, -1) != '\\') {
        $path .= '/';
    }
    sl_open_fileoperations();
    if ($file_sponsor != '') {
        sl_unlink($path . $file_sponsor);
    }
    if ($file_logo != '') {
        sl_unlink($path . $file_logo);
    }
    if ($file_material != '') {
        sl_unlink($path . $file_material);
    }
    if ($file_othermaterial != '') {
        sl_unlink($path . $file_othermaterial);
    }
    if ($file_demo != '') {
        sl_unlink($path . $file_demo);
    }
    sl_close_fileoperations();
    //if the scs exist create a room
    if ($GLOBALS['where_scs'] !== false) {
        require_once $GLOBALS['where_scs'] . '/lib/lib.room.php';
        $re = deleteRoom(false, 'course', $id_course);
    }
    if (!sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_course WHERE idCourse = '{$id_course}'")) {
        return false;
    }
    return true;
}
Esempio n. 5
0
 public function delCourse($id_course)
 {
     if ((int) $id_course <= 0) {
         return false;
     }
     require_once _lms_ . '/lib/lib.course.php';
     require_once _base_ . '/lib/lib.upload.php';
     $course_man = new Man_Course();
     //remove course subscribed------------------------------------------
     $levels =& $course_man->getCourseIdstGroupLevel($id_course);
     foreach ($levels as $lv => $idst) {
         Docebo::aclm()->deleteGroup($idst);
     }
     $alluser = getIDGroupAlluser($id_course);
     Docebo::aclm()->deleteGroup($alluser);
     $course_man->removeCourseRole($id_course);
     $course_man->removeCourseMenu($id_course);
     $query = "DELETE FROM %lms_courseuser WHERE idCourse = '" . (int) $id_course . "'";
     $qres = sql_query($query);
     if (!$qres) {
         return false;
     }
     //--- remove course data ---------------------------------------------------
     $query_course = "SELECT imgSponsor, img_course, img_material, img_othermaterial, course_demo, course_type, has_editions\n\t\t\tFROM %lms_course\n\t\t\tWHERE idCourse = '" . (int) $id_course . "'";
     $qres = sql_query($query_course);
     list($file_sponsor, $file_logo, $file_material, $file_othermaterial, $file_demo, $course_type, $course_edition) = sql_fetch_row($qres);
     require_once _base_ . '/lib/lib.upload.php';
     $path = '/appLms/' . Get::sett('pathcourse');
     if (substr($path, -1) != '/' && substr($path, -1) != '\\') {
         $path .= '/';
     }
     sl_open_fileoperations();
     if ($file_sponsor != '') {
         sl_unlink($path . $file_sponsor);
     }
     if ($file_logo != '') {
         sl_unlink($path . $file_logo);
     }
     if ($file_material != '') {
         sl_unlink($path . $file_material);
     }
     if ($file_othermaterial != '') {
         sl_unlink($path . $file_othermaterial);
     }
     if ($file_demo != '') {
         sl_unlink($path . $file_demo);
     }
     sl_close_fileoperations();
     //if the scs exist delete course rooms
     if ($GLOBALS['where_scs'] !== false) {
         require_once _scs_ . '/lib/lib.room.php';
         $re = deleteRoom(false, 'course', $id_course);
     }
     //--- delete classroom or editions -----------------------------------------
     if ($course_type == 'classroom') {
         require_once _lms_ . '/admin/model/ClassroomAlms.php';
         $classroom_model = new ClassroomAlms($id_course);
         $classroom = $classroom_model->classroom_man->getDateIdForCourse($id_course);
         foreach ($classroom as $id_date) {
             if (!$classroom_model->classroom_man->delDate($id_date)) {
                 return false;
             }
         }
     } elseif ($course_edition == 1) {
         require_once _lms_ . '/admin/model/EditionAlms.php';
         $edition_model = new EditionAlms($id_course);
         $editions = $edition_model->classroom_man->getEditionIdFromCourse($id_course);
         foreach ($editions as $id_edition) {
             if (!$edition_model->edition_man->delEdition($id_edition)) {
                 return false;
             }
         }
     }
     //--- end classrooms or editions -------------------------------------------
     //--- clear LOs ------------------------------------------------------------
     require_once _lms_ . '/lib/lib.module.php';
     require_once _lms_ . '/lib/lib.param.php';
     require_once _lms_ . '/class.module/track.object.php';
     $arr_lo_param = array();
     $arr_lo_track = array();
     $arr_org_access = array();
     $query = "SELECT * FROM %lms_organization WHERE idCourse = " . (int) $id_course;
     $ores = sql_query($query);
     while ($obj = sql_fetch_object($ores)) {
         $deleted = true;
         if ($obj->idResource != 0 && $obj->objectType != "") {
             $lo = createLO($obj->objectType);
             $deleted = $lo->del($obj->idResource);
             //delete learning object
         }
         if ($deleted) {
             $arr_lo_track[] = $obj->idOrg;
             $arr_org_access[] = $obj->idOrg;
             //collect org access ids
             $arr_lo_param[] = $obj->idParam;
             //collect idParams ids
         }
     }
     //delete all organizations references for the course
     $query = "DELETE FROM %lms_organization WHERE idCourse = " . (int) $id_course;
     $res = sql_query($query);
     //delete LOs trackings
     if (!empty($arr_lo_track)) {
         $track_object = new Track_Object(false, 'course_lo');
         $track_object->delIdTrackFromCommon($arr_lo_track);
     }
     //delete org accesses
     if (!empty($arr_org_access)) {
         $query = "DELETE FROM %lms_organization_access\n\t\t\t\tWHERE idOrgAccess IN (" . implode(",", $arr_org_access) . ")";
         $res = sql_query($query);
     }
     //delete lo params
     if (!empty($arr_lo_param)) {
         $query = "DELETE FROM %lms_lo_param\n\t\t\t\tWHERE idParam IN (" . implode(",", $arr_lo_param) . ")";
     }
     //--- end LOs --------------------------------------------------------------
     //--- clear coursepath references ------------------------------------------
     require_once _lms_ . '/lib/lib.coursepath.php';
     $cman = new CoursePath_Manager();
     $cman->deleteCourseFromCoursePaths($id_course);
     //--- end coursepath references --------------------------------------------
     //--- clear certificates assignments ---------------------------------------
     require_once _lms_ . '/lib/lib.certificate.php';
     $cman = new Certificate();
     $cman->deleteCourseCertificateAssignments($id_course);
     //--- end certificates assignments -----------------------------------------
     //--- clear labels ---------------------------------------------------------
     $lmodel = new LabelAlms();
     $lmodel->clearCourseLabel($id_course);
     //--- end labels -----------------------------------------------------------
     //--- clear advices --------------------------------------------------------
     require_once _lms_ . '/lib/lib.advice.php';
     $aman = new Man_Advice();
     $aman->deleteAllCourseAdvices($id_course);
     //--- end advices ----------------------------------------------------------
     //--- clear coursereports --------------------------------------------------
     require_once _lms_ . '/lib/lib.coursereport.php';
     $cman = new CourseReportManager();
     $cman->deleteAllReports($id_course);
     //--- end coursereports ----------------------------------------------------
     //--- clear competences ----------------------------------------------------
     $cmodel = new CompetencesAdm();
     $cmodel->deleteAllCourseCompetences($id_course);
     //--- end competences ------------------------------------------------------
     //--- finally delete course from courses table -----------------------------
     if (!sql_query("DELETE FROM %lms_course WHERE idCourse = '" . $id_course . "'")) {
         return false;
     }
     return true;
 }
Esempio n. 6
0
     call_user_func("updateHotelsStep_" . $edit_section[1]);
     break;
 case "deleteHotel":
     deleteHotel();
     break;
 case "activateHotel":
     activateHotel();
     break;
 case "deactivateHotelRequest":
     deactivateHotelRequest();
     break;
 case "deactivateHotelRequestCancel":
     deactivateHotelRequestCancel();
     break;
 case "deleteRoom":
     deleteRoom();
     break;
 case "editHotelFirst":
     editHotelFirst();
     break;
 case "loginHotels":
     loginHotels();
     break;
 case "logout":
     logout();
     break;
 case "activeHotel":
     activeHotel();
     break;
 case "activeHotelFeatured":
     activeHotelFeatured();
Esempio n. 7
0
<?php

session_start();
if (!isset($_SESSION['SESS_EMAIL'])) {
    die("login first");
}
include_once "../db_conx.php";
if ($_POST['toDo'] == "logOff") {
    session_destroy();
} else {
    if ($_POST['toDo'] == "displayRooms") {
        displayRooms();
    } elseif ($_POST['toDo'] == "deleteRoom") {
        deleteRoom($_POST['roomId']);
    } elseif ($_POST['toDo'] == "updateRoom") {
        updateRoom();
    } elseif ($_POST['toDo'] == "addRoom") {
        addRoom();
    } elseif ($_POST['toDo'] == "displaySubjects") {
        displaySubjects();
    } elseif ($_POST['toDo'] == "updateSubject") {
        updateSubject();
    } elseif ($_POST['toDo'] == "deleteSubject") {
        deleteSubject($_POST['subId']);
    } elseif ($_POST['toDo'] == "addSubject") {
        addSubject();
    } elseif ($_POST['toDo'] == "displayBatches") {
        displayBatches();
    } elseif ($_POST['toDo'] == "addBatch") {
        addBatch();
    } elseif ($_POST['toDo'] == "updateBatch") {
<?php

$command = 0;
if (isset($_POST["theID"])) {
    $id = $_POST["theID"];
    if ($id != "") {
        deleteRoom($id);
        $command = 1;
    } else {
        $command = 0;
    }
} else {
    $command = 0;
}