public function __construct()
 {
     parent::__construct();
     $this->user_model = new User_Model();
     if (Session::user_exist() && Session::get_Account_type() == "Signatory") {
         $this->schoolYearSem_model = new SchoolYearSem_Model();
         $this->student_model = new Student_Model();
         $this->clearanceStatus_model = new ClearanceStatus();
         $this->requirementbyStudent_model = new Requirementbystudent_Model();
         $this->signatorialList_model = new SignatorialList_Model();
         $this->bulletin_model = new Bulletin_Model();
         $this->department_model = new Department_Model();
         $this->template = new Template();
         $listOfSchoolYear = $this->schoolYearSem_model->getSchool_Year();
         $currentSemester = $this->schoolYearSem_model->getCurSemester();
         $currentSchool_Year = $this->schoolYearSem_model->getCurSchool_Year();
         $this->template->setPageName('Signatory Page');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type() . " in Charge -");
         $this->template->setContent('Signatorydashboard.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->setSchool_YearSemContent('SchoolYear_Sem.tpl');
         $this->template->assign('assign_sign', ", " . Session::get_AssignSignatory());
         $this->template->assign('mySchool_Year', $listOfSchoolYear);
         $this->template->assign('currentSemester', $currentSemester);
         $this->template->assign('currentSchool_Year', $currentSchool_Year);
         $this->template->set_photo(Session::get_photo());
         $this->displayTable('', 1, "default", "");
     } else {
         header('Location: /SOCS/');
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Admin") {
         $this->template = new Template();
         $this->signatorialList_model = new SignatorialList_Model();
         $this->department_model = new Department_Model();
         $this->template->setPageName('Signatorial List for Graduate');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type());
         $this->template->assign('Dept_name', Session::get_DepartmentName());
         $this->template->assign('Dept_desc', $this->department_model->getDescription(Session::get_DepartmentName()));
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('signatorialList.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->assign('assign_sign', '');
         $filename = "../Excel_File/student_current_enroll.xls";
         if (file_exists($filename)) {
             $this->template->assign('excel_file', 'true');
         }
         $this->displayTable('', 1, "default");
     } else {
         header('Location: ' . HOST);
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->template = new Template();
     $this->schoolYearSem_model = new SchoolYearSem_Model();
     $this->requirement_model = new Requirements_Model();
     $this->signatorialList_model = new SignatorialList_Model();
     $this->signatory_model = new Signatory_Model();
     $this->course_model = new Course_Model();
     $listOfSchoolYear = $this->schoolYearSem_model->getSchool_Year();
     $currentSemester = $this->schoolYearSem_model->getCurSemester();
     $currentSchool_Year = $this->schoolYearSem_model->getCurSchool_Year();
     $this->template->setPageName('Requirements Page');
     $this->template->set_username(Session::get_user());
     $this->template->set_surname(Session::get_Surname());
     $this->template->set_firstname(Session::get_Firstname());
     $this->template->set_middlename(Session::get_Middlename());
     $this->template->set_account_type(Session::get_Account_type() . " in Charge -");
     $this->template->setContent('RequirementsPage.tpl');
     $this->template->setCalendar('Calendar.tpl');
     $this->template->setSchool_YearSemContent('SchoolYear_Sem.tpl');
     $this->template->assign('assign_sign', ", " . Session::get_AssignSignatory());
     $this->template->assign('mySchool_Year', $listOfSchoolYear);
     $this->template->assign('currentSemester', $currentSemester);
     $this->template->assign('currentSchool_Year', $currentSchool_Year);
     $this->template->set_photo(Session::get_photo());
     $this->displayTable('', 1, "default");
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Admin") {
         $this->administrator_model = new User_Model();
         $this->registered_student_model = new Registered_Student();
         $this->signatoriallist_model = new SignatorialList_Model();
         $this->signatory_model = new Signatory_Model();
         $this->template = new Template();
         $this->template->setPageName('User Accounts Page');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type());
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('dashboard.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->assign('assign_sign', '');
         $filename = "../Excel_File/student_current_enroll.xls";
         if (file_exists($filename)) {
             $this->template->assign('excel_file', 'true');
         }
         //var_dump($_GET['account_types']);
         if (isset($_GET['user_type'])) {
             $this->displayTable('', 1, trim($_GET['user_type']), "default");
         } else {
             // echo "wwwwwwwwww";
             $this->displayTable('', 1, 'Student', "default");
         }
     } else {
         header('Location: ' . HOST);
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Admin") {
         $this->signatory_model = new Signatory_Model();
         $this->template = new Template();
         $this->template->setPageName('Signatories Page');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type());
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('signatory_list_manager.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->assign('assign_sign', '');
         $this->displayTable('', 1, "default");
         $filename = "../Excel_File/student_current_enroll.xls";
         if (file_exists($filename)) {
             $this->template->assign('excel_file', 'true');
         }
         if (isset($_GET['successEdit'])) {
             if ($_GET['successEdit'] == 'true') {
                 $this->template->setAlert("Updating Signatory was Successful", Template::ALERT_SUCCESS, 'alert');
             }
         }
         if (isset($_GET['successAdd'])) {
             if ($_GET['successAdd'] == 'true') {
                 $this->template->setAlert("Adding Signatory was Successful", Template::ALERT_SUCCESS, 'alert');
             }
         }
     } else {
         header('Location: ' . HOST);
     }
 }
