diversen
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* Customer: Theo Weijmer
|
||||
@@ -12,7 +13,7 @@ class customersController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE )
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* External: Theo Weijmer
|
||||
@@ -12,6 +13,8 @@ class externalsController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
@@ -12,6 +13,8 @@ class RolesController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
@@ -12,6 +13,8 @@ class usersController extends MY_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 05/01/2018
|
||||
* Time: 15:03
|
||||
*/
|
||||
class OffersController extends MY_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
$this->load->model( $models );
|
||||
$this->load->library( $libraries );
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getAllOffers( $archive = 'F' )
|
||||
{
|
||||
$users = Offer::getAllOffers( $archive );
|
||||
|
||||
$this->json( $users );
|
||||
}
|
||||
|
||||
public function saveOffer()
|
||||
{
|
||||
$userValidation = new OfferValidation();
|
||||
|
||||
if ( ! $userValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $userValidation->getErrorMessages()] );
|
||||
|
||||
$user = $this->input->post();
|
||||
|
||||
$userID = $user['id'];
|
||||
unset( $user['id'] );
|
||||
|
||||
$userID = Offer::saveOffer( $userID, $user );
|
||||
|
||||
$this->json( ['success' => TRUE, 'userID' => $userID] );
|
||||
}
|
||||
|
||||
public function archiveOffer( $userID, $status )
|
||||
{
|
||||
Offer::whereId( $userID )->update( ['archive' => $status] );
|
||||
}
|
||||
|
||||
public function removeOffer( $userID )
|
||||
{
|
||||
$removeOffer = new RemoveOffer( $userID );
|
||||
|
||||
if ( $removeOffer->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Offer::removeOffer( $userID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 21/12/2017
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Page extends Eloquent {
|
||||
|
||||
protected $table = "offers";
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo( 'Project' );
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,10 @@ class Page extends Eloquent {
|
||||
->with( [
|
||||
'subpages' => function ( $q ) use ( $user ) {
|
||||
$q->whereRaw(
|
||||
"id != page_id AND ((SELECT {$user->role} & pagelevel) != 0 OR pagelevel = 0)" );
|
||||
"id != page_id AND ((SELECT {$user->role} & pagelevel) != 0 OR pagelevel = 0)" )
|
||||
->orderBy( 'pageorder' );
|
||||
}] )
|
||||
->orderBy( 'pageorder' )
|
||||
->get();
|
||||
|
||||
return $pages;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 21/12/2017
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Project extends Eloquent {
|
||||
|
||||
protected $table = "projects";
|
||||
|
||||
public function offers()
|
||||
{
|
||||
return $this->hasMany( 'Offer' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 15/12/2017
|
||||
* Time: 19:37
|
||||
*/
|
||||
|
||||
class Offer_model extends MY_Model {
|
||||
|
||||
protected $tablename = "offers";
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<div class="modal modal-fade-in-scale-up modal-primary" tabindex="-1" id="offer-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">toevoegen / wijzigen offerte</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div role="form" class="form-horizontal">
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
klant
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<select class="form-control"
|
||||
data-bind="options:customers
|
||||
optionsValue:id,
|
||||
optionsText:name,
|
||||
value:selectedCustomerID,
|
||||
optionsCaption:selecteer klant"></select>
|
||||
</div>
|
||||
<small class="invalid-feedback"
|
||||
data-bind="style:{display: ! selectedCustomer() ? 'block' : 'none'}">
|
||||
selecteer een klant
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
project
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<select class="form-control"
|
||||
data-bind="options:projects,
|
||||
optionsValue: id,
|
||||
optionsText:projectnumber,
|
||||
value:selectedProjectID"
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
datum offerte
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-calendar"></i>
|
||||
</span>
|
||||
<input type="text"
|
||||
placeholder="datum offerte"
|
||||
class="form-control"
|
||||
data-bind="datepicker:{}, value:startdate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
kans
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-question"></i>
|
||||
</span>
|
||||
<input type="text"
|
||||
placeholder="kans"
|
||||
class="form-control"
|
||||
data-bind="textInput:acceptance_chance">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
acceptatie datum
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-calendar"></i>
|
||||
</span>
|
||||
<input type="text"
|
||||
placeholder="acceptatie datum"
|
||||
class="form-control"
|
||||
data-bind="datepicker:{}, value:accepteddate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-xl-3 form-control-label">
|
||||
afwijsdatum
|
||||
</label>
|
||||
<div class="col-xl-9">
|
||||
<div class="input-group input-group-icon">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon fa-calendar"></i>
|
||||
</span>
|
||||
<input type="email"
|
||||
placeholder="afwijsdatum"
|
||||
class="form-control"
|
||||
data-bind="datepicker:{}, value:rejectdate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-success"
|
||||
data-bind="visible:formValid(), click:saveOffer">opslaan
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning" data-dismiss="modal">annuleren</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@
|
||||
</thead>
|
||||
<tbody data-bind="foreach:externals">
|
||||
<tr>
|
||||
<td><span data-bind="text:contactperson"</td>
|
||||
<td><span data-bind="text:contactperson"></span></td>
|
||||
<td><span data-bind="text:name"></span></td>
|
||||
<td><span data-bind="text:address"></span></td>
|
||||
<td><span data-bind="text:postcode + ' ' + place"></span></td>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xl-8">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="table-tealish-header">klant</th>
|
||||
<th class="table-tealish-header">project</th>
|
||||
<th class="table-tealish-header">datum</th>
|
||||
<th class="table-tealish-header">kans</th>
|
||||
<th class="table-tealish-header">geaccepteerd</th>
|
||||
<th class="table-tealish-header">afgewezen</th>
|
||||
<th class="table-tealish-header"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-bind="foreach:externals">
|
||||
<tr>
|
||||
<td><span data-bind="text:customerName"></span></td>
|
||||
<td><span data-bind="text:pojectNumber"></span></td>
|
||||
<td><span data-bind="text:startdate"></span></td>
|
||||
<td><span data-bind="text:acceptance_chance"></span></td>
|
||||
<td><span data-bind="text:accepted"></span></td>
|
||||
<td><span data-bind="text:rejected"></span></td>
|
||||
<td>
|
||||
<i class="icon fa-edit pointer" title="wijzig" data-bind="click:$root.editExternal"></i>
|
||||
<!-- ko if:archive == 'F' -->
|
||||
<i class="icon fa-archive pointer" title="archiveer"
|
||||
data-bind="click:$root.archiveOffer"></i>
|
||||
<!-- /ko -->
|
||||
<!-- ko if:archive != 'F' -->
|
||||
<i class="icon fa-minus-circle redish pointer" title="archiveer"
|
||||
data-bind="click:$root.archiveOffer"></i>
|
||||
<!-- /ko -->
|
||||
<i class="icon fa-trash redish pointer" title="verwijder"
|
||||
data-bind="click:$root.removeOffer"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4" class="">
|
||||
<button class="btn btn-primary btn-round btn-sm" data-bind="click:newOffer">
|
||||
nieuwe offerte
|
||||
</button>
|
||||
</td>
|
||||
<td colspan="2" class="">
|
||||
<div class="row form-horizontal">
|
||||
<label class="col-md-4 form-control-label">archief</label>
|
||||
<div class="col-md-8">
|
||||
<div class="onoffswitch" data-bind="click:toggleArchive">
|
||||
<input type="checkbox"
|
||||
name="onoffswitch"
|
||||
class="onoffswitch-checkbox"
|
||||
data-bind="checked:archive"
|
||||
id="myonoffswitch">
|
||||
<label class="onoffswitch-label" for="myonoffswitch">
|
||||
<span class="onoffswitch-inner"></span>
|
||||
<span class="onoffswitch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,6 +4,7 @@
|
||||
<!-- Stylesheets VENDOR -->
|
||||
<link rel="stylesheet" href="css/vendor/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/vendor/bootstrap-extend.css">
|
||||
<link rel="stylesheet" href="js/vendor/jquery-ui/jquery-ui.css">
|
||||
<link rel="stylesheet" href="fonts/font-awesome/font-awesome.min.css">
|
||||
|
||||
<link rel="stylesheet" href="css/vendor/site.min.css">
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<!-- Core -->
|
||||
<!--<script src="js/vendor/babel-external-helpers/babel-external-helpers.js"></script>-->
|
||||
<script src="js/vendor/jquery/jquery.js"></script>
|
||||
<script src="js/vendor/Knockout.min.js"></script>
|
||||
<script src="js/vendor/jquery-ui/jquery-ui.js"></script>
|
||||
<script src="js/vendor/jquery-ui/knockout-jqueryui.min.js"></script>
|
||||
<script src="js/vendor/popper-js/umd/popper.min.js"></script>
|
||||
<script src="js/vendor/bootstrap/bootstrap.js"></script>
|
||||
<script src="js/vendor/animsition/animsition.js"></script>
|
||||
@@ -47,7 +50,6 @@
|
||||
|
||||
<!-- DBOIS -->
|
||||
|
||||
<script src="js/vendor/Knockout.min.js"></script>
|
||||
|
||||
<script src="js/lib/main.js"></script>
|
||||
<script src="js/lib/modules/specials/tellmeModule.js"></script>
|
||||
@@ -58,11 +60,13 @@
|
||||
<script src="js/lib/modules/modals/userModal.js"></script>
|
||||
<script src="js/lib/modules/modals/customerModal.js"></script>
|
||||
<script src="js/lib/modules/modals/externalModal.js"></script>
|
||||
<script src="js/lib/modules/modals/offerModal.js"></script>
|
||||
|
||||
|
||||
<!---->
|
||||
<script src="js/lib/dataservices/pageDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/userDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/customerDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/externalDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/rolesDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/offerDataservice.js"></script>
|
||||
<script src="js/lib/helpers.js"></script>
|
||||
@@ -3,9 +3,9 @@
|
||||
$this->load->view('modals/user_modal');
|
||||
$this->load->view('modals/customer_modal');
|
||||
$this->load->view('modals/external_modal');
|
||||
$this->load->view('modals/offer_modal');
|
||||
|
||||
$this->load->view('specials/tellme_modal');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user