This commit is contained in:
Manish Verma
2017-04-30 17:25:08 +05:30
parent cd43537fd7
commit b2800d7a3f
4 changed files with 142 additions and 16 deletions

View File

@@ -44,7 +44,7 @@ active
</div>
@endif
{!! Form::open(['url'=> '/step4post']) !!}
{!! Form::open(['url'=> '/step4post', 'id' => 'databaseform']) !!}
<table ng-controller="MainController">
<tr>
<td>
@@ -69,7 +69,7 @@ active
<label for="box1">Host<span style="color: red;font-size:12px;">*</span></label>
</td>
<td>
<input type="text" name="host">
{!! Form::text('host', null, ['required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Hosttitle}}" data-content="@{{Hostcontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -81,7 +81,7 @@ active
<label for="box2">Port</label>
</td>
<td>
<input type="number" name="port">
{!! Form::text('port', null, ['onkeydown' => 'return CheckPortForInput(event)']) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Porttitle}}" data-content="@{{Portcontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -93,7 +93,7 @@ active
<label for="box3">Database Name<span style="color: red;font-size:12px;">*</span></label>
</td>
<td>
<input type="text" name="databasename">
{!! Form::text('databasename', null, ['required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Databasenametitle}}" data-content="@{{Databasenamecontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -105,7 +105,7 @@ active
<label for="box4">User Name<span style="color: red; font-size: 12px;">*</span></label>
</td>
<td>
<input type="text" name="username">
{!! Form::text('username', null, ['required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Usertitle}}" data-content="@{{Usercontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -130,10 +130,75 @@ active
<input type="submit" id="submitme" class="button-primary button button-large button-next" value="Continue">
<a href="{!! route('prerequisites') !!}" class="button button-large button-next" style="float: left">Previous</a>
</p>
<br>
</form>
</div>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js"></script>
<script src="{{asset("lb-faveo/js/angular2.js")}}" type="text/javascript"></script>
<script type="text/javascript">
function CheckPortForInput(e) {
var code = e.which || e.keyCode;
if (e.ctrlKey != true){
if((code >=48 && code<= 57) || code == 8 || code == 46 || e.keyCode == 9 || e.keyCode == 13) {
return true;
}
} else {
if((code == 65 || code == 97) || (code == 88 || code == 120) || (code == 86 || code == 118)) {
return true;
}
}
return false;
}
</script>
<script type="text/javascript">
@if($errors->has('host'))
addErrorClass('host');
@endif
@if($errors->has('host'))
addErrorClass('host');
@endif
@if($errors->has('databasename'))
addErrorClass('databasename');
@endif
@if($errors->has('username'))
addErrorClass('username');
@endif
@if($errors->has('password'))
addErrorClass('password');
@endif
$('#databaseform').on('submit', function(e){
$("#databaseform input[type=text]").each(function(){
if($(this).attr('name') == 'host' || $(this).attr('name') == 'databasename' || $(this).attr('name') == 'username'){
if ($(this).val() == '') {
$(this).css('border-color','red')
$(this).css('border-width','1px');
e.preventDefault();
alert('Please fill all required values.');
}
}
});
});
$('input[type=text]').on('blur', function(){
if($(this).attr('name') == 'host' || $(this).attr('name') == 'databasename' || $(this).attr('name') == 'username'){
if ($(this).val() == '') {
addErrorClass($(this).attr('name'));
}
}
})
function addErrorClass(name){
var target = document.getElementsByName(name);
$(target[0]).css('border-color','red');
$(target[0]).css('border-width','1px');
}
$('input').on('focus', function(){
$(this).css('border-color','#A9A9A9')
$(this).css('border-width','1px');
})
</script>
</div>
@stop

View File

@@ -20,8 +20,8 @@ active
<div id="form-content">
<div ng-app="myApp">
<h1 style="text-align: center;">Locale Information</h1>
{!! Form::open(['url'=>route('postaccount')]) !!}
<input type="hidden" name="_token" value="{{ csrf_token() }}">
{!! Form::open(['url'=>route('postaccount'), 'id' => 'postaccount']) !!}
<!-- checking if the form submit fails -->
@if($errors->first('firstname')||$errors->first('Lastname')||$errors->first('email')||$errors->first('username')||$errors->first('password')||$errors->first('confirmpassword'))
@@ -70,7 +70,7 @@ active
: red;font-size:12px;">*</span></label>
</td>
<td>
{!! Form::text('firstname',null,['style' =>'margin-left:250px']) !!}
{!! Form::text('firstname',null,['style' =>'margin-left:250px', 'required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Nametitle}}" data-content="@{{Namecontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -83,7 +83,7 @@ active
: red;font-size:12px;">*</span></label>
</td>
<td>
{!! Form::text('Lastname',null,['style' =>'margin-left:250px']) !!}
{!! Form::text('Lastname',null,['style' =>'margin-left:250px', 'required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Lasttitle}}" data-content="@{{Lastcontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -96,7 +96,7 @@ active
: red;font-size:12px;">*</span></label>
</td>
<td>
{!! Form::text('email',null,['style' =>'margin-left:250px']) !!}
{!! Form::email('email',null,['style' =>'margin-left:250px', 'required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Emailtitle}}" data-content="@{{Emailcontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -117,7 +117,7 @@ active
</label>
</td>
<td>
{!! Form::text('username',null,['style' =>'margin-left:195px']) !!}
{!! Form::text('username',null,['style' =>'margin-left:195px', 'required' => true]) !!}
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{UserNametitle}}" data-content="@{{UserNamecontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -131,7 +131,7 @@ active
</label>
</td>
<td>
<input type="password" name="password" style="margin-left: 195px" >
<input type="password" name="password" style="margin-left: 195px" required="true">
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Passtitle}}" data-content="@{{Passcontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -145,7 +145,7 @@ active
</label>
</td>
<td>
<input type="password" name="confirmpassword" style="margin-left: 195px" >
<input type="password" name="confirmpassword" style="margin-left: 195px" required="true">
</td>
<td>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{Confirmtitle}}" data-content="@{{Confirmcontent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
@@ -333,9 +333,11 @@ active
</table>
<input id="dummy-data" class="input-checkbox" type="checkbox" name="dummy-data">
<label for="dummy-data" style="color:#3AA7D9">Install dummy data</label>
<button type="button" data-toggle="popover" data-placement="right" data-arrowcolor="#eeeeee" data-bordercolor="#bbbbbb" data-title-backcolor="#cccccc" data-title-bordercolor="#bbbbbb" data-title-textcolor="#444444" data-content-backcolor="#eeeeee" data-content-textcolor="#888888" title="@{{DummyDataTitle}}" data-content="@{{DummyDataContent}}" style="padding: 0px;border: 0px; border-radius: 5px;"><i class="fa fa-question-circle" style="padding: 0px;"></i>
</button>
<br><br>
<p class="setup-actions step">
<input type="submit" id="submitme" class="button-primary button button-large button-next" value="Install" onclick="this.disabled=true;this.value='Installing, please wait...';this.form.submit();">
<input type="submit" id="submitme" class="button-primary button button-large button-next" value="Install">
<a href="{{url('step4')}}" class="button button-large button-next" style="float: left">Previous</a>
</p>
</form>
@@ -346,5 +348,61 @@ active
<script src="{{asset("lb-faveo/js/angular2.js")}}" type="text/javascript"></script>
</div>
</div>
<script type="text/javascript">
@if($errors->has('firstname'))
addErrorClass('firstname');
@endif
@if($errors->has('Lastname'))
addErrorClass('Lastname');
@endif
@if($errors->has('email'))
addErrorClass('email');
@endif
@if($errors->has('username'))
addErrorClass('username');
@endif
@if($errors->has('password'))
addErrorClass('password');
@endif
@if($errors->has('confirmpassword'))
addErrorClass('confirmpassword');
@endif
$('#postaccount').on('submit', function(e) {
$("#postaccount input").each(function(){
if($(this).attr('name') == 'firstname' ||
$(this).attr('name') == 'Lastname' ||
$(this).attr('name') == 'email' ||
$(this).attr('name') == 'username' ||
$(this).attr('name') == 'password' ||
$(this).attr('name') == 'confirmpassword'){
if ($(this).val() == '') {
$(this).css('border-color','red')
$(this).css('border-width','1px');
e.preventDefault();
}
} else {
$('#submitme').attr('disabled', true);
$('#submitme').val('Installing, please wait...');
}
});
});
$('input').on('focus', function(){
$(this).css('border-color','#A9A9A9')
$(this).css('border-width','1px');
})
$('input').on('blur', function(){
if($(this).val() == ''){
addErrorClass($(this).attr('name'));
}
});
function addErrorClass(name){
var target = document.getElementsByName(name);
$(target[0]).css('border-color','red');
$(target[0]).css('border-width','1px');
}
</script>
@stop