Example #6
0
 public function is_user($user)
 {
     if (is_null($user)) {
         $user = Session::get_user();
     }
     if ($this->get_parentid()) {
         $parent = Groups::get($this->get_parentid());
     }
     $result = DigiplayDB::select("* FROM usersgroups WHERE (groupid = " . $this->get_id() . ") AND userid = '" . $user->get_id() . "'");
     if ($result) {
         return true;
     } else {
         if (isset($parent)) {
             return $parent->is_user($user);
         }
     }
     return false;
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Signatory") {
         $this->template = new Template();
         $this->user_model = new User_Model();
         $this->schoolYearSem_model = new SchoolYearSem_Model();
         $this->signatorialList_model = new SignatorialList_Model();
         $this->signatory_model = new Signatory_Model();
         $this->bulletin_model = new Bulletin_Model();
         $listOfSchoolYear = $this->schoolYearSem_model->getSchool_Year();
         $currentSemester = $this->schoolYearSem_model->getCurSemester();
         $currentSchool_Year = $this->schoolYearSem_model->getCurSchool_Year();
         $this->template->setPageName('Bulletin Page');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type() . " in Charge -");
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('UploadSignaturePage.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->setSchool_YearSemContent('SchoolYear_Sem.tpl');
         $this->template->assign('assign_sign', ", " . Session::get_AssignSignatory());
         $this->template->assign('mySchool_Year', $listOfSchoolYear);
         $this->template->assign('currentSemester', $currentSemester);
         $this->template->assign('currentSchool_Year', $currentSchool_Year);
         $this->signatoryID = $this->user_model->getAssignSignatory_SigIDOnly(Session::get_user());
         $sigIm = $this->signatory_model->getSignature($this->signatoryID);
         if (is_null($sigIm)) {
             $this->template->assign('signatureImage', HOST . "/photos/default_signature.jpg");
             $this->template->assign('hasImageSet', '0');
         } else {
             $this->template->assign('signatureImage', $sigIm);
             $this->template->assign('hasImageSet', '1');
         }
     } else {
         header('Location: /SOCS/');
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Signatory") {
         $this->template = new Template();
         $this->user_model = new User_Model();
         $this->schoolYearSem_model = new SchoolYearSem_Model();
         $this->signatorialList_model = new SignatorialList_Model();
         $this->bulletin_model = new Bulletin_Model();
         $listOfSchoolYear = $this->schoolYearSem_model->getSchool_Year();
         $currentSemester = $this->schoolYearSem_model->getCurSemester();
         $currentSchool_Year = $this->schoolYearSem_model->getCurSchool_Year();
         $this->template->setPageName('Bulletin Page');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type() . " in Charge -");
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('BulletinPage.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->setSchool_YearSemContent('SchoolYear_Sem.tpl');
         $this->template->assign('assign_sign', ", " . Session::get_AssignSignatory());
         $this->template->assign('mySchool_Year', $listOfSchoolYear);
         $this->template->assign('currentSemester', $currentSemester);
         $this->template->assign('currentSchool_Year', $currentSchool_Year);
         $this->displayTable('', 1, "default");
         if (isset($_GET['successAdd'])) {
             if ($_GET['successAdd'] == 'true') {
                 $this->template->setAlert("An announcement has been posted in the bulletin.", Template::ALERT_SUCCESS, 'alert');
             }
         }
     } else {
         header('Location: /SOCS/');
     }
 }
