initial commit
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of MY_Controller
|
||||
* Algemene controller functies
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date 12-07-2011
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class MY_Controller extends CI_Controller{
|
||||
// public $version = '1.5'; // 14 november 2017
|
||||
// public $version = '1.9'; //13 feb 2018
|
||||
// public $version = '1.14'; //21 maart 2018
|
||||
// public $version = '1.17.20'; //21dec 2018
|
||||
// public $version = '1.17.25'; //maart 2019 ijkpuntengrafiek
|
||||
// public $version = '1.17.26';//ijkpuntengrafiek meetfout
|
||||
// public $version = '1.17.27';//ijkpuntengrafiek gemiddeld in sop + laatste dingen
|
||||
|
||||
// public $version = '1.17.28';//optellen diversiteitsoverzicht, wisselen van org en schooljaar
|
||||
// public $version = '1.17.29';//kopieren groepen divmeter po
|
||||
// public $version = '1.17.30'; //nog iets vergeten
|
||||
// public $version = '1.17.31'; //ophalen naam voor ijkpunten (bug) + onv, vold, goed, ook in grafiek
|
||||
// public $version = '1.17.32'; //nieuwe html voor toelichting onderdelen + verwijzing hoofdstukkeuze nieuwe clusters
|
||||
//public $version = '1.17.33'; //fout in verwijzing naar labels ijkpunten
|
||||
// public $version = '1.17.34'; //fout in diversiteitsmeter/schoolgegevens en in SOP oud ondersteuning1.php
|
||||
// public $version = '1.17.35'; //'weggooien' gebruiker als aut = 10 (medewerker) dan mag de aut =100 (geen toegang) gezet worden
|
||||
// public $version = '1.17.36'; //ophalen gegevens + query inspectiemeters ontwikkelagenda
|
||||
// public $version = '1.17.37'; //divmeter opslaan leerkracht en ondersteuningaantallen bij groepen
|
||||
// public $version = '1.17.38'; //optellen aantal lln divmonitor
|
||||
// public $version = '1.17.39'; //dq divmonitor
|
||||
// public $version = '1.17.40'; //16 okt 2017 terugzetten functies in groepenmodel.js
|
||||
// public $version = '1.17.44'; //laatste aspecten van sop compact
|
||||
// public $version = '1.17.46'; //nov 3 html opgeschoond
|
||||
// public $version = '1.17.47'; //foutend qs divmeter so, alttekst logo sop, slashes uit orgnaam pdf
|
||||
// public $version = '1.17.48'; //mededeling als er geen budgetversie is.
|
||||
// public $version = '1.17.49'; //schooljaar fout + inspectiemeter kleiner
|
||||
// public $version = '1.17.51'; //datum in bestandsnaam compact sop + streepje
|
||||
// public $version = '1.17.52'; //geen melding meer in flexibel sop als lijst buiten de sopperiode valt
|
||||
// public $version = '1.17.53'; //divoverzicht po: organisaties zonder licentie worden niet getoond
|
||||
// public $version = '1.17.54';//extra scoretype: included/involved/present/absent
|
||||
// public $version = '1.17.55'; // flexibel sop
|
||||
// public $version = '1.17.56'; // omvang extra ondersteuning: instrument + in compactsop
|
||||
// public $version = '1.17.57'; // ophalen van kalenderjaren bij overzicht (monfinoverzicht2.js)
|
||||
// public $version = '1.17.60'; // verbeteringen omvang extra ondersteuning: instrument + in compactsop
|
||||
// public $version = '1.17.61'; // documenten genummerd
|
||||
// public $version = '1.17.62'; // bijlage bij inlogmail
|
||||
// public $version = '1.17.63'; // mogelijkheid tot toevoegen omschrijvingen bij scores
|
||||
// public $version = '1.17.64'; // fout in ophalen scores ++ + - -- in matrix, individuele en schoolgemiddelden,
|
||||
// public $version = '1.17.66'; // instrument diversiteit po 2203
|
||||
public $version = '1.17.67'; // logo en foto koko
|
||||
public $partituurid;
|
||||
public $globProfielVersieID = 1;
|
||||
public $userid; //id of the user that is logged in
|
||||
public $orgid; //orgid of the user logged in
|
||||
public $globorgid; //orgid which has been chosen by user (only BG and SUPERUSER)
|
||||
public $userbg; // TRUE or FALSE for orgid if this org is BG
|
||||
public $globisbg; // TRUE or FALSE for globorgid if this org is BG
|
||||
public $userrole; //role of the user logged in dwz autorisatienivo van de eigen organisatie
|
||||
// dus echt het nivo en niet het id van autorisatienivos
|
||||
public $roleid;
|
||||
public $super; //TRUE or FALSE for user SUPERUSER
|
||||
public $writer; //TRUE or FALSE sets the write permission
|
||||
public $ontwikkel=TRUE;
|
||||
public $module;
|
||||
public $selectedschool;
|
||||
public $schooljaar;
|
||||
public $rootpath;
|
||||
public $dossierpath;
|
||||
public $pdfpath;
|
||||
public $beanstalkPipe;
|
||||
public $compactsoppath;
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
//$this->session->sess_destroy();
|
||||
$this->userid = $this->session->userdata('userid');
|
||||
$this->orgid = $this->session->userdata('orgid');
|
||||
$this->userrole = $this->session->userdata('role');
|
||||
$this->module = $this->session->userdata('module');
|
||||
$this->selectedschool = $this->session->userdata('selectedschool');
|
||||
$this->schooljaar = $this->session->userdata('schooljaar');
|
||||
$this->nologin = FALSE;
|
||||
$this->rootpath = str_replace('/public', '', $_SERVER['DOCUMENT_ROOT']);
|
||||
$this->setApplicationPaths();
|
||||
|
||||
$this->lang->load('partituur',$this->config->item('language'));
|
||||
$this->beanstalkPipe = 'monpas';
|
||||
|
||||
log_message('error', $this->userid ? $this->userid : 'GEEN USR BEKEND');
|
||||
if($this->userid){
|
||||
// if there is a user but no org or role user gets nologin_view
|
||||
if(!$this->orgid || !$this->userrole || $this->userrole==''){
|
||||
$this->session->sess_destroy();
|
||||
redirect(base_url().'index.php/toner');
|
||||
$this->nologin = TRUE;
|
||||
}else{
|
||||
$this->super = FALSE;
|
||||
if($this->Autorisaties_model->check_autorisatie($this->userrole, SUPERUSER)) $this->super=TRUE;
|
||||
if(!$this->session->userdata('globorgid')) $this->Session_model->set_globorgid($this->orgid);
|
||||
|
||||
$this->globorgid= $this->session->userdata('globorgid');
|
||||
$this->writer = $this->Autorisaties_model->check_write();
|
||||
$this->roleid = $this->Autorisatienivos_model->get_fieldvalue(array('nivo'=>$this->userrole), 'id');
|
||||
$this->userbg = $this->Organisaties_model->is_bg($this->orgid);
|
||||
$this->globisbg = $this->Organisaties_model->is_bg($this->globorgid);
|
||||
|
||||
$where = array('partituur_organisatie_id'=>$this->globorgid, 'partituur_actief'=>1);
|
||||
$this->load->model('ijkpartituur/Partituurs_model');
|
||||
$partituur = $this->Partituurs_model->get_single_details($where);
|
||||
if ($partituur) {$this->partituurid = $partituur->id; }
|
||||
else $this->partituurid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function clean_input($post){
|
||||
return str_replace('null', '', $this->db->escape_str($this->input->post($post), TRUE));
|
||||
}
|
||||
function check_online_status() {
|
||||
if ( ! $this->uri->segment( 2 ) || $this->uri->segment( 1 ) == 'login' ) return TRUE;
|
||||
if ( $this->uri->segment( 2 ) == 'reports' ) return TRUE;
|
||||
if ( $this->session->userdata( 'userid' ) ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
private function setApplicationPaths() {
|
||||
// $this->base_path = MYROOTPATH;
|
||||
// $this->dossierpath = $_ENV['DOSSIER']['DOSSIER_DOCUMENTS'];
|
||||
// $this->pdfpath = $_ENV['DOSSIER']['PDF_DOCUMENTS'];
|
||||
$this->dossierpath = '../dossier/';
|
||||
$this->pdfpath='../pdfdossier/';
|
||||
$this->partituurUpload='../tmp_uploads/';
|
||||
$this->partituurSchatkist='../schatkist/';
|
||||
$this->compactsoppath = MYROOTPATH.'documents/compactsops/';
|
||||
}
|
||||
|
||||
function json($wat){
|
||||
echo json_encode($wat);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of MY_Model
|
||||
* Algemene database functies
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date 12-07-2011
|
||||
*
|
||||
* my_model VHM versie 2.1
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class MY_Model extends CI_Model{
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function get_record_by_id($id, $fieldname=FALSE, $row=TRUE){
|
||||
$query = $this->db->get_where($this->tablename, array('id' => $id));
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}elseif($row){
|
||||
$row = $query->row();
|
||||
if($fieldname){
|
||||
return $row->$fieldname;
|
||||
}else{
|
||||
return $row;
|
||||
}
|
||||
}else{
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
function get_fieldvalue($where, $fieldname){
|
||||
$query = $this->db->get_where($this->tablename, $where);
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
$row = $query->row();
|
||||
return $row->$fieldname;
|
||||
}
|
||||
}
|
||||
|
||||
function get_records_where($where=FALSE, $row=FALSE, $order=FALSE, $sort='asc'){
|
||||
if($order) $this->db->order_by($order, $sort);
|
||||
if($where){
|
||||
$query = $this->db->get_where($this->tablename, $where);
|
||||
}else{
|
||||
$query = $this->db->get($this->tablename);
|
||||
}
|
||||
// echo $this->db->last_query();
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
if($row){
|
||||
return $query->row();
|
||||
}else{
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function check_for_record($where){
|
||||
$query = $this->db->get_where($this->tablename, $where);
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
function get_query_result(){
|
||||
$query = $this->db->query($this->sql);
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
function check_query_record(){
|
||||
$query = $this->db->query($this->sql);
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
function get_query_row($fieldname=FALSE){
|
||||
$query = $this->db->query($this->sql);
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
if($fieldname){
|
||||
$row = $query->row();
|
||||
return $row->$fieldname;
|
||||
}else{
|
||||
return $query->row();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_result_count($where){
|
||||
$this->db->where($where);
|
||||
$this->db->from($this->tablename);
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
function update_record($data, $id){
|
||||
$data['update_date']=date('Y-m-d G:i:s');
|
||||
$data['updated_by']=$this->Users_model->gID;
|
||||
$this->db->update($this->tablename, $data, 'id = '.$id);
|
||||
|
||||
}
|
||||
|
||||
function update_record_where($data, $where){
|
||||
$data['update_date']=date('Y-m-d G:i:s');
|
||||
$data['updated_by']=$this->Users_model->gID;
|
||||
$this->db->update($this->tablename, $data, $where);
|
||||
}
|
||||
|
||||
function insert_record($data){
|
||||
$data['creation_date']=date('Y-m-d G:i:s');
|
||||
$data['created_by']=$this->Users_model->gID;
|
||||
$data['update_date']=date('Y-m-d G:i:s');
|
||||
$data['updated_by']=$this->Users_model->gID;
|
||||
$this->db->insert($this->tablename, $data);
|
||||
return $this->db->insert_id();
|
||||
}
|
||||
|
||||
function delete_record($id){
|
||||
$this->db->delete($this->tablename, array('id'=>$id));
|
||||
}
|
||||
|
||||
function delete_record_where($where){
|
||||
$this->db->delete($this->tablename, $where);
|
||||
}
|
||||
|
||||
function sanitise_postinput($post, $notinclude){
|
||||
foreach($post as $key=>$value){
|
||||
if(!in_array($key, $notinclude))$data[] = array($key=>$value);
|
||||
}
|
||||
}
|
||||
|
||||
function save_record($data, $id){
|
||||
if(!$id){
|
||||
$id = $this->insert_record($data);
|
||||
}else{
|
||||
$this->update_record($data, $id);
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
function get_ar_query(){
|
||||
$query = $this->db->get();
|
||||
if($query->num_rows()==0){
|
||||
return FALSE;
|
||||
}else{
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
function get($where = FALSE, $fieldname = FALSE, $row = FALSE) {
|
||||
if( $fieldname ) $row = TRUE;
|
||||
|
||||
if ( ! is_array( $where ) && $where ) {
|
||||
$this->db->where( array('T1.id' => $where) );
|
||||
$row = TRUE;
|
||||
} elseif ( $where ) {
|
||||
$this->db->where( $where );
|
||||
}
|
||||
|
||||
if ( $fieldname ) $this->db->select( $fieldname );
|
||||
$query = $this->db->get( $this->tablename . ' AS T1' );
|
||||
if ( $query->num_rows() == 0 ) return FALSE;
|
||||
|
||||
if ( $row ){
|
||||
$row = $query->row();
|
||||
if ( $fieldname ) { return $row->$fieldname; }
|
||||
else { return $row; }
|
||||
}
|
||||
else { return $query->result(); }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user