mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Removed Legacy Scripts
This commit is contained in:
@@ -1,246 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Main extends CI_Controller
|
||||
{
|
||||
/**
|
||||
* Load Database und the url-helper
|
||||
**/
|
||||
private function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// Standard Libraries of codeigniter are required
|
||||
$this->load->database();
|
||||
$this->load->helper('url');
|
||||
// Test the grocery CRUD
|
||||
$this->load->library('grocery_CRUD');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Welcome Page by default
|
||||
* @return void
|
||||
**/
|
||||
public function index()
|
||||
{
|
||||
echo "<h1>Welcome to the world of Codeigniter</h1>";
|
||||
//Just an example to ensure that we get into the function die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test grocery CRUD for tbl_person
|
||||
* @return void
|
||||
**/
|
||||
public function person()
|
||||
{
|
||||
$this->grocery_crud->set_table('tbl_pperson');
|
||||
$output = $this->grocery_crud->render();
|
||||
|
||||
echo "<pre>";
|
||||
print_r($output);
|
||||
echo "</pre>";
|
||||
//die();
|
||||
|
||||
$this->__exampleOutput($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* example Output
|
||||
* @param string $output The HTML-Output from grocery.
|
||||
* @return void
|
||||
**/
|
||||
private function __exampleOutput($output = null)
|
||||
{
|
||||
$this->load->view('our_template.php', $output);
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class ModelTest extends FHC_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
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//$this->session->uid='admin'; // Should normaly be set through auth
|
||||
$this->load->model('person/Person_model');
|
||||
$res = $this->Person_model->getPerson(null, 'asdf\' OR person_id=1; SELECT 1; --');
|
||||
var_dump($res->result_object());
|
||||
|
||||
$this->load->model('crm/Prestudent_model');
|
||||
$id=null;
|
||||
|
||||
// Insert PreStudent
|
||||
$data = array
|
||||
(
|
||||
'aufmerksamdurch_kurzbz' => 'k.A.',
|
||||
'person_id' => 1,
|
||||
'studiengang_kz' => 0
|
||||
);
|
||||
$res = $this->Prestudent_model->insert($data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
$id=$res->retval;
|
||||
|
||||
// Update PreStudent
|
||||
$data = array
|
||||
(
|
||||
'zgvort' => 'Wien',
|
||||
'zgvdatum' => '2012-12-12',
|
||||
'facheinschlberuf' => true
|
||||
);
|
||||
$res = $this->Prestudent_model->update($id, $data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
$id=$res->retval;
|
||||
|
||||
// Replace PreStudent
|
||||
/*$data = array
|
||||
(
|
||||
'prestudent_id' => $id,
|
||||
'zgvmaort' => 'Linz',
|
||||
'zgvmadatum' => '2011-11-11',
|
||||
'facheinschlberuf' => false
|
||||
);
|
||||
$res = $this->Prestudent_model->replace($data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval;
|
||||
else
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval;*/
|
||||
|
||||
// Load PreStudent
|
||||
$res = $this->Prestudent_model->load($id);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
var_dump($res->retval);
|
||||
|
||||
// Insert PreStudentStatus
|
||||
$this->load->model('crm/Prestudentstatus_model');
|
||||
$data = array
|
||||
(
|
||||
'prestudent_id' => $id,
|
||||
'status_kurzbz' => 'Interessent',
|
||||
'studiensemester_kurzbz' => 'WS2001',
|
||||
'ausbildungssemester' => 1
|
||||
);
|
||||
$res = $this->Prestudentstatus_model->insert($data);
|
||||
var_dump($res->retval);
|
||||
|
||||
// Load PreStudentStatus
|
||||
$res = $this->Prestudentstatus_model->load($data);
|
||||
var_dump($res->retval->result_object());
|
||||
$res = $this->Prestudentstatus_model->load(array($id,'Interessent', 'WS2001', 1));
|
||||
var_dump($res->retval->result_object());
|
||||
|
||||
// Update PreStudentStatus
|
||||
$res = $this->Prestudentstatus_model->update($data, array
|
||||
(
|
||||
'prestudent_id' => $id,
|
||||
'status_kurzbz' => 'Bewerber',
|
||||
'studiensemester_kurzbz' => 'WS2011',
|
||||
'ausbildungssemester' => 2
|
||||
));
|
||||
var_dump($res->retval);
|
||||
$res = $this->Prestudentstatus_model->update(array($id,'Bewerber', 'WS2011', 2), $data );
|
||||
var_dump($res->retval);
|
||||
|
||||
// Delete PreStudentStatus
|
||||
$res = $this->Prestudentstatus_model->delete($data);
|
||||
var_dump($res->retval);
|
||||
|
||||
// Delete PreStudent
|
||||
$res = $this->Prestudent_model->delete($id);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
var_dump($res->retval);
|
||||
|
||||
$this->load->model('organisation/Organisationseinheit_model');
|
||||
// Insert OE
|
||||
$data = array
|
||||
(
|
||||
'oe_kurzbz' => 'testoe',
|
||||
'bezeichnung' => 'testoe',
|
||||
'organisationseinheittyp_kurzbz' => 'Institut',
|
||||
'standort_id' => null
|
||||
);
|
||||
$res = $this->Organisationseinheit_model->insert($data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
$id = $data['oe_kurzbz'];
|
||||
var_dump($res);
|
||||
|
||||
// Update OE
|
||||
$data = array
|
||||
(
|
||||
'freigabegrenze' => 1234.56,
|
||||
'kurzzeichen' => 'TestOE',
|
||||
'lehre' => false
|
||||
);
|
||||
$res = $this->Organisationseinheit_model->update($id, $data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
$id=$res->retval;
|
||||
|
||||
// Delete Organisationseinheit
|
||||
$res = $this->Organisationseinheit_model->delete($id);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
var_dump($res->retval);
|
||||
|
||||
$this->load->model('system/Sprache_model');
|
||||
// Insert Sprache
|
||||
$data = array
|
||||
(
|
||||
'sprache' => 'test',
|
||||
'bezeichnung' => "{'testsprache'}",
|
||||
'locale' => 'te_TE',
|
||||
'content' => false
|
||||
);
|
||||
$res = $this->Sprache_model->insert($data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
$id = $data['sprache'];
|
||||
var_dump($res);
|
||||
|
||||
// Update Sprache
|
||||
$data = array
|
||||
(
|
||||
'index' => 4,
|
||||
'bezeichnung' => "{'TestSprache', 'TestLanguage', 'TestSpanisch'}",
|
||||
'content' => true
|
||||
);
|
||||
$res = $this->Sprache_model->update($id, $data);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
$id=$res->retval; //echo $id;
|
||||
|
||||
// Load Sprache
|
||||
$res = $this->Sprache_model->load($id);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
{
|
||||
$result = $res->retval->result_object();
|
||||
var_dump($result);
|
||||
var_dump($this->Sprache_model->pgArrayPhp($result[0]->bezeichnung));
|
||||
var_dump($this->Sprache_model->pgBoolPhp($result[0]->content));
|
||||
}
|
||||
|
||||
// Load All Sprache
|
||||
$res = $this->Sprache_model->loadWhere();
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
{
|
||||
var_dump($res->retval);
|
||||
$result = $res->retval->result_object();
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
// Delete Sprache
|
||||
$res = $this->Sprache_model->delete($id);
|
||||
if ($res->error)
|
||||
echo 'Error: ',$res->error, ', Code: ',$res->fhcCode,' -> ',$res->msg,': ',$res->retval,'<br/>';
|
||||
else
|
||||
var_dump($res->retval);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Pages extends CI_Controller {
|
||||
|
||||
public function view($page = 'vilesci')
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -22,15 +22,13 @@ class Redirect extends FHC_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
||||
// Loads config file fhcomplete
|
||||
$this->config->load('fhcomplete');
|
||||
}
|
||||
|
||||
|
||||
public function redirectByToken($token)
|
||||
{
|
||||
var_dump($token);
|
||||
|
||||
if (isset($token))
|
||||
{
|
||||
redirect($this->config->item('addons_aufnahme_url') . '?token=' . $token);
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* @class Rest_server
|
||||
* @brief Rest Server Controller
|
||||
*
|
||||
* A more detailed class description.
|
||||
*/
|
||||
class Rest_server extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Index Method for default function.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->helper('url');
|
||||
$this->load->view('rest_server');
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user