Example #9
0
 public function get()
 {
     $user = Session::get_user();
     $p = Persistence::getInstance();
     $_model = $this->model->get_called_class();
     $array = $this->filter;
     if ($this->model instanceof User) {
         $_packa = null;
         $array['hashtype'] = $this->model->getHashType()->val();
     } else {
         $_packa = $this->model->get_package();
     }
     $resp = $p->filter($user, $_packa, strtolower($_model), $array);
     $arrayo = array();
     $class = get_class($this->model);
     if ($resp) {
         foreach ($resp as $array) {
             $object = new $class();
             $object->setArray($array);
             array_push($arrayo, $object);
         }
     }
     return $arrayo;
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Admin") {
         $this->user_model = new User_Model();
         $this->template = new Template();
         $this->template->setPageName('User Accounts Page');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type());
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('unconfirmed_signatory.tpl');
         $this->template->assign('assign_sign', '');
         $this->displayTable('', 1, "default");
         $filename = "../Excel_File/student_current_enroll.xls";
         if (file_exists($filename)) {
             $this->template->assign('excel_file', 'true');
         }
     } else {
         header('Location: ' . HOST);
     }
 }
Example #11
0
    case "set-user-audiowall":
        if (!is_numeric($_REQUEST["id"])) {
            exit(json_encode(array("response" => "error")));
        }
        // *TODO* check for actual valid audiowall when james adds the classes
        $location->get_config("user_aw_set")->set_val($_REQUEST["id"]);
        echo json_encode(array("response" => "success"));
        break;
    case "login":
        if ($_POST["username"] == "" || $_POST["password"] == "") {
            exit(json_encode(array("response" => "error")));
        }
        if (!Session::login($_POST["username"], $_POST["password"])) {
            exit(json_encode(array("response" => "invalid")));
        }
        $location->get_config("user_aw_set")->set_val(Session::get_user()->get_config_var("default_aw_set"));
        $location->get_config("userid")->set_val(Session::get_user()->get_id());
        if (Session::is_group_user("Music Admin")) {
            $location->get_config("can_update")->set_val("true");
        } else {
            $location->get_config("can_update")->set_val("false");
        }
        echo json_encode(array("response" => "success"));
        break;
    case "logout":
        Session::logout();
        $location->get_config("user_aw_set")->set_val(0);
        $location->get_config("userid")->set_val(0);
        $location->get_config("can_update")->set_val("false");
        break;
}
// Determine if a session doesn't exists and if the current user is not a student
if (!(Session::user_exist() && Session::get_Account_type() == "Student")) {
    // if it is, force the browser to redirect to the home page
    header('Location: /SOCS/index.php');
}
$sy_model = new SchoolYearSem_Model();
$signatory_model = new Signatory_Model();
$current_sy = $sy_model->getCurSchool_Year();
$current_sem = $sy_model->getCurSemester();
if ($current_sem != "Summer") {
    $current_sem .= " Semester";
}
$current_sysemID = $_GET["sy_sem_id"];
$stud_status = $_GET['status'] == "Grad" ? "Graduate" : "Under Graduate";
$student_model = new Student_Model();
$stud_id = Session::get_user();
$student_model->queryStudent_Info($stud_id);
$stud_name = $student_model->getStud_Name();
$stud_gender = $student_model->getStud_Gender();
$stud_year = $student_model->getStud_Yearlevel();
$stud_course = $student_model->getStud_Course();
$stud_dept = $student_model->getStud_DeptName();
$stud_deptID = $student_model->getStud_DeptID();
$signatorial_model = new SignatorialList_Model();
$signatorial_model->getListofSignatoryByDept($stud_deptID, $stud_status);
$listOfSignatories["name"] = $signatorial_model->getSign_Name();
$listOfSignatories["id"] = $signatorial_model->getSign_ID();
$clearance_model = new ClearanceStatus();
foreach ($listOfSignatories["id"] as $key => $value) {
    $status = $clearance_model->getOverallSignatoryClearanceStatus($stud_id, $value, $current_sysemID);
    if ($status == "No Requirements") {
Example #13
0
 public static function get_by_parent($parent)
 {
     return DigiplayDB::select("* FROM v_tree WHERE parent = :parent AND username = :username", "File", true, array(":parent" => $parent->get_id(), ":username" => Session::get_user()->get_username()));
 }
 public function __construct()
 {
     parent::__construct();
     @($this->Username = Session::get_user());
 }
 public function verify()
 {
     $oldpass = trim($_POST['oldpass']);
     $newpass = trim($_POST['newpass']);
     $confirmpass = trim($_POST['confirmpass']);
     $actualPass = Session::getUserPass();
     $surname = $_POST['surname'];
     $firstname = $_POST['firstname'];
     $middleName = $_POST['middleName'];
     $email_add = $_POST['emailAdd'];
     $imagefile = $_FILES["photo"];
     //$this->admin->Signatory_Usability = $_POST['sign_usability'];
     $this->admin->Assigned_Signatory = $this->signatoriallist_model->getSignId(trim($_POST['sign_name']));
     if ($newpass == "") {
         $newpass = md5($oldpass);
         $confirmpass = md5($oldpass);
     } else {
         $newpass = md5($newpass);
         $confirmpass = md5($confirmpass);
     }
     $test = 0;
     //Check if fields are empty in firstname surname and middlename
     if ($surname != "" && $firstname != "" && $middleName != "" && $email_add != "") {
         $this->admin->Surname = $surname;
         $this->admin->First_Name = $firstname;
         $this->admin->Middle_Name = $middleName;
         $this->admin->email_add = $email_add;
         $test++;
     } else {
         $this->template->setAlert('Surname, first name, middle name and email address are required!', Template::ALERT_ERROR, 'alert');
         return;
     }
     //checks the surname if valid
     if (Validator::is_valid_name($surname) && $test == 1) {
         $test++;
     } else {
         $this->template->setAlert('Surname must not have a numerical values and characters / \\ ? < > : ; " and *', Template::ALERT_ERROR, 'alert');
         return;
     }
     //checks the firstname if valid
     if (Validator::is_valid_name($firstname) && $test == 2) {
         $test++;
     } else {
         $this->template->setAlert('Surname must not have a numerical values and characters / \\ ? < > : ; " and *', Template::ALERT_ERROR, 'alert');
         return;
     }
     //checks the middlename if valid
     if (Validator::is_valid_name($middleName) && $test == 3) {
         $test++;
     } else {
         $this->template->setAlert('Surname must not have a numerical values and characters / \\ ? < > : ; " and *', Template::ALERT_ERROR, 'alert');
         return;
     }
     //checks the email if valid
     if (Validator::is_email_valid($email_add) && $test == 4) {
         $test++;
     } else {
         $this->template->setAlert('Not valid Email', Template::ALERT_ERROR, 'alert');
         return;
     }
     //var_dump(Session::getUserPass());
     //    var_dump($newpass);
     // check if actual pass and old pass are equal
     if ($actualPass == md5($oldpass) && $test == 5) {
         $test++;
     } else {
         $this->template->setAlert('Incorrect Password!', Template::ALERT_ERROR, 'alert');
         return;
     }
     //check if new pass and confirm pass are equal
     if ($newpass == $confirmpass && $test == 6) {
         $test++;
     } else {
         $this->template->setAlert('Passwords does not matched!', Template::ALERT_ERROR, 'alert');
         return;
     }
     //check if password is valid
     if (Validator::is_valid_password($newpass) && $test == 7) {
         $this->admin->Password = $newpass;
         $test++;
     } else {
         $this->template->setAlert('Password\'s length must have a minimum of 7 characters!', Template::ALERT_ERROR, 'alert');
         return;
     }
     //check if photo is valid
     if ($imagefile['name'] != "") {
         if (Validator::is_valid_photo($imagefile)) {
             //                $ext = explode(".", $imagefile["name"]);
             $actor = "";
             if (Session::get_Account_type() == "Admin") {
                 $actor = "administrator";
             } else {
                 if (Session::get_Account_type() == "Signatory") {
                     $actor = "signatory";
                 } else {
                     if (Session::get_Account_type() == "Student") {
                         $actor = "student";
                     }
                 }
             }
             //                $this->admin->Picture = HOST . "/photos/$actor/" . Session::get_user() . "." . end($ext);
             //                $this->local_dir = PATH . "photos/$actor/" . Session::get_user() . "." . end($ext);
             $this->admin->Picture = HOST . "/photos/{$actor}/" . Session::get_user() . "." . "jpg";
             $this->local_dir = PATH . "photos/{$actor}/";
         } else {
             $this->template->setAlert('Invalid Photo!', Template::ALERT_ERROR, 'alert');
             return;
         }
     } else {
         $this->admin->Picture = Session::get_photo();
     }
     //var_dump($actualPass);
     //var_dump($this->admin->email_add);
     if ($this->admin->update() && $test == 8) {
         $this->template->set_surname($surname);
         $this->template->set_firstname($firstname);
         $this->template->set_middlename($middleName);
         $this->template->assign('email_add', $email_add);
         $this->template->set_photo($this->admin->Picture);
         $this->template->assign('current_assignSign', trim($_POST['sign_name']));
         $this->template->assign('sign_status', $this->admin->Signatory_Usability);
         if (Session::get_Account_type() == "Signatory") {
             Session::set_signatory_usability($_POST['sign_usability']);
             Session::set_assignSignatory(trim($_POST['sign_name']));
         }
         if (isset($this->admin->Picture)) {
             $image_upload = new upload($imagefile);
             if ($image_upload->uploaded) {
                 $image_upload->image_resize = "true";
                 $image_upload->image_y = 256;
                 $image_upload->image_ratio_x = "true";
                 $image_upload->image_convert = "jpg";
                 $image_upload->file_overwrite = true;
                 $image_upload->file_new_name_body = Session::get_user();
                 $image_upload->process($this->local_dir);
                 if ($image_upload->processed) {
                     $this->template->setAlert('Account has been updated!', Template::ALERT_SUCCESS);
                 } else {
                     $this->template->setAlert('Account has been updated! But there\'s problem in uploading a photo.' . $image_upload->error, Template::ALERT_INFO);
                 }
             } else {
                 $this->template->setAlert('Account has been updated! But there\'s problem in uploading a photo.', Template::ALERT_INFO);
             }
             //                if (move_uploaded_file($imagefile["tmp_name"], $this->local_dir)) {
             //                    $this->template->setAlert('Account has been updated!', Template::ALERT_SUCCESS);
             //                }else{
             //                    $this->template->setAlert('Account has been updated! But there\'s problem in uploading a photo.', Template::ALERT_INFO);
             //                }
         } else {
             $this->template->setAlert('Account has been updated!', Template::ALERT_SUCCESS);
         }
     } else {
         $this->template->setAlert('Database Error!', Template::ALERT_ERROR);
     }
 }
Example #16
0
 public function delete()
 {
     $p = Persistence::getInstance();
     $user = Session::get_user();
     return $p->delete($user, $this->get_package(), $this->get_called_class(), $this->getArray());
 }
Example #17
0
<?php

$session = Session::get_user();
$aw = AudiowallSets::get_by_id(pg_escape_string($_REQUEST['setid']));
$sessionpermissions = $aw->get_user_permissions($session->get_id());
if ($sessionpermissions[2] == '1' || Session::is_group_user('Audiowalls Admin')) {
    $ownerid = DigiplayDB::select("user_id FROM aw_sets_owner WHERE set_id = '" . $aw->get_id() . "'");
    if (isset($ownerid)) {
        $user = Users::get_by_id($ownerid);
        $username = $user->get_display_name();
    } else {
        $username = "";
    }
    require_once 'pre.php';
    Output::add_script("../aw.js");
    Output::set_title("Audiowall Users");
    MainTemplate::set_subtitle("<span style=\"margin-right:20px;\">Set: " . $aw->get_name() . "</span><span style=\"margin-right:20px;\">Owner: " . $username . "</span><span id=\"editor_edit_buttons\"><a href=\"#\" class=\"btn btn-success\">Add Viewer</a></span>");
    echo "<style type=\"text/css\">\n\ttable { font-size:1.2em; }\n\tthead { display:none; }\n\t.description { font-size:0.8em; font-style:italic; }\n\t.hover-info { display:none; }\n\t.table tbody tr.success td { background-color: #DFF0D8; }\n\t</style>";
    echo "<table class=\"table table-striped\" cellspacing=\"0\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th></th>\n\t\t\t\t\t\t<th style=\"width:65px\"></th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead><tbody>";
    $aw_set = AudiowallSets::get_by_id($_REQUEST['setid']);
    $users = $aw_set->get_users_with_permissions();
    if (!is_null($users) && count($users) > 1) {
        foreach ($users as $user) {
            $userclass = Users::get_by_id($user->get_id());
            $username = $userclass->get_username();
            $permissions = $aw_set->get_user_permissions($user->get_id());
            if ($permissions[0] == "1" && $permissions[1] == '0') {
                echo "<tr><td><strong>" . $username . "</strong></td>";
                echo "<td class=\"delete-aw-btn\" style=\"width:65px\"><a href=\"#\" class=\"btn btn-danger\">Delete</a></td>";
                echo "</td></tr>";
            }
Example #18
0
<?php

Output::set_title("Requested Tracks");
Output::add_stylesheet(LINK_ABS . "css/music.css");
Output::add_script(LINK_ABS . "js/bootstrap-popover.js");
MainTemplate::set_subtitle("Want to play a track, but it's not in the database? Request it here");
if (isset($_REQUEST["name"]) && isset($_REQUEST["artistname"])) {
    $request = new Request();
    $request->set_name($_REQUEST["name"]);
    $request->set_artist_name($_REQUEST["artistname"]);
    $request->set_user(Session::get_user());
    $request->save();
}
if (isset($_REQUEST["delete"])) {
    if (!Session::is_group_user("Music Admin")) {
        echo Bootstrap::alert_message_basic("error", "You are trying to delete a request, but you do not have the requred privelidges!", "Error!");
    } else {
        $request = Requests::get_by_id($_REQUEST["delete"]);
        if ($request) {
            $request->delete();
        }
    }
}
echo "\n<h3 style=\"margin-top: -4px\">Request a track</h3>\n<form action=\"\" method=\"post\" name=\"request-track\" class=\"form-inline\">\n\t<div class=\"form-group\">\n\t\t<input type=\"text\" name=\"artistname\" placeholder=\"Artist...\" class=\"form-control\">\n\t</div>\n\t<div class=\"form-group\">\n\t\t<input type=\"text\" name=\"name\" placeholder=\"Title...\" class=\"form-control\">\n\t</div>\n\t<div class=\"form-group\">\n\t\t<input type=\"submit\" value=\"Request\" class=\"btn btn-primary\">\n\t</div>\n</form>";
if ($requested = Requests::get_all()) {
    echo "\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t<th class=\"date nowrap\">Date Requested</th>\n\t\t\t<th class=\"requester nowrap\">Requester</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($requested as $request) {
        echo "\n\t<tr id=\"" . $request->get_id() . "\">\n\t\t<td class=\"artist\">" . $request->get_artist_name() . "</td>\n\t\t<td class=\"title\">" . $request->get_name() . "</td>\n\t\t<td class=\"date nowrap\">" . date("d/m/Y H:i", $request->get_date()) . "</td>\n\t\t<td class=\"requester nowrap\">" . $request->get_user()->get_username() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/request/?delete=" . $request->get_id() . "\" class=\"request-delete\" title=\"Delete this request\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
    }
    echo "\n</table>";
} else {
 public function renew_student()
 {
     $this->student_model->updateSY_SEM_ID(Session::getSY_SEM_ID(), Session::get_user());
     header("Location: " . HOST . "/student/index.php");
 }
Example #20
0
 public function do_del()
 {
     $user = Session::get_user();
     if ($user instanceof AdminUser && $user != null && $user->getVerified()) {
         $model = $_GET['model'];
         $object = Kernel::instance($model);
         $object->setArray($_POST);
         $r = $object->delete();
         //var_dump($r);
         if ($r) {
             header('HTTP/1.0 200 OK');
             header("Location: ?ID=show&model={$model}");
             exit(0);
         }
         header('HTTP/1.0 406 Not Acceptable');
         $pk = $object->get_pk()->val();
         header("Location: ?ID=del&model={$model}&pk=" . $pk);
     } else {
         header("Location: ?ID=login");
     }
 }
Example #21
0
 function login()
 {
     $user = Session::get_user();
     if ($user != null && $user->getVerified()) {
         header("Location: ./");
     } else {
         return parent::render('index.html', array('content' => parent::render('login.html', array('action' => '?ID=dologin'))));
     }
 }
Example #22
0
 public function count()
 {
     return DigiplayDB::select("count(*) from v_tree where parent = :parent AND userid = :userid", null, false, array("parent" => $this->id, ":userid" => Session::get_user()->get_id()));
 }
Example #23
0
 public function do_invite(View $view)
 {
     $formul = $view->getPOST('form', false);
     $user = Session::get_user();
     if ($formul && $user) {
         $files = $view->getFILES();
         $uploader = new Upload($files);
         $nombres = $uploader->uploadFile();
         foreach ($nombres as $nombre) {
             if (($handle = fopen($nombre, "r")) !== FALSE) {
                 while (($datos = fgetcsv($handle, 1000, ";")) !== FALSE) {
                     $nombre = $datos[0];
                     $apellidos = $datos[1];
                     $identificacion = $datos[2];
                     $email = $datos[3];
                     mail($email, "Inivitacion a responder un formulario en q-stad", "Cordialmente se le esta invitando la siguiente encuesta que aparece en el link que aparece a continuacion http://q-stad.alwaysdata.net/?ID=ver/resp/form&form={$formul}");
                 }
                 fclose($handle);
             }
         }
         return $view->response_ok();
     }
     return $view->response_error();
 }