registration gui

This commit is contained in:
Martin Müller 2014-04-02 20:37:38 +02:00
parent dc18f41c9c
commit 5bbd0872bb
8 changed files with 79 additions and 27 deletions

View File

@ -31,6 +31,10 @@
Router::connect('/agb', array('controller' => 'home', 'action' => 'agb')); Router::connect('/agb', array('controller' => 'home', 'action' => 'agb'));
Router::connect('/contact', array('controller' => 'home', 'action' => 'contact')); Router::connect('/contact', array('controller' => 'home', 'action' => 'contact'));
Router::connect('/registration', array('controller' => 'registration', 'action' => 'main'));
Router::connect('/registration/user', array('controller' => 'registration', 'action' => 'worker'));
Router::connect('/registration/company', array('controller' => 'registration', 'action' => 'company'));
Router::connect('/profil', array('controller' => 'user', 'action' => 'profil')); Router::connect('/profil', array('controller' => 'user', 'action' => 'profil'));
Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+")); Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+"));
Router::connect('/profil/edit', array('controller' => 'user', 'action' => 'profil_edit')); Router::connect('/profil/edit', array('controller' => 'user', 'action' => 'profil_edit'));

0
app/Controller/Component/empty Executable file → Normal file
View File

View File

@ -38,6 +38,19 @@ class DreamjobCompany extends AppModel {
public $displayField = 'djaccount_ptr_id'; public $displayField = 'djaccount_ptr_id';
public function registration($data){
$dataSource = $this->getDataSource();
$dataSource->begin();
if ($result) {
$dataSource->commit();
return true;
} else {
$dataSource->rollback();
}
return false;
}
public function saveSettings($data){ public function saveSettings($data){
$dataSource = $this->getDataSource(); $dataSource = $this->getDataSource();
$dataSource->begin(); $dataSource->begin();

View File

@ -38,7 +38,19 @@ class DreamjobWorker extends AppModel {
*/ */
public $displayField = 'djaccount_ptr_id'; public $displayField = 'djaccount_ptr_id';
public function registration($data){
$dataSource = $this->getDataSource();
$dataSource->begin();
if ($result) {
$dataSource->commit();
return true;
} else {
$dataSource->rollback();
}
return false;
}
public function saveSettings($data){ public function saveSettings($data){
$dataSource = $this->getDataSource(); $dataSource = $this->getDataSource();
$dataSource->begin(); $dataSource->begin();

View File

@ -19,7 +19,7 @@
echo $this->Form->end(); echo $this->Form->end();
echo "<br/>"; echo "<br/>";
if(!$isLoggedin){ if(!$isLoggedin){
echo $this->Html->link(__('dreamjob.registration.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); echo $this->Html->link(__('dreamjob.registration.to'),array('controller'=>'registration', 'action'=>'main'),array("class" => "btn btn-primary"));
echo "<br/>"; echo "<br/>";
echo "<br/>"; echo "<br/>";
} }

View File

@ -14,6 +14,20 @@
?> ?>
</head> </head>
<body> <body>
<div class="modal fade" id="popup" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title"></h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal"><?=__('dreamjob.close');?></button>
</div>
</div>
</div>
</div>
<div class="bg" id="logo_bar"> <div class="bg" id="logo_bar">
<div id="logo"> <div id="logo">
<?=$this->Html->image('logo.png',array('url'=>array('controller'=>'home','action'=>'home'))); ?> <?=$this->Html->image('logo.png',array('url'=>array('controller'=>'home','action'=>'home'))); ?>
@ -111,9 +125,8 @@
</div> </div>
<!-- java script --> <!-- java script -->
<?php <?php
echo $this->Html->script(array('jquery.min','bootstrap.min','dreamjob')); echo $this->Html->script(array('jquery.min', 'bootstrap.min', 'jquery-ui', 'dreamjob'));
?> ?>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- extraScript --> <!-- extraScript -->
<?php <?php
$this->startIfEmpty('scriptEnd'); $this->startIfEmpty('scriptEnd');

View File

@ -406,7 +406,9 @@ body.loading #container{
color:black; color:black;
box-shadow:none; box-shadow:none;
} }
.modal-body,.modal-title{
color:black;
}
.infofield{ .infofield{
color:black; color:black;
} }

View File

@ -4,26 +4,33 @@
*/ */
var global_load = null; var global_load = null;
!function($) { !function($) {
$(function() { $(function() {
$body = $("body"); $body = $("body");
$(document).on({ $(document).on({
ajaxStart: function() { $body.addClass("loading"); }, ajaxStart: function() { $body.addClass("loading"); },
ajaxStop: function() { $body.removeClass("loading"); } ajaxStop: function() { $body.removeClass("loading"); }
}); });
function event(where){ function event(where){
$("#alert .alert").alert(); $("#alert .alert").alert();
$(where+'.dropdown-toggle').dropdown(); $("#popup").modal({'remote':false,'show':false});
$("#popup").on('show.bs.modal',function(e){
$(where+" a").each(function(that){ $.ajax({url:$(e.relatedTarget).attr("href"),success:function(data){
if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff") $("#popup .modal-title").html($(e.relatedTarget).attr("title"));
$(this).click(function(e){ $("#popup .modal-body").html($("#container div.box",data).html());
load($(this).attr('href'),{},($(this).attr('rel')=="tab")); } ,error:function(data){}});
return false; });
});
}); $(where+'.dropdown-toggle').dropdown();
$(where+" a").each(function(that){
$(where+" form").submit(function(e){ if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff")
$(this).click(function(e){
load($(this).attr('href'),{},($(this).attr('rel')=="tab"));
return false;
});
});
$(where+" form").submit(function(e){
if(!$(this).hasClass("hide-form") && $(this).attr('enctype')!='multipart/form-data' ){ if(!$(this).hasClass("hide-form") && $(this).attr('enctype')!='multipart/form-data' ){
e.stopPropagation(); e.stopPropagation();
//e.preventDefault(); //e.preventDefault();
@ -35,8 +42,8 @@
return false; return false;
} }
}); });
$("form[ enctype *= 'multipart/form-data' ]").each(function(evt){ $(where+" form[ enctype *= 'multipart/form-data' ]").each(function(evt){
if (!$('#fileUpload').length) if (!$('#fileUpload').length)
$('body').append('<iframe id="fileUpload" name="fileUpload" style="display:none" />'); $('body').append('<iframe id="fileUpload" name="fileUpload" style="display:none" />');
$(this).attr('target','fileUpload'); $(this).attr('target','fileUpload');
@ -48,6 +55,7 @@
}); });
}); });
}); });
$(where+" form.tableForm tbody").each(function(evt){ $(where+" form.tableForm tbody").each(function(evt){
var that = this; var that = this;
newRow = $(".new").html(); newRow = $(".new").html();