mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
CI Init
This commit is contained in:
@@ -0,0 +1,248 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Examples extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->database();
|
||||
$this->load->helper('url');
|
||||
|
||||
$this->load->library('grocery_CRUD');
|
||||
}
|
||||
|
||||
public function _example_output($output = null)
|
||||
{
|
||||
$this->load->view('example.php',$output);
|
||||
}
|
||||
|
||||
public function offices()
|
||||
{
|
||||
$output = $this->grocery_crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
|
||||
}
|
||||
|
||||
public function offices_management()
|
||||
{
|
||||
try{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_theme('datatables');
|
||||
$crud->set_table('offices');
|
||||
$crud->set_subject('Office');
|
||||
$crud->required_fields('city');
|
||||
$crud->columns('city','country','phone','addressLine1','postalCode');
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
|
||||
}catch(Exception $e){
|
||||
show_error($e->getMessage().' --- '.$e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
public function employees_management()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_theme('datatables');
|
||||
$crud->set_table('employees');
|
||||
$crud->set_relation('officeCode','offices','city');
|
||||
$crud->display_as('officeCode','Office City');
|
||||
$crud->set_subject('Employee');
|
||||
|
||||
$crud->required_fields('lastName');
|
||||
|
||||
$crud->set_field_upload('file_url','assets/uploads/files');
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
public function customers_management()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_table('customers');
|
||||
$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
|
||||
$crud->display_as('salesRepEmployeeNumber','from Employeer')
|
||||
->display_as('customerName','Name')
|
||||
->display_as('contactLastName','Last Name');
|
||||
$crud->set_subject('Customer');
|
||||
$crud->set_relation('salesRepEmployeeNumber','employees','lastName');
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
public function orders_management()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_relation('customerNumber','customers','{contactLastName} {contactFirstName}');
|
||||
$crud->display_as('customerNumber','Customer');
|
||||
$crud->set_table('orders');
|
||||
$crud->set_subject('Order');
|
||||
$crud->unset_add();
|
||||
$crud->unset_delete();
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
public function products_management()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_table('products');
|
||||
$crud->set_subject('Product');
|
||||
$crud->unset_columns('productDescription');
|
||||
$crud->callback_column('buyPrice',array($this,'valueToEuro'));
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
public function valueToEuro($value, $row)
|
||||
{
|
||||
return $value.' €';
|
||||
}
|
||||
|
||||
public function film_management()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_table('film');
|
||||
$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority');
|
||||
$crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name');
|
||||
$crud->unset_columns('special_features','description','actors');
|
||||
|
||||
$crud->fields('title', 'description', 'actors' , 'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features');
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
public function film_management_twitter_bootstrap()
|
||||
{
|
||||
try{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_theme('twitter-bootstrap');
|
||||
$crud->set_table('film');
|
||||
$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority');
|
||||
$crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name');
|
||||
$crud->unset_columns('special_features','description','actors');
|
||||
|
||||
$crud->fields('title', 'description', 'actors' , 'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features');
|
||||
|
||||
$output = $crud->render();
|
||||
$this->_example_output($output);
|
||||
|
||||
}catch(Exception $e){
|
||||
show_error($e->getMessage().' --- '.$e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
function multigrids()
|
||||
{
|
||||
$this->config->load('grocery_crud');
|
||||
$this->config->set_item('grocery_crud_dialog_forms',true);
|
||||
$this->config->set_item('grocery_crud_default_per_page',10);
|
||||
|
||||
$output1 = $this->offices_management2();
|
||||
|
||||
$output2 = $this->employees_management2();
|
||||
|
||||
$output3 = $this->customers_management2();
|
||||
|
||||
$js_files = $output1->js_files + $output2->js_files + $output3->js_files;
|
||||
$css_files = $output1->css_files + $output2->css_files + $output3->css_files;
|
||||
$output = "<h1>List 1</h1>".$output1->output."<h1>List 2</h1>".$output2->output."<h1>List 3</h1>".$output3->output;
|
||||
|
||||
$this->_example_output((object)array(
|
||||
'js_files' => $js_files,
|
||||
'css_files' => $css_files,
|
||||
'output' => $output
|
||||
));
|
||||
}
|
||||
|
||||
public function offices_management2()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
$crud->set_table('offices');
|
||||
$crud->set_subject('Office');
|
||||
|
||||
$crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids")));
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
if($crud->getState() != 'list') {
|
||||
$this->_example_output($output);
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
public function employees_management2()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_theme('datatables');
|
||||
$crud->set_table('employees');
|
||||
$crud->set_relation('officeCode','offices','city');
|
||||
$crud->display_as('officeCode','Office City');
|
||||
$crud->set_subject('Employee');
|
||||
|
||||
$crud->required_fields('lastName');
|
||||
|
||||
$crud->set_field_upload('file_url','assets/uploads/files');
|
||||
|
||||
$crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids")));
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
if($crud->getState() != 'list') {
|
||||
$this->_example_output($output);
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
public function customers_management2()
|
||||
{
|
||||
$crud = new grocery_CRUD();
|
||||
|
||||
$crud->set_table('customers');
|
||||
$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
|
||||
$crud->display_as('salesRepEmployeeNumber','from Employeer')
|
||||
->display_as('customerName','Name')
|
||||
->display_as('contactLastName','Last Name');
|
||||
$crud->set_subject('Customer');
|
||||
$crud->set_relation('salesRepEmployeeNumber','employees','lastName');
|
||||
|
||||
$crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids")));
|
||||
|
||||
$output = $crud->render();
|
||||
|
||||
if($crud->getState() != 'list') {
|
||||
$this->_example_output($output);
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Main extends CI_Controller {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/* Standard Libraries of codeigniter are required */
|
||||
$this->load->database();
|
||||
$this->load->helper('url');
|
||||
/* ------------------ */
|
||||
|
||||
$this->load->library('grocery_CRUD');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
echo "<h1>Welcome to the world of Codeigniter</h1>";//Just an example to ensure that we get into the function
|
||||
die();
|
||||
}
|
||||
|
||||
public function prestudent()
|
||||
{
|
||||
$this->grocery_crud->set_table('tbl_prestudent');
|
||||
$output = $this->grocery_crud->render();
|
||||
|
||||
echo "<pre>";
|
||||
print_r($output);
|
||||
echo "</pre>";
|
||||
die();
|
||||
|
||||
$this->_example_output($output);
|
||||
}
|
||||
|
||||
function _example_output($output = null)
|
||||
|
||||
{
|
||||
$this->load->view('our_template.php',$output);
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file main.php */
|
||||
/* Location: ./application/controllers/main.php */
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Migrate extends CI_Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->library('migration');
|
||||
|
||||
if ($this->migration->current() === FALSE)
|
||||
{
|
||||
show_error($this->migration->error_string());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class Pages extends CI_Controller {
|
||||
|
||||
public function view($page = 'vilesci')
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
class Person extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('person_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['person'] = $this->person_model->get_personen();
|
||||
$data['title'] = 'Personen Archiv';
|
||||
|
||||
$this->load->view('templates/header', $data);
|
||||
$this->load->view('person/index', $data);
|
||||
$this->load->view('templates/footer');
|
||||
}
|
||||
|
||||
public function view($slug = NULL)
|
||||
{
|
||||
$data['person_item'] = $this->person_model->get_personen($slug);
|
||||
if (empty($data['person_item']))
|
||||
{
|
||||
show_404();
|
||||
}
|
||||
|
||||
$data['title'] = $data['person_item']->titelpre;
|
||||
|
||||
$this->load->view('templates/header', $data);
|
||||
$this->load->view('person/view', $data);
|
||||
$this->load->view('templates/footer');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*!
|
||||
* @brief This function sends compute requests to
|
||||
* ZipComp-Task and waits for response:
|
||||
* @image html ZipCmd_ZipComp_Communication.png
|
||||
*
|
||||
* <!-- Hide plantuml commands from Doxygen inside comment.
|
||||
* Note: Use of the Doxygen tag command to hide code in 1.7.3 will hide the Doxygen docs that follow.
|
||||
* Warning: Don't replaced plantuml commands '@' with '\' - it won't work.
|
||||
* @startuml ZipCmd_ZipComp_Communication.png
|
||||
*
|
||||
* ZipCmd -> ZipComp: First Compute Request
|
||||
* ZipCmd <-- ZipComp: First Compute Response
|
||||
*
|
||||
* ZipCmd -> ZipComp: Second Compute Request
|
||||
* ZipCmd <-- ZipComp: Second Compute Response
|
||||
*
|
||||
* @enduml
|
||||
* -->
|
||||
*
|
||||
* @return some value on success.
|
||||
*/
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* @class Rest_server
|
||||
* @brief Rest Server Controller
|
||||
*
|
||||
* A more detailed class description.
|
||||
*/
|
||||
class Rest_server extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->helper('url');
|
||||
|
||||
$this->load->view('rest_server');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Studiengang extends CI_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('studiengang_model');
|
||||
$this->load->library('form_validation');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$keyword = '';
|
||||
$this->load->library('pagination');
|
||||
|
||||
$config['base_url'] = base_url() . 'studiengang/index/';
|
||||
$config['total_rows'] = $this->studiengang_model->total_rows();
|
||||
$config['per_page'] = 10;
|
||||
$config['uri_segment'] = 3;
|
||||
$config['suffix'] = '.html';
|
||||
$config['first_url'] = base_url() . 'studiengang.html';
|
||||
$this->pagination->initialize($config);
|
||||
|
||||
$start = $this->uri->segment(3, 0);
|
||||
$studiengang = $this->studiengang_model->index_limit($config['per_page'], $start);
|
||||
|
||||
$data = array(
|
||||
'studiengang_data' => $studiengang,
|
||||
'keyword' => $keyword,
|
||||
'pagination' => $this->pagination->create_links(),
|
||||
'total_rows' => $config['total_rows'],
|
||||
'start' => $start,
|
||||
);
|
||||
|
||||
$this->load->view('tbl_studiengang_list', $data);
|
||||
}
|
||||
|
||||
public function search()
|
||||
{
|
||||
$keyword = $this->uri->segment(3, $this->input->post('keyword', TRUE));
|
||||
$this->load->library('pagination');
|
||||
|
||||
if ($this->uri->segment(2)=='search') {
|
||||
$config['base_url'] = base_url() . 'studiengang/search/' . $keyword;
|
||||
} else {
|
||||
$config['base_url'] = base_url() . 'studiengang/index/';
|
||||
}
|
||||
|
||||
$config['total_rows'] = $this->studiengang_model->search_total_rows($keyword);
|
||||
$config['per_page'] = 10;
|
||||
$config['uri_segment'] = 4;
|
||||
$config['suffix'] = '.html';
|
||||
$config['first_url'] = base_url() . 'studiengang/search/'.$keyword.'.html';
|
||||
$this->pagination->initialize($config);
|
||||
|
||||
$start = $this->uri->segment(4, 0);
|
||||
$studiengang = $this->studiengang_model->search_index_limit($config['per_page'], $start, $keyword);
|
||||
|
||||
$data = array(
|
||||
'studiengang_data' => $studiengang,
|
||||
'keyword' => $keyword,
|
||||
'pagination' => $this->pagination->create_links(),
|
||||
'total_rows' => $config['total_rows'],
|
||||
'start' => $start,
|
||||
);
|
||||
$this->load->view('tbl_studiengang_list', $data);
|
||||
}
|
||||
|
||||
public function read($id)
|
||||
{
|
||||
$row = $this->studiengang_model->get_by_id($id);
|
||||
if ($row) {
|
||||
$data = array(
|
||||
);
|
||||
$this->load->view('tbl_studiengang_read', $data);
|
||||
} else {
|
||||
$this->session->set_flashdata('message', 'Record Not Found');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = array(
|
||||
'button' => 'Create',
|
||||
'action' => site_url('studiengang/create_action'),
|
||||
);
|
||||
$this->load->view('tbl_studiengang_form', $data);
|
||||
}
|
||||
|
||||
public function create_action()
|
||||
{
|
||||
$this->_rules();
|
||||
|
||||
if ($this->form_validation->run() == FALSE) {
|
||||
$this->create();
|
||||
} else {
|
||||
$data = array(
|
||||
);
|
||||
|
||||
$this->studiengang_model->insert($data);
|
||||
$this->session->set_flashdata('message', 'Create Record Success');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$row = $this->studiengang_model->get_by_id($id);
|
||||
|
||||
if ($row) {
|
||||
$data = array(
|
||||
'button' => 'Update',
|
||||
'action' => site_url('studiengang/update_action'),
|
||||
);
|
||||
$this->load->view('tbl_studiengang_form', $data);
|
||||
} else {
|
||||
$this->session->set_flashdata('message', 'Record Not Found');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function update_action()
|
||||
{
|
||||
$this->_rules();
|
||||
|
||||
if ($this->form_validation->run() == FALSE) {
|
||||
$this->update($this->input->post('', TRUE));
|
||||
} else {
|
||||
$data = array(
|
||||
);
|
||||
|
||||
$this->studiengang_model->update($this->input->post('', TRUE), $data);
|
||||
$this->session->set_flashdata('message', 'Update Record Success');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$row = $this->studiengang_model->get_by_id($id);
|
||||
|
||||
if ($row) {
|
||||
$this->studiengang_model->delete($id);
|
||||
$this->session->set_flashdata('message', 'Delete Record Success');
|
||||
redirect(site_url('studiengang'));
|
||||
} else {
|
||||
$this->session->set_flashdata('message', 'Record Not Found');
|
||||
redirect(site_url('studiengang'));
|
||||
}
|
||||
}
|
||||
|
||||
public function _rules()
|
||||
{
|
||||
|
||||
$this->form_validation->set_rules('', '', 'trim');
|
||||
$this->form_validation->set_error_delimiters('<span class="text-danger">', '</span>');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/* End of file Studiengang.php */
|
||||
/* Location: ./application/controllers/Studiengang.php */
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Welcome extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see http://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('welcome_message');
|
||||
}
|
||||
}
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Basic extends CI_Controller {
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library(array('rdf'));
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->load->library('Rdf');
|
||||
|
||||
$d['title'] = '';
|
||||
|
||||
|
||||
$d['content']= $this->load->view('rdf/basic',$d,true);
|
||||
$this->load->view('home',$d);
|
||||
}
|
||||
public function sparql()
|
||||
{
|
||||
|
||||
$this->load->library('Rdf');
|
||||
|
||||
$d['title'] = '';
|
||||
|
||||
|
||||
$d['content']= $this->load->view('rdf/basic_sparql',$d,true);
|
||||
$this->load->view('home',$d);
|
||||
}
|
||||
public function foafinfo()
|
||||
{
|
||||
|
||||
$this->load->library('Rdf');
|
||||
|
||||
|
||||
|
||||
$d['title'] = '';
|
||||
|
||||
|
||||
$d['content']= $this->load->view('rdf/foafinfo',$d,true);
|
||||
$this->load->view('home',$d);
|
||||
}
|
||||
public function foafmaker()
|
||||
{
|
||||
|
||||
$d['title'] = '';
|
||||
|
||||
|
||||
$d['content']= $this->load->view('rdf/foafmaker',$d,true);
|
||||
$this->load->view('home',$d);
|
||||
}
|
||||
public function converter()
|
||||
{
|
||||
|
||||
$d['title'] = '';
|
||||
|
||||
$d['content']= $this->load->view('rdf/converter',$d,true);
|
||||
$this->load->view('home',$d);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user