chore: remove APAW from tracking; gitignore agent-generated files

This commit is contained in:
Deploy Bot
2026-06-20 01:32:54 +01:00
parent d6dedfb513
commit 6aa41381ac
362 changed files with 48506 additions and 13261 deletions

85
resources/js/app.js vendored Normal file
View File

@@ -0,0 +1,85 @@
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
require('admin-lte/dist/js/adminlte.js');
window.Vue = require('vue');
//to use lodash in templates
Vue.prototype._ = _;
// ladda.js
import * as Ladda from 'ladda';
//easy qr code.js
import * as qrcode from 'easyqrcodejs'
window.QRCode = qrcode;
//accounting.js for currency formatting
import accounting from 'accounting-js';
window.__formatCurrency = function(money){
var currency_symbol = APP.CURRENCY_SYMBOL+' ';
var formatted_currency = accounting.formatMoney(money, { symbol: currency_symbol});
return formatted_currency;
}
window.__convert_currency_in_datatable = function (elements) {
elements.find('.currency').each(function(){
var money = $(this).text();
var formatted_currency = __formatCurrency(money);
$(this).text(formatted_currency);
});
}
/**
* global event bus for communication between
* two different component
*/
Vue.prototype.$eventBus = new Vue();
/**
* The following block of code may be used to automatically register your
* Vue components. It will recursively scan this directory for the Vue
* components and automatically register them with their "basename".
*
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
*/
window.validationRules = [
{'rule' : 'email', 'display': 'Email', 'applies_to':['text']},
{'rule' : 'url', 'display': 'URL', 'applies_to':['text']},
{'rule' : 'minlength', 'display': 'Minlength', 'applies_to':['text', 'dropdown', 'checkbox', 'textarea']},
{'rule' : 'maxlength', 'display': 'Maxlength', 'applies_to':['text', 'dropdown', 'checkbox', 'textarea']},
{'rule' : 'digits', 'display': 'Digits', 'applies_to':['text']},
{'rule' : 'number', 'display': 'Number', 'applies_to':['text']},
{'rule' : 'alphanumeric', 'display': 'Alphanumeric', 'applies_to':['text']},
{'rule' : 'lettersonly', 'display': 'Letters Only', 'applies_to':['text']},
{'rule' : 'phone', 'display': 'Phone', 'applies_to':['text']},
{'rule' : 'phoneus', 'display': 'Phone US', 'applies_to':['text']},
{'rule' : 'creditcard', 'display': 'Credit Card', 'applies_to':['text']},
];
// const files = require.context('./', true, /\.vue$/i);
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
Vue.component('create-form', require('./components/CreateForm.vue').default);
Vue.component('show-form', require('./components/ShowForm.vue').default);
Vue.component('tool-tip', require('./components/TooltipComponent.vue').default);
//common function
import functions from './functions';
Vue.mixin(functions);
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
$('body').tooltip({
selector: '[data-toggle="tooltip"]'
});
const app = new Vue({
el: '#app',
});

61
resources/js/bootstrap.js vendored Normal file
View File

@@ -0,0 +1,61 @@
import _ from 'lodash';
window._ = _;
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
try {
// window.Popper = require('popper.js').default;
// window.$ = window.jQuery = require('jquery');
// require('bootstrap');
} catch (e) {}
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
import axios from 'axios';
window.axios = axios;
/**
* Next we will set the base url for axios requests.
*/
window.axios.defaults.baseURL = APP.APP_URL;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo'
// window.Pusher = require('pusher-js');
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// encrypted: true
// });

View File

@@ -0,0 +1,208 @@
<template>
<section class="mt-3">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
id="is_enabled_acelle_mail"
v-model="acelleMail.is_enable"
value="1">
<label class="custom-control-label" for="is_enabled_acelle_mail">
{{trans('messages.enable')}}
</label>
</div>
<template
v-if="acelleMail.is_enable">
<div class="text-left text-muted text-center">
<small>
<i class="fa fa-info-circle"></i>
{{trans('messages.not_in_downloaded_code')}}
</small>
<br/>
</div>
<div class="form-group row">
<label for="api_token" class="col-sm-3 col-form-label">
{{trans('messages.api_token')}}:
<span class="error">*</span>
<i class="fa fa-info-circle"
data-html="true"
data-toggle="tooltip"
:title="trans('messages.api_token_n_list_tooltip', {name:acelle_mail_name})">
</i>
</label>
<div class="col-sm-9">
<div class="input-group">
<input type="text" class="form-control"
id="api_token"
:placeholder="trans('messages.api_token')"
name="acelleMail.api_token"
:required="acelleMail.is_enable"
v-model="acelleMail.api_token">
<div class="input-group-append">
<button type="button" class="btn btn-primary"
@click="getAcelleListIds"
:disabled="loading">
{{trans('messages.get_list')}}
<i class="fas fa-spinner fa-pulse fa-spin ml-1" v-if="loading"></i>
</button>
</div>
</div>
<small class="form-text text-danger"
v-if="error_msg">
{{error_msg}}
</small>
</div>
</div>
</template>
<template v-if="!_.isEmpty(campaign_list)">
<div class="form-group row">
<label for="site_key" class="col-sm-3 col-form-label">
{{acelle_mail_name}} {{trans('messages.list_id')}}:
<span class="error">*</span>
</label>
<div class="col-sm-9">
<select class="form-control"
:required="acelleMail.is_enable"
name="acelleMail.list_id"
v-model="acelleMail.list_id"
@change="getListFields">
<option value="" v-text="trans('messages.please_select')"></option>
<template
v-for="campaign in campaign_list">
<option
:value="campaign.uid"
v-text="campaign.name">
</option>
</template>
</select>
<small class="form-text text-danger"
v-if="field_error_msg">
{{field_error_msg}}
</small>
</div>
</div>
</template>
<template
v-if="!_.isEmpty(acelleMail.campaign_fields)">
<div class="form-group row"
v-for="(campaign_field, index) in acelleMail.campaign_fields">
<label class="col-sm-3 col-form-label">
{{campaign_field.label}}
<span class="error" v-if="campaign_field.required">*</span>
<p class="mt-0 p-0">
<small>
<code>
({{campaign_field.type}})
</code>
</small>
</p>
</label>
<div class="col-sm-9">
<select class="form-control"
:required="campaign_field.required"
:name="campaign_field.key"
v-model="campaign_field.param_field_name">
<option value="" v-text="trans('messages.please_select')"></option>
<template
v-for="element in selected_elements">
<option
:value="element.name"
v-if="!_.includes(['heading', 'hr', 'html_text', 'file_upload', 'signature', 'iframe', 'youtube', 'pdf', 'countdown'], element.type)"
v-text="element.label">
</option>
</template>
</select>
</div>
</div>
</template>
</section>
</template>
<script>
export default {
props: ['acelleMail', 'selected_elements'],
data() {
return {
acelle_mail_name: APP.ACELLE_MAIL_NAME,
campaign_list: [],
error_msg: '',
field_error_msg: '',
loading: false,
}
},
created() {
const self = this;
if (!_.isEmpty(self.acelleMail.api_token)) {
self.getAcelleListIds();
self.getListFields();
}
},
methods:{
getAcelleListIds() {
const self = this;
if (self.acelleMail.api_token) {
self.loading = true;
axios
.get('/get-acelle-list-ids',{
params: {
token: self.acelleMail.api_token
}
})
.then(function(response) {
self.loading = false;
if (response.data.success) {
self.campaign_list = response.data.list;
self.error_msg = _.isEmpty(response.data.list) ? self.trans('messages.no_acelle_list_please_create') : '';
} else {
self.error_msg = response.data.msg;
}
})
.catch(function(error) {
console.log(error);
});
} else{
self.error_msg = self.trans('messages.api_token_required');
}
},
getListFields() {
const self = this;
if (self.acelleMail.api_token && self.acelleMail.list_id) {
self.field_error_msg = self.trans('messages.retriving_fields');
axios
.get('/get-acelle-list-info',{
params: {
token: self.acelleMail.api_token,
list_id: self.acelleMail.list_id,
}
})
.then(function(response) {
if (response.data.success) {
self.field_error_msg = '';
self.filterExistingFields(response.data.fields);
} else {
self.field_error_msg = response.data.msg;
}
})
.catch(function(error) {
console.log(error);
});
}
},
filterExistingFields(fields) {
const self = this;
if (self.acelleMail.campaign_fields) {
fields.forEach(function(field){
self.acelleMail.campaign_fields.forEach(function(campField){
if(
(field.key == campField.key) &&
!_.isUndefined(campField.param_field_name))
{
field['param_field_name'] = campField.param_field_name;
return false;
}
});
});
}
self.acelleMail.campaign_fields = fields;
}
}
}
</script>

View File

@@ -0,0 +1,34 @@
<template>
<div class="mt-3">
<p>
{{trans('messages.additional_js_css_help_text')}}
</p>
<br>
<div class="form-group row">
<label class="col-sm-2">
{{trans('messages.javascript')}}
<i class="fa fa-info-circle" data-html="true" data-toggle="tooltip" :title="trans('messages.additional_js_help')"></i>
</label>
<div class="col-sm-10">
<textarea class="form-control" rows="4" :placeholder="trans('messages.additional_js')" v-model="additionalData.js">
</textarea>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2">
{{trans('messages.css')}}
<i class="fa fa-info-circle" data-html="true" data-toggle="tooltip" :title="trans('messages.additional_css_help')"></i>
</label>
<div class="col-sm-10">
<textarea class="form-control" rows="4" :placeholder="trans('messages.additional_css')"
v-model="additionalData.css">
</textarea>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['additionalData'],
}
</script>

View File

@@ -0,0 +1,52 @@
<template>
<!-- Modal -->
<div class="modal fade" id="AskUserChoice" tabindex="-1" role="dialog" aria-labelledby="AskUserChoiceModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="AskUserChoiceModalLabel">
<span v-html="trans('messages.what_do_u_want_next')"></span>
</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-4">
<button type="button" class="btn btn-primary btn-sm"@click="getUserChoice('edit')">
<i class="fa fa-edit"></i>
{{trans('messages.continue_editing')}}
</button>
</div>
<div class="col-md-4">
<button type="button" class="btn btn-info btn-sm"@click="getUserChoice('preview')">
<i class="fa fa-eye"></i>
{{trans('messages.preview_the_form')}}
</button>
</div>
<div class="col-md-4">
<button type="button" class="btn btn-success btn-sm" @click="getUserChoice('home')">
<i class="fas fa-home"></i>
{{trans('messages.go_to_home')}}
</button>
</div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
<!-- /modal -->
</template>
<script>
export default {
methods: {
getUserChoice(choice){
this.$eventBus.$emit('callRedirectUser', choice);
}
}
}
</script>

View File

@@ -0,0 +1,248 @@
<template>
<div class="container-fluid mt-3 mb-85">
<div class="text-left text-muted pl-3">
<i class="fas fa-info-circle mr-1"></i>
<small>{{trans('messages.not_in_downloaded_code')}}</small><br/>
</div>
<template v-for="(conditionalField, index) in conditionalFields">
<div v-if="index != 0">
<h4 class="text-center">
<strong>
{{trans('messages.or').toUpperCase()}}
</strong>
</h4>
</div>
<div class="card m-3 card-outline card-success">
<div class="card-body">
<div class="row">
<div class="col-md-5">
<div class="input-group">
<select class="form-control" v-model="conditionalField.action">
<option :value="''">
{{trans('messages.show_hide')}}
</option>
<option :value="'show'">
{{trans('messages.show')}}
</option>
<option :value="'hide'">
{{trans('messages.hide')}}
</option>
</select>
<select class="form-control" v-model="conditionalField.element">
<option :value="''">
{{trans('messages.choose_element')}}
</option>
<option v-for="(element, index) in selectedElements"
:key="index"
:value="element.name"
v-if="!_.includes(['hr', 'page_break'], element.type)">
{{element.label}}
({{element.name}})
</option>
</select>
</div>
</div>
<div class="col-md-6">
<template v-for="(conditions, conditionIndex) in conditionalField.conditions">
<div class="row">
<div class="col-md-5">
<div class="input-group mb-2">
<div class="input-group-prepend">
<span class="input-group-text" v-if="conditionIndex == 0">
{{trans('messages.when')}}
</span>
<select v-if="conditionIndex != 0"
class="form-control input-group-text" v-model="conditions.logical_operator">
<option value="AND">
{{trans('messages.and')}}
</option>
<option value="OR">
{{trans('messages.or')}}
</option>
</select>
</div>
<select class="form-control" v-model="conditions.condition"
@change="toggleConditionValueField(conditions.condition)">
<option :value="''">
{{trans('messages.condition')}}
</option>
<option v-for="(element, index) in selectedElements"
:key="index"
:value="element.name"
v-if="!_.includes(['heading', 'hr', 'html_text', 'file_upload', 'text_editor', 'signature', 'page_break', 'iframe', 'youtube', 'pdf', 'countdown'], element.type)">
{{element.label}}
</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="input-group mb-2" v-if="_.includes(['text', 'textarea', 'range', 'calendar', 'rating'], conditions.element_type)">
<div class="input-group-prepend">
<select class="form-control input-group-text" v-model="conditions.operator">
<option value="==">
{{trans('messages.equal_to')}}
</option>
<option value="!=">
{{trans('messages.not_equal_to')}}
</option>
<option value="empty">
{{trans('messages.empty')}}
</option>
<option value="not_empty">
{{trans('messages.not_empty')}}
</option>
</select>
</div>
<input type="text" class="form-control"
:placeholder="trans('messages.write_conditional_value')"
v-model="conditions.value" :disabled="_.includes(['empty', 'not_empty'], conditions.operator)">
</div>
<div class="input-group mb-2" v-if="_.includes(['dropdown', 'radio', 'checkbox'], conditions.element_type)">
<div class="input-group-prepend">
<select class="form-control input-group-text" v-model="conditions.operator">
<option value="==">
{{trans('messages.equal_to')}}
</option>
<option value="!=">
{{trans('messages.not_equal_to')}}
</option>
<option value="empty" v-if="!_.includes(['radio', 'checkbox'], conditions.element_type)">
{{trans('messages.empty')}}
</option>
<option value="not_empty" v-if="!_.includes(['radio', 'checkbox'], conditions.element_type)">
{{trans('messages.not_empty')}}
</option>
</select>
</div>
<select class="form-control" v-model="conditions.value" :disabled="_.includes(['empty', 'not_empty'], conditions.operator)">
<option :value="''">
{{trans('messages.choose_value')}}
</option>
<option v-for="(option, index) in optionsForConditionalValue(selectedElements[conditions.element_index])"
:value="option"
:key="index"
>
{{option}}
</option>
</select>
</div>
<div class="input-group mb-2" v-if="_.includes(['terms_and_condition'], conditions.element_type)">
<div class="input-group-prepend">
<select class="form-control input-group-text" v-model="conditions.operator">
<option value="==">
{{trans('messages.equal_to')}}
</option>
</select>
</div>
<select class="form-control" v-model="conditions.value">
<option :value="''">
{{trans('messages.choose_value')}}
</option>
<option value="true">
{{trans('messages.checked')}}
</option>
<option value="false">
{{trans('messages.unchecked')}}
</option>
</select>
</div>
<div class="input-group mb-2" v-if="_.includes(['switch'], conditions.element_type)">
<div class="input-group-prepend">
<select class="form-control input-group-text" v-model="conditions.operator">
<option value="==">
{{trans('messages.equal_to')}}
</option>
<option value="!=">
{{trans('messages.not_equal_to')}}
</option>
</select>
</div>
<select class="form-control" v-model="conditions.value">
<option :value="''">
{{trans('messages.choose_value')}}
</option>
<option value="1">
{{trans('messages.on')}}
</option>
<option value="0">
{{trans('messages.off')}}
</option>
</select>
</div>
</div>
<div class="col-md-1">
<button type="button" class="btn btn-primary btn-sm" @click="addCondition(index)" v-if="conditionIndex == 0" data-toggle="tooltip" data-placement="top" :title="trans('messages.add_condition')">
<i class="fas fa-plus-circle"></i>
</button>
<button type="button" class="btn btn-danger btn-sm" @click="removeCondition(index,conditionIndex)" v-if="conditionIndex != 0">
<i class="fas fa-trash-alt"></i>
</button>
</div>
</div>
</template>
</div>
<div class="col-md-1">
<button type="button" class="btn btn-danger btn-sm" @click="removeConditionalField(index)">
<i class="fas fa-trash-alt"></i>
</button>
</div>
</div>
</div>
</div>
</template>
<button type="button" class="btn btn-info float-right mt-3" @click="addMoreConditionalField" data-toggle="tooltip" data-placement="top" :title="trans('messages.add_conditional_field')">
<i class="fas fa-plus-circle"></i>
{{trans('messages.add')}}
</button>
</div>
</template>
<script>
export default {
props: ['conditionalFields', 'selectedElements'],
methods:{
addCondition(index) {
var condition_field = {'condition':'', 'value':"", 'element_type' : 'text', 'element_index' : '', 'operator' : '==', 'logical_operator' : 'AND'};
this.conditionalFields[index].conditions.push(condition_field);
},
addMoreConditionalField() {
var conditional_field = {'action':'', 'element':'', 'conditions':[{'condition':'', 'value':"", 'element_type' : 'text', 'element_index' : '', 'operator' : '==', 'logical_operator' : 'AND'}]};
this.conditionalFields.push(conditional_field);
},
removeCondition(index, conditionalIndex) {
if (conditionalIndex != 0) {
this.conditionalFields[index].conditions.splice(conditionalIndex, 1);
}
},
removeConditionalField(index) {
this.conditionalFields.splice(index, 1);
},
toggleConditionValueField(choosenCondition) {
var schema = this.selectedElements;
_.forEach(this.conditionalFields, function(conditionalField){
_.forEach(conditionalField.conditions, function(conditionalElement) {
if (conditionalElement.condition === choosenCondition) {
var index = schema.findIndex(element => element.name === choosenCondition);
conditionalElement.element_type = _.isUndefined(schema[index]) ? 'text' : schema[index].type;
conditionalElement.element_index = index;
}
});
});
},
optionsForConditionalValue(element) {
if(!_.isUndefined(element)) {
let options = element.options;
return (options || "").split("\n");
}
return "";
}
}
}
</script>

View File

@@ -0,0 +1,617 @@
<template>
<div>
<form id="create_form">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="form-tab" data-toggle="tab" href="#form_builder_tab" role="tab" aria-controls="form" aria-selected="true">
<i class="fas fa-align-justify"></i> {{ trans('messages.form') }}
</a>
</li>
<li class="nav-item" role="presentation" id="tour_step_4">
<a class="nav-link" id="field_conditions-tab" data-toggle="tab" href="#field_conditions_tab" role="tab" aria-controls="field_conditions" aria-selected="false">
<i class="fas fa-wrench"></i> {{trans('messages.field_conditions')}}
</a>
</li>
<li class="nav-item" role="presentation" id="tour_step_5">
<a class="nav-link" id="email-tab" data-toggle="tab" href="#email_settings_tab" role="tab" aria-controls="email" aria-selected="false">
<i class="fas fa-envelope"></i> {{trans('messages.email')}}
</a>
</li>
<li class="nav-item" role="presentation" id="tour_step_6">
<a class="nav-link" id="form-settings-tab" data-toggle="tab" href="#form_settings_tab" role="tab" aria-controls="form-settings" aria-selected="false">
<i class="fas fa-cogs"></i> {{trans('messages.settings')}}
</a>
</li>
<li class="nav-item" role="presentation" id="tour_step_7">
<a class="nav-link" id="mailchimp-tab" data-toggle="tab" href="#mailchimp_tab" role="tab" aria-controls="mailchimp" aria-selected="false">
<i class="fab fa-mailchimp fa-lg"></i> {{trans('messages.mailchimp')}}
</a>
</li>
<li class="nav-item" role="presentation" id="acelle_mail_tour"
v-if="is_acelle_mail_enabled">
<a class="nav-link" id="acelle-mail-tab" data-toggle="tab" href="#acelle_mail_tab" role="tab">
<i class="fas fa-mail-bulk"></i>
{{acelle_mail_name}}
</a>
</li>
<li class="nav-item" role="presentation" id="webhook_tour">
<a class="nav-link" id="webhook-tab" data-toggle="tab" href="#webhook_tab" role="tab">
<i class="far fa-paper-plane"></i>
{{trans('messages.webhook')}}
</a>
</li>
<li class="nav-item" role="presentation" id="tour_step_8">
<a class="nav-link" id="js-css-tab" data-toggle="tab" href="#custom_js_css_tab" role="tab" aria-controls="js-css" aria-selected="false">
<i class="fas fa-file-code"></i> {{trans('messages.additional_js_css')}}
</a>
</li>
<li class="nav-item" role="presentation">
<button type="button" class="btn btn-xs bg-gradient-danger app_tour_play_btn" @click="getAppTour">
<i class="far fa-play-circle"></i>
{{trans('messages.app_tour')}}
</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="form_builder_tab" role="tabpanel" aria-labelledby="form-tab">
<form-tab :selected_elements="selected_elements" :settings="settings" :form="form" :placeholder_img="placeholderImg" :form_custom_attributes="form_custom_attributes"></form-tab>
</div>
<div class="tab-pane fade" id="field_conditions_tab" role="tabpanel" aria-labelledby="field_conditions-tab">
<condtionalFields
:conditional-fields="conditional_fields"
:selected-elements="selected_elements"
></condtionalFields>
</div>
<div class="tab-pane fade" id="email_settings_tab" role="tabpanel" aria-labelledby="email-tab">
<email-tab
:emailConfig="emailConfig"
:selected_elements="selected_elements"
:settings="settings">
</email-tab>
</div>
<div class="tab-pane fade" id="form_settings_tab" role="tabpanel" aria-labelledby="form-settings-tab">
<settings-tab
:settings="settings"
:selected_elements="selected_elements">
</settings-tab>
</div>
<div class="tab-pane fade" id="mailchimp_tab" role="tabpanel" aria-labelledby="mailchimp-tab">
<mailchimp
:details="mailchimp_details"
:selected_elements="selected_elements">
</mailchimp>
</div>
<div class="tab-pane fade" id="acelle_mail_tab" role="tabpanel" aria-labelledby="acelle-mail-tab"
v-if="is_acelle_mail_enabled">
<acelle-mail
:acelle-mail="acelle_mail_info"
:selected_elements="selected_elements">
</acelle-mail>
</div>
<div class="tab-pane fade" id="webhook_tab" role="tabpanel" aria-labelledby="webhook-tab">
<webhook
:webhook-info="webhook_info"/>
</div>
<div class="tab-pane fade" id="custom_js_css_tab" role="tabpanel" aria-labelledby="js-css-tab">
<additional-js-css :additional-data="additionalData">
</additional-js-css>
</div>
</div>
<!-- submit button -->
<div v-if="selected_elements.length">
<hr class="mt-5">
<div id="tour_step_9">
<button type="submit" class="btn btn-success btn-lg float-right ladda-form-save-btn mb-2" name="submit_type" value="0">
{{trans('messages.save_as_form')}}
</button>
<button type="submit" class="btn btn-secondary btn-lg float-right ladda-template-save-btn mb-2 mr-1" name="submit_type" value="1" v-if="disabled_save_temp_btn">
{{trans('messages.save_as_template')}}
</button>
</div>
</div>
<AskUserChoice id="userChoiceModal">
</AskUserChoice>
</form>
</div>
</template>
<script>
import formTab from "./FormTab";
import emailTab from "./EmailTab";
import settingsTab from "./SettingsTab";
import additionalJsCss from "./AdditionalJsCss";
import mailchimp from "./Mailchimp";
import condtionalFields from "./ConditionalField";
import AskUserChoice from "./AskUserChoiceAfterSave";
import AcelleMail from "./AcelleMail";
import Webhook from "./Webhook/Webhook";
export default {
props: ['formData', 'placeholderImg', 'saveTemplate'],
components: {
formTab,
emailTab,
settingsTab,
mailchimp,
additionalJsCss,
condtionalFields,
AskUserChoice,
AcelleMail,
Webhook
},
data() {
return {
selected_elements: [],
form_parsed: [],
form:[],
emailConfig: {},
settings:{},
dashboard:'',
additionalData: {},
mailchimp_details: {},
conditional_fields:[],
form_scheduling: {
closed_msg:'The form has been closed now!',
start_date_time:'',
end_date_time:'',
is_enabled: false
},
form_submision_ref: {
is_enabled: false,
prefix: '',
suffix: '',
start_no: '1',
min_digit: '4'
},
form_theme: 'default',
responseData:[],
is_enabled_draft_submit: 0,
form_custom_attributes : [],
disabled_save_temp_btn:null,
password_protection:{
is_enabled:false,
password: ''
},
pdf_design:{
header: `<h1 style="margin-top: 0px; margin-bottom: 0.5rem; font-family: &quot;Source Sans Pro&quot;, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, &quot;Helvetica Neue&quot;, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; line-height: 1.2; color: rgb(0, 0, 0); font-size: 2.5rem; text-align: center;"><span style="color: rgb(33, 37, 41); font-size: 12.8px; text-align: left; background-color: rgb(244, 246, 249);"><span style="font-size: 24px;"><span style="font-weight: bolder;">{form_name}</span></span><sub style="font-size: 9.6px;"><span style="font-size: 12px;">{submission_date}</span></sub></span></h1>`
},
spread_to_col:{
enable: false,
column: 2
},
acelle_mail_info: {},
is_acelle_mail_enabled: APP.ACELLE_MAIL_ENABLED,
acelle_mail_name: APP.ACELLE_MAIL_NAME,
webhook_info: {},
popover_help_text:{
enable: false,
content: ''
}
};
},
created() {
this.form_parsed = JSON.parse(this.formData);
this.form.name = this.form_parsed.name;
this.form.slug = this.form_parsed.slug;
this.form.description = this.form_parsed.description;
this.form.is_template = this.form_parsed.is_template;
this.disabled_save_temp_btn = JSON.parse(this.saveTemplate);
if (this.form_parsed.schema === null) {
this.emailConfig = this.getData('email_config');
this.settings = this.getData('settings');
this.additionalData = {js:'', css:''};
this.conditional_fields = this.getData('conditional_fields');
} else {
this.selected_elements = this.form_parsed.schema.form;
this.emailConfig = this.form_parsed.schema.emailConfig;
this.settings = this.form_parsed.schema.settings;
this.additionalData = _.isNull(this.form_parsed.schema.additional_js_css) ? {js:'', css:''} : this.form_parsed.schema.additional_js_css;
this.mailchimp_details = _.isNull(this.form_parsed.mailchimp_details) ? this.getData('mailchimp') : this.form_parsed.mailchimp_details;
this.acelle_mail_info = _.isEmpty(this.form_parsed.acelle_mail_info) ? this.getData('acelle_mail') : this.form_parsed.acelle_mail_info;
this.conditional_fields = _.isUndefined(this.form_parsed.schema.conditional_fields) ? this.getData('conditional_fields') : this.form_parsed.schema.conditional_fields;
this.form_custom_attributes = _.isUndefined(this.form_parsed.schema.form_attributes) ? this.form_custom_attributes : this.form_parsed.schema.form_attributes;
}
this.webhook_info = this.form_parsed?.webhook_info || this.getData('webhook_info');
this.getNewlyAddedPropertyForExistingForm();
this.$eventBus.$on('callRedirectUser', (data) => {
$("#userChoiceModal").modal("hide");
setTimeout(() => {
this.redirectUsersAccordingToResponse(data);
}, 1000);
});
},
beforeDestroy() {
this.$eventBus.$off('callRedirectUser');
},
mounted(){
const self = this;
$('form#create_form').validate({
ignore: ".note-editor *",
submitHandler: function(form, e) {
var field_names = [];
if (self.selected_elements.length > 0) {
for (let index = 0; index < self.selected_elements.length; index++) {
self.selected_elements[index].extras.showConfigurator = false;
if (_.isEmpty(self.selected_elements[index].name)) {
toastr.error(self.trans('messages.field_dont_have_name_property', {
input: self.selected_elements[index].label,
}));
return false;
} else if (/\s/.test(self.selected_elements[index].name)) {
toastr.error(self.trans('messages.field_contain_space', {
input: self.selected_elements[index].label,
}));
return false;
} else if (_.includes(field_names, self.selected_elements[index].name)) {
toastr.error(self.trans('messages.field_contain_duplicate_field_name', {
input: self.selected_elements[index].label,
}));
field_names = [];
return false;
}else if (!_.includes(field_names, self.selected_elements[index].name)) {
field_names.push(self.selected_elements[index].name);
}
}
}
let data = _.pick(self.form, ['name', 'description', 'slug']);
data.form = self.selected_elements;
data.email_config = self.emailConfig;
data.settings = self.settings;
data.js_css = self.additionalData;
data.mailchimp_details = self.mailchimp_details;
data.acelle_mail_info = self.acelle_mail_info;
data.conditional_fields = self.conditional_fields;
data.is_template = $("input[name='submit_type']").val();
data.form_attributes = self.form_custom_attributes;
data.contains_page_break = _.some(self.selected_elements, {type: "page_break"});
data.webhook_info = self.webhook_info;
//get ladda btn based on submit type
if (data.is_template === '1') {
var ladda = Ladda.create(document.querySelector('.ladda-template-save-btn'));
} else {
var ladda = Ladda.create(document.querySelector('.ladda-form-save-btn'));
}
if ($('form#create_form').valid()) {
//disable both btn and start ladda
$("button.ladda-form-save-btn, button.ladda-template-save-btn").attr('disabled', 'disabled');
ladda.start();
axios
.put('/forms/'+self.form_parsed.id, data)
.then(function(response) {
//remove disable from both btn and stop ladda
$("button.ladda-form-save-btn, button.ladda-template-save-btn").removeAttr("disabled");
ladda.stop();
if (response.data.success == true) {
self.responseData = response.data;
$("#userChoiceModal").modal("show");
} else {
toastr.error(response.data.msg);
}
})
.catch(function(error) {
console.log(error);
});
}
}
});
//if mpfg_tour not finished call getAppTour
if (_.isNull(localStorage.getItem("mpfg_tour"))) {
localStorage.setItem("mpfg_tour", 'finished');
this.getAppTour();
}
},
methods: {
getData(type) {
if (type == 'email_config') {
var email = {
email: {
enable: '',
from: '',
to: '',
reply_to_email: '',
cc:'',
bcc:'',
subject: '',
body:'',
attach_pdf: false
},
auto_response: {
from:'',
to:'',
subject: '',
body: '',
is_enable: false,
attach_pdf: false
},
smtp: {
host:'',
port:'',
from_address:'',
from_name:'',
encryption:'',
username:'',
password:'',
use_system_smtp:1
}
};
return email;
} else if (type == 'settings') {
var setting = {
recaptcha:{
is_enable:0,
site_key:'',
secret_key:''
},
color:{
label:'#000000',
error_msg:'#a94442',
required_asterisk_color:'#a94442',
background:'#ffffff',
image_path:'',
page_color:'#f4f6f9'
},
notification:{
post_submit_action:'same_page',
failed_msg:'Something went wrong, please try again.',
success_msg:'Your submission has been received.',
redirect_url:'',
position: 'toast-top-right'
},
submit:{
text:'Submit',
loading_text:'Submitting...',
btn_alignment:'float-right',
btn_size:'',
btn_color:'btn-primary',
btn_style: 'default',
btn_icon: 'none',
icon_position:'left'
},
form_data:{
col_visible:[],
btn_enabled:[
'view', 'delete'
]
},
background:{
bg_type:'bg_color'
},
form_scheduling:this.form_scheduling,
form_submision_ref: this.form_submision_ref,
theme: this.form_theme,
is_enabled_draft_submit: this.is_enabled_draft_submit,
layout: 'classic',
password_protection: this.password_protection,
pdf_design: this.pdf_design,
is_qr_code_enabled: false,
qr_code_data_format: 'string',
is_ref_num_bar_code_enabled: false,
is_ref_num_qr_code_enabled: false
};
return setting;
} else if(type == 'mailchimp'){
return {
is_enable: false,
api_key: '',
list_id: '',
email_field: '',
name_field: ''
};
} else if(type == 'acelle_mail'){
return {
is_enable: false,
api_token: '',
list_id: '',
campaign_fields: []
};
} else if (type == 'conditional_fields') {
var conditional_fields = [
{
'action':'',
'element':'',
'conditions': [
{
'condition':'',
'value':"",
'element_type' : 'text',
'element_index' : '',
'operator' : '==',
'logical_operator' : 'AND'
}
]
}
];
return conditional_fields;
} else if (type == 'webhook_info') {
return {
is_enable: false,
url: '',
secret_key: ''
};
}
},
getNewlyAddedPropertyForExistingForm() {
const self = this;
_.forEach(self.selected_elements, function(element) {
if (_.isUndefined(element.conditional_class)) {
element.conditional_class = '';
}
if (_.isUndefined(element.col)) {
element.col = 'col-md-12';
}
if (_.isUndefined(element.popover_help_text)) {
element['popover_help_text'] = _.clone(self.popover_help_text);
}
//if spread to col option is undefined for element set to default
if (
_.includes(['radio', 'checkbox'], element.type) &&
_.isUndefined(element.spread_to_col)
) {
element.spread_to_col = self.spread_to_col;
}
if (
_.includes(['text'], element.type) &&
_.includes(['text', 'email', 'number'], element.subtype) &&
_.isUndefined(element.allowed_input)
) {
element.allowed_input = {
values:'',
error_msg: 'This value is not allowed.'
};
}
});
if (_.isUndefined(self.settings.form_scheduling)) {
self.settings.form_scheduling = self.form_scheduling;
}
if (_.isUndefined(self.settings.form_submision_ref)) {
self.settings.form_submision_ref = self.form_submision_ref;
}
if (_.isUndefined(self.settings.theme)) {
self.settings.theme = self.form_theme;
}
if (_.isUndefined(self.settings.is_qr_code_enabled)) {
Vue.set(self.settings, 'is_qr_code_enabled', false);
}
if (
_.isUndefined(self.settings.is_ref_num_bar_code_enabled) ||
_.isUndefined(self.settings.is_ref_num_qr_code_enabled)
) {
Vue.set(self.settings, 'is_ref_num_bar_code_enabled', false);
Vue.set(self.settings, 'is_ref_num_qr_code_enabled', false);
}
if (_.isUndefined(self.settings.qr_code_data_format)) {
Vue.set(self.settings, 'qr_code_data_format', 'string');
}
if (_.isUndefined(self.settings.is_enabled_draft_submit)) {
self.settings.is_enabled_draft_submit = self.is_enabled_draft_submit;
}
if (_.isUndefined(self.settings.notification.position)) {
self.settings.notification.position = 'toast-top-right';
}
if (_.isUndefined(self.settings.submit.btn_style)) {
Vue.set(self.settings.submit, 'btn_style', 'default');
}
if (_.isUndefined(self.settings.submit.btn_icon)) {
Vue.set(self.settings.submit, 'btn_icon', 'none');
}
if (_.isUndefined(self.settings.submit.icon_position)) {
Vue.set(self.settings.submit, 'icon_position', 'left');
}
if (_.isUndefined(self.settings.color.page_color)) {
Vue.set(self.settings.color, 'page_color', '#f4f6f9');
}
if (_.isUndefined(self.settings.password_protection)) {
self.settings.password_protection = self.password_protection;
}
if (_.isUndefined(self.settings.pdf_design)) {
self.settings.pdf_design = self.pdf_design;
}
},
redirectUsersAccordingToResponse(choice) {
if (choice == 'home') {
window.location = this.responseData.redirect;
} else if (choice == 'preview') {
window.open(this.responseData.preview, this.responseData.form_name);
}
},
getAppTour() {
if (!$('#appTab a[href="#form-generator"]').hasClass('active')) {
$('#appTab a[href="#form-generator"]').tab('show');
}
const self = this;
var intro = introJs();
intro.setOptions({
steps: [
{
intro : self.trans('messages.welcome_tour_msg')
},
{
element: document.querySelectorAll('#tour_step_1')[0],
intro: self.trans('messages.tour_step_1_intro'),
position: 'right',
scrollTo: 'tooltip'
},
{
element: '#tour_step_2',
intro: self.trans('messages.tour_step_2_intro'),
position: 'right',
scrollTo: 'tooltip'
},
{
element: '#tour_step_3',
intro: self.trans('messages.tour_step_3_intro'),
position: 'bottom',
scrollTo: 'tooltip'
},
{
element: '#tour_step_4',
intro: self.trans('messages.tour_step_4_intro'),
scrollTo: 'tooltip'
},
{
element: '#tour_step_5',
intro: self.trans('messages.tour_step_5_intro'),
scrollTo: 'tooltip'
},
{
element: '#tour_step_6',
intro: self.trans('messages.tour_step_6_intro'),
scrollTo: 'tooltip'
},
{
element: '#tour_step_7',
intro: self.trans('messages.tour_step_7_intro'),
scrollTo: 'tooltip'
},
{
element: '#tour_step_8',
intro: self.trans('messages.tour_step_8_intro'),
scrollTo: 'tooltip'
},
{
element: '#tour_step_9',
intro: self.trans('messages.tour_step_9_intro'),
scrollTo: 'tooltip'
}
]
});
intro.start();
}
}
}
</script>

View File

@@ -0,0 +1,212 @@
<template>
<!-- modal -->
<div class="modal fade" id="elementDetailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalCenterTitle">
{{trans('messages.element_details')}}
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<b>{{trans('messages.input')}}:</b><br>
<div v-html="getTooltips('text')"></div><hr>
<b>{{trans('messages.textarea')}}:</b><br>
<div v-html="getTooltips('textarea')"></div><hr>
<b>{{trans('messages.dropdown')}}:</b><br>
<div v-html="getTooltips('dropdown')"></div><hr>
<b>{{trans('messages.radio')}}:</b><br>
<div v-html="getTooltips('radio')"></div><hr>
<b>{{trans('messages.checkbox')}}:</b><br>
<div v-html="getTooltips('checkbox')"></div><hr>
<b>{{trans('messages.heading_paragrahp')}}:</b><br>
<div v-html="getTooltips('heading')"></div><hr>
<b>{{trans('messages.range')}}:</b><br>
<div v-html="getTooltips('range')"></div><hr>
<b>{{trans('messages.datetime')}}:</b><br>
<div v-html="getTooltips('calendar')"></div><hr>
<b>{{trans('messages.file_upload')}}:</b><br>
<div v-html="getTooltips('file_upload')"></div><hr>
<b>{{trans('messages.text_editor')}}:</b><br>
<div v-html="getTooltips('text_editor')"></div> <hr>
<b>{{trans('messages.terms_condition')}}:</b><br>
<div v-html="getTooltips('terms_and_condition')"></div><hr>
<b>{{trans('messages.horizontal_line')}}:</b><br>
<div v-html="getTooltips('hr')"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">
{{trans('messages.close')}}
</button>
</div>
</div>
</div>
</div>
<!-- /modal -->
</template>
<script>
export default {
methods:{
getTooltips(element_type) {
var validation_rules = validationRules;
var rules = [];
var title = '';
_.forEach(validation_rules, function(validation) {
if (_.includes(validation.applies_to, element_type)) {
rules.push(validation.display);
}
});
if (element_type == 'text') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To enter short information. <br>
<span class="text-success">
<i>Example:</i>
</span> Name, Email, Phone.<br>
<span class="text-success">
<i>Contains:</i>
</span> Is required,
`+ rules.join(', ');
} else if (element_type == 'textarea') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To enter long information.<br>
<span class="text-success">
<i>Example:</i>
</span> Address, About me, Description.<br>
<span class="text-success">
<i>Contains:</i>
</span> Is required,
`+ rules.join(', ');
} else if (element_type == 'dropdown') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To select Single or Multiple pre-defined values. <br>
<span class="text-success">
<i>Example:</i>
</span> Hobbies, Model <br>
<span class="text-success">
<i>Contains:</i>
</span> Is required, `+ rules.join(', ');
} else if (element_type == 'radio') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To select ONE of a limited number of choices <br>
<span class="text-success">
<i>Example:</i>
</span> Gender, True-False <br>
<span class="text-success">
<i>Contains:</i>
</span> Is required.`;
} else if (element_type == 'checkbox') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> select ZERO or MORE options of a limited number of choices <br>
<span class="text-success">
<i>Example:</i>
</span> Hobbies, Qualification <br>
<span class="text-success">
<i>Contains:</i>
</span>Is required, `+ rules.join(', ');
} else if(element_type == 'heading') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> For heading or any type of texts with H1 to H6 & Paragraph tags with your defined color. <br>
<span class="text-success">
<i>Example:</i>
</span> Description & other informations.`;
} else if(element_type == 'range') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To Select Minimum-maximum range value.<br>
<span class="text-success">
<i>Example:</i>
</span>
Price range`;
} else if(element_type == 'calendar') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To pick a date and/or time, with your defined format.<br>
<span class="text-success">
<i>Example:</i>
</span> Appointment date <br>
<span class="text-success">
<i>Contains:</i>
</span> Is required.`;
} else if(element_type == 'file_upload') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To upload file(s) and/or images.<br>
<span class="text-success">
<i>Example:</i>
</span> Documents, Photo <br>
<span class="text-success">
<i>Contains:</i>
</span> Is required.`;
} else if(element_type == 'text_editor') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> To enter long information with the many options to format<br>
<span class="text-success">
<i>Example:</i>
</span>
Description, blogs <br>
<span class="text-success">
<i>Contains:</i>
</span> Is required.`;
} else if (element_type == 'terms_and_condition') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> Rules by which one must agree to abide in order to use a service<br>
<span class="text-success">
<i>Example:</i>
</span>
Privacy Policy<br>
<span class="text-success">
<i>Contains:</i>
</span> Is required.`;
} else if (element_type == 'hr') {
title = `
<span class="text-success">
<i>Usage:</i>
</span> This tag defines a thematic break in an HTML page.<br>
<span class="text-success">
<i>Example:</i>
</span>
a shift of topic<br>
`;
}
return title;
}
}
}
</script>

View File

@@ -0,0 +1,594 @@
<template>
<div class="row mt-3">
<div class="col-md-12">
<div class="accordion" id="accordionEmail">
<div class="card">
<div class="card-header bg-success" id="headingEmailSettings">
<h2 class="mb-0">
<button class="btn btn-link text-white" type="button" data-toggle="collapse"
data-target="#collapseEmail"
aria-expanded="true"
aria-controls="collapseEmail">
{{trans('messages.new_submission_email')}}:
</button>
</h2>
</div>
<div id="collapseEmail"
class="collapse show"
aria-labelledby="headingEmailSettings"
data-parent="#accordionEmail">
<div class="card-body">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
id="enable_submission_email"
v-model="emailConfig.email.enable"
@change="emailToggle()"
value="1">
<label class="custom-control-label" for="enable_submission_email">
{{trans('messages.enable')}}
</label>
</div>
<div v-if="emailConfig.email.enable">
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.from')}}<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="email"
class="form-control"
:required="emailConfig.email.enable"
:placeholder="trans('messages.from_email')"
name="emailConfig.email.from"
v-model="emailConfig.email.from">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.to')}}<span class="error">*</span></label>
<div class="col-sm-10">
<input type="text"
class="form-control"
:required="emailConfig.email.enable"
name="emailConfig.email.to"
:placeholder="trans('messages.multiple_email_help_text')"
v-model="emailConfig.email.to">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.reply_to_email')}}
</label>
<div class="col-sm-10">
<select class="form-control"
name="reply_to_email"
v-model="emailConfig.email.reply_to_email">
<option value="" v-text="trans('messages.please_select')"></option>
<template
v-for="element in selected_elements">
<option
:value="element.name"
v-if="_.includes(['email'], element.subtype)"
v-text="element.label">
</option>
</template>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.cc')}}
</label>
<div class="col-sm-10">
<input type="text"
class="form-control"
:placeholder="trans('messages.multiple_email_help_text')"
v-model="emailConfig.email.cc">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.bcc')}}
</label>
<div class="col-sm-10">
<input type="text"
class="form-control"
:placeholder="trans('messages.multiple_email_help_text')"
v-model="emailConfig.email.bcc">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.subject')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
class="form-control"
:required="emailConfig.email.enable"
name="emailConfig.email.subject"
:placeholder="trans('messages.email_subject')"
v-model="emailConfig.email.subject">
<small class="form-text text-muted">
{{trans('messages.click_to_add_tags')}}:
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
v-for="(element, index) in selected_elements"
v-if="!_.includes(['heading','hr', 'html_text', 'signature', 'file_upload', 'page_break', 'iframe', 'youtube', 'pdf', 'countdown'], element.type)"
@click="appendTag(index, 'email_subject')">{{element.label}}</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'submission_ref_for_email_subject')">
{{trans('messages.submission_numbering')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.body')}}:
<span class="error">*</span></label>
<div class="col-sm-10">
<textarea class="submission_email_body"
rows="5"
:required="emailConfig.email.enable"
name="emailConfig.email.body"
:placeholder="trans('messages.email_body')"
v-model="emailConfig.email.body"></textarea>
<small class="form-text text-muted">
{{trans('messages.click_to_add_tags')}}:
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
v-for="(element, index) in selected_elements"
v-if="!_.includes(['heading','hr', 'html_text', 'signature', 'file_upload', 'page_break', 'iframe', 'youtube', 'pdf', 'countdown'], element.type)"
@click="appendTag(index, 'email_body')">{{element.label}}</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'submission_ref_for_email_body')">
{{trans('messages.submission_numbering')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'ref_num_qr_code_for_email_body')">
{{trans('messages.qr_code_for_ref_num')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'ref_num_bar_code_for_email_body')">
{{trans('messages.bar_code_for_ref_num')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.pdf')}}
</label>
<div class="col-sm-10">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="email_attach_pdf" value="1" name="attach_pdf" v-model="emailConfig.email.attach_pdf">
<label class="custom-control-label" for="email_attach_pdf">
{{trans('messages.attach_pdf')}}
</label>
<i class="fas fa-info-circle text-info" data-toggle="tooltip" data-html="true" :title="trans('messages.pdf_of_submitted_data_will_be_attached_to_mail')"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header bg-success" id="headingEmailResponse">
<h2 class="mb-0">
<button class="btn btn-link text-white" type="button" data-toggle="collapse" data-target="#collapseEmailResponse" aria-expanded="true" aria-controls="collapseEmailResponse">
{{trans('messages.auto_response_settings')}}:
</button>
</h2>
</div>
<div id="collapseEmailResponse" class="collapse" aria-labelledby="headingEmailResponse" data-parent="#accordionEmail">
<div class="card-body">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
id="enable_auto_response"
@change="replyToggle()"
v-model="emailConfig.auto_response.is_enable"
value="1">
<label class="custom-control-label" for="enable_auto_response">
{{trans('messages.enable_auto_response')}}
</label>
</div>
<div v-show="emailConfig.auto_response.is_enable">
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.from')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="email"
:required="emailConfig.auto_response.is_enable"
class="form-control"
:placeholder="trans('messages.from_email')"
name="emailConfig.auto_response.from"
v-model="emailConfig.auto_response.from">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.to')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<select class="form-control"
:required="emailConfig.auto_response.is_enable"
name="emailConfig.auto_response.to"
v-model="emailConfig.auto_response.to">
<option :value="element.name"
v-if="_.includes(['text', 'email'], element.type)"
v-for="element in selected_elements">{{element.label}}</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.subject')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
:required="emailConfig.auto_response.is_enable"
name="emailConfig.auto_response.is_enable"
class="form-control"
:placeholder="trans('messages.email_subject')"
v-model="emailConfig.auto_response.subject">
<small class="form-text text-muted">
{{trans('messages.click_to_add_tags')}}:
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
v-for="(element, index) in selected_elements"
v-if="!_.includes(['heading','hr', 'html_text', 'signature', 'file_upload', 'page_break', 'iframe', 'youtube', 'pdf', 'countdown'], element.type)"
@click="appendTag(index, 'response_subject')">{{element.label}}</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'submission_ref_for_response_subject')">
{{trans('messages.submission_numbering')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.body')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<textarea
class="autoresponse_email_body"
rows="5"
name="emailConfig.auto_response.body"
:required="emailConfig.auto_response.is_enable"
v-model="emailConfig.auto_response.body"></textarea>
<small class="form-text text-muted">
{{trans('messages.click_to_add_tags')}}:
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
v-for="(element, index) in selected_elements"
v-if="!_.includes(['heading','hr', 'html_text', 'signature', 'file_upload', 'page_break', 'iframe', 'youtube', 'pdf', 'countdown'], element.type)"
@click="appendTag(index, 'response_body')">{{element.label}}</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'submission_ref_for_response_body')">
{{trans('messages.submission_numbering')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'ref_num_qr_code_for_response_body')">
{{trans('messages.qr_code_for_ref_num')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
<button type="button"
class="btn btn-primary btn-sm xs mr-2 mt-2"
@click="appendTag(1, 'ref_num_bar_code_for_response_body')">
{{trans('messages.bar_code_for_ref_num')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-html="true" :title="trans('messages.works_if_enabled_in_settings')"></i>
</button>
</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.pdf')}}
</label>
<div class="col-sm-10">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="auto_response_attach_pdf" value="1" name="auto_response_attach_pdf" v-model="emailConfig.auto_response.attach_pdf">
<label class="custom-control-label" for="auto_response_attach_pdf">
{{trans('messages.attach_pdf')}}
</label>
<i class="fas fa-info-circle text-info" data-toggle="tooltip" data-html="true" :title="trans('messages.pdf_of_submitted_data_will_be_attached_to_mail')"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header bg-success" id="headingSMTP">
<h2 class="mb-0">
<button class="btn btn-link text-white" type="button" data-toggle="collapse" data-target="#collapseSMTP" aria-expanded="true" aria-controls="collapseSMTP">
{{trans('messages.smtp_settings')}}:
</button>
</h2>
</div>
<div id="collapseSMTP" class="collapse" aria-labelledby="headingSMTP" data-parent="#accordionEmail">
<div class="card-body">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
id="use_system_smtp"
v-model="emailConfig.smtp.use_system_smtp"
value="1">
<label class="custom-control-label" for="use_system_smtp">
{{trans('messages.use_settings_smtp')}}
</label>
</div>
<div v-show="!emailConfig.smtp.use_system_smtp">
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.host')}}<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
name="emailConfig.smtp.host"
:required="!emailConfig.smtp.use_system_smtp"
class="form-control"
v-model="emailConfig.smtp.host">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.port')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
:required="!emailConfig.smtp.use_system_smtp"
class="form-control"
name="emailConfig.smtp.port"
v-model="emailConfig.smtp.port">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.from_address')}}<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="email"
:required="!emailConfig.smtp.use_system_smtp"
class="form-control"
name="emailConfig.smtp.from_address"
v-model="emailConfig.smtp.from_address">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.from_name')}}
<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
:required="!emailConfig.smtp.use_system_smtp"
class="form-control"
name="emailConfig.smtp.from_name"
v-model="emailConfig.smtp.from_name">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.encryption')}}
</label>
<div class="col-sm-10">
<input type="text"
class="form-control"
v-model="emailConfig.smtp.encryption">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
{{trans('messages.username')}}<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
:required="!emailConfig.smtp.use_system_smtp"
class="form-control"
name="emailConfig.smtp.username"
v-model="emailConfig.smtp.username">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">{{trans('messages.password')}}<span class="error">*</span>
</label>
<div class="col-sm-10">
<input type="text"
class="form-control"
:required="!emailConfig.smtp.use_system_smtp"
name="emailConfig.smtp.password"
v-model="emailConfig.smtp.password">
</div>
</div>
<testSmtpDetails :details="emailConfig.smtp"></testSmtpDetails>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import testSmtpDetails from "./TestSmtpDetails";
export default {
props:{
emailConfig: Object,
selected_elements: Array,
settings: Object,
},
components: {
testSmtpDetails
},
created(){
this.emailToggle();
this.replyToggle();
if (_.isUndefined(this.emailConfig.email.reply_to_email)) {
this.emailConfig.email['reply_to_email'] = '';
}
},
computed: {
tags: function () {
return this.selected_elements;
}
},
methods: {
appendTag: function(index, to){
if(to == 'email_subject'){
this.emailConfig.email.subject += ' __' + this.selected_elements[index].name + '__';
} else if(to == 'email_body'){
var content = ' __' + this.selected_elements[index].name + '__';
this.emailConfig.email.body += content;
$('.submission_email_body').summernote('pasteHTML', content);
} else if(to == 'response_subject'){
this.emailConfig.auto_response.subject += ' __' + this.selected_elements[index].name + '__';
} else if(to == 'response_body'){
var content = ' __' + this.selected_elements[index].name + '__';
this.emailConfig.auto_response.body += content;
$('.autoresponse_email_body').summernote('pasteHTML', content);
} else if (to == 'submission_ref_for_email_body') {
var content = ' __' + 'submission_ref' + '__';
this.emailConfig.email.body += content;
$('.submission_email_body').summernote('pasteHTML', content);
} else if(to == 'submission_ref_for_response_body'){
var content = ' __' + 'submission_ref' + '__';
this.emailConfig.auto_response.body += content;
$('.autoresponse_email_body').summernote('pasteHTML', content)
} else if(to == 'submission_ref_for_email_subject'){
this.emailConfig.email.subject += ' __' + 'submission_ref' + '__';
} else if(to == 'submission_ref_for_response_subject'){
this.emailConfig.auto_response.subject += ' __' + 'submission_ref' + '__';
} else if(to == 'ref_num_bar_code_for_response_body'){
let content = ' __' + 'submission_ref_bar_code' + '__';
this.emailConfig.auto_response.body += content;
$('.autoresponse_email_body').summernote('pasteHTML', content);
} else if(to == 'ref_num_qr_code_for_response_body'){
let content = ' __' + 'submission_ref_qr_code' + '__';
this.emailConfig.auto_response.body += content;
$('.autoresponse_email_body').summernote('pasteHTML', content);
} else if(to == 'ref_num_bar_code_for_email_body'){
let content = ' __' + 'submission_ref_bar_code' + '__';
this.emailConfig.email.body += content;
$('.submission_email_body').summernote('pasteHTML', content);
} else if(to == 'ref_num_qr_code_for_email_body'){
let content = ' __' + 'submission_ref_qr_code' + '__';
this.emailConfig.email.body += content;
$('.submission_email_body').summernote('pasteHTML', content);
}
},
emailToggle(){
const self = this;
if(this.emailConfig.email.enable){
setTimeout(function(){
$('.submission_email_body').summernote({
height: 200,
placeholder: self.trans('messages.email_body'),
callbacks: {
onChange: function(contents, editable) {
self.emailConfig.email.body = contents;
}
}
});
}, 200);
}
},
replyToggle(){
const self = this;
if(this.emailConfig.auto_response.is_enable){
setTimeout(function(){
$('.autoresponse_email_body').summernote({
placeholder: self.trans('messages.email_body'),
height: 200,
callbacks: {
onChange: function(contents, editable) {
self.emailConfig.auto_response.body = contents;
}
}
});
}, 200);
}
}
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,806 @@
<template>
<div class="form-group" v-if="element.type == 'text'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="input-group">
<div class="input-group-prepend" v-if="element.prefix_icon && element.prefix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.prefix_icon"></i>
</span>
</div>
<input :type="element.subtype" class="form-control"
:name="element.name"
:placeholder="element.placeholder"
:class="[element.size, element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
:id="element.name"
:value="_.get(submitted_data, element.name, '')"
:data-msg-required="element.required_error_msg"
@change="$emit('apply_conditions')">
<div class="input-group-append" v-if="element.suffix_icon && element.suffix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.suffix_icon"></i>
</span>
</div>
</div>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'range'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class, 'mb-4 mt-3']"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="row">
<div class="col-sm-1">{{ element.min }}</div>
<div class="col-sm-10">
<input type="range" :name="element.name" :required="element.required && applyValidations"
:id="element.name" :min="element.min" :max="element.max" :step="element.step"
:data-orientation="element.data_orientation"
:value="_.get(submitted_data, element.name, '')"
:class="[element.conditional_class]"
v-bind="getCustomAttributes(element.custom_attributes)"
:data-msg-required="element.required_error_msg"
>
</div>
<div class="col-sm-1">{{ element.max }}</div>
</div>
<b>
<output :class="element.name" style="display: block;text-align:center;" :for="element.name">
{{ _.get(submitted_data, element.name, '') }}
</output>
</b>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div class="form-group" v-else-if="element.type == 'calendar'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()"
@mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="input-group date" :id="element.name" data-target-input="nearest">
<div class="input-group-prepend"
:data-target="'#' + element.name"
data-toggle="datetimepicker"
v-if="element.prefix_icon && element.prefix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.prefix_icon"></i>
</span>
</div>
<input type="text"
class="form-control datetimepicker-input"
:data-target="'#' + element.name"
data-toggle="datetimepicker"
:name="element.name"
:id="element.name"
readonly
:class="[element.size, element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getCustomAttributes(element.custom_attributes)"
:data-msg-required="element.required_error_msg"
:disabled="actionBy === 'user'"
/>
<div class="input-group-append"
:data-target="'#' + element.name"
data-toggle="datetimepicker"
v-if="element.suffix_icon && element.suffix_icon !== 'none'">
<div class="input-group-text">
<i :class="'fas ' + element.suffix_icon"></i>
</div>
</div>
</div>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div class="form-group" v-else-if="element.type == 'textarea'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="input-group">
<div class="input-group-prepend" v-if="element.prefix_icon && element.prefix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.prefix_icon"></i>
</span>
</div>
<textarea class="form-control"
:value="_.get(submitted_data, element.name, '')"
:rows="element.rows"
:name="element.name"
:id="element.name"
:cols="element.columns"
:placeholder="element.placeholder"
:class="[element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
@change="$emit('apply_conditions')"
:data-msg-required="element.required_error_msg"
></textarea>
<div class="input-group-append" v-if="element.suffix_icon && element.suffix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.suffix_icon"></i>
</span>
</div>
</div>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div class="form-group"
v-else-if="element.type == 'radio' || element.type == 'checkbox'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="row">
<div :class="[spreadColumnForElement(element)]"
v-for="(option, index) in element.options.split('\n')">
<div class="custom-control" :class="[element.type == 'radio' ? 'custom-radio' : 'custom-checkbox']">
<input class="custom-control-input"
:type="element.type"
:value="option"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
:required="element.required && applyValidations"
:name="(element.type == 'checkbox' ? element.name + '[]' : element.name)"
:id="element.name +'_'+ index"
@change="$emit('apply_conditions')"
:checked="_.includes(_.get(submitted_data, element.name, ''), option)"
:class="[element.conditional_class]"
:data-msg-required="element.required_error_msg"
>
<label class="custom-control-label" :for="element.name +'_'+ index">
{{ option }}
</label>
</div>
</div>
</div>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div class="form-group" v-else-if="element.type == 'dropdown'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="input-group">
<div class="input-group-prepend" v-if="element.prefix_icon && element.prefix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.prefix_icon"></i>
</span>
</div>
<select class="custom-select" :class="[element.size, element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
:id="element.name" :multiple="element.multiselect"
:name="(element.multiselect == true ? element.name + '[]' : element.name)"
@change="$emit('apply_conditions')"
:data-msg-required="element.required_error_msg"
>
<option v-for="option in element.options.split('\n')"
:selected="_.includes(_.get(submitted_data, element.name, ''), option)"
>
{{ option }}
</option>
</select>
<div class="input-group-append" v-if="element.suffix_icon && element.suffix_icon !== 'none'">
<span class="input-group-text">
<i :class="'fas ' + element.suffix_icon"></i>
</span>
</div>
</div>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'heading'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<div
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + element.content + '</' + element.tag + '>'"
:class="[element.custom_class]">
</div>
</div>
<div v-else-if="element.type == 'file_upload'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" class="mb-3">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="dropzone" :class="[element.custom_class]" :id="element.name"
v-bind="getCustomAttributes(element.custom_attributes)">
</div>
<input type="hidden" :name="element.name + '[]'" :id="element.name"
:value="_.get(submitted_data, element.name, '')" :required="element.required && applyValidations"
:class="element.conditional_class" :data-msg-required="element.required_error_msg">
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'text_editor'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<textarea :id="element.name" :name="element.name"
:required="element.required && applyValidations" class="form-control summer_note"
:class="[element.conditional_class]"
:value="_.get(submitted_data, element.name, '')"
v-bind="getCustomAttributes(element.custom_attributes)"
:data-msg-required="element.required_error_msg"
>
</textarea>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'terms_and_condition'" class="pt-3 mb-3"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" :name="element.name" id="terms_and_condition"
:required="element.required && applyValidations"
:class="[element.custom_class, element.conditional_class]" @change="$emit('apply_conditions')"
:checked="_.includes(['on'], _.get(submitted_data, element.name, ''))"
v-bind="getCustomAttributes(element.custom_attributes)"
:data-msg-required="element.required_error_msg"
>
<label class="custom-control-label" for="terms_and_condition">
<a :href="element.link" target="_blank" v-if="element.link">
{{ element.label }}
</a>
<span v-else>{{ element.label }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
</div>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'hr'" :class="[element.extras.showConfigurator ? 'active_element' : '']"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<hr :style="{'margin-top' : element.padding_top + 'px', 'margin-bottom' : element.padding_bottom + 'px', 'border-top' : element.border_size + 'px ' + element.border_type + element.border_color, 'margin-left' : element.horizontal_space + 'px', 'margin-right' : element.horizontal_space + 'px'}">
</div>
<div v-else-if="element.type == 'html_text'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span v-html="element.html_text" :class="element.custom_class"></span>
</div>
<div class="form-group" v-else-if="element.type == 'rating'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<input :id="element.name" :name="element.name"
class="star_rating" :data-stars="element.stars_to_display"
:data-min="element.min_rating" :data-max="element.max_rating"
:data-step="element.increment" :dir="element.direction"
:data-size="element.size"
type="hidden"
:required="element.required && applyValidations"
:data-msg-required="element.required_error_msg"
:class="element.conditional_class"
:value="_.get(submitted_data, element.name, '')"
>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'switch'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<div class="form-group">
<span class="switch" :class="element.size">
<input type="checkbox" class="switch" :name="element.name" :id="element.name"
:required="element.required && applyValidations" @change="$emit('apply_conditions')"
:class="element.conditional_class"
:checked="_.includes(['on'], _.get(submitted_data, element.name, ''))"
v-bind="getCustomAttributes(element.custom_attributes)"
:data-msg-required="element.required_error_msg"
>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
</span>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
</div>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<div v-else-if="element.type == 'signature'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
:data-target="`#${element.name}_modal`"></i>
</label>
<div class="form-group">
<canvas :id="element.name" width="300" height="200" class="signature-pad"
v-bind="getCustomAttributes(element.custom_attributes)">
</canvas>
<input type="hidden" :name="element.name" :id="'output_'+element.name"
:value="_.get(submitted_data, element.name, '')" :required="element.required && applyValidations"
:class="[element.conditional_class, 'signature']"
:data-msg-required="element.required_error_msg">
</div>
<div class="form-text">
<span :id="'clear_' + element.name" class="pointer mr-4" :title="trans('messages.clear_signature_pad')"
:data-name="element.name">
<i class="far fa-times-circle"></i>
{{ trans('messages.clear') }}
</span>
<span :id="'undo_' + element.name" class="pointer" :title="trans('messages.undo')"
:data-name="element.name">
<i class="fas fa-undo"></i>
{{ trans('messages.undo') }}
</span>
<small class="form-text text-muted" v-if="element.help_text">
{{ element.help_text }}
</small>
</div>
<popover-help-text-modal
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable && element.popover_help_text.content"
:element="element"
></popover-help-text-modal>
</div>
<!-- page break -->
<div v-else-if="_.includes(['page_break'], element.type) && !applyValidations"
:class="[element.extras.showConfigurator ? 'active_element' : '']"
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<div class="divider divider-secondary divider-dashed">
<div class="divider-text">
{{ trans('messages.page_break') }}
</div>
</div>
</div>
<!-- /page break -->
<!-- youtube -->
<div v-else-if="element.type == 'youtube'"
class="mt-25 mb-25"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
<div class="col-md-12">
<iframe :src="getYtEmbedUrl(element.iframe_url)"
:id="element.name"
:name="element.label" :title="element.label"
:class="[element.custom_class, element.conditional_class]"
:width="`${element.width}%`"
:height="`${element.height}`"
frameborder="0"
style="max-width: 100%;"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
</div>
<!-- /youtube -->
<!-- iframe -->
<div v-else-if="element.type == 'iframe'"
class="mt-25 mb-25"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
<div :class="['col-md-12']">
<iframe :src="element.iframe_url"
:id="element.name"
:name="element.label" :title="element.label"
:class="[element.custom_class, element.conditional_class]"
:width="`${element.width}%`"
:height="`${element.height}`"
frameborder="0"
style="max-width: 100%;">
</iframe>
</div>
</div>
<!-- /iframe -->
<!-- pdf -->
<div v-else-if="element.type == 'pdf'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
class="col-md-12" @mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
<div class="text-center col-md-12">
<iframe
v-if="!_.isEmpty(element.pdf)"
:src="`${MEDIA_URL}/${element.pdf}`"
:id="element.name"
:name="element.label" :title="element.label"
:class="[element.custom_class, element.conditional_class]"
:width="`${element.width}%`"
:height="`${element.height}`"
frameborder="0"
style="max-width: 100%;"
>
</iframe>
<img v-if="_.isEmpty(element.pdf)" class="img-fluid" :src="PDF_PLACEHOLDER">
</div>
</div>
<!-- /pdf -->
<!-- countdown -->
<div v-else-if="element.type == 'countdown'"
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class, 'row']"
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
<div class="col-md-12">
<div :class="[element.custom_class, element.conditional_class]">
<span :id="element.name" class="max-width-100">
</span>
</div>
</div>
</div>
<!-- /countdown -->
</template>
<script>
import PopoverHelpTextModal from './Shared/PopoverHelpText.vue';
export default {
props: {
element: Object,
settings: Object,
applyValidations: {
type: Boolean,
default: true //If passed false then validation will not be applied to field. Used while creating forms
},
submitted_data: Object,
action: String | null,
actionBy: String | null
},
components: {
PopoverHelpTextModal
},
data() {
return {
display_handler: 'hide',
PDF_PLACEHOLDER: APP.PDF_PLACEHOLDER,
MEDIA_URL: APP.APP_MEDIA_URL
}
},
mounted() {
this.$eventBus.$emit('callApplyConditions');
},
created() {
const self = this;
var field = self.element;
var notification_position = self.settings.notification.position;
//if spread to col option is undefined for element set to default
if (
_.includes(['radio', 'checkbox'], self.element.type) &&
_.isUndefined(self.element.spread_to_col)
) {
self.element.spread_to_col = {
enable: (!_.isUndefined(self.element.inline) && self.element.inline) ? true : false,
column: 2
};
}
$(function () {
$(".modal_trigger").on("click", function () {
let modal_id = $(this).attr('data-target');
$(modal_id).modal('toggle');
});
//input range
if (field.type == 'range') {
initialize_rangeslider(field.name);
//on change of range silder call applyConditions through event
$('#' + field.name).on('change', function () {
self.$eventBus.$emit('callApplyConditions');
});
}
//datetime picker
if (field.type == 'calendar') {
initialize_datetimepicker(field.name, _.get(self.submitted_data, field.name, ''), field.start_date, field.end_date, field.format, field.time_format, field.disabled_days, field.enable_time_picker, field.time_picker_inline);
//on change of dateTimePicker call applyConditions through event
$('#' + field.name).on('change.datetimepicker', function () {
self.$eventBus.$emit('callApplyConditions');
});
}
if (field.type == 'file_upload') {
initialize_dropzone(field.name, field.upload_text, field.no_of_files, field.file_size_limit, field.allowed_file_type);
}
if (field.type == 'text_editor') {
initialize_text_editor(field.name, field.placeholder, field.editor_height);
}
if (field.type == 'rating') {
initialize_star_rating(field.name);
//on change of star rating call applyConditions through event
$('#' + field.name).on('rating:change', function (event, value) {
self.$eventBus.$emit('callApplyConditions');
});
}
if (field.type == 'signature') {
initialize_signature_pad(field.name);
}
if (field.type == 'countdown') {
initialize_countdowntimer(field);
}
initializeToastrSettingsForForm(notification_position);
});
},
methods: {
getDynamicallyGeneratedAttributeObj(validations, attributes) {
var rules = [];
if (this.applyValidations) {
_.forEach(validations, function (validation) {
var rule = 'data-rule-' + validation.rule;
var error_msg = 'data-msg-' + validation.rule;
var is_rule_required = validation.value ? validation.value : true;
rules.push({[rule]: is_rule_required, [error_msg]: validation.error_msg});
});
}
let custom_attr = this.getCustomAttributes(attributes);
let validation_rules = Object.assign({}, ...rules);
return {...validation_rules, ...custom_attr};
},
onMouseHover() {
if (!this.applyValidations) {
this.display_handler = '';
}
},
onMouseLeave(element) {
if (!this.applyValidations) {
this.display_handler = 'hide';
}
},
/**
* get col size for
* checkbox & radio
**/
spreadColumnForElement(element) {
let total_columns = 12;
let spread = (parseInt(element.spread_to_col.column) <= 4 ? parseInt(element.spread_to_col.column) : 4) || 2;
let default_column = 12;
if (element.spread_to_col.enable) {
default_column = _.floor(total_columns / spread);
}
return `col-md-${default_column}`;
},
getYtEmbedUrl(url) {
if (url.search("watch") != -1) {
let YT_ID = url.replace("https://www.youtube.com/watch?v=", "");
return `https://www.youtube.com/embed/${YT_ID}`;
} else if (url.search("youtu.be") != -1) {
let YT_ID = url.replace("https://youtu.be/", "");
return `https://www.youtube.com/embed/${YT_ID}`;
} else if (url.search("embed") != -1) {
let YT_ID = url.replace("https://www.youtube.com/embed/", "");
return `https://www.youtube.com/embed/${YT_ID}`;
}
},
}
}
</script>
<style scoped>
.active_element {
padding: 15px;
cursor: pointer;
-webkit-box-shadow: 0px 0px 0px 2px #0293e2;
box-shadow: 0px 0px 0px 2px #0293e2;
border-radius: 10px;
}
.hide {
display: none;
}
.show {
display: block;
}
</style>

View File

@@ -0,0 +1,774 @@
<template>
<div class="row mt-3">
<div class="col-md-2" id="tour_step_1">
<div class="element-sidebar">
<div class="card">
<div class="card-header">
<p class="card-title">{{trans('messages.elements')}}</p>
</div>
<div class="collapse show" id="basicElements">
<div class="card-body pr-1 pl-1 elements_sidebar_height">
<draggable class="dragArea list-group"
:list="basic_elements"
:group="{ name: 'element', pull: 'clone', put: false }"
:clone="cloneElement"
:sort="false"
@change="change"
>
<div class="list-group-item"
v-for="element in basic_elements"
:key="element.type"
>
<button type="button"
class="btn btn-primary btn-block"
:class="[(_.includes(['card_form'], settings.layout) && _.includes(['page_break'], element.type)) ? '' : 'hvr-grow']"
:title="element.tooltip"
:disabled="_.includes(['card_form'], settings.layout) && _.includes(['page_break'], element.type)">
<i class="mt-1 mb-1" :class="'float-left fas fa-' + element.display_icon"></i>
{{ element.label }}
<i
v-if="_.includes(['card_form'], settings.layout) && _.includes(['page_break'], element.type)"
class="fas fa-info-circle float-right mt-1 mb-1"
data-toggle="tooltip"
:title="trans('messages.page_break_disabled')"></i>
</button>
</div>
</draggable>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-7" :style="{'background-color': settings.color.page_color, 'padding':`10px`}">
<div class="card scrollableCard" :style="{'background': getBackgroundStyle(), 'background-image':`${backgroundImg}`}" style="height: 100%;" id="tour_step_2">
<div class="text-center mt-2" v-if="selected_elements.length == 0">
<h5>{{trans('messages.pls_add_element')}}</h5>
</div>
<draggable
class="dragArea card-body"
:list="selected_elements"
group="element"
handle=".handle"
@change="change"
:animation="200"
>
<transition-group
name="custom-classes-transition"
enter-active-class="animated zoomIn"
leave-active-class="animated fadeOut"
tag="div"
class="row"
:class="[(selected_elements.length < 3) ? 'transition-card-body' : '']">
<div
v-for="(element, index) in selected_elements"
:key="element.id"
:class="element.col"
@click="toggleConfigurator(index, true)"
>
<fieldGenerator
:element="element"
:settings="settings"
:applyValidations="applyValidations"
action=""
></fieldGenerator>
<div class="element-config-action-btn float-right"
v-show="element.extras.showConfigurator">
<p>
<button type="button"
v-if="!_.includes(['page_break'], element.type)"
class="btn btn-xs btn-secondary"
:title="trans('messages.properties')"
@click="openElementConfigurator()">
<i class="fas fa-cog"></i>
</button>
</p>
<p>
<button type="button"
class="btn btn-xs btn-danger"
:title="trans('messages.remove')"
@click="deleteElement(index)">
<i class="far fa-trash-alt"></i>
</button>
</p>
</div>
</div>
</transition-group>
</draggable>
</div>
</div>
<div class="col-md-3" id="tour_step_3">
<div class="element-sidebar">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link" id="formDetails-tab" data-toggle="tab" href="#formDetails" role="tab" :class="isConfiguratorOpen ? '' : 'active'" aria-controls="formDetails" aria-selected="true">
{{ trans('messages.form') }}
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="configuration-tab" :class="isConfiguratorOpen ? 'active' : ''" data-toggle="tab" href="#configuration" role="tab" aria-controls="configuration" aria-selected="false">
{{ trans('messages.element_configuration') }}
</a>
</li>
</ul>
<div class="tab-content" id="tab_content" role="tabpanel">
<div class="tab-pane fade" :class="isConfiguratorOpen ? '' : 'active show'" id="formDetails" role="tabpanel" aria-labelledby="formDetails-tab">
<div class="card mt-1 configurator_form_height">
<div class="card-body">
<div class="row">
<div class="col-md-12 mb-2">
<label>
{{ trans('messages.form_name') }}
<span class="error">*</span>
</label>
<input type="text" class="form-control"
v-model="form.name" required @change="generateFormSlug(form.name)">
</div>
</div>
<div class="row">
<div class="col-md-12 mb-2">
<label for="form_slug">
{{ trans('messages.form_slug') }}
<span class="error">*</span>
</label>
<input type="text" class="form-control"
v-model="form_slug" required readonly>
</div>
</div>
<div class="row mb-1">
<div class="col-md-12">
<label>
{{ trans('messages.form_description') }}
</label>
<input type="text" class="form-control" v-model="form.description">
</div>
</div>
<form-layout
:selected_elements="selected_elements"
:settings="settings">
</form-layout>
<div class="row">
<!-- form custom attribute -->
<div class="col-md-12" v-if="form_custom_attributes.length">
<hr>
<label>{{trans('messages.custom_attributes')}}</label>
</div>
<div class="row form_custom_attr_field" v-for="(form_custom_attribute, index) in form_custom_attributes">
<div class="col-md-10">
<div class="input-group">
<input type="text" class="form-control" v-model="form_custom_attribute.key" :placeholder="trans('messages.key')">
<input type="text" class="form-control" v-model="form_custom_attribute.value" :placeholder="trans('messages.value')">
</div>
</div>
<div class="col-md-2">
<button type="button" class="btn btn-danger btn-sm" @click="removeAttribute(index)">
<i class="fas fa-trash-alt"></i>
</button>
</div>
</div>
<button type="button" class="btn btn-sm btn-info" @click="addMoreAttribute" style="margin: 28px;">
<i class="fas fa-plus-circle"></i>
{{trans('messages.add_form_custom_attribute')}}
</button>
</div>
</div>
</div>
</div>
<div class="tab-pane fade mb-2" :class="isConfiguratorOpen ? 'active show' : ''" id="configuration" role="tabpanel" aria-labelledby="configuration-tab">
<template v-for="(element, index) in selected_elements"
v-if="element.extras.showConfigurator && isConfiguratorOpen">
<fieldConfigurator
v-if="!_.includes(['page_break'], element.type)"
:key="element.id"
:element="element"
:index="index"
:selected_elements="selected_elements"
v-on:toggleConfigurator="toggleConfiguratorEvent"
v-on:deleteElement="deleteElement"
></fieldConfigurator>
<div
v-if="_.includes(['page_break'], element.type)"
class="mt-1 ml-3">
{{ trans('messages.no_config_option') }}
</div>
</template>
<div v-if="!isConfiguratorOpen">
<div class="mt-1 ml-3">
{{ trans('messages.pls_add_element_to_configure') }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import draggable from "../../../node_modules/vuedraggable";
import fieldGenerator from "./FieldGenerator";
import fieldConfigurator from "./FieldConfigurator";
import ElementDetails from "./ElementDetails";
import FormLayout from "./Shared/Layout";
let idGlobal = 0;
export default {
props:{
selected_elements: Array,
settings:Object,
form:Array,
placeholder_img:String,
form_custom_attributes: Array
},
components: {
draggable,
fieldGenerator,
fieldConfigurator,
ElementDetails,
FormLayout
},
data(){
const self = this;
return {
applyValidations: false,
basic_elements: [
{ type: 'text',
subtype:'text',
label: self.trans('messages.input'),
help_text: '',
display_icon: 'grip-lines',
prefix_icon: 'none',
suffix_icon: 'none',
placeholder:'',
size:'',
custom_class:'',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.text_tooltip'),
popover_help_text:{
enable: false,
content: ''
},
allowed_input:{
values:'',
error_msg: 'This value is not allowed.'
}
},
{ type: 'textarea',
label: self.trans('messages.textarea'),
help_text: '',
display_icon: 'list',
prefix_icon: 'none',
suffix_icon: 'none',
rows: 3,
columns:'',
placeholder:'',
custom_class:'',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.textarea_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'dropdown',
label: self.trans('messages.dropdown'),
help_text: '',
display_icon: 'caret-square-down',
prefix_icon: 'none',
suffix_icon: 'none',
options:'Option-1\nOption-2',
size:'',
custom_class:'',
conditional_class:'',
multiselect:false,
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.dropdown_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'radio',
label: self.trans('messages.radio'),
help_text: '',
spread_to_col: {
enable: false,
column: 2
},
display_icon: 'dot-circle',
options:'Option-1\nOption-2',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.radio_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'checkbox',
label: self.trans('messages.checkbox'),
help_text: '',
spread_to_col: {
enable: false,
column: 2
},
display_icon: 'check-circle',
options:'Option-1\nOption-2',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.checkbox_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'heading',
label: self.trans('messages.heading_paragrahp'),
tag: 'h1',
text_color: '#212529',
content: 'Click to change it',
display_icon: 'heading',
col:'col-md-12',
tooltip: self.trans('messages.heading_paragrahp_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'range',
label: self.trans('messages.range'),
help_text: '',
display_icon: 'arrows-alt-h',
min:1,
max:10,
step:1,
data_orientation:'horizontal',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.range_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'calendar',
label: self.trans('messages.datetime'),
help_text: '',
size:'',
display_icon: 'calendar-alt',
prefix_icon: 'none',
suffix_icon: 'none',
custom_class:'',
start_date:'none',
end_date:'none',
format:'MM-DD-YYYY',
disabled_days:[],
enable_time_picker:false,
time_format:'12',
time_picker_inline:false,
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.datetime_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'file_upload',
label: self.trans('messages.file_upload'),
help_text:'',
display_icon: 'upload',
upload_text: self.trans('messages.drop_a_file_here'),
no_of_files:'1',
send_as_email_attachment: false,
file_size_limit: 5,
file_type:'all',
allowed_file_type:'',
custom_class:'',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.file_upload_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'text_editor',
label: self.trans('messages.text_editor'),
placeholder: self.trans('messages.jot_down_here'),
help_text:'',
display_icon: 'keyboard',
editor_height: 150,
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.text_editor_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'terms_and_condition',
label: self.trans('messages.terms_condition'),
link: '',
display_icon: 'file-signature',
custom_class: '',
conditional_class:'',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.terms_condition_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'rating',
label: self.trans('messages.rating'),
display_icon: 'star',
conditional_class:'',
stars_to_display:5,
min_rating:0,
max_rating:5,
increment:0.5,
direction:'ltr',
size:'md',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.rating_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'switch',
label: self.trans('messages.switch'),
display_icon: 'toggle-off',
conditional_class: '',
help_text:'',
size:'switch',
col:'col-md-12',
custom_attributes:[],
tooltip: self.trans('messages.switch_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'hr',
label: self.trans('messages.horizontal_line'),
padding_top:1,
padding_bottom:1,
border_size:1,
horizontal_space: 0,
border_type:'solid',
border_color:'#0a0a0a',
display_icon: 'window-minimize',
col:'col-md-12',
tooltip: self.trans('messages.hr_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'html_text',
label: self.trans('messages.html_text'),
html_text:'Write Something..',
display_icon: 'code',
custom_class: '',
col:'col-md-12',
tooltip: self.trans('messages.html_text_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'signature',
label: self.trans('messages.signature'),
display_icon: 'signature',
col: 'col-md-12',
html_text:'',
custom_class:'',
custom_attributes:[],
tooltip: self.trans('messages.signature_tooltip'),
popover_help_text:{
enable: false,
content: ''
}
},
{
type: 'page_break',
label: self.trans('messages.page_break'),
label_align: 'top',
display_icon: 'cut',
col:'col-md-12',
tooltip: '',
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'youtube',
label: self.trans('messages.youtube'),
display_icon: 'video',
custom_class:'',
conditional_class:'',
col:'col-md-12',
tooltip: '',
iframe_url:'',
width: 100,
height: 350,
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'iframe',
label: self.trans('messages.iframe_embed'),
display_icon: 'crop-alt',
custom_class:'',
conditional_class:'',
col:'col-md-12',
iframe_url:'https://www.lipsum.com',
iframe_align: 'left',
css: '',
width: 100,
height: 400,
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'pdf',
label: self.trans('messages.pdf_embedder'),
display_icon: 'file-pdf',
custom_class:'',
conditional_class:'',
col:'col-md-12',
tooltip: '',
pdf:'',
width: 100,
height: 350,
popover_help_text:{
enable: false,
content: ''
}
},
{ type: 'countdown',
label: self.trans('messages.countdown'),
display_icon: 'hourglass-start',
custom_class: '',
conditional_class: '',
col: 'col-md-12',
tooltip: '',
seconds: 0,
minutes: 0,
hours: 1,
labels_format : true,
size: 'lg',
border_color: '#F0068E',
font_color: '#FFFFFF',
bg_color: '#000000',
time_separator: ':',
display_format: 'HMS',
popover_help_text:{
enable: false,
content: ''
}
}
],
isConfiguratorOpen: false,
form_slug: ''
}
},
computed:{
backgroundImg() {
if (this.selected_elements.length == 0) {
return 'url(' + this.placeholder_img +')';
} else {
return '';
}
}
},
created() {
if (this.selected_elements.length > 0) {
var ids = [];
_.forEach(this.selected_elements, function(element) {
ids.push(element.id);
});
var id = _.max(ids);
idGlobal = ++id;
}
this.form_slug = this.form.slug;
},
methods: {
addMoreAttribute() {
var custom_attribute = {'key':'', 'value':''};
this.form_custom_attributes.push(custom_attribute);
},
removeAttribute(index) {
this.form_custom_attributes.splice(index, 1);
},
getBackgroundStyle() {
if (this.settings.background.bg_type !== 'bg_image') {
return this.settings.color.background;
} else {
return '';
}
},
change: function(evt) {
window.console.log(evt);
if(evt.added != undefined){
//find index of an added element
var index = this.selected_elements.indexOf(evt.added.element);
this.toggleConfigurator(index, true);
//add field for col visibility in datatable
if (!_.includes(['terms_and_condition', 'heading', 'hr', 'html_text', 'page_break', 'youtube', 'iframe', 'pdf', 'countdown'], evt.added.element.type)) {
this.settings.form_data.col_visible.push(evt.added.element.name);
}
}
},
cloneElement(element_details) {
var details_cloned = _.clone(element_details);
var data = {
id: idGlobal++,
name: 'field_' + idGlobal,
extras: {showConfigurator: false}
};
_.unset(details_cloned, 'id');
_.unset(details_cloned, 'name');
_.unset(details_cloned, 'display_icon');
_.unset(details_cloned, 'tooltip');
var output = _.merge(data, details_cloned);
output['required'] = false;
output['required_error_msg'] = 'This field is required';
output['validations'] = [];
return output;
},
toggleConfigurator(index, show) {
//Check if any previously open, then close it
const self = this;
if(show == true){
_.forEach(this.selected_elements, function(value, key) {
self.selected_elements[key].extras.showConfigurator = false;
});
}
this.selected_elements[index].extras.showConfigurator = show;
},
toggleConfiguratorEvent(values){
this.toggleConfigurator(values.index, values.show);
this.openElementConfigurator();
},
openElementConfigurator() {
this.isConfiguratorOpen = !this.isConfiguratorOpen
},
deleteElement(index) {
const self = this;
Swal.fire({
title: self.trans("messages.are_you_sure"),
text: self.trans("messages.you_wont_be_able_to_revert"),
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: self.trans("messages.yes_remove_it"),
}).then((result) => {
if (result.isConfirmed) {
let element = self.selected_elements[index];
let deletedElementIndex = self.settings.form_data.col_visible.indexOf(element.name);
self.selected_elements.splice(index, 1);
self.isConfiguratorOpen = false;
if (deletedElementIndex != '-1') {
self.settings.form_data.col_visible.splice(index, 1);
}
}
});
},
generateFormSlug(name) {
const self = this;
axios
.get('/generate-form-slug', {
params:{
name: name,
}
})
.then(function(response) {
self.form.slug = response.data;
self.form_slug = self.form.slug;
}).catch(function(error) {
console.log(error);
});
}
}
}
</script>
<style scoped>
.scrollableCard{
display: flex;
flex-direction: column;
height: 200vh;
min-height: 392px;
padding-right: 25px;
padding-left: 15px;
}
#tab_content {
border-right: 1px solid #d2e3f5;
border-left: 1px solid #d2e3f5;
border-bottom: 1px solid #d2e3f5;
}
.card-title{
font-size: 1rem !important;
}
.list-group-item{
border: 0px !important;
padding-left: 0.25rem !important;
padding-right: 0.25rem !important;
}
.element-sidebar{
position: -webkit-sticky;
position: sticky;
top: 0rem;
height: 58vh;
}
.elements_sidebar_height{
overflow-y: auto;
max-height: 58vh;
}
.configurator_form_height {
overflow-y: auto;
max-height: 58vh;
}
#formDetails {
height : 58vh;
}
.transition-card-body{
min-height: 392px;
}
</style>

View File

@@ -0,0 +1,104 @@
<template>
<div class="mt-3">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
id="mailchimp_is_enable"
v-model="details.is_enable"
value="1">
<label class="custom-control-label" for="mailchimp_is_enable">
{{trans('messages.enable')}}
</label>
</div>
<div v-if="details.is_enable">
<div class="text-left text-muted">
<small>{{trans('messages.not_in_downloaded_code')}}</small><br/>
</div>
<div class="form-group row">
<label for="site_key" class="col-sm-3 col-form-label">{{trans('messages.mailchimp_api_key')}}:
<span class="error">*</span></label>
<div class="col-sm-9">
<input type="text" class="form-control"
id="mailchimp_api_key"
:placeholder="trans('messages.mailchimp_api_key')"
name="details.api_key"
:required="details.is_enable"
v-model="details.api_key">
<small class="form-text text-muted" v-html="trans('messages.mailchimp_api_key_help')"></small>
</div>
</div>
<div class="form-group row">
<label for="site_key" class="col-sm-3 col-form-label">{{trans('messages.mailchimp_list_id')}}:
<span class="error">*</span></label>
<div class="col-sm-9">
<input type="text" class="form-control"
id="mailchimp_list_id"
:placeholder="trans('messages.mailchimp_list_id')"
name="details.list_id"
:required="details.is_enable"
v-model="details.list_id">
<small class="form-text text-muted" v-html="trans('messages.mailchimp_list_id_help')"></small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.mailchimp_subscription_status')}}
<span class="error">*</span>
</label>
<div class="col-sm-9">
<select class="form-control"
:required="details.is_enable"
name="details.status"
v-model="details.status">
<option value="subscribe_pending">{{trans('messages.mailchimp_subscribe_confirm')}}</option>
<option value="subscribe">{{trans('messages.mailchimp_subscribe')}}</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.email')}}
<span class="error">*</span>
</label>
<div class="col-sm-9">
<select class="form-control"
:required="details.is_enable"
name="details.email_field"
v-model="details.email_field">
<option :value="element.name"
v-if="_.includes(['text', 'email'], element.type)"
v-for="element in selected_elements">{{element.label}}</option>
</select>
<small class="form-text text-muted">{{trans('messages.mailchimp_email_help')}}</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.name')}}
</label>
<div class="col-sm-9">
<select class="form-control"
name="details.name_field"
v-model="details.name_field">
<option :value="element.name"
v-if="_.includes(['text', 'email'], element.type)"
v-for="element in selected_elements">{{element.label}}</option>
</select>
<small class="form-text text-muted">{{trans('messages.mailchimp_name_help')}}</small>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['details', 'selected_elements'],
}
</script>

View File

@@ -0,0 +1,925 @@
<template>
<div class="mt-3">
<!-- reCAPTCHA settings -->
<h5 class="text-primary">
{{trans('messages.google_recaptcha_settings')}}:
</h5>
<div class="form-group">
<div class="col-sm offset-3 col-sm-9">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" value="1" id="enable_recaptcha" name="enable_recaptcha" v-model="settings.recaptcha.is_enable">
<label class="custom-control-label" for="enable_recaptcha">
{{trans('messages.add_google_recaptcha')}}
</label>
</div>
</div> <br>
<div class="form-group row" v-if="settings.recaptcha.is_enable">
<label for="site_key" class="col-sm-3 col-form-label">
{{trans('messages.site_key')}}
<span class="error">*</span></label>
<div class="col-sm-9">
<input type="text" class="form-control" id="site_key" :placeholder="trans('messages.enter_site_key')"
name="settings.recaptcha.site_key"
:required="settings.recaptcha.is_enable"
v-model="settings.recaptcha.site_key">
</div>
</div>
<div class="form-group row" v-if="settings.recaptcha.is_enable">
<label for="secret_key" class="col-sm-3 col-form-label">
{{trans('messages.secret_key')}}<span class="error">*</span></label>
<div class="col-sm-9">
<input type="text" name="settings.recaptcha.secret_key" class="form-control" id="secret_key" :placeholder="trans('messages.enter_secret_key')" v-model="settings.recaptcha.secret_key"
:required="settings.recaptcha.is_enable">
<small id="help_text" class="form-text text-muted">
{{trans('messages.secret_key_help_text')}}
<a href="https://www.google.com/recaptcha/admin" target="_blank">{{trans('messages.click_here')}}</a> {{trans('messages.to_create')}}
</small>
</div>
</div>
</div>
<!-- Design settings -->
<h5 class="text-primary">{{trans('messages.design_settings')}}:</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.theme')}}
</label>
<div class="col-sm-9">
<select class="custom-select" aria-describedby="theme" v-model="settings.theme">
<option v-for="(theme, index) in themes" :value="theme.key" :key="index">
{{theme.value}}
</option>
</select>
<small id="theme" class="form-text text-muted">
{{trans('messages.to_see_effect_preview_form')}}
</small>
</div>
</div>
<div class="form-group row">
<label for="label_color" class="col-sm-3 col-form-label">
{{trans('messages.label_color')}}
</label>
<div class="input-group col-sm-9">
<input type="text" class="form-control form-control-lg" name="label_color" id="label_color" v-model="settings.color.label">
<div class="input-group-append">
<span class="input-group-text">
<input type="color" v-model="settings.color.label">
</span>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label" for="error_msg_color">
{{trans('messages.error_msg_color')}}
</label>
<div class="input-group col-sm-9">
<input type="text" class="form-control form-control-lg" name="error_msg_color" id="error_msg_color" v-model="settings.color.error_msg">
<div class="input-group-append">
<span class="input-group-text">
<input type="color" v-model="settings.color.error_msg">
</span>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label" for="required_asterisk_color">
{{trans('messages.required_asterisk_color')}}
</label>
<div class="input-group col-sm-9">
<input type="text" class="form-control form-control-lg" name="required_asterisk_color" id="required_asterisk_color" v-model="settings.color.required_asterisk_color">
<div class="input-group-append">
<span class="input-group-text">
<input type="color" v-model="settings.color.required_asterisk_color">
</span>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label" for="page_color">
{{trans('messages.page_color')}}
</label>
<div class="input-group col-sm-9">
<input type="text" class="form-control form-control-lg" name="page_color" id="page_color" v-model="settings.color.page_color">
<div class="input-group-append">
<span class="input-group-text">
<input type="color" v-model="settings.color.page_color">
</span>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.form_background_setting')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" name="settings.bg_settings" type="radio" id="bg_color" :value="'bg_color'" v-model="settings.background.bg_type">
<label class="custom-control-label" for="bg_color">
{{trans('messages.form_background_color')}}
</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" name="settings.bg_settings" type="radio" id="bg_image" :value="'bg_image'" v-model="settings.background.bg_type">
<label class="custom-control-label" for="bg_image">
{{trans('messages.form_background_image')}}
</label>
</div>
</div>
</div>
<div class="form-group row" v-show="settings.background.bg_type === 'bg_color'">
<label class="col-sm-3 col col-form-label" for="background_color">
{{trans('messages.form_background_color')}}
</label>
<div class="input-group col-sm-9">
<input type="text" name="background_color" id="background_color" class="form-control form-control-lg" v-model="settings.color.background">
<div class="input-group-append">
<span class="input-group-text">
<input type="color" v-model="settings.color.background">
</span>
</div>
</div>
</div>
<div class="form-group row" v-show="settings.background.bg_type === 'bg_image'">
<label class="col-sm-3 col col-form-label" for="background_color">
{{trans('messages.form_background_image')}}
</label>
<div class="col-sm-9 dropzone" id="fileUpload"></div>
</div>
<!-- notification settings -->
<h5 class="text-primary">
{{trans('messages.notification_setting')}}:
</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.action_after_submit')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" type="radio" id="notification_same_page" :value="same_page" name="post_submit_action" v-model="settings.notification.post_submit_action" checked>
<label class="custom-control-label" for="notification_same_page">
{{trans('messages.show_notification_in_same_page')}}
</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" name="post_submit_action" type="radio" id="notification_redirect" :value="redirect" v-model="settings.notification.post_submit_action">
<label class="custom-control-label" for="notification_redirect">
{{trans('messages.redirect_to_thank_you_page')}}
</label>
</div>
</div>
</div>
<div class="form-group row" v-show="settings.notification.post_submit_action === same_page">
<label for="success_msg" class="col-sm-3 col-form-label">
{{trans('messages.email_success_notification')}}
</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="success_msg" :placeholder="trans('messages.enter_msg')" name="success_msg" v-model="settings.notification.success_msg">
</div>
</div>
<div class="form-group row" v-show="settings.notification.post_submit_action === same_page">
<label for="failed_msg" class="col-sm-3 col-form-label">
{{trans('messages.email_failed_notification')}}
</label>
<div class="col-sm-9">
<input type="text" class="form-control"
id="failed_msg" :placeholder="trans('messages.enter_msg')"
name="failed_msg" v-model="settings.notification.failed_msg">
</div>
</div>
<div class="form-group row" v-show="settings.notification.post_submit_action === same_page">
<label for="position" class="col-sm-3 col-form-label">
{{trans('messages.display_position')}}
</label>
<div class="col-sm-9">
<select name="position" class="form-control" v-model="settings.notification.position">
<option value="toast-top-right">
{{trans('messages.top_right')}}
</option>
<option value="toast-bottom-right">
{{trans('messages.bottom_right')}}
</option>
<option value="toast-bottom-left">
{{trans('messages.bottom_left')}}
</option>
<option value="toast-top-left">
{{trans('messages.top_left')}}
</option>
<option value="toast-top-center">
{{trans('messages.top_center')}}
</option>
<option value="toast-bottom-center">
{{trans('messages.bottom_center')}}
</option>
</select>
</div>
</div>
<div class="form-group row" v-show="settings.notification.post_submit_action === same_page">
<label for="enable_qr_code" class="col-sm-3 col-form-label">
{{trans('messages.qr_code_for_submitted_data')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input"
id="enable_qr_code"
v-model="settings.is_qr_code_enabled">
<label class="custom-control-label" for="enable_qr_code">
{{trans('messages.enable')}}
<i class="fas fa-info-circle"
data-toggle="tooltip"
:title="trans('messages.qr_code_tooltip')"></i>
</label>
</div>
<small class="form-text text-muted"
v-html="trans('messages.qr_code_limit_help_text')">
</small>
</div>
</div>
<div class="form-group row"
v-if="_.includes(['same_page'], settings.notification.post_submit_action) && settings.is_qr_code_enabled">
<label for="data_format" class="col-sm-3 col-form-label">
{{trans('messages.qr_code_for_submitted_data')}} ({{trans('messages.data_format')}})
</label>
<div class="col-sm-9">
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" type="radio" id="key_value_format" value="string" name="data_format" v-model="settings.qr_code_data_format">
<label class="custom-control-label" for="key_value_format">
{{trans('messages.key_value_format')}}
</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" name="data_format" type="radio" id="json_format" value="json" v-model="settings.qr_code_data_format">
<label class="custom-control-label" for="json_format">
{{trans('messages.json_format')}}
</label>
</div>
</div>
</div>
<!-- ref num qr code -->
<div class="form-group row" v-show="settings.notification.post_submit_action === same_page">
<label for="enable_qr_code_for_ref_num" class="col-sm-3 col-form-label">
{{trans('messages.qr_code_for_ref_num')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input"
id="enable_qr_code_for_ref_num"
v-model="settings.is_ref_num_qr_code_enabled">
<label class="custom-control-label" for="enable_qr_code_for_ref_num">
{{trans('messages.enable')}}
<i class="fas fa-info-circle"
data-toggle="tooltip"
:title="trans('messages.submission_ref_qr_code_tooltip')"></i>
</label>
</div>
<small class="form-text text-muted"
v-html="trans('messages.bar_code_help_text')">
</small>
</div>
</div>
<!-- ref num bar code -->
<div class="form-group row" v-show="settings.notification.post_submit_action === same_page">
<label for="enable_bar_code_for_ref_num" class="col-sm-3 col-form-label">
{{trans('messages.bar_code_for_ref_num')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input"
id="enable_bar_code_for_ref_num"
v-model="settings.is_ref_num_bar_code_enabled">
<label class="custom-control-label" for="enable_bar_code_for_ref_num">
{{trans('messages.enable')}}
<i class="fas fa-info-circle"
data-toggle="tooltip"
:title="trans('messages.submission_ref_qr_code_tooltip')"></i>
</label>
</div>
<small class="form-text text-muted"
v-html="trans('messages.bar_code_help_text')">
</small>
</div>
</div>
<div class="form-group row" v-show="settings.notification.post_submit_action === redirect">
<label for="redirect_url" class="col-sm-3 col-form-label">
{{trans('messages.redirect_url')}}<span class="error">*</span>
</label>
<div class="col-sm-9">
<input type="text"
class="form-control"
id="redirect_url"
:placeholder="trans('messages.enter_redirect_url')"
name="settings.notification.redirect_url"
:required="settings.notification.post_submit_action === redirect"
data-rule-url="true"
v-model="settings.notification.redirect_url">
</div>
</div>
<!-- submit button settings -->
<h5 class="text-primary">
{{trans('messages.submit_btn_setting')}}
</h5>
<div class="form-group row">
<label for="btn_style" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_style')}}
</label>
<div class="col-sm-9">
<label class="btn btn-primary">
<input type="radio" name="btn_style" :value="'default'" v-model="settings.submit.btn_style"> {{trans('messages.default')}}
</label>
<label class="btn btn-outline-primary">
<input type="radio" name="btn_style" :value="'outline'" v-model="settings.submit.btn_style"> {{trans('messages.outline')}}
</label>
</div>
</div>
<div class="form-group row">
<label for="sb_btn_size" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_size')}}
</label>
<div class="col-sm-6">
<label class="btn btn-lg btn-primary">
<input type="radio" name="btn_size" :value="btn_large" v-model="settings.submit.btn_size"> {{trans('messages.large')}}
</label>
<label class="btn btn-primary">
<input type="radio" name="btn_size" :value="btn_default" v-model="settings.submit.btn_size"> {{trans('messages.medium')}}
</label>
<label class="btn btn-primary btn-sm" aria-describedby="sb_btn_size">
<input type="radio" name="btn_size" :value="btn_sm" v-model="settings.submit.btn_size"> {{trans('messages.small')}}
</label>
<small id="sb_btn_size" class="form-text text-muted">
{{trans('messages.submit_btn_size_help_text')}}
</small>
</div>
</div>
<div class="form-group row">
<label for="sb_btn_color" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_color')}}
</label>
<div class="col-sm-6" v-show="settings.submit.btn_style == 'default'">
<label class="btn">
<input type="radio" name="sb_btn_color" :value="default_value" v-model="settings.submit.btn_color"> {{trans('messages.default')}}
</label>
<label class="btn btn-primary">
<input type="radio" name="sb_btn_color" :value="primary" v-model="settings.submit.btn_color"> {{trans('messages.primary')}}
</label>
<label class="btn btn-success">
<input type="radio" name="sb_btn_color" :value="success" v-model="settings.submit.btn_color"> {{trans('messages.success')}}
</label>
<label class="btn btn-warning">
<input type="radio" name="sb_btn_color" :value="warning" v-model="settings.submit.btn_color"> {{trans('messages.warning')}}
</label>
<label class="btn btn-danger">
<input type="radio" name="sb_btn_color" :value="danger" v-model="settings.submit.btn_color" aria-describedby="sb_btn_color"> {{trans('messages.danger')}}
</label>
<small id="sb_btn_color" class="form-text text-muted">
{{trans('messages.submit_btn_color_help_text')}}
</small>
</div>
<div class="col-sm-6" v-show="settings.submit.btn_style == 'outline'">
<label class="btn">
<input type="radio" name="sb_btn_color" :value="default_value" v-model="settings.submit.btn_color"> {{trans('messages.default')}}
</label>
<label class="btn btn-outline-primary">
<input type="radio" name="sb_btn_color" :value="'btn-outline-primary'" v-model="settings.submit.btn_color"> {{trans('messages.primary')}}
</label>
<label class="btn btn-outline-success">
<input type="radio" name="sb_btn_color" :value="'btn-outline-success'" v-model="settings.submit.btn_color"> {{trans('messages.success')}}
</label>
<label class="btn btn-outline-warning">
<input type="radio" name="sb_btn_color" :value="'btn-outline-warning'" v-model="settings.submit.btn_color"> {{trans('messages.warning')}}
</label>
<label class="btn btn-outline-danger">
<input type="radio" name="sb_btn_color" :value="'btn-outline-danger'" v-model="settings.submit.btn_color" aria-describedby="sb_btn_color"> {{trans('messages.danger')}}
</label>
<small id="sb_btn_color" class="form-text text-muted">
{{trans('messages.submit_btn_color_help_text')}}
</small>
</div>
</div>
<div class="form-group row">
<label for="sb_btn_alignment" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_alignment')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-radio custom-control-inline">
<input class="custom-control-input" type="radio" id="btn_align_left" value="float-left" name="sb_btn_alignment" v-model="settings.submit.btn_alignment">
<label class="custom-control-label" for="btn_align_left">
{{trans('messages.left')}}
</label>
</div>
<div class="custom-control custom-radio custom-control-inline" aria-describedby="btn_align">
<input class="custom-control-input" name="sb_btn_alignment" type="radio" id="btn_align_right" value="float-right" v-model="settings.submit.btn_alignment">
<label class="custom-control-label" for="btn_align_right">
{{trans('messages.right')}}
</label>
</div>
<small id="btn_align" class="form-text text-muted">
{{trans('messages.submit_btn_alignment_help_text')}}
</small>
</div>
</div>
<div class="form-group row">
<label for="sb_text" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_text')}}
</label>
<div class="col-sm-9">
<input type="text" name="sb_text" class="form-control" :placeholder="trans('messages.enter_submit_btn_txt')" v-model="settings.submit.text">
</div>
</div>
<div class="form-group row">
<label for="sb_loading_text" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_loading_text')}}
</label>
<div class="col-sm-9">
<input type="text" name="sb_loading_text" class="form-control" :placeholder="trans('messages.enter_submit_btn_load_txt')" v-model="settings.submit.loading_text">
</div>
</div>
<div class="form-group row">
<label for="btn_icon" class="col-sm-3 col-form-label">
{{trans('messages.submit_btn_icon')}}
</label>
<div class="col-sm-9">
<div class="input-group">
<select id="btn_icon" class="form-control" v-model="settings.submit.btn_icon">
<option :value="'none'">None</option>
<option v-for="(icon, index) in getIcons()" :value="icon.c" :key="index">
{{icon.l}}
</option>
</select>
<select id="icon_position" class="form-control" v-model="settings.submit.icon_position">
<option :value="'left'">{{trans('messages.left')}}</option>
<option :value="'right'">{{trans('messages.right')}}</option>
</select>
</div>
</div>
</div>
<!-- form data settings -->
<h5 class="text-primary">
{{trans('messages.form_data_setting')}}
</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.column_visibility')}}
</label>
<div class="col-sm-9">
<select multiple class="custom-select" aria-describedby="col_visibility" v-model="settings.form_data.col_visible">
<option v-for="element in selected_elements" :value="element.name" v-if="!_.includes(['terms_and_condition', 'heading', 'hr', 'html_text', 'page_break', 'youtube', 'iframe', 'pdf', 'countdown'], element.type)">
{{element.label}}
</option>
</select>
<small id="col_visibility" class="form-text text-muted">
{{trans('messages.column_visibility_help_text')}}
</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.enable_button')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="view" value="view" v-model="settings.form_data.btn_enabled">
<label class="custom-control-label" for="view">
{{trans('messages.view')}}
</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="delete" value="delete" v-model="settings.form_data.btn_enabled">
<label class="custom-control-label" for="delete">
{{trans('messages.delete')}}
</label>
</div>
</div>
</div>
<!-- submit as draft -->
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.form_submit_as_draft')}}
<tooltip-component :tooltip="trans('messages.form_submit_as_draft_tooltip')">
</tooltip-component>
</label>
<div class="col-sm-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="is_enabled_draft_submit" value="1" v-model="settings.is_enabled_draft_submit">
<label class="custom-control-label" for="is_enabled_draft_submit">
{{trans('messages.enable')}}
</label>
</div>
</div>
</div>
<!-- /submit as draft -->
<!-- form scheduling settings -->
<h5 class="text-primary">
{{trans('messages.form_scheduling_setting')}}
</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.scheduling')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="scheduling" value="1" v-model="settings.form_scheduling.is_enabled">
<label class="custom-control-label" for="scheduling">
{{trans('messages.enable')}}
</label>
</div>
</div>
</div>
<div class="text-left text-muted offset-sm-3 mb-2" v-if="settings.form_scheduling.is_enabled">
<small>{{trans('messages.not_in_downloaded_code')}}</small><br/>
</div>
<div class="form-group row" v-show="settings.form_scheduling.is_enabled">
<div class="col-sm-9 offset-sm-3">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="start_date_time">
{{trans('messages.start_date_time')}}
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" :title="trans('messages.form_closed_start_date_time_tooltip')"></i>
</label>
<div class="input-group date" id="start_date_time" data-target-input="nearest">
<input type="text"
class="form-control datetimepicker-input"
data-target="#start_date_time"
data-toggle="datetimepicker"
name="start_date_time"
id="start_date_time"
readonly
/>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="end_date_time">
{{trans('messages.end_date_time')}} *
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" :title="trans('messages.form_closed_end_date_time_tooltip')"></i>
</label>
<div class="input-group date" id="end_date_time" data-target-input="nearest">
<input type="text"
class="form-control datetimepicker-input"
data-target="#end_date_time"
data-toggle="datetimepicker"
name="end_date_time"
id="end_date_time"
:required="settings.form_scheduling.is_enabled"
readonly
/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="closed_msg">
{{trans('messages.closed_msg')}} *
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" :title="trans('messages.form_closed_msg_tooltip')"></i>
</label>
<textarea
class="form-control summer_note" id="closed_msg"
rows="3"
v-model="settings.form_scheduling.closed_msg"
:required="settings.form_scheduling.is_enabled">
</textarea>
</div>
</div>
</div>
</div>
</div>
<!-- form submission reference-->
<h5 class="text-primary">
{{trans('messages.form_submission_numbering')}}
</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.submission_numbering')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="submission_numbering" value="1" v-model="settings.form_submision_ref.is_enabled">
<label class="custom-control-label" for="submission_numbering">
{{trans('messages.enable')}}
</label>
</div>
</div>
</div>
<div class="text-left text-muted offset-sm-3 mb-2" v-if="settings.form_submision_ref.is_enabled">
<small>{{trans('messages.not_in_downloaded_code')}}</small><br/>
</div>
<div class="form-group row" v-if="settings.form_submision_ref.is_enabled">
<div class="col-sm-9 offset-sm-3">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="prefix">
{{trans('messages.prefix')}}
</label>
<input type="text" class="form-control" id="prefix"
:placeholder="trans('messages.prefix')" name="settings.form_submision_ref.prefix" v-model="settings.form_submision_ref.prefix">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="suffix">
{{trans('messages.suffix')}}
</label>
<input type="text" class="form-control" id="suffix"
:placeholder="trans('messages.suffix')" name="settings.form_submision_ref.suffix" v-model="settings.form_submision_ref.suffix">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="start_no">
{{trans('messages.start_no')}} *
</label>
<input type="text" class="form-control" id="start_no"
:placeholder="trans('messages.start_no')" name="settings.form_submision_ref.start_no" required v-model="settings.form_submision_ref.start_no">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="min_digit">
{{trans('messages.min_digit')}} *
</label>
<select class="form-control" required
name="settings.form_submision_ref.min_digit"
v-model="settings.form_submision_ref.min_digit" id="min_digit">
<option v-for="i in 9" :key="i">
{{i}}
</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!-- / form subission reference -->
<!-- Password protection-->
<h5 class="text-primary">
{{trans('messages.password_protection')}}
</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.enable_password_protection')}}
</label>
<div class="col-sm-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="enable_password_protection" value="1" v-model="settings.password_protection.is_enabled">
<label class="custom-control-label" for="enable_password_protection">
{{trans('messages.enable')}}
<i class="fas fa-info-circle"
data-toggle="tooltip"
:title="trans('messages.password_protection_help_text')"></i>
</label>
</div>
</div>
</div>
<div class="form-group row" v-if="settings.password_protection.is_enabled">
<div class="col-sm-9 offset-sm-3">
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="password">
{{trans('messages.password')}} *
</label>
<input type="text" class="form-control" id="password"
:placeholder="trans('messages.password')" name="settings.password_protection.password" v-model="settings.password_protection.password" required>
</div>
</div>
</div>
</div>
</div>
<!-- / Password protection -->
<!-- Pdf Design-->
<h5 class="text-primary">
{{trans('messages.pdf_design')}}
<i class="fas fa-info-circle"
data-toggle="tooltip"
:title="trans('messages.pdf_design_help_text')"></i>
</h5>
<div class="form-group row">
<label class="col-sm-3 col-form-label">
{{trans('messages.header')}}
</label>
<div class="col-sm-9">
<textarea id="pdf_design"
class="form-control pdf_design_summer_note"
v-model="settings.pdf_design.header"></textarea>
<small class="form-text">
{{trans('messages.tags')}} : {form_name}, {submission_date}
</small>
</div>
</div>
<!-- /Pdf Design -->
</div>
</template>
<script>
import tooltipComponent from './TooltipComponent';
export default {
components: {
tooltipComponent
},
props:{
settings: Object,
selected_elements: Array
},
data() {
const self = this;
return {
default_value:'',
primary:'btn-primary',
success:'btn-success',
warning:'btn-warning',
danger:'btn-danger',
btn_large:'btn-lg',
btn_sm:'btn-sm',
btn_default:'',
same_page:'same_page',
redirect:'redirect',
dropzone: null,
themes: [
{
'key' : 'default',
'value' : self.trans('messages.default')
},
{
'key' : 'sketchy',
'value' : 'Sketchy'
},
{
'key' : 'materia',
'value' : 'Material'
},
{
'key' : 'cerulean',
'value' : 'Cerulean'
},
{
'key' : 'lux',
'value' : 'Lux'
},
{
'key' : 'cosmo',
'value' : 'Cosmo'
},
{
'key' : 'lumen',
'value' : 'Lumen'
},
{
'key' : 'simplex',
'value' : 'Simplex'
},
{
'key' : 'flatly',
'value' : 'Flatly'
},
{
'key' : 'journal',
'value' : 'Journal'
},
{
'key' : 'litera',
'value' : 'Litera'
},
{
'key' : 'minty',
'value' : 'Minty'
},
{
'key' : 'pulse',
'value' : 'Pulse'
},
{
'key' : 'sandstone',
'value' : 'Sandstone'
},
{
'key' : 'spacelab',
'value' : 'Spacelab'
},
{
'key' : 'yeti',
'value' : 'Yeti'
},
]
}
},
mounted() {
this.initDropzone();
},
created() {
const self = this;
$(function() {
initialize_datetimepicker_for_form_scheduling();
//set values
$('input#start_date_time').val(self.settings.form_scheduling.start_date_time);
$('input#end_date_time').val(self.settings.form_scheduling.end_date_time);
//on change of dateTimePicker get values
$('div#start_date_time').on('change.datetimepicker', function() {
self.settings.form_scheduling.start_date_time = $('input#start_date_time').val();
});
$('div#end_date_time').on('change.datetimepicker', function() {
self.settings.form_scheduling.end_date_time = $('input#end_date_time').val();
});
$('#closed_msg').summernote({
placeholder: self.trans('messages.jot_down_here'),
height: 200,
callbacks: {
onChange: function(contents, editable) {
self.settings.form_scheduling.closed_msg = contents;
}
}
});
$('#pdf_design').summernote({
placeholder: self.trans('messages.design_pdf_header'),
height: 250,
tabsize: 2,
toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear', 'strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['insert', ['link', 'picture']]
],
callbacks: {
onChange: function(contents, editable) {
self.settings.pdf_design.header = contents;
}
}
});
});
},
methods:{
initDropzone() {
const self = this;
if (self.dropzone) {
self.dropzone.destroy();
}
self.dropzone = new Dropzone('div#fileUpload', {
url: `${APP.APP_URL}/file-upload`,
uploadMultiple: false,
maxFiles: 1,
acceptedFiles: '.jpeg,.jpg,.png,.gif,.JPEG,.JPG,.PNG,.GIF',
autoProcessQueue: true,
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
init: function() {
var prevFile;
this.on('addedfile', function() {
if (typeof prevFile !== 'undefined') {
this.removeFile(prevFile);
}
});
this.on('success', function(file, response) {
prevFile = file;
});
},
success: function(file, response) {
if (response.success == true) {
self.settings.color.image_path = response.path;
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
},
});
},
getIcons() {
var icons = this.getFontAwesomeIcons();
return icons;
}
}
}
</script>

View File

@@ -0,0 +1,86 @@
<template>
<section>
<!-- form layout -->
<label>
{{trans('messages.layout')}}
</label>
<div class="row">
<!-- classic -->
<div class="col-md-6">
<div class="card mb-1 bg-light-gray hvr-grow cursor-pointer"
:class="[_.includes(['classic'], choosen_layout) ? 'border-primary border-1 border-solid' : '']"
@click="setFormLayout('classic')">
<div class="card-body text-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 121 125" class="jfWizard-list-item-icon-svg" width="187" height="204"><g fill="none" fill-rule="evenodd"><path d="M4.417 0h112a4 4 0 014 4v121h-120V4a4 4 0 014-4z" fill="#FFF" fill-rule="nonzero"></path><g transform="translate(10.417 13)"><path d="M17.001 31.122h79.14a2.858 2.858 0 010 5.716h-79.14a2.858 2.858 0 110-5.716z" fill="#DAE2ED" fill-rule="nonzero"></path><rect fill="#DAE2ED" fill-rule="nonzero" y="20.324" width="74.571" height="5.716" rx="2.858"></rect><rect fill="#DAE2ED" fill-rule="nonzero" width="99" height="8.257" rx="3"></rect><path d="M17.001 41.284h79.14a2.858 2.858 0 010 5.716h-79.14a2.858 2.858 0 110-5.716z" fill="#DAE2ED" fill-rule="nonzero"></path><g transform="translate(0 30.486)"><rect fill="#2F90FF" fill-rule="nonzero" width="6.429" height="6.351" rx="2"></rect><path d="M2.734 4.765a.33.33 0 01-.238-.103L1.304 3.424a.36.36 0 010-.495.328.328 0 01.477 0l.953.99L4.878 1.69a.328.328 0 01.477 0 .36.36 0 010 .496L2.972 4.662a.33.33 0 01-.238.103" fill="#FFF"></path></g><rect fill="#DAE2ED" fill-rule="nonzero" y="40.649" width="6.429" height="6.351" rx="2"></rect></g><g transform="translate(10.417 72)"><path d="M17.036 10.929h79.071a2.893 2.893 0 010 5.785H17.036a2.893 2.893 0 110-5.785zM2.893 0h68.786a2.893 2.893 0 110 5.786H2.893a2.893 2.893 0 010-5.786zm14.143 21.214h79.071a2.893 2.893 0 010 5.786H17.036a2.893 2.893 0 110-5.786z" fill="#DAE2ED" fill-rule="nonzero"></path><g transform="translate(0 10.286)"><rect fill="#2F90FF" fill-rule="nonzero" width="6.429" height="6.429" rx="2"></rect><path d="M2.734 4.823a.327.327 0 01-.238-.104L1.304 3.465a.367.367 0 010-.5.325.325 0 01.477 0l.953 1.002L4.878 1.71a.325.325 0 01.477 0 .367.367 0 010 .501L2.972 4.72a.328.328 0 01-.238.104" fill="#FFF"></path></g><rect fill="#DAE2ED" fill-rule="nonzero" y="20.571" width="6.429" height="6.429" rx="2"></rect><g transform="translate(0 20.571)"><rect fill="#2F90FF" fill-rule="nonzero" width="6.429" height="6.429" rx="2"></rect><path d="M2.734 4.823a.327.327 0 01-.238-.104L1.304 3.465a.367.367 0 010-.5.325.325 0 01.477 0l.953 1.002L4.878 1.71a.325.325 0 01.477 0 .367.367 0 010 .501L2.972 4.72a.328.328 0 01-.238.104" fill="#FFF"></path></g></g><rect fill="#2F90FF" fill-rule="nonzero" x="77.417" y="109" width="32" height="10" rx="4"></rect></g></svg>
</div>
</div>
<h6 class="text-center mt-0 mb-0">
{{trans('messages.classic_form')}}
</h6>
<p class="text-center mt-0 mb-0">
<small>{{trans('messages.classic_form_subtitle')}}</small>
</p>
</div>
<!-- card form -->
<div class="col-md-6">
<div class="card mb-1 bg-light-gray hvr-grow cursor-pointer"
:class="[_.includes(['card_form'], choosen_layout) ? 'border-primary border-1 border-solid' : '']"
@click="setFormLayout('card_form')">
<div class="card-body text-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 121 92" class="jfWizard-list-item-icon-svg" width="166" height="146"><g fill="none" fill-rule="evenodd"><rect fill="#FFF" fill-rule="nonzero" x="7.934" width="105.131" height="62.153" rx="4"></rect><path d="M7.934 49.59h105.132v9.224a4 4 0 01-4 4H11.934a4 4 0 01-4-4V49.59z" fill="#2A5ACA" fill-rule="nonzero"></path><g transform="translate(15.208 11.24)"><rect fill="#DAE2ED" fill-rule="nonzero" x="10.579" y="11.24" width="80.667" height="5.951" rx="2.975"></rect><rect fill="#DAE2ED" fill-rule="nonzero" width="50.913" height="5.951" rx="2.975"></rect><path d="M13.555 21.82H88.27a2.975 2.975 0 010 5.95H13.555a2.975 2.975 0 010-5.95z" fill="#DAE2ED" fill-rule="nonzero"></path><g transform="translate(0 10.58)"><rect fill="#2F90FF" fill-rule="nonzero" width="6.612" height="6.612" rx="2"></rect><path d="M2.812 4.96a.337.337 0 01-.245-.107L1.34 3.564a.378.378 0 010-.515.334.334 0 01.49 0l.98 1.031 2.206-2.32a.334.334 0 01.49 0 .378.378 0 010 .515l-2.45 2.578a.337.337 0 01-.245.107" fill="#FFF"></path></g><rect fill="#DAE2ED" fill-rule="nonzero" y="21.158" width="6.612" height="6.612" rx="2"></rect></g><rect fill="#FFF" fill-rule="nonzero" width="121" height="62.153" rx="4"></rect><path d="M0 49.59h121v9.224a4 4 0 01-4 4H4a4 4 0 01-4-4V49.59z" fill="#51DCA9" fill-rule="nonzero"></path><g transform="translate(9.257 11.24)"><path d="M14.877 11.24H98.85a2.975 2.975 0 010 5.951H14.877a2.975 2.975 0 110-5.95zM2.975 0h50.913a2.975 2.975 0 110 5.95H2.975a2.975 2.975 0 110-5.95zm11.902 21.82H98.85a2.975 2.975 0 010 5.95H14.877a2.975 2.975 0 110-5.95z" fill="#DAE2ED" fill-rule="nonzero"></path><g transform="translate(0 10.58)"><rect fill="#2F90FF" fill-rule="nonzero" width="6.612" height="6.612" rx="2"></rect><path d="M2.812 4.96a.337.337 0 01-.245-.107L1.34 3.564a.378.378 0 010-.515.334.334 0 01.49 0l.98 1.031 2.206-2.32a.334.334 0 01.49 0 .378.378 0 010 .515l-2.45 2.578a.337.337 0 01-.245.107" fill="#FFF"></path></g><rect fill="#DAE2ED" fill-rule="nonzero" y="21.158" width="6.612" height="6.612" rx="2"></rect></g><path stroke="#319BF3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M8.596 86.646h104.47"></path><circle stroke="#319BF3" stroke-width="1.5" fill="#51DCA9" fill-rule="nonzero" cx="60.831" cy="86.646" r="3.967"></circle><circle fill="#319BF3" fill-rule="nonzero" cx="9.918" cy="86.646" r="3.967"></circle><circle fill="#319BF3" fill-rule="nonzero" cx="111.743" cy="86.646" r="3.967"></circle></g></svg>
</div>
</div>
<h6 class="text-center mt-0 mb-0">
{{trans('messages.card_form')}}
</h6>
<p class="text-center mt-0 mb-0">
<small>{{trans('messages.card_form_subtitle')}}</small>
</p>
</div>
<div
v-if="_.some(selected_elements, {type: 'page_break'})"
class="col-md-12 text-center text-danger">
<i class="fas fa-info-circle mr-1"></i>
<small v-text="trans('messages.card_layout_disabled')"></small>
</div>
</div>
<!-- /form layout -->
</section>
</template>
<script>
export default {
props:{
selected_elements: Array,
settings:Object,
},
data(){
return {
layout: 'classic',
choosen_layout: 'classic'
}
},
created() {
const self = this;
if (_.isUndefined(self.settings.layout)) {
Vue.set(self.settings, 'layout', self.layout);
} else {
self.choosen_layout = self.settings.layout;
}
},
methods:{
setFormLayout(layout) {
const self = this;
if (!_.some(self.selected_elements, {type: 'page_break'})) {
self.settings.layout = layout;
self.choosen_layout = layout;
}
}
}
}
</script>
<style scoped>
svg{
max-width: 100%;
height: 100px;
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<div class="row mb-1">
<!-- remove pdf -->
<div class="card border-secondary mb-2"
v-show="!_.isEmpty(element.pdf)">
<div class="row">
<div class="col-md-4 mt-auto mb-auto">
<i class="fas fa-file-pdf fa-5x ml-1 text-primary"></i>
</div>
<div class="col-md-8">
<div class="card-body">
<p class="card-text text-truncate">
{{element.pdf}}
</p>
<p class="card-text text-warning cursor-pointer"
@click="removePdf">
{{trans('messages.remove_pdf')}}
</p>
</div>
</div>
</div>
</div>
<!-- dropzone -->
<div class="col-md-12 mb-1"
v-show="_.isEmpty(element.pdf)">
<label for="pdf_upload">
{{trans('messages.upload_pdf')}}
</label>
<div class="dropzone" id="pdf_upload"></div>
</div>
<!-- pdf properties -->
<div v-if="!_.isEmpty(element.pdf)">
<div class="mb-1">
<label>
{{trans('messages.width')}}
</label>
<div class="input-group mb-2">
<input type="number" class="form-control" v-model="element.width">
<div class="input-group-append">
<span class="input-group-text">
%
</span>
</div>
</div>
</div>
<div class="mb-1">
<label>
{{trans('messages.height')}}
</label>
<div class="input-group mb-2">
<input type="number" class="form-control" v-model="element.height">
<div class="input-group-append">
<span class="input-group-text">
px
</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
element: Object,
},
data(){
return{
MAX_UPLOAD_SIZE: APP.MAX_PDF_UPLOAD_SIZE,
dropzone_has_error: false,
dropzone_error_msg: ''
}
},
mounted() {
const self = this;
self.initPdfUploader();
},
methods:{
initPdfUploader() {
const self = this;
if (self.dropzone) {
self.dropzone.destroy();
}
self.dropzone = new Dropzone('div#pdf_upload', {
url: `${APP.APP_URL}/file-upload`,
addRemoveLinks: true,
uploadMultiple: false,
dictDefaultMessage: self.trans('messages.drop_a_pdf_here'),
maxFiles: 1,
maxFilesize: self.MAX_UPLOAD_SIZE,
acceptedFiles: '.pdf',
autoProcessQueue: true,
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
init: function() {
//function to be use on removeing a file
this.on("removedfile", function(file) {
$.ajax({
url: `${APP.APP_URL}/file-delete`,
data: { "file_name": file.uploaded_as },
type: "POST",
success: function(result) {
if(result.success == 1){
self.element.pdf = '';
} else {
toastr.error(result.msg);
}
}
});
});
this.on('success', function(file, response) {
self.dropzone_has_error = false;
self.dropzone_error_msg = '';
});
this.on("error", function(file, message) {
self.dropzone_has_error = true;
self.dropzone_error_msg = message;
});
},
success: function(file, response) {
if (response.success == true) {
file.uploaded_as = response.path;
self.element.pdf = response.path;
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
},
});
},
removePdf() {
const self = this;
Swal.fire({
title: 'Are you sure?',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, remove it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: `${APP.APP_URL}/file-delete`,
data: { "file_name": self.element.pdf},
type: "POST",
success: function(result) {
if(result.success == 1){
self.element.pdf = '';
self.dropzone.removeAllFiles();
} else {
toastr.error(result.msg);
}
}
});
}
});
}
}
}
</script>

View File

@@ -0,0 +1,29 @@
<template>
<!-- Modal -->
<div class="modal fade" :id="`${element.name}_modal`" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
{{element.label}}
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12"
v-html="element.popover_help_text.content">
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props:['element']
}
</script>

View File

@@ -0,0 +1,520 @@
<template>
<form id="show_form" v-bind="getCustomAttributes(form_custom_attributes)">
<div class="row">
<template
v-for="(element, index) in formFields">
<div
v-if="!_.includes(['page_break'], element.type)"
:key="index"
:class="[element.col ? element.col : 'col-md-12']"
v-show="togglePageVisibility(element.page_num)">
<fieldGenerator
:element="element"
:settings="settings"
:submitted_data="submitted_data"
:action="action"
:action-by="actionBy"
@apply_conditions="applyConditions">
</fieldGenerator>
</div>
</template>
</div>
<div class="g-recaptcha" :data-sitekey="settings.recaptcha.site_key" v-if="settings.recaptcha.is_enable"></div>
<div class="row"
:class="[!isCardFormLayout() ? settings.submit.btn_alignment : 'float-right']"
v-show="isSubmitVisible()">
<button v-if="!actionBy.length && settings.is_enabled_draft_submit"
formnovalidate="formnovalidate" type="submit" class="btn m-1 draft_btn"
:class="[settings.submit.btn_size, settings.submit.btn_style == 'default' ? 'btn-warning': 'btn-outline-warning']" name="status" value="incomplete">
<i class="fas " :class="settings.submit.btn_icon" v-if="settings.submit.btn_icon != 'none' && settings.submit.icon_position == 'left'"></i>
{{trans('messages.draft')}}
<i class="fas " :class="settings.submit.btn_icon" v-if="settings.submit.btn_icon != 'none' && settings.submit.icon_position == 'right'"></i>
</button>
<button type="submit" class="btn submit_btn ladda-button m-1" :class="[settings.submit.btn_color, settings.submit.btn_size]" data-style="expand-right" name="status" value="complete">
<i class="fas " :class="settings.submit.btn_icon" v-if="settings.submit.btn_icon != 'none' && settings.submit.icon_position == 'left'"></i>
<span class="btn_text ladda-label"> {{settings.submit.text}} </span>
<i class="fas " :class="settings.submit.btn_icon" v-if="settings.submit.btn_icon != 'none' && settings.submit.icon_position == 'right'"></i>
</button>
</div>
<div class="row" v-if="isCardFormLayout()">
<div class="col-md-12 d-flex justify-content-between">
<button v-show="current_page_number > 0" type="button"
class="btn bg-gradient-primary mr-auto"
@click="changePage('prev')">
<i class="fas fa-arrow-circle-left"></i> {{trans('messages.previous')}}
</button>
<button v-show="current_page_number < page_number" type="button"
class="btn bg-gradient-primary ml-auto" @click="changePage('next')">
{{trans('messages.next')}} <i class="fas fa-arrow-circle-right"></i>
</button>
</div>
</div>
<div class="alert alert-success mt-5 cursor-pointer" role="alert"
v-show="is_available_form_editable_url"
@click="copyLink">
<h4 class="alert-heading cursor-pointer"
v-html="trans('messages.form_editable_url')">
</h4>
<hr>
<span id="form_editable_url" class="cursor-pointer"></span>
<i class="far fa-copy float-right fa-lg cursor-pointer"></i>
</div>
</form>
</template>
<script>
import fieldGenerator from "./FieldGenerator";
export default{
props: ['form', 'actionBy', 'action'],
components: {
fieldGenerator
},
data() {
return {
schema: [],
form_parsed: [],
settings:{},
conditional_fields:[],
is_available_form_editable_url: false,
submitted_data:{},
token:'',
form_data_id: '',
form_custom_attributes : [],
formFields:[],
page_number: 0,
current_page_number:0,
is_page_active:'page#0',
};
},
mounted() {
const self = this;
let rules = {};
let messages = {};
self.formFields.forEach(function(field) {
if(!_.isEmpty(field?.allowed_input?.values)) {
let tempRule = {
remote: {
url: "/validate-input-value",
type: "post",
data: {
field: function() {
return JSON.stringify(field);
},
field_value: function() {
return $(`#${field.name}`).val();
}
}
}
}
let tempMsg = {
remote: field?.allowed_input?.error_msg || 'This value is not allowed.'
}
rules = {...rules, ...{[field.name]:tempRule}};
messages = {...messages, ...{[field.name]:tempMsg}};
}
});
var validator = $('#show_form').validate({
ignore: ".note-editor *, .hide",
rules: rules,
messages: messages,
submitHandler: function(form, e) {
e.preventDefault();
let disabled = $('#show_form :input:disabled').removeAttr('disabled');
var form_data = $('#show_form').serialize();
disabled.attr('disabled', 'disabled');
$("button.submit_btn, button.draft_btn").attr('disabled', 'disabled');
var status = $("input[name=status]").val();
if (status == 'complete') {
$("span.btn_text").text(self.settings.submit.loading_text);
var ladda = Ladda.create(document.querySelector('.ladda-button'));
} else if (status == 'incomplete') {
var ladda = Ladda.create(document.querySelector('.draft_btn'));
}
ladda.start();
if(typeof mpfg_form_submitted === "function"){
var form_array_data = $('#show_form').serializeArray();
mpfg_form_submitted(self.form_parsed.id, form_array_data);
}
let url = '/form-data/' + self.form_parsed.id + '?token=' + self.token + '&form_data_id=' + self.form_data_id;
// if (self.actionBy.length && self.actionBy === 'admin') {
// url = '/update/'+self.form_parsed.id+'/data/'+self.form_data_id;
// }
axios
.post(url, {form_data})
.then(function(response) {
//set token & form data id for form
if (status == 'incomplete') {
self.token = response.data.notification.token;
self.form_data_id = response.data.notification.form_data_id;
}
//remove disabled attr.
$("button.submit_btn, button.draft_btn").removeAttr("disabled");
//set submit text to submit btn
$("span.btn_text").text(self.settings.submit.text);
ladda.stop();
window.onbeforeunload = null;
if (response.data.success == true) {
//if notification action is redirect & status is compelete, redirect user to given url
if ((response.data.notification.post_submit_action === 'redirect') && (status == 'complete')) {
toastr.success(response.data.notification.success_msg);
window.parent.location = response.data.notification.redirect_url;
}
//if submit action is on same page & status is complete, replace url to form view url after 10 sec
if (status == 'complete' && !_.includes(['redirect'], response.data.notification.post_submit_action)) {
$('.card-body').html(response.data.notification.submission_msg);
if (response.data.notification.qr_code_text) {
try {
let qr_option = {
title: self.form_parsed.name,
titleFont: "bold 16px Arial",
titleColor: "#1b294b",
titleBackgroundColor: "#ffffff",
titleHeight: 20,
titleTop: 0,
text: response.data.notification.qr_code_text,
margin: 0,
width: 200,
height: 200,
quietZone: 20,
colorDark: "#1b294b",
colorLight: "#ffffffff",
correctLevel : QRCode.CorrectLevel.L
}
let qr_code = new QRCode(document.getElementById("qrcode"), qr_option);
$('#qrcode').find('canvas').attr('id', 'canvas');
let canvas = document.getElementById('canvas');
$('#download_qrcode').attr('href', canvas.toDataURL());
} catch (error) {
$('#qrcode, #download_qrcode').hide();
}
}
}
//if status is incomplete display form editable url
if (status == 'incomplete') {
toastr.success(response.data.notification.success_msg);
if (response.data.notification.form_editable_url) {
self.is_available_form_editable_url = true;
$('span#form_editable_url').text(response.data.notification.form_editable_url);
} else {
location.reload();
}
}
setTimeout(function() {
window.location.href = document.referrer;
}, 3000);
} else {
toastr.error(response.data.msg);
}
})
.catch(function(error) {
toastr.error(error);
});
}
});
//show aleart before page reloading
var form_obj = $('form#show_form');
var orig_forn_data = form_obj.serialize();
window.onbeforeunload = function() {
if($('form#show_form').length == 1){
if (form_obj.serialize() != orig_forn_data) {
return 'Are you sure?';
}
}
}
},
created() {
this.form_parsed = JSON.parse(this.form);
this.schema = this.form_parsed.schema.form;
this.settings = this.form_parsed.schema.settings;
this.conditional_fields = this.form_parsed.schema.conditional_fields;
this.form_custom_attributes = this.form_parsed.schema.form_attributes;
if (!_.isEmpty(this.form_parsed.data)) {
this.submitted_data = this.form_parsed.data[0].data;
this.token = this.form_parsed.data[0].token;
this.form_data_id = this.form_parsed.data[0].id;
}
this.getUrlParameters();
this.customizeFieldsArrayForLayout();
this.$eventBus.$on('callApplyConditions', (data) => {
this.applyConditions();
});
//if page break enabled, set layout 'card_form'
if (
this.form_parsed.schema.contains_page_break &&
this.form_parsed.schema.contains_page_break
) {
this.settings.layout = 'card_form';
}
},
beforeDestroy() {
this.$eventBus.$off('callApplyConditions');
},
methods: {
applyConditions(){
var schema = this.schema;
var is_condition_satisfied = true;
_.forEach(this.conditional_fields, function(conditional_field) {
_.forEach(conditional_field.conditions, function(element) {
if (!_.isNull(element.condition)) {
//find element as condition is present & if present check its type and find it value
var index = schema.findIndex(field => field.name === element.condition);
var form_element_value = '';
var logical_operator = element?.logical_operator || 'AND';
if (schema[index].type === 'radio') {
form_element_value = $('input[name='+element.condition+']:checked').val();
} else if (schema[index].type === 'checkbox') {
var checked_value = [];
$('input[name='+'"'+element.condition+'[]"'+']:checked').each(function() {
checked_value.push($(this).val());
});
if (_.includes(checked_value, element.value)) {
form_element_value = element.value;
}
} else if (schema[index].type === 'dropdown' && schema[index].multiselect) {
var selected_value = $('select[name='+'"'+element.condition+'[]"'+']').val();
if (_.includes(selected_value, element.value)) {
form_element_value = element.value;
}
} else if(schema[index].type === 'calendar') {
form_element_value = $('input[name='+element.condition+']').val();
} else if(schema[index].type === 'terms_and_condition') {
form_element_value = $('input[name='+element.condition+']').is(':checked') ? 'true' : 'false';
} else if(schema[index].type === 'switch') {
form_element_value = $('input[name='+element.condition+']').is(':checked') ? '1' : '0';
} else {
form_element_value = document.getElementById(element.condition).value;
}
//check if condition_satisfied or not
if(logical_operator == 'AND') {
if (element.operator == '==') {
if (form_element_value == element.value) {
is_condition_satisfied = true && is_condition_satisfied;
} else {
is_condition_satisfied = false;
}
} else if (element.operator == '!=') {
if (form_element_value != element.value) {
is_condition_satisfied = true && is_condition_satisfied;
} else {
is_condition_satisfied = false;
}
} else if (element.operator == 'empty') {
if (form_element_value.length == 0) {
is_condition_satisfied = true && is_condition_satisfied;
} else {
is_condition_satisfied = false;
}
} else if (element.operator == 'not_empty') {
if (form_element_value.length > 0) {
is_condition_satisfied = true && is_condition_satisfied;
} else {
is_condition_satisfied = false;
}
}
} else {
if (element.operator == '==') {
is_condition_satisfied = (form_element_value == element.value) || is_condition_satisfied;
} else if (element.operator == '!=') {
is_condition_satisfied = (form_element_value != element.value) || is_condition_satisfied;
} else if (element.operator == 'empty') {
is_condition_satisfied = (form_element_value.length == 0) || is_condition_satisfied;
} else if (element.operator == 'not_empty') {
is_condition_satisfied = (form_element_value.length > 0) || is_condition_satisfied;
}
}
}
});
//check if element is exist or not in schema
var index = schema.findIndex(element => element.name === conditional_field.element);
var action = conditional_field.action;
//if element exist then toggle conditional class
if (index !== -1) {
if (is_condition_satisfied) {
schema[index].conditional_class = conditional_field.action;
} else {
action = (conditional_field.action === 'show') ? 'hide' : 'show';
schema[index].conditional_class = (conditional_field.action === 'show') ? 'hide' : 'show'
}
is_condition_satisfied = true;
if(action == 'hide') {
if(schema[index]['type'] == 'radio') {
$(`input[name="${schema[index]['name']}"]`).prop('checked',false).trigger("change");
} else if(schema[index]['type'] == 'checkbox') {
$(`input[name="${schema[index]['name']}"]:checkbox`).prop('checked',false).trigger("change");
} else if(schema[index].type === 'dropdown' && schema[index].multiselect) {
$(`select[name="${schema[index]['name']}"]`).val('').trigger("change");
} else if(schema[index].type === 'terms_and_condition' || schema[index].type === 'switch') {
$(`input[name="${schema[index]['name']}"]`).prop('checked',false).trigger("change");
} else {
$(`input[name="${schema[index]['name']}"]`).val('').trigger("change");
}
}
}
});
},
getUrlParameters(){
const self = this;
let url = window.location.href;
let parameters = url.split('?')[1];
if (
!_.isEmpty(parameters) &&
_.isEmpty(self.submitted_data)
) {
let query_string = new URLSearchParams(parameters);
let data = {};
//convert query string to key value object
for (let parameter_pair of query_string.entries()) {
data[parameter_pair[0]] = parameter_pair[1];
}
self.submitted_data = data;
}
},
customizeFieldsArrayForLayout(){
const self = this;
let tempArrayEls = [];
if (!_.isEmpty(self.schema)) {
let maxIndex = self.schema.length - 1;
_.forEach(self.schema, function(element, index){
element['page_num'] = `page#${self.page_number}`;
tempArrayEls.push(element);
let nextEl = self.schema[index+1];//find next field
//increase page num if page break exists & not consecutive page break
if (
_.includes(['page_break'], element.type) &&
index > 0 //remove first index page break
&& nextEl &&
!_.includes(['page_break'], nextEl.type)
) {
self.page_number += 1;
}
//if layout is card.. & does not contain page break, insert one
if(
_.includes(['card_form'], self.settings.layout) &&
!self.form_parsed.schema.contains_page_break &&
(index < maxIndex)
) {
self.page_number += 1;
}
});
}
self.formFields = tempArrayEls;
},
isSubmitVisible() {
const self = this;
let is_visible = true;
if (self.isCardFormLayout() && (self.current_page_number < self.page_number)) {
is_visible = false;
}
return is_visible;
},
isCardFormLayout() {
const self = this;
if (
self.settings.layout &&
_.includes(['card_form'], self.settings.layout)
) {
return true
}
return false;
},
togglePageVisibility(page_num) {
const self = this;
if (!self.isCardFormLayout()) return true;
if (self.isCardFormLayout() && _.includes([self.is_page_active],page_num)) return true;
return false;
},
changePage(move) {
const self = this;
if (move == 'next') {
//validate fields before proceeding
let pageEles = self.formFields
.filter((el) => el.page_num == `page#${self.current_page_number}`);
let is_page_valid = true; //default true
for(let el of pageEles){
if (!_.includes(['page_break'], el.type)) {
is_page_valid = self.validateElement(el);
if(!is_page_valid) break;
}
}
//if page's field validated, move to next page
if (
is_page_valid &&
(self.current_page_number < self.page_number)
) {
self.current_page_number += 1;
self.is_page_active = `page#${self.current_page_number}`;
}
} else if (move == 'prev') {
if (self.current_page_number != 0) {
self.current_page_number -= 1;
self.is_page_active = `page#${self.current_page_number}`;
}
}
},
validateElement(element) {
const self = this;
let element_name = element.name;
let is_element_valid = true;
if (
_.includes(['checkbox', 'file_upload'], element.type) ||
(element.type == 'dropdown' && element.multiselect === true)
) {
element_name = element_name + '[]';
}
if (
!_.includes(['heading', 'hr', 'html_text'], element.type) &&
$('[name="' + element_name + '"]').rules()
) {
is_element_valid = $('[name="' + element_name + '"]').valid();
}
return is_element_valid;
},
copyLink(){
const self = this;
let textarea = document.createElement('textarea');
textarea.innerHTML = $("#form_editable_url").text();
document.body.appendChild(textarea);
textarea.select();
textarea.setSelectionRange(0, 99999);
document.execCommand("copy");
document.body.removeChild(textarea);
Swal.fire(self.trans('messages.link_copied'));
}
}
}
</script>

View File

@@ -0,0 +1,63 @@
<template>
<span>
<button type="button"
class="btn btn-sm btn-outline-primary ladda-button btn-test-smtp"
data-style="expand-right"
data-spinner-color="blue"
@click="testSmtp()">
<span class="ladda-label">
{{trans('messages.test_smtp_details')}}
</span>
</button>
<small class="form-text text-muted">
{{trans('messages.email_will_be_sent_to')}} {{this.details.from_address}}
</small>
</span>
</template>
<script>
export default {
props: ['details'],
methods:{
testSmtp(){
var isValid = true;
_.forEach(this.details, function(detail){
if (!_.isNull(detail)) {
isValid = true && isValid;
} else {
isValid = false;
}
});
if (isValid) {
var ladda = Ladda.create($('.btn-test-smtp')[0]);
ladda.start();
axios.get('/test-smtp', {
params:{
host: this.details.host,
port: this.details.port,
from_name: this.details.from_name,
from_address: this.details.from_address,
encryption: this.details.encryption,
username: this.details.username,
password: this.details.password
}
})
.then(function (response) {
ladda.stop();
alert(response.data.msg);
})
.catch(function (error) {
ladda.stop();
alert(error);
});
} else {
isValid = true;
alert('Please fill all the SMTP details.');
}
}
}
}
</script>

View File

@@ -0,0 +1,10 @@
<template>
<span class="text-success">
<i class="fas fa-info-circle ml-1" data-toggle="tooltip" :title="tooltip"></i>
</span>
</template>
<script>
export default {
props:['tooltip'],
}
</script>

View File

@@ -0,0 +1,94 @@
<template>
<section class="mt-3">
<div class="row">
<div class="col-md-12">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
id="is_enabled_webhook"
v-model="webhookInfo.is_enable"
value="1">
<label class="custom-control-label" for="is_enabled_webhook">
{{trans('messages.enable')}}
</label>
</div>
</div>
</div>
<template
v-if="webhookInfo.is_enable">
<div class="row">
<div class="col-md-12">
<div class="text-left text-muted text-center">
<small>
<i class="fa fa-info-circle"></i>
{{trans('messages.not_in_downloaded_code')}}
</small>
<br/>
</div>
</div>
</div>
<div class="form-group row">
<label for="webhook_url" class="col-sm-3 col-form-label">
{{trans('messages.webhook_url')}}:
<span class="error" v-if="webhookInfo.is_enable">*</span>
</label>
<div class="col-sm-9">
<div class="form-group">
<input type="url" class="form-control"
pattern="https://.*"
id="webhook_url"
:placeholder="trans('messages.webhook_url')"
name="webhookInfo.webhook_url"
:required="webhookInfo.is_enable"
v-model="webhookInfo.url">
</div>
</div>
</div>
<div class="form-group row">
<label for="secret_key" class="col-sm-3 col-form-label">
{{trans('messages.secret_key')}}:
<span class="error" v-if="webhookInfo.is_enable">*</span>
</label>
<div class="col-sm-9">
<div class="input-group">
<input type="text" class="form-control"
id="secret_key"
:placeholder="trans('messages.secret_key')"
name="webhookInfo.secret_key"
:required="webhookInfo.is_enable"
v-model="webhookInfo.secret_key"
readonly>
<div class="input-group-append">
<button type="button" class="btn btn-primary"
@click="generateSecretKey"
:disabled="loading">
{{trans('messages.generate_secret_key')}}
<i class="fas fa-spinner fa-pulse fa-spin ml-1" v-if="loading"></i>
</button>
</div>
</div>
</div>
</div>
</template>
</section>
</template>
<script>
export default {
props:['webhookInfo'],
data() {
return {
loading: false,
}
},
methods:{
generateSecretKey() {
const self = this;
self.loading = true;
self.webhookInfo.secret_key = self.generateRandomString(18);
setTimeout(() => {
self.loading = false;
}, 1000);
}
}
}
</script>

514
resources/js/functions.vue Normal file
View File

@@ -0,0 +1,514 @@
<script>
export default {
methods: {
trans(string, params = []) {
var str = _.get(window.i18n, string);
_.forEach(params, function(value, key) {
str = _.replace(str, ':' + key, value);
});
return str;
},
getCustomAttributes(attributes) {
var mapped_attr = _.reduce(attributes, function(result, attribute, key) {
result[attribute.key] = attribute.value;
return result;
}, {});
return mapped_attr;
},
getFontAwesomeIcons() {
//c = class name, l = label
var icons = [
{"c":"fa-address-book","l":"address-book"},
{"c":"fa-address-card","l":"address-card"},
{"c":"fa-adjust","l":"adjust"},
{"c":"fa-align-center","l":"align-center"},
{"c":"fa-align-justify","l":"align-justify"},
{"c":"fa-align-left","l":"align-left"},
{"c":"fa-align-right","l":"align-right"},
{"c":"fa-ambulance","l":"ambulance"},
{"c":"fa-american-sign-language-interpreting","l":"american-sign-language-interpreting"},
{"c":"fa-anchor","l":"anchor"},
{"c":"fa-angle-double-down","l":"angle-double-down"},
{"c":"fa-angle-double-left","l":"angle-double-left"},
{"c":"fa-angle-double-right","l":"angle-double-right"},
{"c":"fa-angle-double-up","l":"angle-double-up"},
{"c":"fa-angle-down","l":"angle-down"},
{"c":"fa-angle-left","l":"angle-left"},
{"c":"fa-angle-right","l":"angle-right"},
{"c":"fa-angle-up","l":"angle-up"},
{"c":"fa-archive","l":"archive"},
{"c":"fa-arrow-alt-circle-down","l":"arrow-alt-circle-down"},
{"c":"fa-arrow-alt-circle-left","l":"arrow-alt-circle-left"},
{"c":"fa-arrow-alt-circle-right","l":"arrow-alt-circle-right"},
{"c":"fa-arrow-alt-circle-up","l":"arrow-alt-circle-up"},
{"c":"fa-arrow-circle-down","l":"arrow-circle-down"},
{"c":"fa-arrow-circle-left","l":"arrow-circle-left"},
{"c":"fa-arrow-circle-right","l":"arrow-circle-right"},
{"c":"fa-arrow-circle-up","l":"arrow-circle-up"},
{"c":"fa-arrow-down","l":"arrow-down"},
{"c":"fa-arrow-left","l":"arrow-left"},
{"c":"fa-arrow-right","l":"arrow-right"},
{"c":"fa-arrow-up","l":"arrow-up"},
{"c":"fa-arrows-alt","l":"arrows-alt"},
{"c":"fa-arrows-alt-h","l":"arrows-alt-h"},
{"c":"fa-arrows-alt-v","l":"arrows-alt-v"},
{"c":"fa-assistive-listening-systems","l":"assistive-listening-systems"},
{"c":"fa-asterisk","l":"asterisk"},
{"c":"fa-at","l":"at"},
{"c":"fa-audio-description","l":"audio-description"},
{"c":"fa-backward","l":"backward"},
{"c":"fa-balance-scale","l":"balance-scale"},
{"c":"fa-ban","l":"ban"},
{"c":"fa-barcode","l":"barcode"},
{"c":"fa-bars","l":"bars"},
{"c":"fa-bath","l":"bath"},
{"c":"fa-battery-empty","l":"battery-empty"},
{"c":"fa-battery-full","l":"battery-full"},
{"c":"fa-battery-half","l":"battery-half"},
{"c":"fa-battery-quarter","l":"battery-quarter"},
{"c":"fa-battery-three-quarters","l":"battery-three-quarters"},
{"c":"fa-bed","l":"bed"},
{"c":"fa-beer","l":"beer"},
{"c":"fa-bell","l":"bell"},
{"c":"fa-bell-slash","l":"bell-slash"},
{"c":"fa-bicycle","l":"bicycle"},
{"c":"fa-binoculars","l":"binoculars"},
{"c":"fa-birthday-cake","l":"birthday-cake"},
{"c":"fa-blind","l":"blind"},
{"c":"fa-bold","l":"bold"},
{"c":"fa-bolt","l":"bolt"},
{"c":"fa-bomb","l":"bomb"},
{"c":"fa-book","l":"book"},
{"c":"fa-bookmark","l":"bookmark"},
{"c":"fa-braille","l":"braille"},
{"c":"fa-briefcase","l":"briefcase"},
{"c":"fa-bug","l":"bug"},
{"c":"fa-building","l":"building"},
{"c":"fa-bullhorn","l":"bullhorn"},
{"c":"fa-bullseye","l":"bullseye"},
{"c":"fa-bus","l":"bus"},
{"c":"fa-calculator","l":"calculator"},
{"c":"fa-calendar","l":"calendar"},
{"c":"fa-calendar-alt","l":"calendar-alt"},
{"c":"fa-calendar-check","l":"calendar-check"},
{"c":"fa-calendar-minus","l":"calendar-minus"},
{"c":"fa-calendar-plus","l":"calendar-plus"},
{"c":"fa-calendar-times","l":"calendar-times"},
{"c":"fa-camera","l":"camera"},
{"c":"fa-camera-retro","l":"camera-retro"},
{"c":"fa-car","l":"car"},
{"c":"fa-caret-down","l":"caret-down"},
{"c":"fa-caret-left","l":"caret-left"},
{"c":"fa-caret-right","l":"caret-right"},
{"c":"fa-caret-square-down","l":"caret-square-down"},
{"c":"fa-caret-square-left","l":"caret-square-left"},
{"c":"fa-caret-square-right","l":"caret-square-right"},
{"c":"fa-caret-square-up","l":"caret-square-up"},
{"c":"fa-caret-up","l":"caret-up"},
{"c":"fa-cart-arrow-down","l":"cart-arrow-down"},
{"c":"fa-cart-plus","l":"cart-plus"},
{"c":"fa-certificate","l":"certificate"},
{"c":"fa-chart-area","l":"chart-area"},
{"c":"fa-chart-bar","l":"chart-bar"},
{"c":"fa-chart-line","l":"chart-line"},
{"c":"fa-chart-pie","l":"chart-pie"},
{"c":"fa-check","l":"check"},
{"c":"fa-check-circle","l":"check-circle"},
{"c":"fa-check-square","l":"check-square"},
{"c":"fa-chevron-circle-down","l":"chevron-circle-down"},
{"c":"fa-chevron-circle-left","l":"chevron-circle-left"},
{"c":"fa-chevron-circle-right","l":"chevron-circle-right"},
{"c":"fa-chevron-circle-up","l":"chevron-circle-up"},
{"c":"fa-chevron-down","l":"chevron-down"},
{"c":"fa-chevron-left","l":"chevron-left"},
{"c":"fa-chevron-right","l":"chevron-right"},
{"c":"fa-chevron-up","l":"chevron-up"},
{"c":"fa-child","l":"child"},
{"c":"fa-circle","l":"circle"},
{"c":"fa-circle-notch","l":"circle-notch"},
{"c":"fa-clipboard","l":"clipboard"},
{"c":"fa-clock","l":"clock"},
{"c":"fa-clone","l":"clone"},
{"c":"fa-closed-captioning","l":"closed-captioning"},
{"c":"fa-cloud","l":"cloud"},
{"c":"fa-cloud-download-alt","l":"cloud-download-alt"},
{"c":"fa-cloud-upload-alt","l":"cloud-upload-alt"},
{"c":"fa-code","l":"code"},
{"c":"fa-code-branch","l":"code-branch"},
{"c":"fa-coffee","l":"coffee"},
{"c":"fa-cog","l":"cog"},
{"c":"fa-cogs","l":"cogs"},
{"c":"fa-columns","l":"columns"},
{"c":"fa-comment","l":"comment"},
{"c":"fa-comment-alt","l":"comment-alt"},
{"c":"fa-comments","l":"comments"},
{"c":"fa-compass","l":"compass"},
{"c":"fa-compress","l":"compress"},
{"c":"fa-copy","l":"copy"},
{"c":"fa-copyright","l":"copyright"},
{"c":"fa-credit-card","l":"credit-card"},
{"c":"fa-crop","l":"crop"},
{"c":"fa-crosshairs","l":"crosshairs"},
{"c":"fa-cube","l":"cube"},
{"c":"fa-cubes","l":"cubes"},
{"c":"fa-cut","l":"cut"},
{"c":"fa-database","l":"database"},
{"c":"fa-deaf","l":"deaf"},
{"c":"fa-desktop","l":"desktop"},
{"c":"fa-dollar-sign","l":"dollar-sign"},
{"c":"fa-dot-circle","l":"dot-circle"},
{"c":"fa-download","l":"download"},
{"c":"fa-edit","l":"edit"},
{"c":"fa-eject","l":"eject"},
{"c":"fa-ellipsis-h","l":"ellipsis-h"},
{"c":"fa-ellipsis-v","l":"ellipsis-v"},
{"c":"fa-envelope","l":"envelope"},
{"c":"fa-envelope-open","l":"envelope-open"},
{"c":"fa-envelope-square","l":"envelope-square"},
{"c":"fa-eraser","l":"eraser"},
{"c":"fa-euro-sign","l":"euro-sign"},
{"c":"fa-exchange-alt","l":"exchange-alt"},
{"c":"fa-exclamation","l":"exclamation"},
{"c":"fa-exclamation-circle","l":"exclamation-circle"},
{"c":"fa-exclamation-triangle","l":"exclamation-triangle"},
{"c":"fa-expand","l":"expand"},
{"c":"fa-expand-arrows-alt","l":"expand-arrows-alt"},
{"c":"fa-external-link-alt","l":"external-link-alt"},
{"c":"fa-external-link-square-alt","l":"external-link-square-alt"},
{"c":"fa-eye","l":"eye"},
{"c":"fa-eye-dropper","l":"eye-dropper"},
{"c":"fa-eye-slash","l":"eye-slash"},
{"c":"fa-fast-backward","l":"fast-backward"},
{"c":"fa-fast-forward","l":"fast-forward"},
{"c":"fa-fax","l":"fax"},
{"c":"fa-female","l":"female"},
{"c":"fa-fighter-jet","l":"fighter-jet"},
{"c":"fa-file","l":"file"},
{"c":"fa-file-alt","l":"file-alt"},
{"c":"fa-file-archive","l":"file-archive"},
{"c":"fa-file-audio","l":"file-audio"},
{"c":"fa-file-code","l":"file-code"},
{"c":"fa-file-excel","l":"file-excel"},
{"c":"fa-file-image","l":"file-image"},
{"c":"fa-file-pdf","l":"file-pdf"},
{"c":"fa-file-powerpoint","l":"file-powerpoint"},
{"c":"fa-file-video","l":"file-video"},
{"c":"fa-file-word","l":"file-word"},
{"c":"fa-film","l":"film"},
{"c":"fa-filter","l":"filter"},
{"c":"fa-fire","l":"fire"},
{"c":"fa-fire-extinguisher","l":"fire-extinguisher"},
{"c":"fa-flag","l":"flag"},
{"c":"fa-flag-checkered","l":"flag-checkered"},
{"c":"fa-flask","l":"flask"},
{"c":"fa-folder","l":"folder"},
{"c":"fa-folder-open","l":"folder-open"},
{"c":"fa-font","l":"font"},
{"c":"fa-forward","l":"forward"},
{"c":"fa-frown","l":"frown"},
{"c":"fa-futbol","l":"futbol"},
{"c":"fa-gamepad","l":"gamepad"},
{"c":"fa-gavel","l":"gavel"},
{"c":"fa-gem","l":"gem"},
{"c":"fa-genderless","l":"genderless"},
{"c":"fa-gift","l":"gift"},
{"c":"fa-glass-martini","l":"glass-martini"},
{"c":"fa-globe","l":"globe"},
{"c":"fa-graduation-cap","l":"graduation-cap"},
{"c":"fa-h-square","l":"h-square"},
{"c":"fa-hand-lizard","l":"hand-lizard"},
{"c":"fa-hand-paper","l":"hand-paper"},
{"c":"fa-hand-peace","l":"hand-peace"},
{"c":"fa-hand-point-down","l":"hand-point-down"},
{"c":"fa-hand-point-left","l":"hand-point-left"},
{"c":"fa-hand-point-right","l":"hand-point-right"},
{"c":"fa-hand-point-up","l":"hand-point-up"},
{"c":"fa-hand-pointer","l":"hand-pointer"},
{"c":"fa-hand-rock","l":"hand-rock"},
{"c":"fa-hand-scissors","l":"hand-scissors"},
{"c":"fa-hand-spock","l":"hand-spock"},
{"c":"fa-handshake","l":"handshake"},
{"c":"fa-hashtag","l":"hashtag"},
{"c":"fa-hdd","l":"hdd"},
{"c":"fa-heading","l":"heading"},
{"c":"fa-headphones","l":"headphones"},
{"c":"fa-heart","l":"heart"},
{"c":"fa-heartbeat","l":"heartbeat"},
{"c":"fa-history","l":"history"},
{"c":"fa-home","l":"home"},
{"c":"fa-hospital","l":"hospital"},
{"c":"fa-hourglass","l":"hourglass"},
{"c":"fa-hourglass-end","l":"hourglass-end"},
{"c":"fa-hourglass-half","l":"hourglass-half"},
{"c":"fa-hourglass-start","l":"hourglass-start"},
{"c":"fa-i-cursor","l":"i-cursor"},
{"c":"fa-id-badge","l":"id-badge"},
{"c":"fa-id-card","l":"id-card"},
{"c":"fa-image","l":"image"},
{"c":"fa-images","l":"images"},
{"c":"fa-inbox","l":"inbox"},
{"c":"fa-indent","l":"indent"},
{"c":"fa-industry","l":"industry"},
{"c":"fa-info","l":"info"},
{"c":"fa-info-circle","l":"info-circle"},
{"c":"fa-italic","l":"italic"},
{"c":"fa-key","l":"key"},
{"c":"fa-keyboard","l":"keyboard"},
{"c":"fa-language","l":"language"},
{"c":"fa-laptop","l":"laptop"},
{"c":"fa-leaf","l":"leaf"},
{"c":"fa-lemon","l":"lemon"},
{"c":"fa-level-down-alt","l":"level-down-alt"},
{"c":"fa-level-up-alt","l":"level-up-alt"},
{"c":"fa-life-ring","l":"life-ring"},
{"c":"fa-lightbulb","l":"lightbulb"},
{"c":"fa-link","l":"link"},
{"c":"fa-lira-sign","l":"lira-sign"},
{"c":"fa-list","l":"list"},
{"c":"fa-list-alt","l":"list-alt"},
{"c":"fa-list-ol","l":"list-ol"},
{"c":"fa-list-ul","l":"list-ul"},
{"c":"fa-location-arrow","l":"location-arrow"},
{"c":"fa-lock","l":"lock"},
{"c":"fa-lock-open","l":"lock-open"},
{"c":"fa-long-arrow-alt-down","l":"long-arrow-alt-down"},
{"c":"fa-long-arrow-alt-left","l":"long-arrow-alt-left"},
{"c":"fa-long-arrow-alt-right","l":"long-arrow-alt-right"},
{"c":"fa-long-arrow-alt-up","l":"long-arrow-alt-up"},
{"c":"fa-low-vision","l":"low-vision"},
{"c":"fa-magic","l":"magic"},
{"c":"fa-magnet","l":"magnet"},
{"c":"fa-male","l":"male"},
{"c":"fa-map","l":"map"},
{"c":"fa-map-marker","l":"map-marker"},
{"c":"fa-map-marker-alt","l":"map-marker-alt"},
{"c":"fa-map-pin","l":"map-pin"},
{"c":"fa-map-signs","l":"map-signs"},
{"c":"fa-mars","l":"mars"},
{"c":"fa-mars-double","l":"mars-double"},
{"c":"fa-mars-stroke","l":"mars-stroke"},
{"c":"fa-mars-stroke-h","l":"mars-stroke-h"},
{"c":"fa-mars-stroke-v","l":"mars-stroke-v"},
{"c":"fa-medkit","l":"medkit"},
{"c":"fa-meh","l":"meh"},
{"c":"fa-mercury","l":"mercury"},
{"c":"fa-microchip","l":"microchip"},
{"c":"fa-microphone","l":"microphone"},
{"c":"fa-microphone-slash","l":"microphone-slash"},
{"c":"fa-minus","l":"minus"},
{"c":"fa-minus-circle","l":"minus-circle"},
{"c":"fa-minus-square","l":"minus-square"},
{"c":"fa-mobile","l":"mobile"},
{"c":"fa-mobile-alt","l":"mobile-alt"},
{"c":"fa-money-bill-alt","l":"money-bill-alt"},
{"c":"fa-moon","l":"moon"},
{"c":"fa-motorcycle","l":"motorcycle"},
{"c":"fa-mouse-pointer","l":"mouse-pointer"},
{"c":"fa-music","l":"music"},
{"c":"fa-neuter","l":"neuter"},
{"c":"fa-newspaper","l":"newspaper"},
{"c":"fa-object-group","l":"object-group"},
{"c":"fa-object-ungroup","l":"object-ungroup"},
{"c":"fa-outdent","l":"outdent"},
{"c":"fa-paint-brush","l":"paint-brush"},
{"c":"fa-paper-plane","l":"paper-plane"},
{"c":"fa-paperclip","l":"paperclip"},
{"c":"fa-paragraph","l":"paragraph"},
{"c":"fa-paste","l":"paste"},
{"c":"fa-pause","l":"pause"},
{"c":"fa-pause-circle","l":"pause-circle"},
{"c":"fa-paw","l":"paw"},
{"c":"fa-pen-square","l":"pen-square"},
{"c":"fa-pencil-alt","l":"pencil-alt"},
{"c":"fa-percent","l":"percent"},
{"c":"fa-phone","l":"phone"},
{"c":"fa-phone-square","l":"phone-square"},
{"c":"fa-phone-volume","l":"phone-volume"},
{"c":"fa-plane","l":"plane"},
{"c":"fa-play","l":"play"},
{"c":"fa-play-circle","l":"play-circle"},
{"c":"fa-plug","l":"plug"},
{"c":"fa-plus","l":"plus"},
{"c":"fa-plus-circle","l":"plus-circle"},
{"c":"fa-plus-square","l":"plus-square"},
{"c":"fa-podcast","l":"podcast"},
{"c":"fa-pound-sign","l":"pound-sign"},
{"c":"fa-power-off","l":"power-off"},
{"c":"fa-print","l":"print"},
{"c":"fa-puzzle-piece","l":"puzzle-piece"},
{"c":"fa-qrcode","l":"qrcode"},
{"c":"fa-question","l":"question"},
{"c":"fa-question-circle","l":"question-circle"},
{"c":"fa-quote-left","l":"quote-left"},
{"c":"fa-quote-right","l":"quote-right"},
{"c":"fa-random","l":"random"},
{"c":"fa-recycle","l":"recycle"},
{"c":"fa-redo","l":"redo"},
{"c":"fa-redo-alt","l":"redo-alt"},
{"c":"fa-registered","l":"registered"},
{"c":"fa-reply","l":"reply"},
{"c":"fa-reply-all","l":"reply-all"},
{"c":"fa-retweet","l":"retweet"},
{"c":"fa-road","l":"road"},
{"c":"fa-rocket","l":"rocket"},
{"c":"fa-rss","l":"rss"},
{"c":"fa-rss-square","l":"rss-square"},
{"c":"fa-ruble-sign","l":"ruble-sign"},
{"c":"fa-rupee-sign","l":"rupee-sign"},
{"c":"fa-save","l":"save"},
{"c":"fa-search","l":"search"},
{"c":"fa-search-minus","l":"search-minus"},
{"c":"fa-search-plus","l":"search-plus"},
{"c":"fa-server","l":"server"},
{"c":"fa-share","l":"share"},
{"c":"fa-share-alt","l":"share-alt"},
{"c":"fa-share-alt-square","l":"share-alt-square"},
{"c":"fa-share-square","l":"share-square"},
{"c":"fa-shekel-sign","l":"shekel-sign"},
{"c":"fa-shield-alt","l":"shield-alt"},
{"c":"fa-ship","l":"ship"},
{"c":"fa-shopping-bag","l":"shopping-bag"},
{"c":"fa-shopping-basket","l":"shopping-basket"},
{"c":"fa-shopping-cart","l":"shopping-cart"},
{"c":"fa-shower","l":"shower"},
{"c":"fa-sign-in-alt","l":"sign-in-alt"},
{"c":"fa-sign-language","l":"sign-language"},
{"c":"fa-sign-out-alt","l":"sign-out-alt"},
{"c":"fa-signal","l":"signal"},
{"c":"fa-sitemap","l":"sitemap"},
{"c":"fa-sliders-h","l":"sliders-h"},
{"c":"fa-smile","l":"smile"},
{"c":"fa-snowflake","l":"snowflake"},
{"c":"fa-sort","l":"sort"},
{"c":"fa-sort-alpha-down","l":"sort-alpha-down"},
{"c":"fa-sort-alpha-up","l":"sort-alpha-up"},
{"c":"fa-sort-amount-down","l":"sort-amount-down"},
{"c":"fa-sort-amount-up","l":"sort-amount-up"},
{"c":"fa-sort-down","l":"sort-down"},
{"c":"fa-sort-numeric-down","l":"sort-numeric-down"},
{"c":"fa-sort-numeric-up","l":"sort-numeric-up"},
{"c":"fa-sort-up","l":"sort-up"},
{"c":"fa-space-shuttle","l":"space-shuttle"},
{"c":"fa-spinner","l":"spinner"},
{"c":"fa-square","l":"square"},
{"c":"fa-star","l":"star"},
{"c":"fa-star-half","l":"star-half"},
{"c":"fa-step-backward","l":"step-backward"},
{"c":"fa-step-forward","l":"step-forward"},
{"c":"fa-stethoscope","l":"stethoscope"},
{"c":"fa-sticky-note","l":"sticky-note"},
{"c":"fa-stop","l":"stop"},
{"c":"fa-stop-circle","l":"stop-circle"},
{"c":"fa-stopwatch","l":"stopwatch"},
{"c":"fa-street-view","l":"street-view"},
{"c":"fa-strikethrough","l":"strikethrough"},
{"c":"fa-subscript","l":"subscript"},
{"c":"fa-subway","l":"subway"},
{"c":"fa-suitcase","l":"suitcase"},
{"c":"fa-sun","l":"sun"},
{"c":"fa-superscript","l":"superscript"},
{"c":"fa-sync","l":"sync"},
{"c":"fa-sync-alt","l":"sync-alt"},
{"c":"fa-table","l":"table"},
{"c":"fa-tablet","l":"tablet"},
{"c":"fa-tablet-alt","l":"tablet-alt"},
{"c":"fa-tachometer-alt","l":"tachometer-alt"},
{"c":"fa-tag","l":"tag"},
{"c":"fa-tags","l":"tags"},
{"c":"fa-tasks","l":"tasks"},
{"c":"fa-taxi","l":"taxi"},
{"c":"fa-terminal","l":"terminal"},
{"c":"fa-text-height","l":"text-height"},
{"c":"fa-text-width","l":"text-width"},
{"c":"fa-th","l":"th"},
{"c":"fa-th-large","l":"th-large"},
{"c":"fa-th-list","l":"th-list"},
{"c":"fa-thermometer-empty","l":"thermometer-empty"},
{"c":"fa-thermometer-full","l":"thermometer-full"},
{"c":"fa-thermometer-half","l":"thermometer-half"},
{"c":"fa-thermometer-quarter","l":"thermometer-quarter"},
{"c":"fa-thermometer-three-quarters","l":"thermometer-three-quarters"},
{"c":"fa-thumbs-down","l":"thumbs-down"},
{"c":"fa-thumbs-up","l":"thumbs-up"},
{"c":"fa-thumbtack","l":"thumbtack"},
{"c":"fa-ticket-alt","l":"ticket-alt"},
{"c":"fa-times","l":"times"},
{"c":"fa-times-circle","l":"times-circle"},
{"c":"fa-tint","l":"tint"},
{"c":"fa-toggle-off","l":"toggle-off"},
{"c":"fa-toggle-on","l":"toggle-on"},
{"c":"fa-trademark","l":"trademark"},
{"c":"fa-train","l":"train"},
{"c":"fa-transgender","l":"transgender"},
{"c":"fa-transgender-alt","l":"transgender-alt"},
{"c":"fa-trash","l":"trash"},
{"c":"fa-trash-alt","l":"trash-alt"},
{"c":"fa-tree","l":"tree"},
{"c":"fa-trophy","l":"trophy"},
{"c":"fa-truck","l":"truck"},
{"c":"fa-tty","l":"tty"},
{"c":"fa-tv","l":"tv"},
{"c":"fa-umbrella","l":"umbrella"},
{"c":"fa-underline","l":"underline"},
{"c":"fa-undo","l":"undo"},
{"c":"fa-undo-alt","l":"undo-alt"},
{"c":"fa-universal-access","l":"universal-access"},
{"c":"fa-university","l":"university"},
{"c":"fa-unlink","l":"unlink"},
{"c":"fa-unlock","l":"unlock"},
{"c":"fa-unlock-alt","l":"unlock-alt"},
{"c":"fa-upload","l":"upload"},
{"c":"fa-user","l":"user"},
{"c":"fa-user-circle","l":"user-circle"},
{"c":"fa-user-md","l":"user-md"},
{"c":"fa-user-plus","l":"user-plus"},
{"c":"fa-user-secret","l":"user-secret"},
{"c":"fa-user-times","l":"user-times"},
{"c":"fa-users","l":"users"},
{"c":"fa-utensil-spoon","l":"utensil-spoon"},
{"c":"fa-utensils","l":"utensils"},
{"c":"fa-venus","l":"venus"},
{"c":"fa-venus-double","l":"venus-double"},
{"c":"fa-venus-mars","l":"venus-mars"},
{"c":"fa-video","l":"video"},
{"c":"fa-volume-down","l":"volume-down"},
{"c":"fa-volume-off","l":"volume-off"},
{"c":"fa-volume-up","l":"volume-up"},
{"c":"fa-wheelchair","l":"wheelchair"},
{"c":"fa-wifi","l":"wifi"},
{"c":"fa-window-close","l":"window-close"},
{"c":"fa-window-maximize","l":"window-maximize"},
{"c":"fa-window-minimize","l":"window-minimize"},
{"c":"fa-window-restore","l":"window-restore"},
{"c":"fa-won-sign","l":"won-sign"},
{"c":"fa-wrench","l":"wrench"},
{"c":"fa-yen-sign","l":"yen-sign"},
];
return icons;
},
generateRandomString(length=16) {
//characters to be included in string
const characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = ' ';
const charactersLength = characters.length;
for ( let i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
},
reInitializePlugins(element){
const self = this;
if(element.type == 'countdown') {
jQuery("#"+element.name).countdowntimer("destroy");
setTimeout(function(){
initialize_countdowntimer(element);
}, 2000); //initialize after 2 sec
}
}
},
};
</script>

2
resources/js/iframeResizer.js vendored Normal file
View File

@@ -0,0 +1,2 @@
import iFrameResize from 'iframe-resizer/js/iframeResizer.min.js';

View File

@@ -0,0 +1 @@
import iFrameResize from 'iframe-resizer/js/iframeResizer.contentWindow.min.js';

1
resources/js/widget.js vendored Normal file
View File

@@ -0,0 +1 @@
iFrameResize({log: true, scrolling: true, sizeWidth: true, resizeFrom: 'child'})

View File

@@ -0,0 +1,116 @@
/*! CountdownTimer for jQuery @version2.0.0 (https://harshen.github.io/jQuery-countdownTimer/).
* Written by Harshen Pandey (https://remote.com/harshen) January 2014.
* @license MIT (https://github.com/harshen/jQuery-countdownTimer/blob/master/LICENSE.md)
* and GPLv3 (https://github.com/harshen/jQuery-countdownTimer/blob/master/LICENSE-GPL.md).
* @release - 27/10/2017
* Copyright (c) 2017 - 2020 Harshen Pandey
* Please attribute the author if you use it.
*/
/* jQuery.countdownTimer.css*/
.style {
width: 100%;
font-family: sans-serif;
font-weight: bold;
border-style: solid;
}
.colorDefinition {
background: #000000;
color : #FFFFFF;
border-color: #F0068E;
}
.size_xl {
font-size:50px;
border-width: 8px;
border-radius: 6px;
}
.size_lg {
font-size:40px;
border-width: 7px;
border-radius: 5px;
}
.size_md {
font-size:30px;
border-width: 5px;
border-radius: 4px;
}
.size_sm {
font-size:20px;
border-width: 3px;
border-radius: 3px;
}
.size_xs {
font-size:15px;
border-width: 2px;
border-radius: 2px;
}
.lang-rtl {
direction: rtl;
}
.displaySection {
display: block;
float: left;
font-size: 75%;
text-align: center;
border-right: 5px solid #F0068E;
}
.timerDisplay > span.displaySection:last-child {
border-right: none;
}
.label6 .displaySection {
width: 15%;
}
.label5 .displaySection {
width: 18%;
}
.label4 .displaySection {
width: 23.5%;
}
.label3 .displaySection {
width: 31.8%;
}
.label2 .displaySection {
width: 48.6%;
}
.label1 .displaySection {
width: 98%;
}
.numberDisplay {
font-size: 200%;
}
.periodDisplay {
display: block;
}
.timerDisplay {
clear: both;
width: 100%;
padding: 8px 4px;
text-align: center;
float: left;
}
.labelformat {
float: left;
width: 350px;
font-size: 15px;
border-width: 7px;
border-radius: 5px;
}

View File

@@ -0,0 +1,728 @@
/*! CountdownTimer for jQuery @version2.0.0 (https://harshen.github.io/jQuery-countdownTimer/).
* Written by Harshen Pandey (https://remote.com/harshen) January 2014.
* @license MIT (https://github.com/harshen/jQuery-countdownTimer/blob/master/LICENSE.md)
* and GPLv3 (https://github.com/harshen/jQuery-countdownTimer/blob/master/LICENSE-GPL.md).
* @release - 27/10/2017
* Copyright (c) 2017 - 2020 Harshen Pandey
* Please attribute the author if you use it.
*/
/* jQuery.countdownTimer.js*/
(function($) {
"use strict";
var methods = {
init: function(options) {
return this.each(function() {
countdown($(this), options);
});
},
destroy: function() {
this.data('countdowntimer', $.extend(true, {}, $.fn.countdowntimer.defaults, {
destroy: true
}));
},
pause: function(options) {
this.data('countdowntimer', $.extend(true, {}, $.fn.countdowntimer.defaults, {
pause: options
}));
pauseTimer($(this), $(this).data('typefunc').type, $(this).data('opts').opts, $(this).data('typefunc').func);
},
stop: function(options) {
this.data('countdowntimer', $.extend(true, {}, $.fn.countdowntimer.defaults, {
stop: options
}));
stopTimer($(this), $(this).data('typefunc').type, $(this).data('opts').opts, $(this).data('typefunc').func);
}
};
$.fn.countdowntimer = function(methodOrOptions) {
if (methods[methodOrOptions]) {
return methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof methodOrOptions === 'object' || !methodOrOptions) {
this.data('countdowntimer', $.extend(true, {}, $.fn.countdowntimer.defaults, methodOrOptions));
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + methodOrOptions + ' does not exist on jQuery.countdownTimer');
}
};
//Definition of private function countdown.
function countdown($this, options) {
var opts = $.extend({}, $.fn.countdowntimer.defaults, options);
$.extend(true, opts, $.fn.countdowntimer.regionalOptions, options);
$this.data('opts', {
opts: opts
});
$this.addClass("style");
var size = opts.size;
var borderColor = opts.borderColor;
var fontColor = opts.fontColor;
var backgroundColor = opts.backgroundColor;
if (options.regexpMatchFormat !== undefined && options.regexpReplaceWith !== undefined && options.timeSeparator === undefined && options.labelsFormat === undefined) {
window['regexpMatchFormat_' + $this.attr('id')] = options.regexpMatchFormat;
window['regexpReplaceWith_' + $this.attr('id')] = options.regexpReplaceWith;
}
if (options.displayFormat !== undefined) {
var format = [];
format[0] = (opts.displayFormat.match('Y') ? '!' : '#');
format[1] = (opts.displayFormat.match('O') ? '!' : '#');
format[2] = (opts.displayFormat.match('D') ? '!' : '#');
format[3] = (opts.displayFormat.match('H') ? '!' : '#');
format[4] = (opts.displayFormat.match('M') ? '!' : '#');
format[5] = (opts.displayFormat.match('S') ? '!' : '#');
opts.displayFormat = format.join('');
} else {
opts.displayFormat = "###!!!";
}
if (options.borderColor !== undefined || options.fontColor !== undefined || options.backgroundColor !== undefined) {
var customStyle = {
"background": backgroundColor,
"color": fontColor,
"border-color": borderColor
};
$this.css(customStyle);
} else {
$this.addClass("colorDefinition");
}
if (opts.labelsFormat === false) {
if (options.size !== undefined) {
switch (size) {
case "xl":
$this.addClass("size_xl");
break;
case "lg":
$this.addClass("size_lg");
break;
case "md":
$this.addClass("size_md");
break;
case "sm":
$this.addClass("size_sm");
break;
case "xs":
$this.addClass("size_xs");
break;
}
} else if (size === "sm") {
$this.addClass("size_sm");
}
}
if (opts.isRTL === true) {
$this.addClass("lang-rtl");
}
if (options.startDate === undefined && options.dateAndTime === undefined && options.currentTime === undefined && (options.hours !== undefined || options.minutes !== undefined || options.seconds !== undefined)) {
if (options.hours !== undefined && options.minutes === undefined && options.seconds === undefined) {
setTimerInterval($this, "H", opts, onlyHours, options);
} else if (options.hours === undefined && options.minutes !== undefined && options.seconds === undefined) {
setTimerInterval($this, "M", opts, onlyMinutes, options);
} else if (options.hours === undefined && options.minutes === undefined && options.seconds !== undefined) {
setTimerInterval($this, "S", opts, onlySeconds, options);
} else if (options.hours !== undefined && options.minutes !== undefined && options.seconds === undefined) {
setTimerInterval($this, "HM", opts, hoursMinutes, options);
} else if (options.hours === undefined && options.minutes !== undefined && options.seconds !== undefined) {
setTimerInterval($this, "MS", opts, minutesSeconds, options);
} else if (options.hours !== undefined && options.minutes === undefined && options.seconds !== undefined) {
setTimerInterval($this, "HS", opts, hoursSeconds, options);
} else if (options.hours !== undefined && options.minutes !== undefined && options.seconds !== undefined) {
setTimerInterval($this, "HMS", opts, hoursMinutesSeconds, options);
}
} else if (options.startDate !== undefined && options.dateAndTime !== undefined && options.currentTime === undefined) {
window['startDate' + $this.attr('id')] = new Date(opts.startDate);
window['endDate' + $this.attr('id')] = (opts.timeZone !== null ? setTimezone(new Date(opts.dateAndTime), opts.timeZone) : new Date(opts.dateAndTime));
var typeStart = "withStart";
if (options.beforeExpiryTime !== undefined) {
window['beforeExpiry_' + typeStart + $this.attr('id')] = opts.beforeExpiryTime;
}
givenDate($this, opts, typeStart);
window['timer_startDate' + $this.attr('id')] = setInterval(function() {
givenDate($this, opts, typeStart);
}, opts.tickInterval * 1000);
} else if (options.startDate === undefined && options.dateAndTime !== undefined && options.currentTime === undefined) {
var hour = opts.startDate.getHours();
var minutes = opts.startDate.getMinutes();
var seconds = opts.startDate.getSeconds();
var month = (opts.startDate.getMonth() + 1);
var date = opts.startDate.getDate();
var year = opts.startDate.getFullYear();
var timeStart = new Date(year + '/' + month + '/' + date + ' ' + hour + ':' + minutes + ':' + seconds);
window['startTime' + $this.attr('id')] = timeStart;
window['dateTime' + $this.attr('id')] = (opts.timeZone !== null ? setTimezone(new Date(opts.dateAndTime), opts.timeZone) : new Date(opts.dateAndTime));
var typeNostart = "withnoStart";
if (options.beforeExpiryTime !== undefined) {
window['beforeExpiry_' + typeNostart + $this.attr('id')] = opts.beforeExpiryTime;
}
givenDate($this, opts, typeNostart);
window['timer_givenDate' + $this.attr('id')] = setInterval(function() {
givenDate($this, opts, typeNostart);
}, opts.tickInterval * 1000);
} else if (options.currentTime !== undefined && opts.currentTime === true) {
currentDate($this, opts);
window['timer_currentDate' + $this.attr('id')] = setInterval(function() {
currentDate($this, opts);
}, opts.tickInterval * 1000);
} else {
window['countSeconds' + $this.attr('id')] = opts.seconds;
secondsTimer($this, opts);
window['timer_secondsTimer' + $this.attr('id')] = setInterval(function() {
secondsTimer($this, opts);
}, 1000);
}
}
function setTimerInterval($this, timerType, opts, funcName, options) {
$this.data('typefunc', {
type: timerType,
func: funcName
});
window['hours_' + timerType + $this.attr('id')] = opts.hours;
window['minutes_' + timerType + $this.attr('id')] = opts.minutes;
window['seconds_' + timerType + $this.attr('id')] = opts.seconds;
if (options.beforeExpiryTime !== undefined) {
window['beforeExpiry_' + timerType + $this.attr('id')] = opts.beforeExpiryTime;
}
if (options.pauseButton !== undefined) {
pauseTimer($this, timerType, opts, funcName);
}
if (options.stopButton !== undefined) {
stopTimer($this, timerType, opts, funcName);
}
funcName($this, opts);
window['timer_' + timerType + $this.attr('id')] = setInterval(function() {
funcName($this, opts);
}, opts.tickInterval * 1000);
}
function setTimezone(datetime, offset) {
var newTime = (new Date((datetime.getTime() + (datetime.getTimezoneOffset() * 60000)) + (60000 * (Math.abs(offset) < 30 ? offset * 60 : offset))));
return newTime;
}
//Function for only hours are set when invoking plugin.
function onlyHours($this, opts) {
var id = $this.attr('id');
var time = "";
if (window['minutes_H' + id] === opts.minutes && window['seconds_H' + id] === opts.seconds && window['hours_H' + id] === opts.hours) {
time = prepareTime($this, opts, 0, 0, 0, window['hours_H' + id], 0, 0);
html($this, time, opts);
if (typeof window['beforeExpiry_H' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'H');
}
window['seconds_H' + id] = 60 - opts.tickInterval;
window['minutes_H' + id] = 59;
if (window['hours_H' + id] !== 0) {
window['hours_H' + id]--;
} else {
clearTimerInterval($this, "H", opts);
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, "H", opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, window['hours_H' + id], window['minutes_H' + id], window['seconds_H' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_H' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'H');
}
window['seconds_H' + id] -= opts.tickInterval;
if (window['minutes_H' + id] !== 0 && window['seconds_H' + id] < 0) {
window['minutes_H' + id]--;
window['seconds_H' + id] = 60 - opts.tickInterval;
}
if (window['minutes_H' + id] === 0 && window['seconds_H' + id] < 0 && window['hours_H' + id] !== 0) {
window['hours_H' + id]--;
window['minutes_H' + id] = 59;
window['seconds_H' + id] = 60 - opts.tickInterval;
}
if ((window['minutes_H' + id] === 0 && window['seconds_H' + id] < 0 && window['hours_H' + id] === 0) || $this.data('countdowntimer').destroy === true) {
clearTimerInterval($this, "H", opts);
}
}
id = null;
}
//Function for only minutes are set when invoking plugin.
function onlyMinutes($this, opts) {
var id = $this.attr('id');
var time = "";
if (window['minutes_M' + id] === opts.minutes && window['seconds_M' + id] === opts.seconds) {
time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_M' + id], 0);
html($this, time, opts);
if (typeof window['beforeExpiry_M' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'M');
}
window['seconds_M' + id] = 60 - opts.tickInterval;
if (window['minutes_M' + id] !== 0) {
window['minutes_M' + id]--;
} else {
clearTimerInterval($this, "M", opts);
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, "M", opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_M' + id], window['seconds_M' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_M' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'M');
}
window['seconds_M' + id] -= opts.tickInterval;
if (window['minutes_M' + id] !== 0 && window['seconds_M' + id] < 0) {
window['minutes_M' + id]--;
window['seconds_M' + id] = 60 - opts.tickInterval;
}
if ((window['minutes_M' + id] === 0 && window['seconds_M' + id] < 0) || $this.data('countdowntimer').destroy === true) {
clearTimerInterval($this, "M", opts);
}
}
id = null;
}
//Function for only seconds are set when invoking plugin.
function onlySeconds($this, opts) {
var id = $this.attr('id');
var time = "";
time = prepareTime($this, opts, 0, 0, 0, 0, 0, window['seconds_S' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_S' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'S');
}
window['seconds_S' + id] -= opts.tickInterval;
if ((window['seconds_S' + id] < 0) || ($this.data('countdowntimer').destroy === true)) {
clearTimerInterval($this, "S", opts);
}
id = null;
}
//Function for hours and minutes are set when invoking plugin.
function hoursMinutes($this, opts) {
var id = $this.attr('id');
var time = "";
if (window['minutes_HM' + id] === opts.minutes && window['hours_HM' + id] === opts.hours) {
time = prepareTime($this, opts, 0, 0, 0, window['hours_HM' + id], window['minutes_HM' + id], 0);
html($this, time, opts);
if (typeof window['beforeExpiry_HM' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'HM');
}
if (window['hours_HM' + id] !== 0 && window['minutes_HM' + id] === 0) {
window['hours_HM' + id]--;
window['minutes_HM' + id] = 59;
window['seconds_HM' + id] = 60 - opts.tickInterval;
} else if (window['hours_HM' + id] === 0 && window['minutes_HM' + id] !== 0) {
window['seconds_HM' + id] = 60 - opts.tickInterval;
window['minutes_HM' + id]--;
} else {
window['seconds_HM' + id] = 60 - opts.tickInterval;
window['minutes_HM' + id]--;
}
if (window['hours_HM' + id] === 0 && window['minutes_HM' + id] === 0 && window['seconds_HM' + id] == 60) {
clearTimerInterval($this, "HM", opts);
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, "HM", opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, window['hours_HM' + id], window['minutes_HM' + id], window['seconds_HM' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_HM' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'HM');
}
window['seconds_HM' + id] -= opts.tickInterval;
if (window['minutes_HM' + id] !== 0 && window['seconds_HM' + id] < 0) {
window['minutes_HM' + id]--;
window['seconds_HM' + id] = 60 - opts.tickInterval;
}
if (window['minutes_HM' + id] === 0 && window['seconds_HM' + id] < 0 && window['hours_HM' + id] !== 0) {
window['hours_HM' + id]--;
window['minutes_HM' + id] = 59;
window['seconds_HM' + id] = 60 - opts.tickInterval;
}
if ((window['minutes_HM' + id] === 0 && window['seconds_HM' + id] < 0 && window['hours_HM' + id] === 0) || $this.data('countdowntimer').destroy === true) {
clearTimerInterval($this, "HM", opts);
}
}
id = null;
}
//Function for minutes and seconds are set when invoking plugin.
function minutesSeconds($this, opts) {
var id = $this.attr('id');
var time = "";
if (window['minutes_MS' + id] === opts.minutes && window['seconds_MS' + id] === opts.seconds) {
time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_MS' + id], window['seconds_MS' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_MS' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'MS');
}
if (window['minutes_MS' + id] !== 0 && window['seconds_MS' + id] === 0) {
window['minutes_MS' + id]--;
window['seconds_MS' + id] = 60 - opts.tickInterval;
} else if (window['minutes_MS' + id] === 0 && window['seconds_MS' + id] === 0) {
clearTimerInterval($this, "MS", opts);
} else {
window['seconds_MS' + id] -= opts.tickInterval;
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, "MS", opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_MS' + id], window['seconds_MS' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_MS' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'MS');
}
window['seconds_MS' + id] -= opts.tickInterval;
if (window['minutes_MS' + id] !== 0 && window['seconds_MS' + id] < 0) {
window['minutes_MS' + id]--;
window['seconds_MS' + id] = 60 - opts.tickInterval;
}
if ((window['minutes_MS' + id] === 0 && window['seconds_MS' + id] < 0) || $this.data('countdowntimer').destroy === true) {
clearTimerInterval($this, "MS", opts);
}
}
id = null;
}
//Function for hours and seconds are set when invoking plugin.
function hoursSeconds($this, opts) {
var id = $this.attr('id');
var time = "";
if (window['seconds_HS' + id] === opts.seconds && window['hours_HS' + id] === opts.hours) {
time = prepareTime($this, opts, 0, 0, 0, window['hours_HS' + id], 0, window['seconds_HS' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_HS' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'HS');
}
if (window['hours_HS' + id] === 0 && window['seconds_HS' + id] === 0) {
clearTimerInterval($this, "HS", opts);
} else if (window['hours_HS' + id] !== 0 && window['seconds_HS' + id] === 0) {
window['hours_HS' + id]--;
window['minutes_HS' + id] = 59;
window['seconds_HS' + id] = 60 - opts.tickInterval;
} else {
window['seconds_HS' + id] -= opts.tickInterval;
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, "HS", opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, window['hours_HS' + id], window['minutes_HS' + id], window['seconds_HS' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_HS' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'HS');
}
window['seconds_HS' + id] -= opts.tickInterval;
if (window['minutes_HS' + id] !== 0 && window['seconds_HS' + id] < 0) {
window['minutes_HS' + id]--;
window['seconds_HS' + id] = 60 - opts.tickInterval;
}
if (window['minutes_HS' + id] === 0 && window['seconds_HS' + id] < 0 && window['hours_HS' + id] !== 0) {
window['hours_HS' + id]--;
window['minutes_HS' + id] = 59;
window['seconds_HS' + id] = 60 - opts.tickInterval;
}
if ((window['minutes_HS' + id] === 0 && window['seconds_HS' + id] < 0 && window['hours_HS' + id] === 0) || $this.data('countdowntimer').destroy === true) {
clearTimerInterval($this, "HS", opts);
}
}
id = null;
}
//Function for hours, minutes and seconds are set when invoking plugin.
function hoursMinutesSeconds($this, opts) {
var id = $this.attr('id');
var time = "";
if (window['minutes_HMS' + id] === opts.minutes && window['seconds_HMS' + id] === opts.seconds && window['hours_HMS' + id] === opts.hours) {
time = prepareTime($this, opts, 0, 0, 0, window['hours_HMS' + id], window['minutes_HMS' + id], window['seconds_HMS' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_HMS' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'HMS');
}
if (window['hours_HMS' + id] === 0 && window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] === 0) {
clearTimerInterval($this, "HMS", opts);
} else if (window['hours_HMS' + id] !== 0 && window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] === 0) {
window['hours_HMS' + id]--;
window['minutes_HMS' + id] = 59;
window['seconds_HMS' + id] = 60 - opts.tickInterval;
} else if (window['hours_HMS' + id] === 0 && window['minutes_HMS' + id] !== 0 && window['seconds_HMS' + id] === 0) {
window['minutes_HMS' + id]--;
window['seconds_HMS' + id] = 60 - opts.tickInterval;
} else if (window['hours_HMS' + id] !== 0 && window['minutes_HMS' + id] !== 0 && window['seconds_HMS' + id] === 0) {
window['minutes_HMS' + id]--;
window['seconds_HMS' + id] = 60 - opts.tickInterval;
} else {
window['seconds_HMS' + id] -= opts.tickInterval;
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, "HMS", opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, window['hours_HMS' + id], window['minutes_HMS' + id], window['seconds_HMS' + id]);
html($this, time, opts);
if (typeof window['beforeExpiry_HMS' + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, 'HMS');
}
window['seconds_HMS' + id] -= opts.tickInterval;
if (window['minutes_HMS' + id] !== 0 && window['seconds_HMS' + id] < 0) {
window['minutes_HMS' + id]--;
window['seconds_HMS' + id] = 60 - opts.tickInterval;
}
if (window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] < 0 && window['hours_HMS' + id] !== 0) {
window['hours_HMS' + id]--;
window['minutes_HMS' + id] = 59;
window['seconds_HMS' + id] = 60 - opts.tickInterval;
}
if ((window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] < 0 && window['hours_HMS' + id] === 0) || $this.data('countdowntimer').destroy === true) {
clearTimerInterval($this, "HMS", opts);
}
}
id = null;
}
//Function for reverse timer to given date.
function givenDate($this, opts, type) {
var id = $this.attr('id');
var endDate = (type === "withnoStart") ? window['dateTime' + id] : window['endDate' + id];
var startDate = (type === "withnoStart") ? window['startTime' + id] : window['startDate' + id];
var totalSeconds = ((endDate - startDate) / 1000);
var time = "";
if ((endDate - startDate) > 0) {
if (type === "withStart" && (startDate > (new Date()))) {
time = prepareTime($this, opts, 0, 0, 0, 0, 0, 0);
html($this, time, opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, 0, 0, totalSeconds);
html($this, time, opts);
if (typeof window['beforeExpiry_' + type + id] !== 'undefined') {
beforeExpiryTime($this, opts, time, type);
}
var setSecondsInterval = ((type == "withnoStart") ? (window['startTime' + id].setSeconds(window['startTime' + id].getSeconds() + opts.tickInterval)) : (window['startDate' + id].setSeconds(window['startDate' + id].getSeconds() + opts.tickInterval)));
}
if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, type, opts);
} else {
time = prepareTime($this, opts, 0, 0, 0, 0, 0, 0);
html($this, time, opts);
clearTimerInterval($this, type, opts);
}
id = null;
}
//Function for displaying current time.
function currentDate($this, opts) {
var time = "";
var today = (opts.timeZone !== null ? setTimezone(new Date(), opts.timeZone) : new Date());
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
time = prepareTime($this, opts, 0, 0, 0, hours, minutes, seconds);
html($this, time, opts);
}
//Default function called when no options are set.
function secondsTimer($this, opts) {
var id = $this.attr('id');
if (window['countSeconds' + id].toString().length < 2) {
window['countSeconds' + id] = "0" + window['countSeconds' + id];
}
$this.html(window['countSeconds' + id] + " " + "sec");
window['countSeconds' + id]--;
if (window['countSeconds' + id] == -1) {
delete window['countSeconds' + id];
clearInterval(window['timer_secondsTimer' + id]);
}
id = null;
}
//Function for calling the given function name when time is expired.
function timeUp($this, opts) {
if (opts.timeUp !== null) {
if ($.isFunction(opts.timeUp) === true) {
opts.timeUp.apply($this, []);
}
}
if (opts.expiryUrl !== null) {
window.location = opts.expiryUrl;
}
}
//Function for calling the given function name before expiry time.
function beforeExpiryTime($this, opts, time, type) {
var id = $this.attr('id');
var bforeExpTime = window['beforeExpiry_' + type + id];
bforeExpTime = bforeExpTime.split(":");
time = time.split(opts.timeSeparator);
if (time[0] === "0" && time[1] === "0") {
for (var m = 0; m < (time.length - 2); m++) {
time[m] = (time[m + 2] < 10 ? "0" + time[m + 2] : time[m + 2]);
}
time.splice(4, 2);
if (bforeExpTime[0] === time[0] && bforeExpTime[1] === time[1] && bforeExpTime[2] === time[2] && bforeExpTime[3] === time[3]) {
if (opts.beforeExpiryTimeFunction !== null) {
if ($.isFunction(opts.beforeExpiryTimeFunction) === true) {
opts.beforeExpiryTimeFunction.apply($this, []);
}
}
}
}
}
function prepareTime($this, opts, years, months, days, hours, minutes, seconds) {
if (typeof(years) === 'undefined') years = 0;
if (typeof(months) === 'undefined') months = 0;
if (typeof(days) === 'undefined') days = 0;
if (typeof(hours) === 'undefined') hours = 0;
if (typeof(minutes) === 'undefined') minutes = 0;
if (typeof(seconds) === 'undefined') seconds = 0;
var s = (Math.round(years * 31536000 * 100) / 100) + (Math.round(months * 2628000 * 100) / 100) + (Math.round(days * 86400 * 100) / 100) + (Math.round(hours * 3600 * 100) / 100) + (Math.round(minutes * 60 * 100) / 100) + (Math.round(seconds * 100) / 100);
var format = opts.displayFormat.split('');
var yearsFormat = (format[0] === "!" ? (Math.floor(s / 31536000)) : 0);
var monthsFormat = (format[1] === "!" ? (Math.round(Math.floor((s / 2628000) - ((yearsFormat * 31536000) / 2628000)))) : 0);
var daysFormat = (format[2] === "!" ? (Math.round(Math.floor((s / 86400) - ((monthsFormat * 2628000) / 86400) - ((yearsFormat * 31536000) / 86400)))) : 0);
var hoursFormat = (format[3] === "!" ? (Math.round(Math.floor((s / 3600) - ((monthsFormat * 2628000) / 3600) - ((yearsFormat * 31536000) / 3600) - ((daysFormat * 86400) / 3600)))) : 0);
var minutesFormat = (format[4] === "!" ? (Math.round(Math.floor((s / 60) - ((hoursFormat * 3600) / 60) - ((daysFormat * 86400) / 60) - ((monthsFormat * 2628000) / 60) - ((yearsFormat * 31536000) / 60)))) : 0);
var secondsFormat = (format[5] === "!" ? (Math.round(Math.floor(s - (minutesFormat * 60) - (hoursFormat * 3600) - (daysFormat * 86400) - (monthsFormat * 2628000) - (yearsFormat * 31536000)))) : 0);
var time = yearsFormat + opts.timeSeparator + monthsFormat + opts.timeSeparator + daysFormat + opts.timeSeparator + hoursFormat + opts.timeSeparator + minutesFormat + opts.timeSeparator + secondsFormat;
return time;
}
//Function for displaying the timer.
function html($this, time, opts) {
var format = opts.displayFormat.split('');
time = time.split(opts.timeSeparator);
time = $.grep([time[0], time[1], time[2], time[3], time[4], time[5]], function(arr, i) {
return (arr >= 0 && format[i] === "!");
}).join(opts.timeSeparator);
time = time.split(opts.timeSeparator);
for (var i = 0; i < time.length; i++) {
if (time[i].toString().length < 2 && opts.padZeroes === true) {
time[i] = "0" + time[i];
}
}
time = time.join(opts.timeSeparator).toString();
for (var k = 0; k < 10; k++) {
var replace = k.toString();
var re = new RegExp(replace, "g");
time = time.replace(re, opts.digits[k]);
}
if (opts.labelsFormat === true && typeof window['regexpMatchFormat_' + $this.attr('id')] === 'undefined' &&
typeof window['regexpReplaceWith_' + $this.attr('id')] === 'undefined') {
$this.addClass("labelformat");
time = time.split(opts.timeSeparator);
var labelTime = "<span class='timerDisplay label" + time.length + "'>";
var labelarr = [];
for (var j = 0; j < 6; j++) {
if (format[j] === "!")
labelarr.push(opts.labels[j]);
}
for (var a = time.length; a > 0; a--) {
var itr = time.length - a;
labelTime += "<span class='displaySection'><span class='numberDisplay'>" + time[itr] + "</span><span class='periodDisplay'>" + labelarr[itr] + "</span></span>";
}
time = labelTime += "</span>";
} else if (opts.labelsFormat === false && typeof window['regexpMatchFormat_' + $this.attr('id')] !== 'undefined' &&
typeof window['regexpReplaceWith_' + $this.attr('id')] !== 'undefined') {
var regexp = new RegExp(window['regexpMatchFormat_' + $this.attr('id')]);
time = time.replace(regexp,
window['regexpReplaceWith_' + $this.attr('id')]);
}
$this.html(time);
}
//Function to Pause/Resume Timer.
function pauseTimer($this, timerType, opts, func) {
if ($this.data('countdowntimer').pause === 'pause') {
clearInterval(window['timer_' + timerType + $this.attr('id')]);
} else if ($this.data('countdowntimer').pause === 'resume') {
window['timer_' + timerType + $this.attr('id')] = setInterval(function() {
func($this, opts);
}, opts.tickInterval * 1000);
}
$("#" + opts.pauseButton).click(function() {
if ($(this).val() != "resume") {
$("#" + opts.pauseButton).val("resume").text("Resume");
clearInterval(window['timer_' + timerType + $this.attr('id')]);
} else if ($(this).val() == "resume") {
$("#" + opts.pauseButton).val("pause").text("Pause");
window['timer_' + timerType + $this.attr('id')] = setInterval(function() {
func($this, opts);
}, opts.tickInterval * 1000);
}
});
}
//Function to Start/Stop Timer.
function stopTimer($this, timerType, opts, func) {
if ($this.data('countdowntimer').stop === 'stop') {
clearInterval(window['timer_' + timerType + $this.attr('id')]);
window['hours_' + timerType + $this.attr('id')] = opts.hours;
window['minutes_' + timerType + $this.attr('id')] = opts.minutes;
window['seconds_' + timerType + $this.attr('id')] = opts.seconds;
func($this, opts);
} else if ($this.data('countdowntimer').stop === 'start') {
window['timer_' + timerType + $this.attr('id')] = setInterval(function() {
func($this, opts);
}, opts.tickInterval * 1000);
}
$("#" + opts.stopButton).click(function() {
if ($(this).val() != "start") {
$("#" + opts.stopButton).val("start").text("Start");
clearInterval(window['timer_' + timerType + $this.attr('id')]);
window['hours_' + timerType + $this.attr('id')] = opts.hours;
window['minutes_' + timerType + $this.attr('id')] = opts.minutes;
window['seconds_' + timerType + $this.attr('id')] = opts.seconds;
func($this, opts);
} else if ($(this).val() == "start") {
$("#" + opts.stopButton).val("stop").text("Stop");
window['timer_' + timerType + $this.attr('id')] = setInterval(function() {
func($this, opts);
}, opts.tickInterval * 1000);
}
});
}
function clearTimerInterval($this, timerType, opts) {
var id = $this.attr('id');
if (timerType === "withnoStart") {
delete window['dateTime' + id];
delete window['startTime' + id];
clearInterval(window['timer_givenDate' + id]);
} else if (timerType === "withStart") {
delete window['startDate' + id];
delete window['endDate' + id];
clearInterval(window['timer_startDate' + id]);
} else {
delete window['hours_' + timerType + id];
delete window['minutes_' + timerType + id];
delete window['seconds_' + timerType + id];
clearInterval(window['timer_' + timerType + id]);
}
if ($this.data('countdowntimer').destroy === true) {
$this.empty().removeClass();
} else {
timeUp($this, opts);
}
}
//Giving default value for options.
$.fn.countdowntimer.defaults = {
hours: 0,
minutes: 0,
seconds: 60,
startDate: new Date(),
dateAndTime: new Date("1970/01/01 00:00:00"),
currentTime: false,
size: "sm",
borderColor: "#F0068E",
fontColor: "#FFFFFF",
backgroundColor: "#000000",
timeSeparator: ":",
tickInterval: 1,
timeUp: null,
expiryUrl: null,
regexpMatchFormat: null,
regexpReplaceWith: null,
pauseButton: null,
stopButton: null,
beforeExpiryTime: null,
beforeExpiryTimeFunction: null,
padZeroes: true,
displayFormat: "HMS",
labelsFormat: false,
timeZone: null
};
$.fn.countdowntimer.regionalOptions = {
digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
labels: ['Years', 'Months', 'Days', 'Hours', 'Minutes', 'Seconds'],
isRTL: false
};
}(jQuery));

File diff suppressed because one or more lines are too long

19
resources/sass/_variables.scss vendored Normal file
View File

@@ -0,0 +1,19 @@
// Body
$body-bg: #f8fafc;
// Typography
$font-family-sans-serif: 'Nunito', sans-serif;
$font-size-base: 0.9rem;
$line-height-base: 1.6;
// Colors
$blue: #3490dc;
$indigo: #6574cd;
$purple: #9561e2;
$pink: #f66d9b;
$red: #e3342f;
$orange: #f6993f;
$yellow: #ffed4a;
$green: #38c172;
$teal: #4dc0b5;
$cyan: #6cb2eb;

151
resources/sass/app.scss vendored Normal file
View File

@@ -0,0 +1,151 @@
// Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito');
// Variables
@import 'variables';
// Bootstrap
//@import '~bootstrap/scss/bootstrap';
@import '~admin-lte/dist/css/adminlte.css';
.font_icon_size{
font-size: 24px;
}
.on_hover:hover {
box-shadow: 0 0 25px rgba(35,35,35,.3);
}
.subscribed{
box-shadow: 0 0 25px rgba(35,35,35,.3);
}
.app_tour_play_btn{
margin-top: 9px;
margin-bottom: 9px;
margin-left: 80px;
}
.dz-preview .dz-image img{
width: 100% !important;
height: 100% !important;
object-fit: cover;
}
.mb-85 {
margin-bottom: 85px;
}
.float-left {
float: left;
}
.form_custom_attr_field {
margin: 2px;
margin-top: 7px;
}
.mb-10 {
margin-bottom: 10px;
}
.text-deco-none {
text-decoration: none !important;
}
.cursor-pointer {
cursor: pointer;
}
.edit-assigned-form {
background: #d2d6de;
padding-top: 6px;
padding-left: 6px;
}
.assign-form {
background: #86BCEB;
padding-top: 6px;
padding-left: 6px;
padding-right: 6px;
}
.introjs-helperLayer{
min-height:58px !important;
}
.hvr-grow {
display: inline-block;
vertical-align: middle;
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
transition-duration: 0.3s;
transition-property: transform;
}
.hvr-grow:hover,
.hvr-grow:focus,
.hvr-grow:active {
transform: scale(1.1);
}
.element-config-action-btn{
position: absolute;
top: 14%;
transform: translateY(-14%);
right: -32px;
z-index: 1;
}
canvas{
max-width: 100% !important;
}
.bg-light-gray{
background-color: #C8CEED !important;
}
.border-1{
border: 1px;
}
.border-solid{
border-style: solid;
}
.divider {
display: block;
text-align: center;
overflow: hidden;
white-space: nowrap;
margin: 1rem 0;
}
.divider .divider-text {
position: relative;
display: inline-block;
font-size: 0.9375rem;
padding: 0 1rem;
}
.divider .divider-text:before, .divider .divider-text:after {
content: '';
position: absolute;
top: 50%;
width: 9999px;
border-top: 1px solid #ebe9f1;
}
.divider .divider-text:before {
right: 100%;
}
.divider .divider-text:after {
left: 100%;
}
.divider.divider-dashed .divider-text:before, .divider.divider-dashed .divider-text:after {
border-style: dashed;
border-width: 1px;
border-top-width: 0;
border-color: #475569;
}
.max-width-100{
max-width: 100% !important;
}

View File

@@ -0,0 +1,111 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="login-box">
<!-- /.login-logo -->
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
<b>{{ config('app.name', 'Laravel') }}</b>
</a>
</div>
<div class="card-body">
<p class="login-box-msg">
{{ __('messages.login_to_start_your_session') }}
</p>
<form method="POST" action="{{ route('login') }}">
@csrf
@if(config('app.env') == 'demo')
@php
$email = 'admin@admin.com';
$pwd = '12345678';
@endphp
@else
@php
$email = '';
$pwd = '';
@endphp
@endif
<div class="input-group mb-3">
<input type="email" id="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{old('email') ?? $email}}" required autocomplete="email" autofocus placeholder="{{ __('E-Mail Address') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="input-group mb-3">
<input type="password" id="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password" value="{{$pwd}}" placeholder="{{ __('Password') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="row">
<div class="col-8">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="remember" name="remember" {{ old('remember') ? 'checked' : '' }}>
<label class="custom-control-label" for="remember">
{{ __('Remember Me') }}
</label>
</div>
</div>
<!-- /.col -->
<div class="col-4">
<button type="submit" class="btn btn-primary btn-block">
{{ __('Login') }}
</button>
</div>
<!-- /.col -->
</div>
</form>
<!-- /.social-auth-links -->
<div class="social-auth-links text-center mt-2 mb-3">
<p>- {{ __('OR') }} -</p>
@if (Route::has('password.request'))
<a class="btn btn-link" href="{{ route('password.request') }}">
{{ __('messages.forgot_password') }} <b>@lang('messages.reset')</b>
</a>
@endif
@if (Route::has('register'))
<a class="btn btn-link" href="{{ route('register') }}">
{{ __('messages.dont_have_an_account') }} <b>@lang('messages.register')</b>
</a>
@endif
</div>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
@if (!empty(session('status')) && session('status')['success'] == false)
var msg = '{!!session('status')['msg']!!}';
toastr.error(msg);
@endif
});
</script>
@endsection

View File

@@ -0,0 +1,63 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="login-box">
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
<b>
{{ config('app.name', 'Laravel') }}
</b>
</a>
</div>
<div class="card-body login-card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
<p class="login-box-msg">
{{ __('messages.request_password_heading') }}
</p>
<form method="POST" action="{{ route('password.email') }}">
@csrf
<div class="input-group mb-3">
<input type="email" id="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus placeholder="{{ __('E-Mail Address') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="social-auth-links text-center mb-3">
<button type="submit" class="btn btn-block btn-primary">
{{ __('Send Password Reset Link') }}
</button>
</div>
<p class="text-center mt-3">
- {{ __('OR') }} -
<br>
<a href="{{ route('login') }}" class="btn btn-link">
{{ __('messages.already_have_an_account') }} <b>{{ __('Login') }}</b>
</a>
@if (Route::has('register'))
<a class="btn btn-link" href="{{ route('register') }}">
{{ __('messages.dont_have_an_account') }} <b>@lang('messages.register')</b>
</a>
@endif
</p>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,84 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="login-box">
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
<b>
{{ config('app.name', 'Laravel') }}
</b>
</a>
</div>
<div class="card-body login-card-body">
<p class="login-box-msg">
{{ __('messages.password_reset_heading') }}
</p>
<form method="POST" action="{{ route('password.update') }}">
@csrf
<input type="hidden" name="token" value="{{ $token }}">
<div class="input-group mb-3">
<input type="email" id="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus placeholder="{{ __('E-Mail Address') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="input-group mb-3">
<input type="password" id="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password" placeholder="{{ __('Password') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="input-group mb-3">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password" placeholder="{{ __('Confirm Password') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>
<div class="social-auth-links text-center mb-3">
<button type="submit" class="btn btn-block btn-primary">
{{ __('Reset Password') }}
</button>
</div>
</form>
<p class="text-center mt-3">
- {{ __('OR') }} -
<br>
<a href="{{ route('login') }}" class="btn btn-link">
{{ __('messages.already_have_an_account') }} <b>{{ __('Login') }}</b>
</a>
@if (Route::has('register'))
<a class="btn btn-link" href="{{ route('register') }}">
{{ __('messages.dont_have_an_account') }} <b>@lang('messages.register')</b>
</a>
@endif
</p>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,201 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-9">
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
<b>
{{ config('app.name', 'Laravel') }}
</b>
</a>
</div>
<div class="card-body register-card-body">
<p class="login-box-msg">
{{ __('messages.register_a_new_membership') }}
</p>
<form method="POST" action="{{action([\App\Http\Controllers\RegistrationController::class, 'store'])}}">
@csrf
<div class="form-group row">
<div class="col-md-6 offset-md-3">
<div class="input-group mb-3">
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus placeholder="{{__('Name')}}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-user"></span>
</div>
</div>
@error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-6 offset-md-3">
<div class="input-group mb-3">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" placeholder="{{ __('E-Mail Address') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-6 offset-md-3">
<div class="input-group mb-3">
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password" placeholder="{{ __('Password') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-6 offset-md-3">
<div class="input-group mb-3">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password" placeholder="{{ __('Confirm Password') }}">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>
</div>
</div>
@if($__enable_saas)
<div class="form-row">
@foreach($packages as $package)
<div class="col-md-4">
<label>
<input type="radio" class="d-none" name="package_id" value="{{$package->id}}">
<div class="card card-outline card-info on_hover pointer choosen_pack">
<div class="card-header">
<div class="text-center">
<h5>
{{$package->name}}
</h5>
</div>
</div>
<div class="card-body text-center">
@if($package->no_of_active_forms != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $package->no_of_active_forms])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<hr>
@if($package->is_form_downloadable)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
@php
$price_interval = __('messages.'.$package->price_interval);
@endphp
@if($package->price != 0)
<h5>
<span class="currency">
{{$package->price}}
</span>
<small class="text-muted">
@lang('messages.subscription_price',[
'interval' => $package->interval,
'price_interval' => $price_interval
])
</small>
</h5>
@else
<h5>
@lang('messages.free_for_interval', [
'interval' => $package->interval,
'price_interval' => $price_interval
])
</h5>
@endif
</div>
<div class="card-footer text-center">
{{$package->description}}
</div>
</div>
</div>
</label>
@if($loop->iteration%3 == 0)
<div class="clearfix"></div>
@endif
@endforeach
</div>
@endif
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-3">
<button type="submit" class="btn btn-block btn-primary">
{{ __('Register') }}
</button>
</div>
</div>
</form>
<p class="text-center mt-3">
- {{ __('OR') }} -
<br>
<a href="{{ route('login') }}" class="btn btn-link">
{{ __('messages.already_have_an_account') }} <b>{{ __('Login') }}</b>
</a>
</p>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('span.currency').each(function(index, element){
var money = __formatCurrency($(this).text());
$(this).text(money);
});
$(document).on('click', '.choosen_pack', function(){
$('.choosen_pack').removeClass('border-success subscribed');
$(this).closest('.card').addClass('border-success subscribed');
});
});
</script>
@endsection

View File

@@ -0,0 +1,32 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="login-box">
<div class="card">
<div class="card-header text-center">
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
<b>{{ config('app.name', 'Laravel') }}</b>
</a>
</div>
<div class="card-body login-card-body">
@if (session('resent'))
<div class="alert alert-success" role="alert">
{{ __('A fresh verification link has been sent to your email address.') }}
</div>
@endif
<p class="login-box-msg">
{{ __('Verify Your Email Address') }}
</p>
{{ __('Before proceeding, please check your email for a verification link.') }}
{{ __('If you did not receive the email') }}, <a href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>.
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1 @@
{!! $content !!}

View File

@@ -0,0 +1 @@
{!! $body !!}

View File

@@ -0,0 +1,125 @@
<div class="modal-dialog modal-lg" role="document">
<form id="collaborate_form" action="{{action([\App\Http\Controllers\FormController::class, 'postCollab'])}}" method="POST">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
@lang('messages.collaborate') ({{$form->name}})
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
@if($form->assignedTo->count() > 0)
<h5>@lang('messages.assigned_users'):</h5>
@foreach($form->assignedTo as $key => $assigned_to)
<div class="card edit-assigned-form mb-2 p-3">
<label>
<i class="fas fa-user-tie"></i>
{{$assigned_to->user->name}}
<small>
<code>({{$assigned_to->user->email}})</code>
</small>
</label>
<div class="row">
<input type="hidden" name="edit_assigned_id[]" value="{{$assigned_to->id}}">
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="form_design_{{$key}}" value="can_design_form"
@if(in_array('can_design_form', $assigned_to->permissions))
checked
@endif>
<label class="form-check-label" for="form_design_{{$key}}">
@lang('messages.can_design_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="form_data_{{$key}}" value="can_view_data"
@if(in_array('can_view_data', $assigned_to->permissions))
checked
@endif>
<label class="form-check-label" for="form_data_{{$key}}">
@lang('messages.can_view_data')
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="can_view_form_{{$key}}" value="can_view_form"
@if(in_array('can_view_form', $assigned_to->permissions))
checked
@endif>
<label class="form-check-label" for="can_view_form_{{$key}}">
@lang('messages.can_view_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
</label>
</div>
</div>
</div>
</div>
@endforeach
@endif
<input type="hidden" name="form_id" value="{{$form->id}}">
<div class="card assign-form mt-4 p-3">
<h5 class="text-secondary">
@lang('messages.invite_to_collaborate'):
</h5>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="email">
@lang('messages.email'):
</label>
<input type="email" class="form-control"
name="email" id="email">
</div>
</div>
</div>
<h5>@lang('messages.permissions'):</h5>
<div class="row">
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_design" value="can_design_form">
<label class="form-check-label" for="form_design">
@lang('messages.can_design_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data" value="can_view_data">
<label class="form-check-label" for="form_data">
@lang('messages.can_view_data')
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view" value="can_view_form">
<label class="form-check-label" for="form_view">
@lang('messages.can_view_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-sm btn-primary submit_btn">
@lang('messages.save')
</button>
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
@lang('messages.close')
</button>
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,93 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
@lang('messages.copy_form') ({{$form->name}})
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
@if(!isset($subscription_info['success']))
<form id="copy_form" action="{{action([\App\Http\Controllers\FormController::class, 'store'])}}" method="POST">
{{ csrf_field() }}
<div class="form-row pb-4">
<div class="col-md-4">
<label for="name">
@lang('messages.form_name')
<span class="error">*</span>
</label>
<input type="text" class="form-control"
name="name" id="name" required>
<input type="hidden" name="id" value="{{$form->id}}">
</div>
<div class="col-md-4">
<label for="form_slug">
@lang('messages.form_slug')
<span class="error">*</span>
</label>
<input type="text" class="form-control"
name="slug" id="form_slug" required readonly>
</div>
<div class="col-md-4">
<label for="description">
@lang('messages.form_description')
</label>
<input type="text" name="description" id="description" class="form-control">
</div>
</div>
<hr>
<button type="submit" class="btn btn-primary btn-sm float-right">
@lang('messages.copy_form')
</button>
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
@lang('messages.close')
</button>
</form>
@else
<div class="alert alert-danger" role="alert">
<div class="row">
<div class="col-md-10">
{!!$subscription_info['msg']!!}
</div>
@if($subscription_info['subscribe_btn'])
<div class="col-md-2">
<a href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}" class="btn btn-primary text-deco-none float-right btn-sm">
@lang('messages.subscribe')
</a>
</div>
@endif
</div>
</div>
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
@lang('messages.close')
</button>
@endif
</div>
</div>
</div>
<script type="text/javascript">
$('form#copy_form').validate({
submitHandler: function(form) {
$('#modal_div').modal('hide')
form.submit();
}
});
$(document).on('change', 'input#name',function() {
var name = $('form#copy_form input#name').val();
$.ajax({
method: 'GET',
url: '/generate-form-slug',
dataType: 'json',
data: {'name' : name},
success: function(response) {
$('form#copy_form input#form_slug').val(response);
}
});
});
</script>

View File

@@ -0,0 +1,112 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
@lang('messages.create_form')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
@if(!isset($subscription_info['success']))
<form id="create_form" action="{{action([\App\Http\Controllers\FormController::class, 'store'])}}" method="POST">
{{ csrf_field() }}
<div class="form-row pb-4">
<div class="col-md-4">
<label for="name">
@lang('messages.form_name')
<span class="error">*</span>
</label>
<input type="text" class="form-control"
name="name" id="name" required>
</div>
<div class="col-md-4">
<label for="form_slug">
@lang('messages.form_slug')
<span class="error">*</span>
</label>
<input type="text" class="form-control"
name="slug" id="form_slug" required readonly>
</div>
<div class="col-md-4">
<label for="description">
@lang('messages.form_description')
</label>
<input type="text" name="description" id="description" class="form-control">
</div>
</div>
@if(!empty($templates))
<div class="form-row pb-4">
<div class="col-md-6">
<div class="form-group">
<label for="template">
@lang('messages.template')
</label>
<select class="form-control" id="template" name="template_id">
<option value="">
@lang('messages.choose_template')
</option>
@foreach($templates as $id => $name)
<option value="{{$id}}">{{$name}}</option>
@endforeach
</select>
</div>
</div>
</div>
@endif
<hr>
<button type="submit" class="btn btn-primary btn-sm float-right">
@lang('messages.create_form')
</button>
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
@lang('messages.close')
</button>
</form>
@else
<div class="alert alert-danger" role="alert">
<div class="row">
<div class="col-md-10">
{!!$subscription_info['msg']!!}
</div>
@if($subscription_info['subscribe_btn'])
<div class="col-md-2">
<a href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}" class="btn btn-primary text-deco-none float-right btn-sm">
@lang('messages.subscribe')
</a>
</div>
@endif
</div>
</div>
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
@lang('messages.close')
</button>
@endif
</div>
</div>
</div>
<script type="text/javascript">
$('form#create_form').validate({
submitHandler: function(form) {
$('#modal_div').modal('hide')
form.submit();
}
});
$(document).on('change', 'input#name',function() {
var name = $('form#create_form input#name').val();
$.ajax({
method: 'GET',
url: '/generate-form-slug',
dataType: 'json',
data: {'name' : name},
success: function(response) {
$('form#create_form input#form_slug').val(response);
}
});
});
</script>

View File

@@ -0,0 +1,168 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $form->name }}</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
@php
$bg_color = $form->schema['settings']['color']['background'];
$additional_js = $form->schema['additional_js_css']['js'];
$additional_css = $form->schema['additional_js_css']['css'];
$bg_type = $form->schema['settings']['background']['bg_type'];
$bg_image = $form->schema['settings']['color']['image_path'];
$form_attributes = isset($form->schema['form_attributes']) ? $form->schema['form_attributes'] : [];
@endphp
<!-- Styles -->
@include('layouts.partials.css', ['is_download' => true, 'error_msg_color' => $form->schema['settings']['color']['error_msg'], 'additional_css' => $additional_css])
</head>
<body>
<div id="app">
<main class="py-4">
<div class="container">
<div class="card">
<div class="card-body" style="@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url(./asset/{{$bg_image}}); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif">
<div class="row">
<div class="col-md-12">
<form id="{{$form->id}}"
action="{{'./' . $form_slug . '.php'}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $form_attributes])>
@include('form.partials.fields_generator')
@if($form->schema['settings']['recaptcha']['is_enable'])
<div class="g-recaptcha"
data-sitekey="{{$form->schema['settings']['recaptcha']['site_key']}}"></div>
<br/>
@endif
@php
$submit_btn_setting = $form->schema['settings']['submit'];
@endphp
<button type="submit" class="btn mt-5 {{$submit_btn_setting['btn_alignment']}} {{$submit_btn_setting['btn_size']}} {{$submit_btn_setting['btn_color']}}"
data-btn_loading="{{$submit_btn_setting['loading_text']}}"
data-btn_text="{{$submit_btn_setting['text']}}">
@if((!empty($submit_btn_setting['btn_icon']) && $submit_btn_setting['btn_icon'] != 'none') && $submit_btn_setting['icon_position'] == 'left')
<i class="fas {{$submit_btn_setting['btn_icon']}}">
</i>
@endif
{{$submit_btn_setting['text']}}
@if((!empty($submit_btn_setting['btn_icon']) && $submit_btn_setting['btn_icon'] != 'none') && $submit_btn_setting['icon_position'] == 'right')
<i class="fas {{$submit_btn_setting['btn_icon']}}">
</i>
@endif
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
@include('layouts.partials.javascript', ['is_download' => true])
<script type="text/javascript">
$(document).ready(function(){
@if(!empty($form->schema['form']))
@foreach($form->schema['form'] as $element)
@if($element['type'] == 'calendar')
@php
$enable_time_picker = ($element['enable_time_picker'] == 1) ? 'true' : 'false';
$time_picker_inline = ($element['time_picker_inline'] == 1) ? 'true' : 'false';
@endphp
initialize_datetimepicker('{{$element['name']}}', '{{$element['start_date']}}', '{{$element['end_date']}}', '{{$element['format']}}', '{{$element['time_format']}}', {!!json_encode($element['disabled_days'])!!}, {{$enable_time_picker}}, {{$time_picker_inline}});
@elseif($element['type'] == 'range')
initialize_rangeslider('{{$element['name']}}');
@elseif($element['type'] == 'file_upload')
initialize_dropzone('{{$element['name']}}', '{{$element['upload_text']}}', '{{$element['no_of_files']}}', '{{$element['file_size_limit']}}', '{{$element['allowed_file_type']}}', 'library/upload.php');
@elseif($element['type'] == 'text_editor')
initialize_text_editor('{{$element['name']}}', '{{$element['placeholder']}}', '{{$element['editor_height']}}');
@elseif($element['type'] == 'rating')
initialize_star_rating('{{$element['name']}}');
@elseif($element['type'] == 'signature')
initialize_signature_pad('{{$element['name']}}');
@elseif($element['type'] == 'countdown')
initialize_countdowntimer({!!json_encode($element)!!});
@endif
@endforeach
@php
$toastr_position = isset($form->schema['settings']['notification']['position']) ? $form->schema['settings']['notification']['position'] : '';
@endphp
initializeToastrSettingsForForm("{{$toastr_position}}");
@endif
$('form#{{$form->id}}').validate({
ignore: ".note-editor *",
submitHandler: function(form, e) {
e.preventDefault();
var form_data = $('form#{{$form->id}}').serialize();
var form_submit_btn = $(form).find('button[type="submit"]');
form_submit_btn.attr('disabled', 'disabled');
form_submit_btn.text(form_submit_btn.data('btn_loading'));
var dropzoneCount = $('.dropzone').length;
var textEditor = $('.summer_note').length;
$.ajax({
method: 'POST',
url: $(form).attr('action'),
dataType: 'json',
data: form_data,
success: function(result) {
form_submit_btn.text(form_submit_btn.data('btn_text'));
form_submit_btn.removeAttr('disabled', 'disabled');
$(form)[0].reset();
window.onbeforeunload = null;
if(result.success == 1){
if(result.redirect == 1){
window.location = result.url;
} else {
toastr.success(result.msg);
if (textEditor > 0) {
$('.summer_note').each(function(){
$(this).summernote("code", "");
});
}
if (dropzoneCount > 0) {
setTimeout(() => {
location.reload();
}, 2000);
}
}
} else {
toastr.error(result.msg);
}
},
});
}
});
//show aleart before page reloading
var form_obj = $('form#{{$form->id}}');
var orig_forn_data = form_obj.serialize();
window.onbeforeunload = function() {
if($('form#{{$form->id}}').length == 1){
if (form_obj.serialize() != orig_forn_data) {
return 'Are you sure?';
}
}
}
});
</script>
<!-- Form additional JS -->
@if(!empty($additional_js))
{!!$additional_js!!}
@endif
</body>
</html>

View File

@@ -0,0 +1,12 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-12">
<create-form form-data="{{json_encode($form)}}" :placeholder-img="{{json_encode($placeholder_img)}}" :save-template="{{json_encode($save_as_template)}}">
</create-form>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,39 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
@lang('messages.generate_widget')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="widget">
@lang('messages.iframe_code')
</label>
<textarea class="form-control form-control-sm" id="widget" rows="4" aria-describedby="widget_help" readonly>{{$widget}}</textarea>
<small id="widget_help" class="form-text text-muted">
@lang('messages.widget_help_text')
</small>
<textarea class="form-control form-control-sm" id="widget" rows="4" aria-describedby="widget_script_help" readonly>{{$widget_script}}</textarea>
<small id="widget_script_help" class="form-text text-muted">
@lang('messages.widget_script_help_text')
</small>
</div>
<div class="form-group">
<label>@lang('messages.new_window')</label>
<textarea class="form-control form-control-sm" id="new_window" rows="4" aria-describedby="new_window_help" readonly>{{$form}}</textarea>
<small id="widget_help" class="form-text text-muted">
@lang('messages.new_window_help_text')
</small>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">
@lang('messages.close')
</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,3 @@
@foreach($attributes as $attribute)
{{$attribute['key']}} = "{{$attribute['value']}}"
@endforeach

View File

@@ -0,0 +1,499 @@
@if(!empty($form->schema['form']))
<div class="row">
@foreach($form->schema['form'] as $key => $element)
@php
$custom_attributes = isset($element['custom_attributes']) ? $element['custom_attributes'] : [];
@endphp
<div class="@if(!empty($element['col'])) {{$element['col']}} @else col-md-12 @endif mt-25 mb-25">
@if($element['type'] == 'text')
<div class="form-group">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">
{{$element['label']}}
</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="input-group">
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas {{$element['prefix_icon']}}"></i>
</span>
</div>
@endif
<input type="{{$element['subtype']}}"
name="fields[{{$element['name']}}]"
placeholder="{{$element['placeholder']}}"
class="form-control {{$element['size']}} {{$element['custom_class']}}"
id="{{$element['name']}}"
@foreach ($validation_rules[$key] as $validation)
{{$validation['rule']}} = "{{$validation['value']}}"
{{$validation['error']}} = "{{$validation['msg']}}"
@endforeach
@if($element['required']) required @endif
data-msg-required="{{$element['required_error_msg']}}"
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
>
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
<div class="input-group-append">
<span class="input-group-text">
<i class="fas {{$element['suffix_icon']}}"></i>
</span>
</div>
@endif
</div>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'range')
<div class="form-group mb-4 mt-3">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">
{{$element['label']}}
</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="row">
<div class="col-sm-1">{{$element['min']}}</div>
<div class="col-sm-10">
<input type="range"
name="fields[{{$element['name']}}]"
@if($element['required']) required @endif
data-msg-required="{{$element['required_error_msg']}}"
id="{{$element['name']}}"
min="{{$element['min']}}"
max="{{$element['max']}}"
step="{{$element['step']}}"
data-orientation="{{$element['data_orientation']}}"
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
</div>
<div class="col-sm-1">{{$element['max']}}</div>
</div>
<b><output class="{{$element['name']}}" style="display: block;text-align:center;" for="{{$element['name']}}"></output></b>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'calendar')
<div class="form-group">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">
{{$element['label']}}
</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="input-group date" id="{{$element['name']}}" data-target-input="nearest">
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
<div class="input-group-prepend">
<span class="input-group-text" data-target="#{{$element['name']}}" data-toggle="datetimepicker">
<i class="fas {{$element['prefix_icon']}}"></i>
</span>
</div>
@endif
<input type="text"
name="fields[{{$element['name']}}]"
data-toggle="datetimepicker"
id="{{$element['name']}}"
class="form-control datetimepicker-input {{$element['custom_class']}}"
readonly
data-target="#{{$element['name']}}"
@if($element['required']) required @endif
data-msg-required="{{$element['required_error_msg']}}"
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
>
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
<div class="input-group-append">
<span class="input-group-text" data-target="#{{$element['name']}}" data-toggle="datetimepicker">
<i class="fas {{$element['suffix_icon']}}"></i>
</span>
</div>
@endif
</div>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'textarea')
<div class="form-group">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">
{{$element['label']}}
</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="input-group">
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas {{$element['prefix_icon']}}"></i>
</span>
</div>
@endif
<textarea
rows="{{$element['rows']}}"
name="fields[{{$element['name']}}]"
cols="{{$element['columns']}}"
placeholder="{{$element['placeholder']}}"
class="form-control {{$element['custom_class']}}"
id="{{$element['name']}}"
@foreach ($validation_rules[$key] as $validation)
{{$validation['rule']}} = "{{$validation['value']}}"
{{$validation['error']}} = "{{$validation['msg']}}"
@endforeach
@if($element['required']) required @endif
data-msg-required="{{$element['required_error_msg']}}"
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
></textarea>
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
<div class="input-group-append">
<span class="input-group-text">
<i class="fas {{$element['suffix_icon']}}"></i>
</span>
</div>
@endif
</div>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif(in_array($element['type'], ['radio', 'checkbox']))
<div class="form-group">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
@foreach(explode(PHP_EOL, $element['options']) as $option)
<div class="custom-control @if($element['type'] == 'radio') custom-radio @else custom-checkbox @endif">
<input class="custom-control-input"
type="{{$element['type']}}"
value="{{$option}}"
name="fields[{{$element['name']}}][]"
id="{{$element['name']}}_{{$loop->index}}"
@foreach ($validation_rules[$key] as $validation)
{{$validation['rule']}} = "{{$validation['value']}}"
{{$validation['error']}} = "{{$validation['msg']}}"
@endforeach
@if($element['required'])
required
@endif
data-msg-required="{{$element['required_error_msg']}}"
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
>
<label class="custom-control-label" for="{{$element['name']}}_{{$loop->index}}">
{{$option}}
</label>
</div>
@endforeach
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'dropdown')
<div class="form-group">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="input-group">
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas {{$element['prefix_icon']}}"></i>
</span>
</div>
@endif
<select class="custom-select {{$element['size']}} {{$element['custom_class']}}" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}" id="{{$element['name']}}"
@if($element['multiselect'])
multiple
name="fields[{{$element['name']}}][]"
@else
name="fields[{{$element['name']}}]"
@endif
@foreach ($validation_rules[$key] as $validation)
{{$validation['rule']}} = "{{$validation['value']}}"
{{$validation['error']}} = "{{$validation['msg']}}"
@endforeach
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
@foreach(explode(PHP_EOL, $element['options']) as $option)
<option>
{{$option}}
</option>
@endforeach
</select>
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
<div class="input-group-append">
<span class="input-group-text">
<i class="fas {{$element['suffix_icon']}}"></i>
</span>
</div>
@endif
</div>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'heading')
<div class="{{$element['custom_class'] ?? ''}}">
@php
echo '<' . $element['tag'] . ' style="color:' . $element['text_color'] . '">' . $element['content'] .'</' . $element['tag'] . '>';
@endphp
</div>
@elseif($element['type'] == 'file_upload')
<div class="mb-2">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="dropzone {{$element['custom_class']}}"
id="{{$element['name']}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></div>
<input type="hidden" name="fields[{{$element['name']}}][]" id="{{$element['name']}}" value="" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}">
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'text_editor')
<div class="mb-2">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<textarea class="form-control summer_note" id="{{$element['name']}}" name="fields[{{$element['name']}}]" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}"
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></textarea>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'terms_and_condition')
<div class="pt-2 mb-2">
<div class="custom-control custom-checkbox">
<input class="custom-control-input {{$element['custom_class']}}" type="checkbox" name="fields[{{$element['name']}}]" id="terms_and_condition" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
<label class="custom-control-label" for="terms_and_condition">
@if(!empty($element['link']))
<a href="{{$element['link']}}" target="_blank"> {{$element['label']}}
</a>
@else
{{$element['label']}}
@endif
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
</div>
</div>
@elseif($element['type'] == 'hr')
<hr style="
@if(!empty($element['padding_top']))
padding-top: {{$element['padding_top']}}px;
@endif
@if(!empty($element['padding_bottom']))
padding-bottom:{{$element['padding_bottom']}}px;
@endif
@if(!empty($element['border_size']) && !empty($element['border_color']))
border-top:{{$element['border_size']}}px {{$element['border_type']}} {{$element['border_color']}};
@endif">
@elseif($element['type'] == 'html_text')
<div class="{{$element['custom_class'] ?? ''}}">
{!!$element['html_text']!!}
</div>
@elseif($element['type'] == 'rating')
<div class="form-group pt-2">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<input id="{{$element['name']}}" name="fields[{{$element['name']}}]"
data-stars="{{$element['stars_to_display']}}"
data-min="{{$element['min_rating']}}"
data-max="{{$element['max_rating']}}"
data-step="{{$element['increment']}}"
dir="{{$element['direction']}}"
data-size="{{$element['size']}}"
class="star_rating"
@if($element['required']) required @endif
data-msg-required="{{$element['required_error_msg']}}"
>
</div>
@elseif($element['type'] == 'switch')
<div class="form-group pt-2">
<span class="switch @if(!empty($element['size'])) {{$element['size']}} @endif">
<input type="checkbox" class="switch" name="fields[{{$element['name']}}]" id="{{$element['name']}}"" @if($element['required']) required @endif @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes]) data-msg-required="{{$element['required_error_msg']}}">
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}" class="ml-2">
{{$element['label']}}
</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
</span>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif($element['type'] == 'signature')
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="form-group">
<canvas id="{{$element['name']}}" width="300" height="200" class="signature-pad" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></canvas>
<input type="hidden" class="signature" name="fields[{{$element['name']}}]" id="output_{{$element['name']}}" value="" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}">
</div>
<div class="form-text">
<span class="pointer mr-4" id="clear_{{$element['name']}}" title="@lang('messages.clear_signature_pad')" data-name="{{$element['name']}}">
<i class="far fa-times-circle"></i>
{{__('messages.clear')}}
</span>
<span class="pointer" id="undo_{{$element['name']}}" title="@lang('messages.undo')" data-name="{{$element['name']}}">
<i class="fas fa-undo"></i>
{{__('messages.undo')}}
</span>
@if(!empty($element['help_text']))
<small class="form-text text-muted">
{{$element['help_text']}}
</small>
@endif
</div>
@elseif(($element['type'] == 'youtube') && !empty($element['iframe_url']))
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
@php
$video_id = '';
$url = $element['iframe_url'];
if (str_contains($url, 'watch')) {
$video_id = str_replace('https://www.youtube.com/watch?v=', '', $url);
} else if (str_contains($url, 'youtu.be')) {
$video_id = str_replace('https://youtu.be/', '', $url);
} else if (str_contains($url, 'embed')) {
$video_id = str_replace('https://www.youtube.com/embed/', '', $url);
}
$yt_embed_url = "https://www.youtube.com/embed/{$video_id}";
@endphp
<div class="col-md-12">
<iframe src="{{$yt_embed_url}}"
id="{{$element['name']}}"
name="{{$element['label']}}"
title="{{$element['label']}}"
class="{{$element['custom_class']}}"
width="{{$element['width']}}%"
height="{{$element['height']}}"
frameborder="0"
style="max-width: 100%;"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
</div>
@elseif(($element['type'] == 'iframe') && !empty($element['iframe_url']))
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="col-md-12">
<iframe src="{{$element['iframe_url']}}"
id="{{$element['name']}}"
name="{{$element['label']}}"
title="{{$element['label']}}"
class="{{$element['custom_class']}}"
width="{{$element['width']}}%"
height="{{$element['height']}}"
frameborder="0"
style="max-width: 100%;"
>
</iframe>
</div>
@elseif(($element['type'] == 'pdf') && !empty($element['pdf']))
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="col-md-12">
<iframe src="{{$form->media_url.'/'.$element['pdf']}}"
id="{{$element['name']}}"
name="{{$element['label']}}"
title="{{$element['label']}}"
class="{{$element['custom_class']}}"
width="{{$element['width']}}%"
height="{{$element['height']}}"
frameborder="0"
style="max-width: 100%;"
>
</iframe>
</div>
@elseif($element['type'] == 'countdown')
<label for="{{$element['name']}}">
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
@if($element['required'])
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
@endif
</label>
<div class="col-md-12">
<div class="{{$element['custom_class']}}">
<span id="{{$element['name']}}" class="max-width-100">
</span>
</div>
</div>
@endif
</div>
@endforeach
</div>
@endif

View File

@@ -0,0 +1,29 @@
<div class="card">
@php
$bg_color = $form->schema['settings']['color']['background'];
$error_msg_color = $form->schema['settings']['color']['error_msg'];
$bg_type = $form->schema['settings']['background']['bg_type'];
$bg_image = $form->schema['settings']['color']['image_path'];
$action = '';
switch (request()->route()->getName()) {
case 'form-data.edit':
$action = 'edit';
break;
case 'forms.show':
$action = 'show';
break;
}
@endphp
<div class="tab-content card-body"
id="" role="tabpanel" style='@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url("{{Storage::url(config('constants.doc_path').'/'.$bg_image)}}"); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif'>
@if(!empty($is_form_closed) && $is_form_closed)
<div class="card-text">
{!! $form_closed_msg !!}
</div>
@else
<show-form form="{{json_encode($form)}}" action-by="{{$action_by ?? ''}}" action="{{ $action }}"></show-form>
@endif
</div>
</div>

View File

@@ -0,0 +1,40 @@
@extends('layouts.app')
@section('content')
@php
$bg_color = $form->schema['settings']['color']['background'];
$error_msg_color = $form->schema['settings']['color']['error_msg'];
$additional_css = $form->schema['additional_js_css']['css'];
$additional_js = $form->schema['additional_js_css']['js'];
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
@endphp
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
<div class="row justify-content-center">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
@include('form.partials.form_card')
</div>
</div>
</div>
@endsection
@section('footer')
<!-- form theme -->
@if(isset($form->schema['settings']['theme']) && $form->schema['settings']['theme'] != 'default')
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/{{$form->schema['settings']['theme']}}/bootstrap.min.css" rel="stylesheet">
@endif
<style type="text/css">
.error {
color:{{$error_msg_color}}
}
.content-wrapper {
background-color: {{$page_color}} !important;
}
</style>
<!-- Form additional JS -->
@if(!empty($additional_js))
{!!$additional_js!!}
@endif
@endsection

View File

@@ -0,0 +1,78 @@
@extends('layouts.app')
@section('content')
<div class="container mt-5">
<div class="col-md-6 offset-md-3 mt-5">
<div class="card card-outline card-primary card-widget widget-user shadow pb-5">
<div class="card-body">
<form id="password-form" action="{{route('post.validate.protected.form', ['id' => $id])}}"
method="POST">
@csrf
<div class="row">
<div class="col-md-12">
<h4 class="text-center">
<i class="far fa-file-archive fa-5x"></i>
</h4>
<h4 class="text-center">
@lang('messages.this_form_is_password_protected')
</h4>
<p class="text-center form-text text-muted">
{{__('messages.enter_your_password_to_view_the_form')}}
</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-key"></i>
</span>
</div>
<input type="password" class="form-control"
placeholder="@lang('messages.password')"
required
id="password">
<div class="input-group-append">
<button type="submit" class="btn btn-sm bg-primary">
@lang('messages.continue')
</button>
</div>
</div>
</div>
<div class="error-msg text-danger"></div>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(function() {
$("form#password-form").validate({
submitHandler: function(form, e) {
e.preventDefault();
if ($('form#password-form').valid()) {
$(".error-msg").html('');
$.ajax({
method:"POST",
url: $("form#password-form").attr("action"),
data: {
password: $("#password").val()
},
dataType: "json",
success: function(response) {
if(response.success == true){
window.location = response.redirect;
} else {
$(".error-msg").html(response.msg);
}
}
});
}
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,26 @@
@php
$datas = implode(',', $form_upload);
$files = explode(',', $datas);
@endphp
@foreach($files as $file)
@php
$url = Storage::url(config('constants.doc_path').'/'.$file);
$path = public_path('uploads/'.config('constants.doc_path').'/'.$file);
@endphp
@if(file_exists($path))
@php
$media = explode('_', $file, 2);
$file_name = !empty($media[1]) ? $media[1]: $media[0];
@endphp
@if(in_array(mime_content_type($path), ['image/jpeg', 'image/png', 'image/webp']))
<a target="_blank" href="{{$url}}" download="{{$file_name}}">
<img src="{{$url}}" alt="{{$file_name}}" style="width:100px;height: 90px;object-fit: contain;max-width: 100%;">
</a>
@else
<a target="_blank" href="{{$url}}" download="{{$file_name}}">
{{$file_name}}
</a>
@endif
<br>
@endif
@endforeach

View File

@@ -0,0 +1,22 @@
@foreach($comments as $comment)
<div class="direct-chat-msg">
<div class="direct-chat-info clearfix">
<span class="direct-chat-name pull-left">
{{$comment->commentedBy->name}}
</span>
<span class="direct-chat-timestamp pull-right">
{{\Carbon\Carbon::parse($comment->created_at)->isoFormat("D/M/YY HH:mm A")}}
</span>
</div>
<!-- /.direct-chat-info -->
<img class="direct-chat-img" src="https://ui-avatars.com/api/?name={{$comment->commentedBy->name}}">
<!-- /.direct-chat-img -->
<div class="direct-chat-text">
{!! $comment->comment !!}
@if(Auth::user()->id == $comment->user_id)
<i class="delete-comment fa fa-trash float-right text-danger cursor-pointer" data-comment_id="{{$comment->id}}" data-form_data_id="{{$comment->form_data_id}}"></i>
@endif
</div>
<!-- /.direct-chat-text -->
</div>
@endforeach

View File

@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ucFirst($form_data->form->name)}}</title>
<style type="text/css">
th, td {
padding: 15px;
text-align: left;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<div style="width: 100% !important;text-align: center;margin-bottom: 20px;">
@if(!empty($pdf_header))
{!! $pdf_header !!}
@else
<div style="width: 50% !important;">
<h3>
{{ucFirst($form_data->form->name)}}
@if(!empty($form_data->submittedBy))
<small>
(
@lang('messages.submitted_by'):
{{$form_data->submittedBy->name}}
)
</small>
@endif
</h3>
</div>
<div style="width: 50% !important;">
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
<b>@lang('messages.submission_numbering'):</b>
{{$form_data->submission_ref}}
@endif
</div>
@endif
</div>
<table style="width:100%">
<tbody>
@foreach($form_data->form->schema['form'] as $element)
@isset($form_data->data[$element['name']])
<tr>
<td style="width: 50% !important;">
<strong>{{$element['label']}}</strong>
</td>
<td style="width: 50% !important;">
@if($element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
@elseif($element['type'] == 'signature')
@if(!empty($form_data->data[$element['name']]))
<a target="_blank" href="{{$form_data->data[$element['name']]}}"
download="Signature">
<img src="{{$form_data->data[$element['name']]}}" class="signature">
</a>
@endif
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
{{implode(', ', $form_data->data[$element['name']])}}
@else
{!! nl2br($form_data->data[$element['name']]) !!}
@endif
</td>
</tr>
@endisset
@endforeach
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,69 @@
<script>
$(document).ready(function() {
// Запускаем обратный отсчет
var timeLeft = 3;
var countdown = setInterval(function() {
timeLeft--;
$('#countdown').text(timeLeft);
// Если обратный отсчет закончился, закрываем вкладку
if (timeLeft <= 0) {
clearInterval(countdown);
window.close();
}
}, 1000);
});
</script>
<div class="row">
<div class="col-md-6 offset-md-3 text-center mt-3">
<div class="alert alert-success">
<h5>
<i class="far fa-check-circle"></i>
{!!$form->schema['settings']['notification']['success_msg']!!}
<span id="countdown">3</span>
</h5>
</div>
</div>
</div>
<div class="row justify-content-center">
@if(isset($data['sub_ref_qr_code']) && !empty($data['sub_ref_qr_code']))
<div class="col-md-4 text-center">
<img src="{!!$data['sub_ref_qr_code']!!}"
alt="{{$form->name}} Ref Num Qr Code"
style="padding: 2.5rem;"/>
<a href="{!!$data['sub_ref_qr_code']!!}"
class="btn btn-outline-primary btn-block mt-2"
role="button"
download="{{$form->name}} Ref Num Qr Code">
<i class="far fa-arrow-alt-circle-down fa-fw fa-lg"></i>
{{__('messages.download_qr_code')}}
</a>
</div>
@elseif(isset($data['sub_ref_bar_code']) && !empty($data['sub_ref_bar_code']))
<div class="col-md-4 text-center">
<img src="{!!$data['sub_ref_bar_code']!!}" alt="{{$form->name}} Ref Num Bar Code"
style="padding: 2.5rem;"/>
<a href="{!!$data['sub_ref_bar_code']!!}"
class="btn btn-outline-primary btn-block mt-2"
role="button"
download="{{$form->name}} Ref Num Bar Code">
<i class="far fa-arrow-alt-circle-down fa-fw fa-lg"></i>
{{__('messages.download_bar_code')}}
</a>
</div>
@elseif(!in_array($form->schema['settings']['notification']['post_submit_action'], ['redirect']) &&
isset($form->schema['settings']['is_qr_code_enabled']) &&
$form->schema['settings']['is_qr_code_enabled'])
<div class="col-md-4 text-center">
<div id="qrcode" style="padding: 1.2rem;"></div>
<a href=""
class="btn btn-outline-primary btn-block mt-2"
role="button"
download="{{$form->name}} Qr Code"
id="download_qrcode">
<i class="far fa-arrow-alt-circle-down fa-fw fa-lg"></i>
{{__('messages.download_qr_code')}}
</a>
</div>
@endif
</div>

View File

@@ -0,0 +1,204 @@
@extends('layouts.app')
@section('css')
<style type="text/css">
@page {
size: A4 landscape;
max-height:100%;
max-width:100%;
margin-top: 1.2cm;
margin-bottom: 1.2cm;
margin-left: 1cm;
margin-right: 1cm;
size: 210mm 287mm;
}
}
</style>
@endsection
@section('content')
<div class="container-fluid">
<h5>
<i class="fab fa-wpforms"></i>
@lang('messages.reports_for_form', ['form_name' => $form->name])
</h5>
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card card-outline card-info">
<div class="card-header">
<i class="fas fa-chart-line"></i>
@lang('messages.analytics')
</div>
<div class="card-body">
<div class="row mb-5">
<div class="col-md-12">
<div id="visitors_chart"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="referrers_chart"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card card-outline card-info">
<div class="card-header">
<i class="fas fa-chart-pie"></i>
@lang('messages.reports')
</div>
<div class="card-body">
<div class="row">
@forelse($charts as $key => $chart)
<div class="col-md-6 mb-5">
<div id="{{$key}}"></div>
</div>
@empty
<div class="col-md-12">
<div class="alert alert-info" role="alert">
@lang('messages.no_report_found')
</div>
</div>
@endforelse
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script type="text/javascript">
$(document).ready(function(){
@if(!empty($charts))
@foreach($charts as $key => $chart)
@php
$chart_data = [];
foreach($chart['values'] as $label => $data) {
$chart_data[]= ['name' => $label, 'y' => $data];
}
@endphp
//initializing highchart.js
var high_chart_data = {!!json_encode($chart_data)!!};
Highcharts.chart('{{$key}}', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: true,
type: 'pie',
events: {
beforePrint: function() {
this.orgChartWidth = this.chartWidth;
this.orgChartHeight = this.chartHeight;
this.setSize(8500, this.orgChartHeight);
},
afterPrint: function() {
this.setSize(this.orgChartWidth, this.orgChartHeight);
}
}
},
title: {
text: '{{$chart["name"]}}'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b> <i>({point.y})</i>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} % <i>({point.y})</i>'
}
}
},
series: [
{
name: '{{$chart["name"]}}',
colorByPoint: true,
data: high_chart_data
}
]
});
@endforeach
@endif
//vistors chart
Highcharts.chart('visitors_chart', {
xAxis: {
categories: {!!json_encode($visitors_chart['labels'])!!}
},
chart: {
type: 'line',
events: {
beforePrint: function() {
this.orgChartWidth = this.chartWidth;
this.orgChartHeight = this.chartHeight;
this.setSize(8500, this.orgChartHeight);
},
afterPrint: function() {
this.setSize(this.orgChartWidth, this.orgChartHeight);
}
}
},
title: {
text: "{{$visitors_chart['title']}}"
},
series: [{
name: "{{$visitors_chart['total_visits_label']}}",
data: {!!json_encode($visitors_chart['total_visits'])!!}
}, {
name: "{{$visitors_chart['unique_visits_label']}}",
data: {!!json_encode($visitors_chart['unique_visits'])!!}
}]
});
//referrers chart
Highcharts.chart('referrers_chart', {
chart: {
type: 'pie',
events: {
beforePrint: function() {
this.orgChartWidth = this.chartWidth;
this.orgChartHeight = this.chartHeight;
this.setSize(8500, this.orgChartHeight);
},
afterPrint: function() {
this.setSize(this.orgChartWidth, this.orgChartHeight);
}
}
},
title: {
text: "{{$referrers_chart['name']}}"
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b> <i>({point.y})</i>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} % <i>({point.y})</i>'
}
}
},
series: [
{
name: "{{$referrers_chart['name']}}",
colorByPoint: true,
data: {!!json_encode($referrers_chart['values'])!!}
}
]
});
});
</script>
@endsection

View File

@@ -0,0 +1,298 @@
@extends('layouts.app')
@section('css')
<style type="text/css">
.no-print {
display: block;
}
@media screen {
#printSection {
display: none;
}
}
@media print {
body * {
visibility: hidden;
}
#printSection, #printSection * {
visibility: visible;
}
#printSection {
position: absolute;
left: 0;
top: 0;
}
.no-print {
display: none;
}
}
</style>
@endsection
@section('content')
<div class="container-fluid">
<div class="row justify-content-center no-print">
<div class="col-md-12">
@php
$date_format = config('constants.APP_DATE_FORMAT');
if (config('constants.APP_TIME_FORMAT') == '12') {
$date_format .= ' h:i A';
} else if (config('constants.APP_TIME_FORMAT') == '24') {
$date_format .= ' H:i';
} else {
$date_format = 'm/d/Y h:i A';
}
@endphp
<div class="card">
<div class="card-header">
{{$form->name}}
</div>
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
<div class="form-group mb-0 col-1">
<input type="date" class="form-control" name="start_date" value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
</div>
<div class="form-group mb-0 col-1">
<input type="date" class="form-control" name="end_date" value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
</div>
<div class="form-group mb-0 col-2 d-flex">
<button class="btn btn-primary mx-1" type="submit">@lang('messages.search_without_dots')</button>
</div>
</form>
@php
$is_enabled_sub_ref_no = false;
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
$is_enabled_sub_ref_no = true;
}
@endphp
<div class="tab-content card-body table-responsive" role="tabpanel">
@if(!empty($form->schema))
@php
$schema = $form->schema['form'];
$col_visible = $form['schema']['settings']['form_data']['col_visible'];
$btn_enabled = $form['schema']['settings']['form_data']['btn_enabled'];
@endphp
<table class="table" id="submitted_data_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.action')</th>
@if($is_enabled_sub_ref_no)
<th>@lang('messages.submission_numbering')</th>
@endif
<th>@lang('messages.username')</th>
@foreach($schema as $element)
@if(in_array($element['name'], $col_visible))
<th>
{{$element['label']}}
</th>
@endif
@endforeach
<th>@lang('messages.submitted_on')</th>
</tr>
</thead>
<tbody>
@foreach($data as $k => $row)
<tr>
<td>
{{-- Кнопка просмотра для всех, у кого есть права --}}
@if(in_array('view', $btn_enabled) && $has_permission)
<button type="button" class="btn btn-info btn-sm view_form_data m-1"
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id])}}"
data-toggle="modal">
<i class="fa fa-eye" aria-hidden="true"></i>
@lang('messages.view')
</button>
@endif
{{-- Кнопки только для админов/супервайзеров --}}
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
@if(in_array('delete', $btn_enabled))
<button type="button"
class="btn btn-danger btn-sm delete_form_data m-1"
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id])}}">
<i class="fa fa-trash" aria-hidden="true"></i>
@lang('messages.delete')
</button>
@endif
@php
$form_id = !empty($form->slug) ? $form->slug : $form->id;
@endphp
<a class="btn btn-dark btn-sm m-1"
href="{{action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id,'id' => $row->id])}}">
<i class="far fa-edit" aria-hidden="true"></i>
@lang('messages.edit')
</a>
@endif
</td>
@if($is_enabled_sub_ref_no)
<td>
{{$row['submission_ref']}}
</td>
@endif
<td>{{ $row->submittedBy?->name }}</td>
@foreach($schema as $row_element)
@if(in_array($row_element['name'], $col_visible))
<td>
@isset($row->data[$row_element['name']])
@if($row_element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]])
@elseif($row_element['type'] == 'signature')
@if(!empty($row->data[$row_element['name']]))
<a target="_blank"
href="{{$row->data[$row_element['name']]}}"
download="Signature">
<img src="{{$row->data[$row_element['name']]}}"
class="signature">
</a>
@endif
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload')
{{implode(', ', $row->data[$row_element['name']])}}
@else
{!! nl2br($row->data[$row_element['name']]) !!}
@endif
@endisset
</td>
@endif
@endforeach
<td>
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format)}}
<br/>
<small>
{{$row->updated_at->diffForHumans()}}
</small>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<p>Form Not found</p>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function () {
$('#submitted_data_table').DataTable({
scrollY: "600px",
scrollX: true,
scrollCollapse: true,
paging: true,
fixedColumns: {
leftColumns: 2
}
});
// view form data
$(document).on('click', '.view_form_data', function () {
var url = $(this).data("href");
$.ajax({
method: "GET",
dataType: "html",
url: url,
success: function (result) {
$("#modal_div").html(result).modal("show");
}
});
});
//delete form data
$(document).on('click', '.delete_form_data', function () {
var url = $(this).data("href");
var result = confirm('Are You Sure?');
if (result == true) {
$.ajax({
method: "DELETE",
url: url,
dataType: "json",
success: function (result) {
if (result.success == true) {
toastr.success(result.msg);
setTimeout(function () {
location.reload();
}, 1000);
} else {
toastr.error(result.msg);
}
}
});
}
});
//print form data on btn click
$(document).on('click', '.formDataPrintBtn', function () {
printElement(document.getElementById("print_form_data"));
});
$("#modal_div").on('shown.bs.modal', function () {
if ($("form#add_comment_form").length) {
$("form#add_comment_form").validate();
}
});
$(document).on('submit', 'form#add_comment_form', function (e) {
e.preventDefault();
var data = $("form#add_comment_form").serialize();
var url = $("form#add_comment_form").attr('action');
var ladda = Ladda.create(document.querySelector('.add_comment_btn'));
ladda.start();
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: data,
success: function (response) {
ladda.stop();
if (response.success) {
$("#comment").val('');
$('.direct-chat-messages').prepend(response.comment);
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
}
});
});
$(document).on('click', '.delete-comment', function (e) {
e.preventDefault();
var element = $(this);
var comment_id = $(this).data('comment_id');
var form_data_id = $(this).data('form_data_id');
if (confirm('Are you sure.?')) {
$.ajax({
method: 'DELETE',
dataType: 'json',
url: '/form-data-comment/' + comment_id + '?form_data_id=' + form_data_id,
success: function (response) {
if (response.success) {
toastr.success(response.msg);
element.closest('.direct-chat-msg').remove();
} else {
toastr.error(response.msg);
}
}
});
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,113 @@
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content" id="print_form_data">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
{{ucFirst($form_data->form->name)}}
@if(!empty($form_data->submittedBy))
<small>
(
<b>@lang('messages.submitted_by'): </b>
{{$form_data->submittedBy->name}}
)
</small>
@endif
</h5>
<button type="button" class="ml-auto btn btn-info no-print btn-sm formDataPrintBtn">
<i class="fas fa-print"></i>
@lang('messages.print')
</button>
<button type="button" class="close ml-0 no-print" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row mb-2">
<div class="col-md-6">
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
<b>@lang('messages.submission_numbering'):</b>
{{$form_data->submission_ref}}
@endif
</div>
</div>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>@lang('messages.field')</th>
<th>@lang('messages.value')</th>
</tr>
</thead>
<tbody>
@foreach($form_data->form->schema['form'] as $element)
@isset($form_data->data[$element['name']])
<tr>
<td>
<strong>{{$element['label']}}</strong>
</td>
<td>
@if($element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
@elseif($element['type'] == 'signature')
@if(!empty($form_data->data[$element['name']]))
<a target="_blank" href="{{$form_data->data[$element['name']]}}"
download="Signature">
<img src="{{$form_data->data[$element['name']]}}" class="signature">
</a>
@endif
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
{{implode(', ', $form_data->data[$element['name']])}}
@else
{!! nl2br($form_data->data[$element['name']]) !!}
@endif
</td>
</tr>
@endisset
@endforeach
</tbody>
</table>
<div class="no-print mt-4">
<hr>
<form id="add_comment_form" action="{{action([\App\Http\Controllers\FormDataCommentController::class, 'store'])}}" method="POST">
{{ csrf_field() }}
<!-- hiden fields -->
<input type="hidden" name="form_data_id" id="form_data_id" value="{{$form_data->id}}">
<div class="form-group">
<label for="comment">
@lang('messages.comment'):
</label>
<textarea class="form-control" name="comment" id="comment" rows="3" required></textarea>
</div>
<button type="submit" class="btn btn-success add_comment_btn">
@lang('messages.add_comment')
</button>
</form>
<div class="row mt-5">
<div class="col-md-12">
<h5>
<i class="fas fa-comments"></i>
@lang('messages.comments')
</h5>
<div class="direct-chat-messages" style="max-height: 500px;height: auto;">
@includeIf('form_data.partials.comment', ['comments' => $form_data->comments])
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer no-print">
<button type="button" class="float-right m-1 btn btn-secondary btn-sm" data-dismiss="modal">
@lang('messages.close')
</button>
<button type="button" class="float-right m-1 btn btn-info btn-sm formDataPrintBtn">
<i class="fas fa-print"></i>
@lang('messages.print')
</button>
<a class="btn float-right btn-primary btn-sm m-1" target="_blank" href="{{action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id])}}">
<i class="far fa-file-pdf" aria-hidden="true"></i>
@lang('messages.download_pdf')
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,432 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
@include('layouts/partials/status')
</div>
</div>
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
<div class="row mb-5">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-file-alt"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('messages.forms')</span>
<span class="info-box-number">{{$form_count}}</span>
</div>
</div>
</div>
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-danger elevation-1"><i
class="fas fa-align-justify"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('messages.templates')</span>
<span class="info-box-number">{{$template_count}}</span>
</div>
</div>
</div>
@endif
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-green elevation-1"><i class="fas fa-hand-pointer"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('messages.submissions')</span>
<span class="info-box-number">{{$submission_count}}</span>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-3">
<button type="button"
data-href="{{action([\App\Http\Controllers\FormController::class, 'create'])}}"
class="btn btn-primary float-right col-md-9 createForm mt-3">
<i class="fas fa-plus" aria-hidden="true"></i> @lang('messages.new_form')</button>
</div>
</div>
@endif
<div class="row">
<div class="col-12 col-sm-12">
<div class="card card-primary card-outline card-outline-tabs">
<div class="card-header p-0 border-bottom-0">
<ul class="nav nav-tabs
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
nav-justified
@endif"
id="custom-tabs-four-tab" role="tablist">
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value]) || auth()->user()->can_create_form)
<li class="nav-item">
<a class="nav-link active" id="custome-tabs-all-forms" data-toggle="pill"
href="#custome-tabs-forms" role="tab" aria-controls="custome-tabs-forms"
aria-selected="true">
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.all_forms')
</a>
</li>
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
<li class="nav-item">
<a class="nav-link" id="custome-tabs-all-templates" data-toggle="pill"
href="#custome-tabs-templates" role="tab"
aria-controls="custome-tabs-templates">
<i class="fas fa-align-justify"
aria-hidden="true"></i> @lang('messages.all_templates')
</a>
</li>
@endif
@endif
<li class="nav-item">
<a class="nav-link
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
active
@endif
" id="custome-tabs-shared-forms" data-toggle="pill"
href="#custome-tabs-shared-forms-assigned" role="tab"
aria-controls="custome-tabs-shared-forms-assigned"
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
aria-selected="true"
@endif>
<i class="fas fa-file-alt"
aria-hidden="true"></i> @lang('messages.assigned_forms')
</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content" id="custom-tabs-four-tabContent">
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
<div class="tab-pane fade active show" id="custome-tabs-forms" role="tabpanel"
aria-labelledby="custome-tabs-all-forms">
<div class="table-responsive">
<table class="table" id="form_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.description')</th>
<th>@lang('messages.name')</th>
<th>@lang('messages.created_at')</th>
<th>@lang('messages.submissions')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="tab-pane fade" id="custome-tabs-templates" role="tabpanel"
aria-labelledby="custome-tabs-all-templates">
<div class="table-responsive">
<table class="table" id="template_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.description')</th>
<th>@lang('messages.name')</th>
@if(auth()->user()->can('superadmin'))
<th>
@lang('messages.is_global_template')
<i class="fas fa-info-circle"
data-toggle="tooltip"
title="@lang('messages.is_global_template_tooltip')"></i>
</th>
@endif
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
@endif
<div class="tab-pane fade
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form)
active show
@endif
" id="custome-tabs-shared-forms-assigned" role="tabpanel"
aria-labelledby="custome-tabs-shared-forms">
<div class="table-responsive">
<table class="table" id="assigned_form_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.description')</th>
<th>@lang('messages.name')</th>
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<th>@lang('messages.created_by')</th>
@endif
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /.card -->
</div>
</div>
</div>
</div>
<div class="modal fade" id="collab_modal" role="dialog" aria-hidden="true"></div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function () {
// form dataTable
var form_table = $('#form_table').DataTable({
processing: true,
serverSide: true,
ajax: '/home',
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
aaSorting: [[2, 'desc']],
"columnDefs": [
{"width": "22%", "targets": 0},
{"width": "40%", "targets": 1},
{"width": "15%", "targets": 2},
{"width": "3%", "targets": 3},
{"width": "20%", "targets": 4}
],
columns: [
{data: 'name', name: 'name'},
{data: 'description', name: 'description'},
{data: 'created_at', name: 'created_at'},
{data: 'data_count', name: 'data_count', searchable: false},
{data: 'action', name: 'action', sortable: false}
]
});
// template dataTable
var template_table = $('#template_table').DataTable({
processing: true,
serverSide: true,
ajax: '/home-template',
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
columns: [
{data: 'name', name: 'name'},
{data: 'description', name: 'description'},
@if(auth()->user()->can('superadmin'))
{
data: 'is_global_template', name: 'is_global_template', sortable: false, searchable: false
},
@endif
{
data: 'action', name: 'action', sortable: false
}
]
});
//delete form
$(document).on('click', '.delete_form', function () {
var url = $(this).data("href");
var result = confirm('Are You Sure?');
if (result == true) {
$.ajax({
method: "DELETE",
url: url,
dataType: "json",
success: function (result) {
if (result.success == true) {
toastr.success(result.msg);
form_table.ajax.reload();
} else {
toastr.error(result.msg);
}
}
});
}
});
//delete template
$(document).on('click', '.delete_template', function () {
var url = $(this).data("href");
var result = confirm('Are You Sure?');
if (result == true) {
$.ajax({
method: "DELETE",
url: url,
dataType: "json",
success: function (result) {
if (result.success == true) {
toastr.success(result.msg);
template_table.ajax.reload();
} else {
toastr.error(result.msg);
}
}
});
}
});
// create form
$(document).on('click', '.createForm', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#modal_div").html(response).modal("show");
}
});
});
// create widget
$(document).on('click', '.generate_widget', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#modal_div").html(response).modal("show");
}
});
});
//copy form
$(document).on('click', '.copy_form', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#modal_div").html(response).modal("show");
}
});
});
//assigned form to user
var assigned_form_table = $('#assigned_form_table').DataTable({
processing: true,
serverSide: true,
ajax: '/home-assigned-forms',
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
aaSorting: [[0, 'desc']],
"columnDefs": [
{"width": "25%", "targets": 0},
{"width": "40%", "targets": 1},
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
{
"width": "15%", "targets": 2
},
@endif
{
"width": "20%",
"targets": @php echo auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) ? 3 : 2 @endphp }
],
columns: [
{data: 'name', name: 'forms.name'},
{data: 'description', name: 'forms.description'},
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
{
data: 'created_by', name: 'forms.created_by'
},
@endif
{
data: 'action', name: 'action', sortable: false
}
]
});
//form collaborate
$(document).on('click', '.collab_btn', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#collab_modal").html(response).modal("show");
}
});
});
$("#collab_modal").on('shown.bs.modal', function () {
if ($("#form_design").length) {
$(document).on('change', '#form_design', function () {
if ($("#form_design").is(":checked")) {
$("#form_view").attr('checked', true);
} else {
$("#form_view").attr('checked', false);
}
});
}
});
$(document).on('submit', 'form#collaborate_form', function (e) {
e.preventDefault();
var data = $("form#collaborate_form").serialize();
var url = $("form#collaborate_form").attr('action');
var ladda = Ladda.create(document.querySelector('.submit_btn'));
ladda.start();
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: data,
success: function (response) {
ladda.stop();
if (response.success) {
$("#collab_modal").modal('hide');
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
}
});
});
$('a[data-toggle="pill"]').on('shown.bs.tab', function (e) {
var target = $(e.target).attr('href');
if (target == '#custome-tabs-forms') {
if (typeof form_table != 'undefined') {
form_table.ajax.reload();
}
} else if (target == '#custome-tabs-templates') {
if (typeof template_table != 'undefined') {
template_table.ajax.reload();
}
} else if (target == '#custome-tabs-shared-forms-assigned') {
if (typeof assigned_form_table != 'undefined') {
assigned_form_table.ajax.reload();
}
}
});
@if(auth()->user()->can('superadmin'))
$(document).on('click', '.toggle_global_template', function () {
$.ajax({
method: "POST",
url: "{{route('toggle.global.template')}}",
dataType: "json",
data: {
is_checked: $(this).is(":checked") ? 1 : 0,
form_id: $(this).data("form_id"),
},
success: function (response) {
if (response.success) {
template_table.ajax.reload();
} else {
toastr.error(response.msg);
}
}
});
});
@endif
});
</script>
@endsection

View File

@@ -0,0 +1,146 @@
@extends('layouts.app', ['nav' => false])
@section('title', 'Welcome - Installation')
@section('content')
<div class="container">
<div class="row">
<h3 class="text-center">{{ config('app.name', 'POS') }} Installation <small>Step 2 of 3</small></h3>
</div>
<div class="row">
<div class="card">
@include('ic.partials.nav', ['active' => 'app_details'])
<div class="card-body">
@if(session('error'))
<div class="alert alert-danger">
{!! session('error') !!}
</div>
@endif
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form id="details_form" method="post"
action="{{route('install.postDetails')}}">
{{ csrf_field() }}
<h4>Application Details</h4>
<hr/>
<div class="form-row">
<div class="form-group col-md-6">
<label for="app_name">Application Name:*</label>
<input type="text" class="form-control" name="APP_NAME" id="app_name" placeholder="" required>
</div>
<div class="form-group col-md-6">
<label for="app_title">Application Title:</label>
<input type="text" name="APP_TITLE" class="form-control" id="app_title">
</div>
</div>
<br/>
<h4> License Details <small class="text-danger">Make sure to provide correct information from Envato/codecanyon</small></h4>
<hr/>
<div class="form-row">
<div class="form-group col-md-4">
<label for="envato_purchase_code">Envato Purchase Code:*</label>
<input type="password" name="ENVATO_PURCHASE_CODE" required class="form-control" id="envato_purchase_code">
</div>
<div class="form-group col-md-4">
<label for="envato_username">Envato Username:*</label>
<input type="text" name="ENVATO_USERNAME" required class="form-control" id="envato_username">
</div>
<div class="form-group col-md-4">
<label for="envato_email">Your Email:</label>
<input type="email" name="ENVATO_EMAIL" class="form-control" id="envato_email" placeholder="optional">
<p class="help-block">For Newsletter & support</p>
</div>
</div>
<div class="clearfix"></div>
<h4> Database Details <small class="text-muted">Make sure to provide correct information</small></h4>
<hr/>
<div class="form-row">
<div class="form-group col-md-4">
<label for="db_host">Database Host:*</label>
<input type="text" class="form-control" id="db_host" name="DB_HOST" required placeholder="localhost / 127.0.0.1">
</div>
<div class="form-group col-md-4">
<label for="db_port">Database Port:*</label>
<input type="text" class="form-control" id="db_port" name="DB_PORT" required value="3306">
</div>
<div class="form-group col-md-4">
<label for="db_database">Database Name:*</label>
<input type="text" class="form-control" id="db_database" name="DB_DATABASE" required>
<p class="help-block text-danger"><small>Name of empty database</small></p>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="db_username">Database Username:*</label>
<input type="text" class="form-control" id="db_username" name="DB_USERNAME" required>
</div>
<div class="form-group col-md-6">
<label for="db_password">Database Password:*</label>
<input type="password" class="form-control" id="db_password" name="DB_PASSWORD" required>
</div>
</div>
<hr/>
<div class="col-md-12">
<a href="{{route('install.index')}}" class="btn btn-default pull-left back_button" tabindex="-1">Back</a>
<button type="submit" id="install_button" class="btn btn-primary float-md-right">Install</button>
</div>
<div class="col-md-12 text-center text-danger install_msg d-none">
<strong>Installation in progress, Please do not refresh, go back or close the browser.</strong>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('select#MAIL_MAILER').change(function(){
var driver = $(this).val();
if(driver == 'smtp'){
$('div.smtp').removeClass('d-none');
$('input.smtp_input').attr('disabled', false);
} else {
$('div.smtp').addClass('d-none');
$('input.smtp_input').attr('disabled', true);
}
});
$('form#details_form').submit(function(){
$('button#install_button').attr('disabled', true).text('Installing...');
$('div.install_msg').removeClass('d-none');
$('.back_button').d-none();
});
})
</script>
@endsection

View File

@@ -0,0 +1,59 @@
@extends('layouts.app', ['nav' => false])
@section('title', 'Welcome - Installation')
@section('content')
<div class="container">
<div class="row">
<h3 class="text-center">{{ config('app.name', 'POS') }} Installation <small>Step 2 of 3</small></h3>
</div>
<div class="row">
<div class="card">
@include('ic.partials.nav', ['active' => 'app_details'])
<div class="card-body">
<form class="form" method="post"
action="{{route('install.installAlternate')}}"
id="env_details_form">
{{ csrf_field() }}
<h4 class="install_instuction">Hey, I need your help. </h4>
<p class="install_instuction">
Please create a file with name <code>.env</code> in application folder with <code>read & write permission</code> and paste the below content. <br/> Press install after it.
</p>
<hr/>
<div class="col-md-12">
<div class="form-group">
<textarea rows="25" cols="50">{{$envContent}}</textarea>
</div>
</div>
<div class="col-md-12">
<button type="submit" class="btn btn-primary float-md-right" id="install_button">Install</button>
</div>
<div class="col-md-12 text-center text-danger install_msg d-none">
<h3>Installation in progress, Please do not refresh, go back or close the browser.</strong>
</h3>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('form#env_details_form').submit(function(){
$('button#install_button').attr('disabled', true).text('Installing...');
$(".install_instuction").addClass('d-none');
$('div.install_msg').removeClass('d-none');
$('textarea').addClass('d-none');
$('.back_button').d-none();
});
})
</script>
@endsection

View File

@@ -0,0 +1,50 @@
@extends('layouts.app', ['nav' => false])
@section('title', 'Welcome - Installation')
@section('content')
<div class="container">
<div class="row">
<h3 class="text-center">{{ config('app.name', 'MPFG') }} Installation <small>Step 1 of 3</small></h3>
</div>
<div class="row">
<div class="card">
@include('ic.partials.nav', ['active' => 'install'])
<div class="card-body">
<h3 class="text-success">
Welcome to MPFG Installation!
</h3>
<p><strong class="text-danger">[IMPORTANT]</strong> Before you start installing make sure you have following information ready with you:</p>
<ol>
<li>
<b>Application Name</b> - Something short & Meaningful.
</li>
<li>
<b>Database informations:</b>
<ul>
<li>Username</li>
<li>Password</li>
<li>Database Name</li>
<li>Database Host</li>
</ul>
</li>
<li>
<b>Envato or Codecanyon Details:</b>
<ul>
<li><b>Envato purchase code.</b> (<a href="https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-" target="_blank">Where Is My Purchase Code?</a>)</li>
<li>
<b>Envato Username.</b> (Your envato username)
</li>
</ul>
</li>
</ol>
@include('ic.partials.e_license')
<a href="{{route('install.details')}}" class="btn btn-danger float-right">I Agree, Let's Go!</a>
</div>
</div>
</div>
</div>
@endsection

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a class="nav-link @if($active == 'install') active @endif" href="#">Instructions</a>
</li>
<li class="nav-item">
<a class="nav-link @if($active == 'app_details') active @endif" href="#">Application Details</a>
</li>
<li class="nav-item">
<a class="nav-link @if($active == 'success') active @endif" href="#">Success</a>
</li>
</ul>
</div>

View File

@@ -0,0 +1,24 @@
@extends('layouts.app', ['nav' => false])
@section('title', 'Welcome - Installation')
@section('content')
<div class="container">
<div class="row">
<h3 class="text-center">{{ config('app.name', 'POS') }} Installation <small>Step 3 of 3</small></h3>
</div>
<div class="row">
<div class="card">
@include('ic.partials.nav', ['active' => 'success'])
<div class="card-body">
<!-- /.box-header -->
<h1 class="card-title">{{ config('app.name') }}</h1>
<h3 class="text-success card-title">Great!, Your application is succesfully installed.</h3>
<p><br><b>Username:</b> admin@admin.com<br/> <b>Password:</b> 12345678</p>
<p><br>Login link <a href="{{route('login')}}" target="_blank">here</a></p>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,92 @@
@extends('layouts.app', ['nav' => false])
@section('title', 'Welcome - Installation')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
@if(session('error'))
<div class="alert alert-danger">
{!! session('error') !!}
</div>
@endif
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
<div class="card">
<div class="card-body">
<form class="form" id="details_form" method="post"
action="{{route('install.update')}}">
{{ csrf_field() }}
<h4> License Details <small class="text-danger">Make sure to provide correct information from Envato/codecanyon</small></h4>
<hr/>
<div class="form-row">
<div class="form-group col-md-4">
<label for="envato_purchase_code">Envato Purchase Code:*</label>
<input type="text" name="ENVATO_PURCHASE_CODE" required class="form-control" id="envato_purchase_code">
</div>
<div class="form-group col-md-4">
<label for="envato_username">Envato Username:*</label>
<input type="text" name="ENVATO_USERNAME" required class="form-control" id="envato_username">
</div>
<div class="form-group col-md-4">
<label for="envato_email">Your Email:</label>
<input type="email" name="ENVATO_EMAIL" class="form-control" id="envato_email" placeholder="optional">
<p class="help-block">For Newsletter & support</p>
</div>
</div>
<br/>
<strong class=''>💫 Book Update Service <a target='_blank' href='https://ultimatefosters.com/product/installation-update-service/'>Update Service</a></strong><br/><small><i>👉 Get updated by expert engineer within 24 hours</i><small>
@include('ic.partials.e_license')
<div class="col-md-12">
<button type="submit" id="install_button" class="btn btn-primary float-right">I Agree, Update</button>
</div>
</form>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function(){
$('select#MAIL_MAILER').change(function(){
var driver = $(this).val();
if(driver == 'smtp'){
$('div.smtp').removeClass('hide');
$('input.smtp_input').attr('disabled', false);
} else {
$('div.smtp').addClass('hide');
$('input.smtp_input').attr('disabled', true);
}
})
$('form#details_form').submit(function(){
$('button#install_button').attr('disabled', true).text('Installing...');
$('div.install_msg').removeClass('hide');
$('.back_button').hide();
});
})
</script>
@endsection

View File

@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="//fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
@include('layouts.partials.css')
@yield('css')
</head>
<body class="layout-top-nav">
<div id="app" class="wrapper">
@if(!isset($nav) || $nav === true)
@include('layouts.partials.top-nav')
@endif
<div class="content-wrapper">
@if(!isset($iframe_enabled) || !$iframe_enabled)
<div class="content-header">
<div class="container">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark"> @yield('heading')</h1>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
@endif
<section class="content">
<div class="container">
<div col-md-12>
<!-- @include('layouts.partials.status') -->
</div>
</div>
@yield('content')
</section>
<div class="modal fade" id="modal_div" tabindex="-1" role="dialog"
aria-labelledby="gridSystemModalLabel">
</div>
</div>
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
<div class="p-3">
<h5>Title</h5>
<p>Sidebar content</p>
</div>
</aside>
@if(!isset($nav) || $nav === true)
@include('layouts.partials.footer')
@endif
</div>
@include('layouts.partials.javascript')
@yield('footer')
</body>
</html>

View File

@@ -0,0 +1,214 @@
@php
$is_download = isset($is_download) ? $is_download : false;
$error_msg_color = isset($error_msg_color) ? $error_msg_color : 'red';
@endphp
@if(!$is_download)
<link href="{{asset(mix('css/app.css'))}}" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.css?v={{$asset_version}}"/>
<!-- ladda.js -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda-themeless.min.css?v={{$asset_version}}">
<!-- intro.js -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/introjs.min.css?v={{$asset_version}}">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/intro.js@2.9.3/themes/introjs-nassim.min.css?v={{$asset_version}}">
<link href="https://cdn.jsdelivr.net/npm/animate.css@3.5.1?v={{$asset_version}}" rel="stylesheet" type="text/css">
@else
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css?v={{$asset_version}}">
@endif
<!-- form theme -->
@if($is_download && isset($form->schema['settings']['theme']) && $form->schema['settings']['theme'] != 'default')
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/{{$form->schema['settings']['theme']}}/bootstrap.min.css" rel="stylesheet">
@endif
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.css?v={{$asset_version}}" rel="stylesheet">
<link href="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.css?v={{$asset_version}}" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css?v={{$asset_version}}">
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.css?v={{$asset_version}}">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/css/tempusdominus-bootstrap-4.min.css?v={{$asset_version}}" />
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.css?v={{$asset_version}}">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/css/bootstrap-select.min.css?v={{$asset_version}}"/>
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.css?v={{$asset_version}}" rel="stylesheet">
<!-- bootstrap star rating -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/css/star-rating.min.css?v={{$asset_version}}" media="all" rel="stylesheet" type="text/css" />
<!-- if you need to use a theme, then include the theme CSS file -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.css?v={{$asset_version}}" media="all" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{{asset('/plugins/countdowntimer/countdowntimer.css').'?v='.$asset_version}}">
<style type="text/css">
.xs{
font-size: 0.575rem !important;
}
.error {
color:{!!$error_msg_color!!}
}
@if(!$is_download)
body {
margin: 0; /* If not already reset */
}
.content {
min-height: calc(100vh - 80px);
}
footer {
height: 50px;
}
@endif
/*custom css for switch*/
.switch {
font-size: 1rem;
position: relative;
}
.switch input {
position: absolute;
height: 1px;
width: 1px;
background: none;
border: 0;
clip: rect(0 0 0 0);
clip-path: inset(50%);
overflow: hidden;
padding: 0;
}
.switch input + label {
position: relative;
min-width: calc(calc(2.375rem * .8) * 2);
border-radius: calc(2.375rem * .8);
height: calc(2.375rem * .8);
line-height: calc(2.375rem * .8);
display: inline-block;
cursor: pointer;
outline: none;
user-select: none;
vertical-align: middle;
text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem);
}
.switch input + label::before,
.switch input + label::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: calc(calc(2.375rem * .8) * 2);
bottom: 0;
display: block;
}
.switch input + label::before {
right: 0;
background-color: #dee2e6;
border-radius: calc(2.375rem * .8);
transition: 0.2s all;
}
.switch input + label::after {
top: 2px;
left: 2px;
width: calc(calc(2.375rem * .8) - calc(2px * 2));
height: calc(calc(2.375rem * .8) - calc(2px * 2));
border-radius: 50%;
background-color: white;
transition: 0.2s all;
}
.switch input:checked + label::before {
background-color: #08d;
}
.switch input:checked + label::after {
margin-left: calc(2.375rem * .8);
}
.switch input:focus + label::before {
outline: none;
box-shadow: 0 0 0 0.2rem rgba(0, 136, 221, 0.25);
}
.switch input:disabled + label {
color: #868e96;
cursor: not-allowed;
}
.switch input:disabled + label::before {
background-color: #e9ecef;
}
.switch.switch-sm {
font-size: 0.875rem;
}
.switch.switch-sm input + label {
min-width: calc(calc(1.9375rem * .8) * 2);
height: calc(1.9375rem * .8);
line-height: calc(1.9375rem * .8);
text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem);
}
.switch.switch-sm input + label::before {
width: calc(calc(1.9375rem * .8) * 2);
}
.switch.switch-sm input + label::after {
width: calc(calc(1.9375rem * .8) - calc(2px * 2));
height: calc(calc(1.9375rem * .8) - calc(2px * 2));
}
.switch.switch-sm input:checked + label::after {
margin-left: calc(1.9375rem * .8);
}
.switch.switch-lg {
font-size: 1.25rem;
}
.switch.switch-lg input + label {
min-width: calc(calc(3rem * .8) * 2);
height: calc(3rem * .8);
line-height: calc(3rem * .8);
text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem);
}
.switch.switch-lg input + label::before {
width: calc(calc(3rem * .8) * 2);
}
.switch.switch-lg input + label::after {
width: calc(calc(3rem * .8) - calc(2px * 2));
height: calc(calc(3rem * .8) - calc(2px * 2));
}
.switch.switch-lg input:checked + label::after {
margin-left: calc(3rem * .8);
}
.switch + .switch {
margin-left: 1rem;
}
.dropdown-menu {
margin-top: .75rem;
}
.signature-pad {
background: aliceblue;
}
.pointer{
cursor: pointer;
}
/* Scrollbar design css*/
::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
background-color: #F5F5F5;
}
::-webkit-scrollbar
{
width: 6px;
background-color: #F5F5F5;
height: 6px;
}
::-webkit-scrollbar-thumb
{
background-color: #9ca3af;
}
</style>
<!-- Form additional css -->
@if(!empty($additional_css))
{!!$additional_css!!}
@endif
<!-- Application additional css -->
@if(!$is_download && !isset($nav))
@if(!empty($__additional_css))
{!!$__additional_css!!}
@endif
@endif

View File

@@ -0,0 +1,12 @@
<footer class="main-footer no-print">
<div class="float-right d-none d-sm-inline">
@lang('messages.application_copyright',[
'name' => config('app.name', 'Laravel'),
'version' => config('author.app_version'),
'year' => date('Y')
])
</div>
<!-- Default to the left -->
<!-- <strong>Copyright © 2014-2019 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved. -->
</footer>

View File

@@ -0,0 +1,474 @@
@php
$is_download = isset($is_download) ? $is_download : false;
$form = !empty($form) ? $form : '';
@endphp
<!-- reCaptcha -->
<script src="//www.google.com/recaptcha/api.js?v={{$asset_version}}" async defer></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></' + 'script>');
}
</script>
<!-- Bootstrap Js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{$asset_version}}"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{$asset_version}}"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{$asset_version}}"></script>
<script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{$asset_version}}"></script>
<script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{$asset_version}}"></script>
<!-- Boostrap star rating -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{$asset_version}}"
type="text/javascript"></script>
<!-- if you need to use a theme, then include the theme Js file -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{$asset_version}}"></script>
<!-- optionally if you need translation for your language then include locale file as mentioned below -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> -->
<!-- signature pad (https://github.com/szimek/signature_pad)-->
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{$asset_version}}"></script>
<script src="{{asset('/plugins/countdowntimer/countdowntimer.min.js').'?v='.$asset_version}}"></script>
@if(!$is_download)
<!-- app js values -->
<script type="application/javascript">
var APP = {};
APP.APP_URL = "{{config('app.url')}}";
APP.CURRENCY_SYMBOL = "{{env('CURRENCY_SYMBOL')}}";
APP.ACELLE_MAIL_NAME = "{{config('constants.ACELLE_MAIL_NAME')}}";
APP.ACELLE_MAIL_ENABLED = false;
APP.APP_MEDIA_URL = "{{asset('/uploads/'.config('constants.doc_path').'/')}}";
APP.PDF_PLACEHOLDER = "{{asset('/img/pdf_placeholder.png')}}";
APP.MAX_UPLOAD_SIZE = "{{config('constants.max_upload_size')}}";
APP.MAX_PDF_UPLOAD_SIZE = "{{config('constants.pdf_upload_size')}}";
@if(!empty(config('constants.ACELLE_MAIL_NAME')) && !empty(config('constants.ACELLE_MAIL_API')))
APP.ACELLE_MAIL_ENABLED = true;
@endif
$.ajaxSetup({
beforeSend: function (jqXHR, settings) {
if (settings.url.indexOf('http') === -1) {
settings.url = APP.APP_URL + settings.url;
}
},
});
</script>
<script type="text/javascript">
//function to print page
function printElement(elem) {
var domClone = elem.cloneNode(true);
var printSection = document.getElementById("printSection");
if (!printSection) {
var printSection = document.createElement("div");
printSection.id = "printSection";
document.body.appendChild(printSection);
}
printSection.innerHTML = "";
printSection.appendChild(domClone);
window.print();
}
</script>
<script
src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{$asset_version}}"></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{$asset_version}}"></script>
<!-- ladda.js -->
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{$asset_version}}"></script>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{$asset_version}}"></script>
<!-- localization -->
<script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script>
<script src="{{ asset(mix('js/app.js')) }}" defer></script>
<!-- intro.js -->
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{$asset_version}}"></script>
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
@endif
<script type="text/javascript">
jQuery.validator.setDefaults({
errorPlacement: function (error, element) {
if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
error.insertAfter(element.parent());
} else if (element.hasClass('select2')) {
error.insertAfter(element.next('span.select2-container'));
} else if (element.parent().hasClass('input-group')) {
error.insertAfter(element.parent());
} else if (element.parent().hasClass('multi-input')) {
error.insertAfter(element.closest('.multi-input'));
} else if (element.hasClass('summer_note')) {
error.insertAfter(element.next('.note-editor'));
} else if (element.hasClass('custom-control-input')) {
error.insertAfter(element.parent().parent().parent());
} else if (element.hasClass('star_rating')) {
error.insertAfter(element.parent().parent());
} else if (element.hasClass('switch')) {
error.insertAfter(element.parent().parent());
} else if (element.hasClass('signature')) {
error.insertAfter(element.parent());
} else {
error.insertAfter(element);
}
},
invalidHandler: function () {
toastr.error("{{ __('messages.some_error_in_input_field') }}");
}
});
$(document).ready(function () {
@if(!$is_download)
jQuery.extend($.fn.dataTable.defaults, {
fixedHeader: false,
aLengthMenu: [
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"]
],
iDisplayLength: 25,
dom: 'lfrtip',
"language": {
"emptyTable": "{{__('messages.emptyTable')}}",
"info": "{{__('messages.dt_info')}}",
"infoEmpty": "{{__('messages.infoEmpty')}}",
"infoFiltered": "{{__('messages.infoFiltered')}}",
"lengthMenu": "{{__('messages.lengthMenu')}}",
"loadingRecords": "{{__('messages.loadingRecords')}}",
"processing": "{{__('messages.processing')}}",
"search": "{{__('messages.search')}}",
"zeroRecords": "{{__('messages.zeroRecords')}}",
"paginate": {
"first": "{{__('messages.first')}}",
"last": "{{__('messages.last')}}",
"next": "{{__('messages.next')}}",
"previous": "{{__('messages.previous')}}"
},
buttons: {
copyTitle: "{{__('messages.copy_to_clipboard')}}",
copySuccess: {
_: "{{__('messages.copied_n_rows_to_clipboard')}}"
}
}
}
});
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
});
@endif
$('button[type=reset]').on('click', function () {
$(this).parents('form').find('input').val('');
window.location.href = $(this).parents('form').attr('action');
});
});
function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format, disabled_days, enable_time_picker, time_picker_inline) {
var start = null;
var end = null;
var format = '';
var display_time = null;
var disabled_week_days = '';
var side_by_side = time_picker_inline;
if (disabled_days.length > 0) {
disabled_week_days = disabled_days.join(',');
}
//format
if (date_format != null) {
format = date_format.toUpperCase();
}
if (enable_time_picker) {
display_time = 'hh:mm A';
if (time_format == '24') {
display_time = 'HH:mm';
}
format += ' ' + display_time;
}
// start date
if (start_date == 'none') {
start = false;
} else if (start_date == 'today') {
start = moment();
} else if (start_date == 'current_year') {
start = moment().startOf('year');
} else if (start_date == 'current_month') {
start = moment().startOf('month');
}
//end date
if (end_date == 'none') {
end = false;
} else if (end_date == 'today') {
end = moment().add(0, 'd');
} else if (end_date == 'current_year') {
end = moment().endOf('year');
} else if (end_date == 'current_month') {
end = moment().endOf('month');
}
$('#' + element_name).datetimepicker({
icons: {
time: 'far fa-clock',
},
format: format,
minDate: start,
maxDate: end,
daysOfWeekDisabled: [disabled_week_days],
showClear: true,
ignoreReadonly: true,
sideBySide: side_by_side,
defaultDate: element_date.length ? moment(element_date, format) : ''
});
}
function initialize_rangeslider(element_name) {
$('#' + element_name).rangeslider({
polyfill: false,
//Callback function
onInit: function () {
},
// Callback function
onSlide: function (position, value) {
$('.' + element_name).text(value);
},
});
}
Dropzone.autoDiscover = false;
function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size, allowed_file_type, url = null) {
var file_remove_url = "library/delete_file.php";
if (url == null) {
url = "{{ url('/file-upload')}}";
file_remove_url = "{{ url('/file-delete')}}";
}
var file_names = [];
if ($('input#' + element_name).val().length > 0) {
file_names.push($('input#' + element_name).val());
}
$('#' + element_name).dropzone({
paramName: "file",
addRemoveLinks: true,
url: url,
maxFilesize: max_file_size,
dictDefaultMessage: file_upload_msg,
maxFiles: no_of_files_can_be_uploaded,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
acceptedFiles: allowed_file_type,
init: function () {
//function to be use on editing a form, to display existing files
if ($('input#' + element_name).val().length > 0) {
window[`${element_name}_myDropzone`] = this;
var file_obj = {files: $('input#' + element_name).val()};
$.ajax({
method: "GET",
url: '/existing-file-display',
dataType: "json",
data: file_obj,
success: function (result) {
if (result.success) {
$.each(result.files, function (key, file) {
var mockFile = {name: file.name, uploaded_as: file.uploaded_as, size: file.size};
window[`${element_name}_myDropzone`].emit("addedfile", mockFile);
window[`${element_name}_myDropzone`].emit("thumbnail", mockFile, file.path);
window[`${element_name}_myDropzone`].emit("complete", mockFile);
});
}
}
});
}
//function to be use on removeing a file
this.on("removedfile", function (file) {
$.ajax({
url: file_remove_url,
data: {"file_name": file.uploaded_as},
type: "POST",
success: function (result) {
if (typeof (result) == 'string') {
var result = JSON.parse(result);
}
if (result.success == 1) {
toastr.success(result.msg);
var index = file_names.indexOf(file.uploaded_as);
if (index != -1) {
file_names.splice(index, 1);
}
var elementVal = $('input#' + element_name).val();
var oldVal = elementVal.split(",");
index = oldVal.indexOf(file.uploaded_as);
if (index != -1) {
oldVal.splice(index, 1);
}
var newVal = oldVal.join(",");
$('input#' + element_name).val(newVal);
} else {
toastr.error(result.msg);
}
}
});
});
},
success: function (file, response) {
if (typeof (response) == 'string') {
var response = JSON.parse(response);
}
if (response.success == true) {
toastr.success(response.msg);
file_names.push(response.path);
file.uploaded_as = response.path;
$('input#' + element_name).val(file_names); //store file_names
} else {
toastr.error(response.msg);
}
}
});
}
function initialize_text_editor(element_name, placeholder, height) {
$('#' + element_name).summernote({
placeholder: placeholder,
height: height
});
}
function initialize_star_rating(element_name) {
$("#" + element_name).rating({
theme: 'krajee-fas',
filledStar: '<i class="fas fa-star"></i>',
emptyStar: '<i class="fas fa-star"></i>'
});
}
function initialize_datetimepicker_for_form_scheduling() {
$('div#start_date_time').datetimepicker({
icons: {
time: 'far fa-clock',
},
format: 'YYYY-MM-DD hh:mm A',
minDate: moment(),
showClear: true,
ignoreReadonly: true
});
$('div#end_date_time').datetimepicker({
icons: {
time: 'far fa-clock',
},
format: 'YYYY-MM-DD hh:mm A',
minDate: moment(),
showClear: true,
ignoreReadonly: true
});
}
function initialize_signature_pad(element) {
var signaturePad = element;
var canvas = document.getElementById(element);
signaturePad = new SignaturePad(canvas, {
onEnd: function (event) {
var element = $(this)[0]._canvas.id
var signature = $(this)[0].toDataURL();
$('#output_' + element).val(signature);
}
});
if ($('#output_' + element).val().length > 0) {
signaturePad.fromDataURL($('#output_' + element).val());
}
$(document).on('click', '#clear_' + element, function () {
signaturePad.clear();
$('#output_' + $(this).data('name')).val('');
});
$(document).on('click', '#undo_' + element, function () {
var data = signaturePad.toData();
if (data) {
data.pop(); // remove the last dot or line
signaturePad.fromData(data); //draw signature from array of data
if (data.length > 0) {
var signature = signaturePad.toDataURL();
$('#output_' + $(this).data('name')).val(signature);
} else {
$('#output_' + $(this).data('name')).val('');
}
}
});
}
function initializeToastrSettingsForForm(position) {
var toastr_position = 'toast-top-right';
if (position) {
toastr_position = position;
}
toastr.options = {
"positionClass": toastr_position
}
}
function initialize_countdowntimer(element) {
$("#" + element.name).countdowntimer({
hours: element.hours,
minutes: element.minutes,
seconds: element.seconds,
size: element.size,
labelsFormat: element.labels_format,
borderColor: element.border_color,
fontColor: element.font_color,
backgroundColor: element.bg_color,
timeSeparator: element.time_separator,
displayFormat: element.display_format
});
}
</script>
<!-- Application additional js -->
@if(!$is_download && !isset($nav))
@if(!empty($__additional_js))
{!!$__additional_js!!}
@endif
@endif

View File

@@ -0,0 +1,17 @@
@if (session('status') && isset(session('status')['success']))
@if(session('status')['success'] == 1)
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
{!!session('status')['msg']!!}
</div>
@else
<div class="alert alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
{!!session('status')['msg']!!}
</div>
@endif
@endif

View File

@@ -0,0 +1,143 @@
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-light @guest navbar-laravel @else navbar-white @endguest">
<div class="container">
@auth
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="navbar-brand">
<!-- <img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
style="opacity: .8"> -->
<span class="brand-text font-weight-light">{{ config('app.name', 'Laravel') }}</span>
</a>
<ul class="navbar-nav">
<li class="nav-item d-none d-sm-inline-block">
<a class="nav-link" href="{{ action([\App\Http\Controllers\HomeController::class, 'index']) }}">
<i class="fas fa-home"></i>
{{ __('messages.home') }}</a>
</li>
</ul>
@endauth
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item d-none d-sm-inline-block">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@endif
@else
<!-- superadmin menu -->
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
<li class="nav-item dropdown">
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false" class="nav-link dropdown-toggle">
<i class="fas fa-universal-access"></i>
@lang('messages.' . auth()->user()->roles->first()->name)
</a>
<ul aria-labelledby="superadminDropdown" class="dropdown-menu border-0 shadow">
<li>
@if($__enable_saas)
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'index'])}}"
class="dropdown-item">
<i class="fas fa-money-check"></i>
@lang('messages.packages')
</a>
<a href="{{action([\App\Http\Controllers\Superadmin\PackageSubscriptionsController::class, 'index'])}}"
class="dropdown-item">
<i class="fas fa-sync"></i>
@lang('messages.package_subscription')
</a>
@endif
<a href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'index'])}}"
class="dropdown-item">
<i class="fas fa-users"></i>
@lang('messages.users')
</a>
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<a class="dropdown-item"
href="{{action([\App\Http\Controllers\Superadmin\SuperadminSettingsController::class, 'create'])}}">
<i class="fa fa-cogs"></i>
@lang('messages.system_settings')
</a>
@endif
</li>
</ul>
</li>
@endif
<!-- /superadmin menu -->
<li class="nav-item dropdown">
<a id="navbarDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
class="nav-link dropdown-toggle">
<i class="fas fa-user-tie"></i>
{{ ucfirst(Auth::user()->name) }}
</a>
<ul aria-labelledby="navbarDropdown" class="dropdown-menu border-0 shadow">
<li>
<a class="dropdown-item"
href="{{action([\App\Http\Controllers\ManageProfileController::class, 'getProfile'])}}">
<i class="fas fa-user-edit"></i>
@lang('messages.profile')
</a>
@if($__enable_saas)
<a class="dropdown-item"
href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}">
<i class="fas fa-sync"></i>
@lang('messages.my_subscription')
</a>
@endif
<a class="dropdown-item"
href="{{action([\App\Http\Controllers\ManageSettingsController::class, 'getSettings'])}}">
<i class="fas fa-user-cog"></i>
@lang('messages.my_settings')
</a>
<a class="dropdown-item"
href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
<i class="fas fa-sign-out-alt"></i>
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</li>
</ul>
</li>
@endguest
</ul>
<!-- Left navbar links -->
<!-- <ul class="navbar-nav">
<li class="nav-item">
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="index3.html" class="nav-link">Home</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Contact</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Help
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">FAQ</a>
<a class="dropdown-item" href="#">Support</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Contact</a>
</div>
</li>
</ul> -->
</div>
</nav>
<!-- /.navbar -->

View File

@@ -0,0 +1,110 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="card card-outline card-info">
<div class="card-header mb-2">
<h4>
@lang('messages.pay_n_subscribe')
</h4>
</div>
<div class="card-body">
<h5>
{{$package->name}}
@php
$price_interval = __('messages.'.$package->price_interval);
@endphp
@if($package->price != 0)
(<span class="currency">
{{$package->price}}
</span>
<small class="text-muted">
@lang('messages.subscription_price',[
'interval' => $package->interval,
'price_interval' => $price_interval
])
</small>)
@else
(<span class="currency">
0000
</span>)
@endif
</h5>
<ul>
<li>
@if($package->no_of_active_forms != 0)
<span>
@lang('messages.no_of_forms',['active_form' => $package->no_of_active_forms])
<i class="far fa-check-circle text-success small"></i>
</span>
@else
@lang('messages.unlimited_forms')
<i class="far fa-check-circle text-success small"></i>
@endif
</li>
<li>
@if($package->is_form_downloadable)
@lang('messages.form_code_download')
<i class="far fa-check-circle text-success small"></i>
@else
@lang('messages.form_code_download')
<i class="far fa-times-circle text-danger small"></i>
@endif
</li>
</ul>
<ul class="list-group">
@foreach($payment_gateways as $k => $v)
<div class="list-group-item">
<b>@lang('messages.pay_via', ['method' => $v])</b>
<div class="row" id="paymentdiv_{{$k}}">
@php
$view = 'payments.partials.pay_'.$k;
@endphp
@includeIf($view)
</div>
</div>
@endforeach
</ul>
</div>
</div>
</div>
@endsection
@section('footer')
<script src="https://js.stripe.com/v3/"></script>
<script type="text/javascript">
$(document).ready(function(){
//notification after payment failure
@if (!empty(session('status')) && session('status')['success'] == 1)
var msg = '{!!session('status')['msg']!!}';
toastr.success(msg);
@elseif(!empty(session('status')) && session('status')['success'] == 0)
var msg = '{!!session('status')['msg']!!}';
toastr.error(msg);
@endif
$('span.currency').each(function(index, element){
var money = __formatCurrency($(this).text());
$(this).text(money);
});
// stripe payment integration
var stripe = Stripe('{{config("constants.STRIPE_PUB_KEY")}}');
var stripe_payment_session_id = ''
@if(!empty($stripe_payment_session))
stripe_payment_session_id = '{{$stripe_payment_session->id}}';
@endif
$(document).on('click', '#checkout-stripe', function() {
stripe.redirectToCheckout({
// Make the id field from the Checkout Session creation API response
// available to this file, so you can provide it as parameter here
// instead of the CHECKOUT_SESSION_ID placeholder.
sessionId: stripe_payment_session_id
}).then(function (result) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer
// using `result.error.message`.
toastr.error(result.error.message);
});
});
});
</script>
@endsection

View File

@@ -0,0 +1,14 @@
<div class="col-md-12">
<form action="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'confirmPayment'], [$package->id])}}" method="POST">
{{ csrf_field() }}
<input type="hidden" name="paid_via" value="{{$k}}">
<button type="submit" class="btn btn-success btn-sm">
<i class="fas fa-hand-holding-usd"></i>
{{$v}}
</button>
<small class="form-text text-muted">
@lang('messages.offline_pay_helptext')
</small>
</form>
</div>

View File

@@ -0,0 +1,8 @@
<div class="col-md-12">
<a href="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'paypalExpressCheckout'], [$package->id])}}" class="btn btn-primary btn-sm">
<i class="fab fa-paypal"></i>
PayPal
</a>
</div>

View File

@@ -0,0 +1,6 @@
<div class="col-md-12">
<button type="submit" class="btn btn-info btn-sm" id="checkout-stripe">
<i class="fab fa-cc-stripe"></i>
{{$v}}
</button>
</div>

View File

@@ -0,0 +1,146 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="col-md-12">
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h3>@lang('messages.create_package')</h3>
</div>
</div>
<div class="card-body">
<form id="create_package_form">
<div class="form-row">
<div class="col-md-6">
<div class="form-group">
<label for="name">
@lang('messages.name') *
</label>
<input type="text" name="name" class="form-control" id="name" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="description">
@lang('messages.description') *
</label>
<input type="text" name="description" class="form-control" id="description" maxlength="100" required>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label for="price_interval">
@lang('messages.price_interval') *
</label>
<select class="form-control" name="price_interval" id="price_interval" required>
<option value="">
@lang('messages.select_price_interval')
</option>
@foreach($lists as $key => $value)
<option value="{{$key}}">
{{$value}}
</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="interval">
@lang('messages.interval') *
</label>
<input type="number" name="interval" class="form-control" id="interval" required>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="price">
@lang('messages.price')
</label>
<input type="number" name="price" class="form-control" id="price" aria-describedby="price_help_text">
<small id="price_help_text" class="form-text text-muted">
@lang('messages.free_package_help_text')
</small>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-6">
<div class="form-group">
<label for="no_of_active_forms">
@lang('messages.no_of_active_forms')
</label>
<input type="number" name="no_of_active_forms" class="form-control" id="no_of_active_forms" aria-describedby="no_of_active_forms_help">
<small id="no_of_active_forms_help" class="form-text text-muted">
@lang('messages.unlimited_form_help_text')
</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="sort_order">
@lang('messages.sort_order') *
</label>
<input type="number" name="sort_order" class="form-control" id="sort_order" required>
<small class="form-text text-muted">
@lang('messages.sort_order_help_text')
</small>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="is_form_downloadable" id="is_form_downloadable" value="1">
<label class="custom-control-label" for="is_form_downloadable">
@lang('messages.allow_form_code_downloading')
</label>
</div>
</div>
<div class="col-md-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="is_active" id="is_active" value="1">
<label class="custom-control-label" for="is_active">
@lang('messages.activate')
</label>
</div>
</div>
</div>
<button type="submit" class="btn btn-success float-right submit_btn">
@lang('messages.save')
</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function() {
$('form#create_package_form').validate({
submitHandler: function(form, e) {
e.preventDefault();
var data = $('form#create_package_form').serialize();
if ($('form#create_package_form').valid()) {
$.ajax({
method:"POST",
url: "/superadmin/packages",
data: data,
dataType: "json",
success:function(response) {
if(response.success == true){
window.location = response.redirect;
} else {
toastr.error(response.msg);
}
}
});
}
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,151 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="col-md-12">
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h3>@lang('messages.edit_package')</h3>
</div>
</div>
<div class="card-body">
<form id="edit_package_form" action="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'update'], ['package' => $package->id])}}">
<div class="form-row">
<div class="col-md-6">
<div class="form-group">
<label for="name">
@lang('messages.name') *
</label>
<input type="text" name="name" class="form-control" id="name" value="{{$package->name}}" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="description">
@lang('messages.description') *
</label>
<input type="text" name="description" class="form-control" id="description" value="{{$package->description}}" maxlength="100" required>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label for="price_interval">
@lang('messages.price_interval') *
</label>
<select class="form-control" name="price_interval" id="price_interval" required>
<option value="">
@lang('messages.select_price_interval')
</option>
@foreach($lists as $key => $value)
<option value="{{$key}}"
@if($key == $package->price_interval)
selected
@endif
>
{{$value}}
</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="interval">
@lang('messages.interval') *
</label>
<input type="number" name="interval" class="form-control" id="interval" required value="{{$package->interval}}">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="price">
@lang('messages.price')
</label>
<input type="number" name="price" class="form-control" id="price" value="{{$package->price}}" aria-describedby="price_help_text">
<small id="price_help_text" class="form-text text-muted">
@lang('messages.free_package_help_text')
</small>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-6">
<div class="form-group">
<label for="no_of_active_forms">
@lang('messages.no_of_active_forms')
</label>
<input type="number" name="no_of_active_forms" class="form-control" id="no_of_active_forms" value="{{$package->no_of_active_forms}}" aria-describedby="no_of_active_forms_help">
<small id="no_of_active_forms_help" class="form-text text-muted">
@lang('messages.unlimited_form_help_text')
</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="sort_order">
@lang('messages.sort_order') *
</label>
<input type="number" name="sort_order" class="form-control" id="sort_order" value="{{$package->sort_order}}" required>
<small class="form-text text-muted">
@lang('messages.sort_order_help_text')
</small>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="is_form_downloadable" id="is_form_downloadable" value="1" @if($package->is_form_downloadable) checked @endif>
<label class="custom-control-label" for="is_form_downloadable">
@lang('messages.allow_form_code_downloading')
</label>
</div>
</div>
<div class="col-md-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="is_active" id="is_active" value="1" @if($package->is_active) checked @endif>
<label class="custom-control-label" for="is_active">
@lang('messages.activate')
</label>
</div>
</div>
</div>
<button type="submit" class="btn btn-success submit_btn float-right">
@lang('messages.update')
</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function() {
$('form#edit_package_form').validate({
submitHandler: function(form, e) {
e.preventDefault();
var data = $('form#edit_package_form').serialize();
var url = $('form#edit_package_form').attr('action');
if ($('form#edit_package_form').valid()) {
$.ajax({
method:"PUT",
url: url,
data: data,
dataType: "json",
success:function(response) {
if(response.success == true){
window.location = response.redirect;
} else {
toastr.error(response.msg);
}
}
});
}
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,150 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="card card-outline card-info">
<div class="card-header">
<div class="card-title">
<h4>
<i class="fas fa-money-check"></i>
@lang('messages.all_packages')
</h4>
</div>
<div class="card-tools">
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'create'])}}" class="btn btn-primary btn-sm float-right">
<i class="fas fa-plus"></i>
@lang('messages.create')
</a>
</div>
</div>
<div class="card-body">
@if(count($packages) <= 0)
<div class="alert alert-danger" role="alert">
<span class="text-white">@lang('messages.no_packages_found')</span>
</div>
@endif
<div class="row">
@foreach($packages as $package)
<div class="col-md-4">
<div class="card card-outline card-success on_hover">
<div class="card-header">
<div class="text-center">
{{$package->name}}
</div>
<div class="text-center">
@if($package->is_active)
<span class="badge badge-pill badge-success">
@lang('messages.active')
</span>
@else
<span class="badge badge-pill badge-danger">
@lang('messages.inactive')
</span>
@endif
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'edit'], ['package' => $package->id])}}" class="btn btn-link text-info">
<i class="fa fa-edit"></i>
</a>
<a href="#" class="btn btn-link delete_package text-danger" data-url="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'destroy'], ['package' => $package->id])}}">
<i class="fa fa-trash"></i>
</a>
</div>
</div>
<div class="card-body text-center">
@if($package->no_of_active_forms != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $package->no_of_active_forms])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<hr>
@if($package->is_form_downloadable)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
@php
$price_interval = __('messages.'.$package->price_interval);
@endphp
@if($package->price != 0)
<h3>
<span class="currency">
{{$package->price}}
</span>
<small class="text-muted">
@lang('messages.subscription_price',[
'interval' => $package->interval,
'price_interval' => $price_interval
])
</small>
</h3>
@else
<h3>
@lang('messages.free_for_interval', [
'interval' => $package->interval,
'price_interval' => $price_interval
])
</h3>
@endif
</div>
<div class="card-footer text-center">
{{$package->description}}
</div>
</div>
</div>
@if($loop->iteration%3 == 0)
<div class="clearfix"></div>
@endif
@endforeach
</div>
<div class="col-md-12">
{{ $packages->links() }}
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('span.currency').each(function(index, element){
var money = __formatCurrency($(this).text());
$(this).text(money);
});
$(document).on('click', '.delete_package', function(){
var url = $(this).data('url');
var is_confirmed = confirm('Are You Sure?');
if (is_confirmed) {
$.ajax({
method: "DELETE",
url: url,
dataType: "json",
success: function(result){
if(result.success == true){
toastr.success(result.msg);
setTimeout(() => {
location.reload();
}, 1100);
} else {
toastr.error(result.msg);
}
}
});
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,572 @@
@extends('layouts.app')
@section('content')
<div class="container">
<section class="content-header">
<h1>
@lang('messages.system_settings')
</h1>
</section>
<div class="col-md-12">
<form id="settings_form" action="{{action([\App\Http\Controllers\Superadmin\SuperadminSettingsController::class, 'store'])}}" method="POST">
@csrf
<div class="card card-outline card-primary">
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-6">
<label for="APP_NAME">
@lang('messages.app_name') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-suitcase"></i>
</span>
</div>
<input type="text" class="form-control" name="APP_NAME" id="APP_NAME" placeholder="{{__('messages.enter_app_name')}}" value="{{$settings['APP_NAME']}}" required>
</div>
</div>
<div class="form-group col-md-6">
<label for="APP_TITLE">
@lang('messages.app_title') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-tag"></i>
</span>
</div>
<input type="text" class="form-control" name="APP_TITLE" id="APP_TITLE" placeholder="{{__('messages.enter_app_title')}}" value="{{$settings['APP_TITLE']}}" required>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="language">
@lang('messages.language') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-language"></i>
</span>
</div>
<select id="language" class="form-control" name="APP_LOCALE" required>
@foreach($settings['APP_LOCALE'] as $key => $language)
<option value="{{$key}}"
@if($key == env('APP_LOCALE'))
selected
@endif>
{{$language['full_name']}}
</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="APP_TIMEZONE">
@lang('messages.timezone') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-hourglass"></i>
</span>
</div>
<select class="form-control" name="APP_TIMEZONE" required id="APP_TIMEZONE">
<option value="">
@lang('messages.choose_timezone')
</option>
@foreach($settings['timezones'] as $timezone)
<option value="{{$timezone}}"
@if($timezone == $settings['APP_TIMEZONE'])
selected
@endif>
{{$timezone}}
</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label for="CURRENCY_NAME">
@lang('messages.currency_name') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-money-bill-alt"></i>
</span>
</div>
<input type="text" name="CURRENCY_NAME" id="CURRENCY_NAME" class="form-control" value="{{$settings['CURRENCY_NAME']}}" required placeholder="{{__('messages.enter_currency_name')}}">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="CURRENCY_CODE">
@lang('messages.currency_code') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-money-bill-alt"></i>
</span>
</div>
<input type="text" name="CURRENCY_CODE" id="CURRENCY_CODE" class="form-control" value="{{$settings['CURRENCY_CODE']}}" required
placeholder="{{__('messages.enter_currency_code')}}">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="CURRENCY_SYMBOL">
@lang('messages.currency_symbol') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-money-bill-alt"></i>
</span>
</div>
<input type="text" name="CURRENCY_SYMBOL" id="CURRENCY_SYMBOL" class="form-control" value="{{$settings['CURRENCY_SYMBOL']}}" required
placeholder="{{__('messages.enter_currency_symbol')}}">
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label for="APP_DATE_FORMAT">
@lang('messages.date_format') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-calendar-day"></i>
</span>
</div>
<select class="form-control" name="APP_DATE_FORMAT" required id="APP_DATE_FORMAT">
@foreach($date_formats as $key => $value)
<option value="{{$key}}"
@if($key == config('constants.APP_DATE_FORMAT'))
selected
@endif>
{{$value}}
</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="APP_TIME_FORMAT">
@lang('messages.time_format') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-clock"></i>
</span>
</div>
<select class="form-control" name="APP_TIME_FORMAT" required id="APP_TIME_FORMAT">
<option value="12"
@if(config('constants.APP_TIME_FORMAT') == '12')
selected
@endif>
@lang('messages.12_hour')
</option>
<option value="24"
@if(config('constants.APP_TIME_FORMAT') == '24')
selected
@endif>
@lang('messages.24_hour')
</option>
</select>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="ENABLE_REGISTRATION" id="ENABLE_REGISTRATION" value="1" @if($settings['ENABLE_REGISTRATION']) checked @endif>
<label class="custom-control-label" for="ENABLE_REGISTRATION">
@lang('messages.enable_registration')
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="{{__('messages.resgistration_will_be_enabled')}}"></i>
</label>
</div>
</div>
@if($__type_e)
<div class="col-md-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="ENABLE_SAAS_MODULE" id="ENABLE_SAAS_MODULE" value="1" @if($settings['ENABLE_SAAS_MODULE']) checked @endif>
<label class="custom-control-label" for="ENABLE_SAAS_MODULE">
@lang('messages.enable_saas_module')
</label>
</div>
</div>
@endif
</div>
</div>
</div>
@if($__enable_saas)
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h4>
@lang('messages.payment_api_settings')
</h4>
</div>
</div>
<div class="card-body">
<div class="form-row">
<div class="col-md-12">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="ENABLE_OFFLINE_PAYMENT" id="ENABLE_OFFLINE_PAYMENT" value="1" @if($settings['ENABLE_OFFLINE_PAYMENT']) checked @endif>
<label class="custom-control-label" for="ENABLE_OFFLINE_PAYMENT">
@lang('messages.enable_ofline_payment')
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="{{__('messages.offline_pay_helptext')}}"></i>
</label>
</div>
</div>
</div>
</div>
<div class="card-body">
<h4 class="mb-2">Paypal</h4>
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_MODE">
PAYPAL MODE *
</label>
<select class="form-control" name="PAYPAL_MODE" id="PAYPAL_MODE" required>
<option value="sandbox"
@if($settings['PAYPAL_MODE'] == 'sandbox')
selected
@endif
>
Sandbox
</option>
<option value="live"
@if($settings['PAYPAL_MODE'] == 'live')
selected
@endif
>
Live
</option>
</select>
</div>
</div>
</div>
<div class="form-row">
<!-- live mode -->
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_LIVE_API_USERNAME">
PAYPAL LIVE API USERNAME
</label>
<input type="text" class="form-control" name="PAYPAL_LIVE_API_USERNAME" id="PAYPAL_LIVE_API_USERNAME" placeholder="PAYPAL LIVE API USERNAME" value="{{$settings['PAYPAL_LIVE_API_USERNAME']}}">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_LIVE_API_PASSWORD">
PAYPAL LIVE API PASSWORD
</label>
<input type="text" class="form-control" name="PAYPAL_LIVE_API_PASSWORD" id="PAYPAL_LIVE_API_PASSWORD" placeholder="PAYPAL LIVE API PASSWORD" value="{{$settings['PAYPAL_LIVE_API_PASSWORD']}}">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_LIVE_API_SECRET">
PAYPAL LIVE API SECRET
</label>
<input type="text" class="form-control" name="PAYPAL_LIVE_API_SECRET" id="PAYPAL_LIVE_API_SECRET" placeholder="PAYPAL LIVE API SECRET" value="{{$settings['PAYPAL_LIVE_API_SECRET']}}">
</div>
</div>
<!-- sandbox mode -->
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_SANDBOX_API_USERNAME">
PAYPAL SANDBOX API USERNAME
</label>
<input type="text" class="form-control" name="PAYPAL_SANDBOX_API_USERNAME" id="PAYPAL_SANDBOX_API_USERNAME" placeholder="PAYPAL SANDBOX API USERNAME" value="{{$settings['PAYPAL_SANDBOX_API_USERNAME']}}">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_SANDBOX_API_PASSWORD">
PAYPAL SANDBOX API PASSWORD
</label>
<input type="text" class="form-control" name="PAYPAL_SANDBOX_API_PASSWORD" id="PAYPAL_SANDBOX_API_PASSWORD" placeholder="PAYPAL SANDBOX API PASSWORD" value="{{$settings['PAYPAL_SANDBOX_API_PASSWORD']}}">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="PAYPAL_SANDBOX_API_SECRET">
PAYPAL SANDBOX API SECRET
</label>
<input type="text" class="form-control" name="PAYPAL_SANDBOX_API_SECRET" id="PAYPAL_SANDBOX_API_SECRET" placeholder="PAYPAL SANDBOX API SECRET" value="{{$settings['PAYPAL_SANDBOX_API_SECRET']}}">
</div>
</div>
</div>
</div>
<div class="card-body">
<h4 class="mb-2">Stripe</h4>
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label for="STRIPE_PUB_KEY">
STRIPE PUBLISHABLE KEY
</label>
<input type="text" class="form-control" name="STRIPE_PUB_KEY" id="STRIPE_PUB_KEY" placeholder="STRIPE PUBLISHABLE KEY" value="{{$settings['STRIPE_PUB_KEY']}}">
<small id="help_text" class="form-text text-muted">
{{trans('messages.to_see_supported_curreny')}}
<a href="https://stripe.com/docs/currencies" target="_blank">{{trans('messages.click_here')}}.</a>
</small>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="STRIPE_SECRET_KEY">
STRIPE SECRET KEY
</label>
<input type="text" class="form-control" name="STRIPE_SECRET_KEY" id="STRIPE_SECRET_KEY" placeholder="STRIPE SECRET KEY" value="{{$settings['STRIPE_SECRET_KEY']}}">
</div>
</div>
</div>
</div>
</div>
@endif
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h4>
@lang('messages.smtp_email_settings')
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" title="{{__('messages.system_settings_smtp_tooltips')}}"></i>
</h4>
</div>
</div>
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-4">
<label for="MAIL_HOST">
@lang('messages.mail_host') *
</label>
<input type="text" class="form-control" name="MAIL_HOST" id="MAIL_HOST" placeholder="{{__('messages.enter_mail_host')}}" value="{{$settings['MAIL_HOST']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_PORT">
@lang('messages.mail_port') *
</label>
<input type="text" class="form-control" name="MAIL_PORT" id="MAIL_PORT" placeholder="{{__('messages.enter_mail_port')}}" value="{{$settings['MAIL_PORT']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_USERNAME">
@lang('messages.mail_username') *
</label>
<input type="text" class="form-control" name="MAIL_USERNAME" id="MAIL_USERNAME" placeholder="{{__('messages.enter_mail_username')}}" value="{{$settings['MAIL_USERNAME']}}" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="MAIL_FROM_ADDRESS">
@lang('messages.mail_from_address') *
</label>
<input type="text" class="form-control" name="MAIL_FROM_ADDRESS" id="MAIL_FROM_ADDRESS" placeholder="{{__('messages.mail_from_address')}}" value="{{$settings['MAIL_FROM_ADDRESS']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_FROM_NAME">
@lang('messages.mail_from_name') *
</label>
<input type="text" class="form-control" name="MAIL_FROM_NAME" id="MAIL_FROM_NAME" placeholder="{{__('messages.mail_from_name')}}" value="{{$settings['MAIL_FROM_NAME']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_PASSWORD">
@lang('messages.mail_password') *
</label>
<input type="text" class="form-control" name="MAIL_PASSWORD" id="MAIL_PASSWORD" placeholder="{{__('messages.enter_mail_password')}}" value="{{$settings['MAIL_PASSWORD']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_ENCRYPTION">
@lang('messages.mail_encryption') *
</label>
<input type="text" class="form-control" name="MAIL_ENCRYPTION" id="MAIL_ENCRYPTION" placeholder="{{__('messages.enter_mail_encryption')}}" value="{{$settings['MAIL_ENCRYPTION']}}" required>
</div>
</div>
<button type="button"
class="btn btn-sm btn-outline-primary ladda-button btn-test-smtp float-right m-1"
data-style="expand-right"
data-spinner-color="blue"
>
<span class="ladda-label">
{{trans('messages.test_smtp_details')}}
</span>
</button>
</div>
</div>
<!-- Acelle Mail -->
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h4>
@lang('messages.integration')
</h4>
</div>
</div>
<div class="card-body">
<div class="form-row mb-4">
<div class="col-md-12">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="enable_acelle_mail" value="1" @if(!empty($settings['ACELLE_MAIL_NAME']) && !empty($settings['ACELLE_MAIL_API'])) checked @endif>
<label class="custom-control-label" for="enable_acelle_mail">
@lang('messages.enable') Acelle Mail
</label>
</div>
</div>
</div>
<div class="form-row acelle_mail_details"
@if(empty($settings['ACELLE_MAIL_NAME']) && empty($settings['ACELLE_MAIL_API']))
style="display:none;"
@endif>
<div class="form-group col-md-6">
<label for="acelle_name">
@lang('messages.name') *
</label>
<input type="text" class="form-control" name="ACELLE_MAIL_NAME" id="acelle_name" placeholder="{{__('messages.name')}}" value="{{$settings['ACELLE_MAIL_NAME']}}" required>
<small id="acelle_name_help" class="form-text text-muted">
@lang('messages.acelle_mail_name_help_text')
</small>
</div>
<div class="form-group col-md-6">
<label for="acelle_url">
@lang('messages.api_endpoint') *
</label>
<input type="url" class="form-control" name="ACELLE_MAIL_API" id="acelle_url" placeholder="{{__('messages.api_endpoint')}}" value="{{$settings['ACELLE_MAIL_API']}}" required>
<small id="acelle_url_help" class="form-text text-muted">
@lang('messages.acelle_mail_api_url_help_text')
</small>
</div>
</div>
</div>
</div>
<!-- /Acelle Mail -->
<!-- additional js/css -->
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h4>
@lang('messages.additional_js_css')
</h4>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<label for="additional_js">
@lang('messages.additional_js')
</label>
<textarea class="form-control" name="system[additional_js]" id="additional_js" rows="8" aria-describedby="additional_jsHelp">@if(!empty($additional_js)){{$additional_js}}@endif</textarea>
<small id="additional_jsHelp" class="form-text text-muted">
@lang('messages.additional_js_help')
</small>
</div>
</div>
<div class="row mt-3">
<div class="col-md-12">
<label for="additional_css">
@lang('messages.additional_css')
</label>
<textarea class="form-control" name="system[additional_css]" id="additional_css" rows="8" aria-describedby="additional_css_Help">@if(!empty($additional_css)){{$additional_css}}@endif</textarea>
<small id="additional_css_Help" class="form-text text-muted">
@lang('messages.additional_css_help')
</small>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md-12">
<button type="submit" class="btn btn-success btn-lg submit_btn float-right">
@lang('messages.save')
</button>
</div>
</div>
</form>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('form#settings_form').validate();
$(document).on('click', '.btn-test-smtp', function(){
var smtpdata = {
'host': $("input[name=MAIL_HOST]").val(),
'port' : $("input[name=MAIL_PORT]").val(),
'from_address' : $("input[name=MAIL_FROM_ADDRESS]").val(),
'from_name' : $("input[name=MAIL_FROM_NAME]").val(),
'encryption' : $("input[name=MAIL_ENCRYPTION]").val(),
'username' : $("input[name=MAIL_USERNAME]").val(),
'password' : $("input[name=MAIL_PASSWORD]").val(),
};
var isValid = true;
_.forEach(smtpdata, function(smtp){
if (!_.isEmpty(smtp)) {
isValid = true && isValid;
} else {
isValid = false;
}
});
if (isValid) {
var ladda = Ladda.create($('.btn-test-smtp')[0]);
ladda.start();
$.ajax({
method:"GET",
url: "/test-smtp",
data: smtpdata,
dataType: "json",
success: function(response) {
ladda.stop();
if(response.success == true){
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
}
});
} else {
isValid = true;
alert('Please fill all the SMTP details.');
}
});
$(document).on('change', "#enable_acelle_mail", function(){
if ($(this).is(":checked")) {
$(".acelle_mail_details").show();
} else {
$(".acelle_mail_details").hide();
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,61 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
@lang('messages.edit_subscription')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="edit_subscription" action="{{action([\App\Http\Controllers\Superadmin\PackageSubscriptionsController::class, 'update'], [$subscription['id']])}}" method="PUT">
<div class="form-group">
<label for="start_date">
@lang('messages.start_date')
</label>
<input type="date" name="start_date" id="start_date" class="form-control" value="{{$subscription['start_date']}}" required>
</div>
<div class="form-group">
<label for="end_date">
@lang('messages.end_date')
</label>
<input type="date" name="end_date" id="end_date" class="form-control" value="{{$subscription['end_date']}}" required>
</div>
<div class="form-group">
<label for="status">
@lang('messages.status')
</label>
<select name="status" id="status" class="form-control">
@foreach($status_list as $key=>$value)
<option value="{{$key}}"
@if($key == $subscription['status'])
selected
@endif
>
{{$value}}
</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="transaction_id">
@lang('messages.transaction_id')
</label>
<input type="text" name="payment_transaction_id" id="transaction_id" class="form-control" value="{{$subscription['payment_transaction_id']}}">
</div>
<button type="submit" class="btn btn-primary btn-sm float-right m-1">
@lang('messages.update')
</button>
<button type="button" class="btn btn-secondary btn-sm float-right m-1" data-dismiss="modal">
@lang('messages.close')
</button>
</form>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('form#edit_subscription').validate();
});
</script>

View File

@@ -0,0 +1,203 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card card-outline card-info">
<div class="card-header">
<div class="card-title">
<h3>
<i class="fas fa-sync-alt"></i>
@lang('messages.package_subscription')
</h3>
</div>
</div>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-12">
<div class="box-group" id="accordion">
<div class="panel box box-primary">
<div class="box-header with-border">
<h4 class="box-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
<i class="fas fa-filter"></i>
@lang('messages.filter')
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="box-body">
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="filter_by_package">
@lang('messages.package')
</label>
<select name="filter_by_package" id="filter_by_package" class="form-control">
<option value="">
@lang('messages.all')
</option>
@if(!empty($packages))
@foreach($packages as $id => $package)
<option value="{{$id}}">
{{$package}}
</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="filter_by_status">
@lang('messages.status')
</label>
<select name="filter_by_status" id="filter_by_status" class="form-control">
<option value="">
@lang('messages.all')
</option>
@if(!empty($subscription_status))
@foreach($subscription_status as $id => $status)
<option value="{{$id}}">
{{$status}}
</option>
@endforeach
@endif
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<div id="export-btns" class="float-right"></div>
<table class="table" id="package_subscription_table">
<thead>
<tr>
<th>@lang('messages.name')</th>
<th>@lang('messages.email')</th>
<th>@lang('messages.package_name')</th>
<th>@lang('messages.status')</th>
<th>@lang('messages.start_date')</th>
<th>@lang('messages.end_date')</th>
<th>@lang('messages.price')</th>
<th>@lang('messages.paid_via')</th>
<th>@lang('messages.transaction_id')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
var package_subscription_table = $("#package_subscription_table").DataTable({
processing: true,
serverSide: true,
ajax:{
url: '/superadmin/package-subscription',
data: function(d) {
d.package_id = $('#filter_by_package').val();
d.status = $('#filter_by_status').val();
}
},
buttons: [
{
extend: 'csv',
footer: true,
exportOptions: {
columns: [0,1,2,3,4,5,6,7,8]
},
title: '{{config("app.name") ."-". __("messages.package_subscription")}}'
},
{
extend: 'excelHtml5',
footer: false,
exportOptions: {
columns: [0,1,2,3,4,5,6,7,8]
},
title: '{{config("app.name") ."-". __("messages.package_subscription")}}'
}
],
fixedHeader: false,
columnDefs: [
{
targets: [2],
orderable: false,
searchable: false,
},
],
columns: [
{ data: 'user' , name: 'users.name'},
{ data: 'user_email' , name: 'users.email'},
{ data: 'package' , name: 'package'},
{ data: 'status' , name: 'status'},
{ data: 'start_date' , name: 'start_date'},
{ data: 'end_date', name: 'end_date'},
{ data: 'package_price' , name: 'package_price'},
{ data: 'paid_via', name: 'paid_via'},
{ data: 'payment_transaction_id' , name: 'payment_transaction_id'},
{ data: 'action', name: 'action', sortable:false }
],
"fnDrawCallback": function (oSettings) {
__convert_currency_in_datatable($('#package_subscription_table'));
}
});
package_subscription_table.buttons().container().appendTo($('#export-btns'));
$(document).on('click', '.edit_subscription', function(){
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function(response) {
$("#modal_div").html(response).modal("show");
}
});
});
$(document).on('submit', 'form#edit_subscription', function(e){
e.preventDefault();
var data = $('form#edit_subscription').serialize();
var url = $('form#edit_subscription').attr('action');
$.ajax({
method:"PUT",
url: url,
data: data,
dataType: "json",
success:function(response) {
if(response.success == true){
toastr.success(response.msg);
package_subscription_table.ajax.reload();
$("#modal_div").modal("hide");
} else {
toastr.error(response.msg);
}
}
});
});
$(document).on('change', '#filter_by_package, #filter_by_status', function() {
package_subscription_table.ajax.reload();
});
});
</script>
@endsection

View File

@@ -0,0 +1,39 @@
<div class="modal-dialog modal-lg">
<form data-type="form" action="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'adminSubscription'], [$package_id, $user_id])}}" method="PUT">
{{ csrf_field() }}
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
@lang('messages.confirm_upgrade_account')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="form-check">
<input type="checkbox" id="disable_all_packages" name="disable_all_packages" value="1" class="form-check-input" aria-describedby="disable_all_packagesHelp" checked>
<label class="form-check-label" for="disable_all_packages">
@lang('messages.disable_current_packages')
</label>
</div>
<p>
<small id="disable_all_packagesHelp" class="form-text text-muted">
@lang('messages.disable_current_packages_help_text')
</small>
</p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
@lang('messages.close')
</button>
<button type='submit' class="btn btn-sm btn-success btn-sm submit_btn">
@lang('messages.upgrade_account')
</button>
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,173 @@
<div class="modal-dialog modal-lg">
<form id="add_user_form"
action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'store'])}}" method="POST">
{{ csrf_field() }}
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
@lang('messages.add_user')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="name">
@lang('messages.name')
<span class="error">*</span>
</label>
<input type="text" class="form-control"
name="name" id="name" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="email">
@lang('messages.email')
<span class="error">*</span>
</label>
<input type="email" class="form-control"
name="email" id="email" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="password">
@lang('messages.password')
<span class="error">*</span>
</label>
<input type="password" class="form-control"
name="password" id="password" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
checked>
<label class="form-check-label" for="is_active">
@lang('messages.is_active')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.is_active_tooltip')"></i>
</label>
</div>
</div>
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value]))
<div class="col-md-2">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin">
<label class="form-check-label" for="is_admin">
@lang('messages.is_admin')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.is_admin_tooltip')"></i>
</label>
</div>
</div>
@endif
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="send_email" id="send_email"
value="1">
<label class="form-check-label" for="send_email">
@lang('messages.send_email')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.send_email_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="can_create_form"
id="can_create_form" value="1">
<label class="form-check-label" for="can_create_form">
@lang('messages.can_create_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_create_form_tooltip')"></i>
</label>
</div>
</div>
@endif
</div>
<div class="card assign-form p-3">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="assign_form">
@lang('messages.assign_forms'):
</label>
<select multiple class="form-control" id="assign_form" name="form_id[]">
@foreach($forms as $key => $value)
<option value="{{$key}}">
{{$value}}
</option>
@endforeach
</select>
</div>
</div>
</div>
<h5>@lang('messages.permission_for_forms'):</h5>
<div class="row">
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]"
id="form_design"
value="can_design_form">
<label class="form-check-label" for="form_design">
@lang('messages.can_design_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_design_form_tooltip')"></i>
</label>
</div>
</div>
@endif
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data"
value="can_view_data">
<label class="form-check-label" for="form_data">
@lang('messages.can_view_data')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_view_data_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view"
value="can_view_form">
<label class="form-check-label" for="form_view">
@lang('messages.can_view_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_view_form_tooltip')"></i>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-sm btn-primary submit_btn">
@lang('messages.save')
</button>
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
@lang('messages.close')
</button>
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,241 @@
<div class="modal-dialog modal-lg">
<form id="edit_user_form"
action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'update'], [$user->id])}}"
method="PUT">
{{ csrf_field() }}
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
@lang('messages.edit_user')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<input type="hidden" id="user_id" value="{{$user->id}}">
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="name">
@lang('messages.name')
<span class="error">*</span>
</label>
<input type="text" class="form-control"
name="name" id="name" value="{{$user->name}}" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="email">
@lang('messages.email')
<span class="error">*</span>
</label>
<input type="email" class="form-control"
name="email" id="email" value="{{$user->email}}" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="password">
@lang('messages.password')
</label>
<input type="password" class="form-control"
name="password" id="password" aria-describedby="passwordHelp">
<small id="passwordHelp" class="form-text text-muted">
@lang('messages.dont_want_to_change_keep_it_blank')
</small>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
@if($user->is_active) checked @endif>
<label class="form-check-label" for="is_active">
@lang('messages.is_active')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.is_active_tooltip')"></i>
</label>
</div>
</div>
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
<div class="col-md-2">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin"
@if($user->hasRole(\App\Enums\User\RoleEnum::ADMIN->value)) checked @endif>
<label class="form-check-label" for="is_admin">
@lang('messages.is_admin')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.is_admin_tooltip')"></i>
</label>
</div>
</div>
@endif
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="send_email" id="send_email"
value="1">
<label class="form-check-label" for="send_email">
@lang('messages.send_email')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.send_email_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="can_create_form"
id="can_create_form" value="1" @if($user->can_create_form) checked @endif>
<label class="form-check-label" for="can_create_form">
@lang('messages.can_create_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_create_form_tooltip')"></i>
</label>
</div>
</div>
@endif
</div>
@php
$form_ids = $assigned_forms->pluck('form_id')->toArray();
@endphp
@if($assigned_forms->count() > 0)
<h5>@lang('messages.assigned_forms'):</h5>
@foreach($assigned_forms as $key => $assigned_form)
<div class="card edit-assigned-form mb-4 p-3">
<label>
<i class="fab fa-wpforms"></i>
{{$assigned_form->form->name}}
</label>
<div class="row">
<input type="hidden" name="edit_assigned_form_id[]" value="{{$assigned_form->id}}">
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input"
name="edit_permissions[{{$assigned_form->id}}][]"
id="form_design_{{$key}}" value="can_design_form"
@if(in_array('can_design_form', $assigned_form->permissions))
checked
@endif>
<label class="form-check-label" for="form_design_{{$key}}">
@lang('messages.can_design_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_design_form_tooltip')"></i>
</label>
</div>
</div>
@endif
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input"
name="edit_permissions[{{$assigned_form->id}}][]"
id="form_data_{{$key}}" value="can_view_data"
@if(in_array('can_view_data', $assigned_form->permissions))
checked
@endif>
<label class="form-check-label" for="form_data_{{$key}}">
@lang('messages.can_view_data')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_view_data_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input"
name="edit_permissions[{{$assigned_form->id}}][]"
id="can_view_form_{{$key}}" value="can_view_form"
@if(in_array('can_view_form', $assigned_form->permissions))
checked
@endif>
<label class="form-check-label" for="can_view_form_{{$key}}">
@lang('messages.can_view_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_view_form_tooltip')"></i>
</label>
</div>
</div>
</div>
</div>
@endforeach
@endif
<div class="card assign-form p-3">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="assign_form">
@lang('messages.assign_forms'):
</label>
<select multiple class="form-control" id="assign_form" name="form_id[]">
@foreach($forms as $key => $value)
@if(!in_array($key, $form_ids))
<option value="{{$key}}">
{{$value}}
</option>
@endif
@endforeach
</select>
</div>
</div>
</div>
<h5>@lang('messages.permission_for_forms'):</h5>
<div class="row">
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]"
id="form_design" value="can_design_form">
<label class="form-check-label" for="form_design">
@lang('messages.can_design_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_design_form_tooltip')"></i>
</label>
</div>
</div>
@endif
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data"
value="can_view_data">
<label class="form-check-label" for="form_data">
@lang('messages.can_view_data')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_view_data_tooltip')"></i>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view"
value="can_view_form">
<label class="form-check-label" for="form_view">
@lang('messages.can_view_form')
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
title="@lang('messages.can_view_form_tooltip')"></i>
</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-sm btn-primary submit_btn">
@lang('messages.update')
</button>
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
@lang('messages.close')
</button>
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,354 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card card-outline card-info">
<div class="card-header">
<div class="card-title">
<h3>
<i class="fas fa-users-cog"></i>
@lang('messages.all_users')
</h3>
</div>
<button type="button" class="btn btn-sm btn-primary float-right" data-href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'create'])}}" id="add_user">
<i class="fas fa-user-plus"></i>
@lang('messages.add')
</button>
</div>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-12">
<div class="box-group" id="accordion">
<div class="panel box box-primary">
<div class="box-header with-border">
<h4 class="box-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
<i class="fas fa-filter"></i>
@lang('messages.filter')
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="box-body">
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="filter_by_status">
@lang('messages.status')
</label>
<select name="filter_by_status" id="filter_by_status" class="form-control">
<option value="">
@lang('messages.all')
</option>
<option value="active">
@lang('messages.active')
</option>
<option value="inactive">
@lang('messages.inactive')
</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table" id="users_table">
<thead>
<tr>
<th>@lang('messages.name')</th>
<th>@lang('messages.email')</th>
<th>
@lang('messages.is_active')
</th>
<th>
@lang('messages.created_at')
</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="user_modal" tabindex="-1" role="dialog"></div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
var users_table = $('#users_table').DataTable({
processing: true,
serverSide: true,
ajax:{
url: '/superadmin/users',
data: function(d) {
d.status = $('#filter_by_status').val();
}
},
buttons: [
{
extend: 'csv',
footer: true,
exportOptions: {
columns: [0,1,2,3]
},
title: '{{config("app.name") ."-". __("messages.all_users")}}'
},
{
extend: 'excelHtml5',
footer: false,
exportOptions: {
columns: [0,1,2,3]
},
title: '{{config("app.name") ."-". __("messages.all_users")}}'
}
],
dom: 'lfrtip',
fixedHeader: false,
columns: [
{ data: 'name' , name: 'name'},
{ data: 'email' , name: 'email'},
{ data: 'is_active' , name: 'is_active'},
{ data: 'created_at', name: 'created_at'},
{ data: 'action', name: 'action', sortable:false }
]
});
users_table.buttons().container().appendTo($('#export-btns'));
$(document).on('click', '.toggle_is_active', function(){
url = $(this).data('href');
$.ajax({
method:"GET",
url: url,
dataType: "json",
success:function(response) {
if(response.success == true){
toastr.success(response.msg);
users_table.ajax.reload();
} else {
toastr.error(response.msg);
}
}
});
});
$(document).on('click', '.delete_user', function () {
var url = $(this).data('href');
if (confirm('Are you sure?')) {
$.ajax({
method:"DELETE",
url: url,
dataType: "json",
success:function(response) {
if(response.success == true){
toastr.success(response.msg);
users_table.ajax.reload();
} else {
toastr.error(response.msg);
}
}
});
}
});
$(document).on('click', '#add_user', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#user_modal").html(response).modal('show');
}
});
});
$(document).on('click', '.edit_user', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#user_modal").html(response).modal('show');
}
});
});
$(document).on('click', '.upgrade_account', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#user_modal").html(response).modal('show');
}
});
});
$("#user_modal").on('shown.bs.modal', function () {
if ($("form#add_user_form").length) {
$("form#add_user_form").validate({
rules: {
email: {
email: true,
remote: {
url: "/superadmin/users/check-email-exist",
type: "post",
data: {
email: function() {
return $( "#email" ).val();
}
}
}
}
},
messages: {
email: {
remote: '{{ __("validation.unique", ["attribute" => __("messages.email")]) }}'
}
}
});
}
if ($("form#edit_user_form").length) {
$("form#edit_user_form").validate({
rules: {
email: {
email: true,
remote: {
url: "/superadmin/users/check-email-exist",
type: "post",
data: {
email: function() {
return $( "#email" ).val();
},
user_id: $('input#user_id').val()
}
}
}
},
messages: {
email: {
remote: '{{ __("validation.unique", ["attribute" => __("messages.email")]) }}'
}
}
});
}
if ($("#form_design").length) {
$(document).on('change', '#form_design', function(){
if ($("#form_design").is(":checked")) {
$("#form_view").attr('checked', true);
} else {
$("#form_view").attr('checked', false);
}
});
}
});
$(document).on('submit', 'form#add_user_form', function (e) {
e.preventDefault();
var data = $("form#add_user_form").serialize();
var url = $("form#add_user_form").attr('action');
var ladda = Ladda.create(document.querySelector('.submit_btn'));
ladda.start();
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: data,
success: function (response) {
ladda.stop();
if (response.success) {
$("#user_modal").modal('hide');
toastr.success(response.msg);
users_table.ajax.reload();
} else {
toastr.error(response.msg);
}
}
});
});
$(document).on('submit', 'form#edit_user_form', function (e) {
e.preventDefault();
var data = $("form#edit_user_form").serialize();
var url = $("form#edit_user_form").attr('action');
var ladda = Ladda.create(document.querySelector('.submit_btn'));
ladda.start();
$.ajax({
method: "PUT",
url: url,
dataType: "json",
data: data,
success: function (response) {
ladda.stop();
if (response.success) {
$("#user_modal").modal('hide');
toastr.success(response.msg);
users_table.ajax.reload();
} else {
toastr.error(response.msg);
}
}
});
});
$(document).on('submit', 'form[data-type="form"]', function (e) {
e.preventDefault();
var data = $(this).serialize();
var url = $(this).attr('action');
var ladda = Ladda.create(this.querySelector('.submit_btn'));
ladda.start();
$.ajax({
method: "PUT",
url: url,
dataType: "json",
data: data,
success: function (response) {
ladda.stop();
if (response.success) {
$("#user_modal").modal('hide');
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
}
});
});
$(document).on('change', '#filter_by_status', function() {
users_table.ajax.reload();
});
$(document).on('click', '.confirm-subscription', function(e){
let url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function (response) {
$("#user_modal").html(response).modal('show');
}
});
});
});
</script>
@endsection

View File

@@ -0,0 +1,101 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
@lang('messages.upgrade_account')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
@if(count($active_packages) <= 0)
<div class="alert alert-danger" role="alert">
<span class="text-white">@lang('messages.no_packages_found')</span>
</div>
@endif
<div class="row">
@foreach($active_packages as $package)
<div class="col-md-6">
<div class="card card-outline card-success on_hover">
<div class="card-header">
<div class="text-center">
<h5>
{{$package->name}}
</h5>
</div>
</div>
<div class="card-body text-center">
@if($package->no_of_active_forms != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $package->no_of_active_forms])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<hr>
@if($package->is_form_downloadable)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
@php
$price_interval = __('messages.'.$package->price_interval);
@endphp
@if($package->price != 0)
<h4>
<span class="currency">
{{ number_format((float)$package->price, 2, '.', '')}}
</span>
<small class="text-muted">
@lang('messages.subscription_price',[
'interval' => $package->interval,
'price_interval' => $price_interval
])
</small>
</h4>
@else
<h4>
@lang('messages.free_for_interval', [
'interval' => $package->interval,
'price_interval' => $price_interval
])
</h4>
@endif
</div>
<div class="card-footer text-center">
<button type="button" class="btn btn-block btn-success btn-sm confirm-subscription"
data-href="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'confirmAdminSubscription'], [$package->id, $user->id])}}">
@lang('messages.subscribe')
</button>
{{$package->description}}
</div>
</div>
</div>
@if($loop->iteration%3 == 0)
<div class="clearfix"></div>
@endif
@endforeach
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
@lang('messages.close')
</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,95 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="col-md-12">
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h3>@lang('messages.edit_profile')</h3>
</div>
</div>
<div class="card-body">
<form id="edit_profile" action="{{action([\App\Http\Controllers\ManageProfileController::class, 'postProfile'], [$user['id']])}}">
<div class="form-row">
<div class="form-group col-md-4">
<label for="name">
@lang('messages.name') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-user-tie"></i>
</span>
</div>
<input type="text" class="form-control" name="name" id="name" placeholder="{{__('messages.enter_name')}}" value="{{$user['name']}}" required>
</div>
</div>
<div class="form-group col-md-4">
<label for="email">
@lang('messages.email') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-envelope"></i>
</span>
</div>
<input type="email" class="form-control" name="email" id="email" placeholder="{{__('messages.enter_email')}}" value="{{$user['email']}}" required>
</div>
</div>
<div class="form-group col-md-4">
<label for="password">
@lang('messages.password')
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-user-lock"></i>
</span>
</div>
<input type="password" class="form-control" name="password" id="password" placeholder="{{__('messages.enter_password')}}" value="" aria-describedby="passwordHelp">
</div>
<small id="passwordHelp" class="form-text text-muted">
@lang('messages.password_edit_help')
</small>
</div>
</div>
<button type="submit" class="btn btn-success float-right submit_btn">
@lang('messages.update')
</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('form#edit_profile').validate({
submitHandler: function(form, e) {
var data = $('form#edit_profile').serialize();
var url = $('form#edit_profile').attr('action');
if ($('form#edit_profile').valid()) {
$.ajax({
method:"PUT",
url: url,
data: data,
dataType: "json",
success: function(response) {
if(response.success == true){
window.location = response.redirect;
} else {
toastr.error(response.msg);
}
}
});
}
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,215 @@
@extends('layouts.app')
@section('content')
<div class="container">
<section class="content-header">
<h1>
@lang('messages.my_settings')
</h1>
</section>
<div class="col-md-12">
<form id="settings_form">
<div class="card card-outline card-primary">
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-6">
<label for="language">
@lang('messages.language') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-language"></i>
</span>
</div>
<select id="language" class="form-control" name="language" required>
@foreach($settings['languages'] as $key => $language)
<option value="{{$key}}"
@if($key == $settings['language'])
selected
@endif>
{{$language['full_name']}}
</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="APP_TIMEZONE">
@lang('messages.timezone') *
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-hourglass"></i>
</span>
</div>
<select class="form-control" name="timezone" required id="APP_TIMEZONE">
<option value="">
@lang('messages.choose_timezone')
</option>
@foreach($settings['timezones'] as $timezone)
<option value="{{$timezone}}"
@if($timezone == $settings['timezone'])
selected
@endif>
{{$timezone}}
</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-title">
<h4>
@lang('messages.smtp_email_settings')
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" title="{{__('messages.my_settings_smtp_tooltips')}}"></i>
</h4>
</div>
</div>
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-4">
<label for="MAIL_HOST">
@lang('messages.mail_host') *
</label>
<input type="text" class="form-control" name="MAIL_HOST" id="MAIL_HOST" placeholder="{{__('messages.enter_mail_host')}}" required value="{{$settings['smtp']['MAIL_HOST']}}">
</div>
<div class="form-group col-md-4">
<label for="MAIL_PORT">
@lang('messages.mail_port') *
</label>
<input type="text" class="form-control" name="MAIL_PORT" id="MAIL_PORT" placeholder="{{__('messages.enter_mail_port')}}" required value="{{$settings['smtp']['MAIL_PORT']}}">
</div>
<div class="form-group col-md-4">
<label for="MAIL_USERNAME">
@lang('messages.mail_username') *
</label>
<input type="text" class="form-control" name="MAIL_USERNAME" id="MAIL_USERNAME" placeholder="{{__('messages.enter_mail_username')}}" required value="{{$settings['smtp']['MAIL_USERNAME']}}">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="MAIL_FROM_ADDRESS">
@lang('messages.mail_from_address') *
</label>
<input type="text" class="form-control" name="MAIL_FROM_ADDRESS" id="MAIL_FROM_ADDRESS" placeholder="{{__('messages.mail_from_address')}}" value="{{$settings['smtp']['MAIL_FROM_ADDRESS']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_FROM_NAME">
@lang('messages.mail_from_name') *
</label>
<input type="text" class="form-control" name="MAIL_FROM_NAME" id="MAIL_FROM_NAME" placeholder="{{__('messages.mail_from_name')}}" value="{{$settings['smtp']['MAIL_FROM_NAME']}}" required>
</div>
<div class="form-group col-md-4">
<label for="MAIL_PASSWORD">
@lang('messages.mail_password') *
</label>
<input type="text" class="form-control" name="MAIL_PASSWORD" id="MAIL_PASSWORD" placeholder="{{__('messages.enter_mail_password')}}" required value="{{$settings['smtp']['MAIL_PASSWORD']}}">
</div>
<div class="form-group col-md-4">
<label for="MAIL_ENCRYPTION">
@lang('messages.mail_encryption') *
</label>
<input type="text" class="form-control" name="MAIL_ENCRYPTION" id="MAIL_ENCRYPTION" placeholder="{{__('messages.enter_mail_encryption')}}" required value="{{$settings['smtp']['MAIL_ENCRYPTION']}}">
</div>
</div>
<button type="submit" class="btn btn-sm btn-success submit_btn float-right m-1">
@lang('messages.update')
</button>
<button type="button"
class="btn btn-sm btn-outline-primary ladda-button btn-test-smtp float-right m-1"
data-style="expand-right"
data-spinner-color="blue"
>
<span class="ladda-label">
{{trans('messages.test_smtp_details')}}
</span>
</button>
</div>
</div>
</form>
</div>
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
$('form#settings_form').validate({
submitHandler: function(form, e) {
var data = $('form#settings_form').serialize();
if ($('form#settings_form').valid()) {
$.ajax({
method:"POST",
url: "/post-user-settings",
data: data,
dataType: "json",
success: function(response) {
if(response.success == true){
window.location = response.redirect;
} else {
toastr.error(response.msg);
}
}
});
}
}
});
$(document).on('click', '.btn-test-smtp', function(){
var smtpdata = {
'host': $("input[name=MAIL_HOST]").val(),
'port' : $("input[name=MAIL_PORT]").val(),
'from_address' : $("input[name=MAIL_FROM_ADDRESS]").val(),
'from_name' : $("input[name=MAIL_FROM_NAME]").val(),
'encryption' : $("input[name=MAIL_ENCRYPTION]").val(),
'username' : $("input[name=MAIL_USERNAME]").val(),
'password' : $("input[name=MAIL_PASSWORD]").val(),
};
var isValid = true;
_.forEach(smtpdata, function(smtp){
if (!_.isEmpty(smtp)) {
isValid = true && isValid;
} else {
isValid = false;
}
});
if (isValid) {
var ladda = Ladda.create($('.btn-test-smtp')[0]);
ladda.start();
$.ajax({
method:"GET",
url: "/test-smtp",
data: smtpdata,
dataType: "json",
success: function(response) {
ladda.stop();
if(response.success == true){
toastr.success(response.msg);
} else {
toastr.error(response.msg);
}
}
});
} else {
isValid = true;
alert('Please fill all the SMTP detials.');
}
});
});
</script>
@endsection

View File

@@ -0,0 +1,365 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="card card-outline card-info">
<div class="card-header">
<div class="card-title">
@lang('messages.active_subscription')
</div>
</div>
<div class="card-body">
@if(!empty($active_subscription))
<div class="col-md-4">
<div class="card card card-outline card-success">
<div class="card-header">
<div class="text-center">
{{$active_subscription->package_details['name']}}
<span class="badge badge-pill badge-success float-right">
@lang('messages.running')
</span>
</div>
</div>
<div class="card-body text-center">
@if($active_subscription->package_details['no_of_active_forms'] == 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
<hr>
@endif
@if($active_subscription->package_details['is_form_downloadable'])
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.package_activated_on', ['date' => \Carbon\Carbon::parse($active_subscription->start_date)->isoFormat("D/M/YY")])
</span>
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.remaining_days', ['days' => \Carbon\Carbon::today()->diffInDays($active_subscription->end_date)])
</span>
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.package_expire_on', ['date' => \Carbon\Carbon::parse($active_subscription->end_date)->isoFormat("D/M/YY")])
</span>
</div>
</div>
</div>
@else
<h3 class="text-danger text-center">
@lang('messages.no_active_subscription')
</h3>
@endif
@if(!empty($upcoming_subscriptions))
<div class="row">
@foreach($upcoming_subscriptions as $upcoming_subscription)
<div class="col-md-4">
<div class="card card card-outline card-success">
<div class="card-header">
<div class="text-center">
{{$upcoming_subscription->package_details['name']}}
<span class="badge badge-pill badge-info float-right">
@lang('messages.upcoming')
</span>
</div>
</div>
<div class="card-body text-center">
@if($upcoming_subscription->package_details['no_of_active_forms'] != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $upcoming_subscription->package_details['no_of_active_forms']])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<hr>
@if($upcoming_subscription->package_details['is_form_downloadable'])
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.package_starts_on', ['date' => \Carbon\Carbon::parse($upcoming_subscription->start_date)->isoFormat("D/M/YY")])
</span>
<!-- @lang('messages.start_date') : {{\Carbon\Carbon::parse($upcoming_subscription->start_date)->isoFormat("D/M/YY")}} -->
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.package_expire_on', ['date' => \Carbon\Carbon::parse($upcoming_subscription->end_date)->isoFormat("D/M/YY")])
</span>
<!-- @lang('messages.end_date') : {{\Carbon\Carbon::parse($upcoming_subscription->end_date)->isoFormat("D/M/YY")}} -->
</div>
</div>
</div>
@if($loop->iteration%3 == 0)
<div class="clearfix"></div>
@endif
@endforeach
</div>
@endif
@if(!empty($waiting_subscriptions))
<div class="row">
@foreach($waiting_subscriptions as $waiting_subscription)
<div class="col-md-4">
<div class="card card card-outline card-success">
<div class="card-header">
<div class="text-center">
{{$waiting_subscription->package_details['name']}}
<span class="badge badge-pill badge-warning float-right text-white">
@lang('messages.waiting')
</span>
</div>
</div>
<div class="card-body text-center">
@if($waiting_subscription->package_details['no_of_active_forms'] != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $waiting_subscription->package_details['no_of_active_forms']])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<hr>
@if($waiting_subscription->package_details['is_form_downloadable'])
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.package_starts_on', ['date' => \Carbon\Carbon::parse($waiting_subscription->start_date)->isoFormat("D/M/YY")])
</span>
<!-- @lang('messages.start_date') : {{\Carbon\Carbon::parse($waiting_subscription->start_date)->isoFormat("D/M/YY")}} -->
<hr>
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.package_expire_on', ['date' => \Carbon\Carbon::parse($waiting_subscription->end_date)->isoFormat("D/M/YY")])
</span>
<!-- @lang('messages.end_date') : {{\Carbon\Carbon::parse($waiting_subscription->end_date)->isoFormat("D/M/YY")}} -->
</div>
</div>
</div>
@if($loop->iteration%3 == 0)
<div class="clearfix"></div>
@endif
@endforeach
</div>
@endif
</div>
</div>
<div class="card card-outline card-info">
<div class="card-header">
<div class="card-title">
@lang('messages.all_subscriptions')
</div>
</div>
<div class="card-body">
<table class="table" id="package_subscription_table">
<thead>
<tr>
<th>@lang('messages.package_name')</th>
<th>@lang('messages.start_date')</th>
<th>@lang('messages.end_date')</th>
<th>@lang('messages.price')</th>
<th>@lang('messages.paid_via')</th>
<th>@lang('messages.transaction_id')</th>
<th>@lang('messages.status')</th>
<th>@lang('messages.created_at')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
@if($__enable_saas)
<div class="card card-outline card-info">
<div class="card-header">
<div class="card-title">
@lang('messages.packages')
</div>
</div>
<div class="card-body">
@if(count($active_packages) <= 0)
<div class="alert alert-danger" role="alert">
<span class="text-white">@lang('messages.no_packages_found')</span>
</div>
@endif
<div class="row">
@foreach($active_packages as $package)
<div class="col-md-4">
<div class="card card-outline card-success on_hover">
<div class="card-header">
<div class="text-center">
<h5>
{{$package->name}}
</h5>
</div>
</div>
<div class="card-body text-center">
@if($package->no_of_active_forms != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $package->no_of_active_forms])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<hr>
@if($package->is_form_downloadable)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<hr>
@php
$price_interval = __('messages.'.$package->price_interval);
@endphp
@if($package->price != 0)
<h4>
<span class="currency">
{{$package->price}}
</span>
<small class="text-muted">
@lang('messages.subscription_price',[
'interval' => $package->interval,
'price_interval' => $price_interval
])
</small>
</h4>
@else
<h4>
@lang('messages.free_for_interval', [
'interval' => $package->interval,
'price_interval' => $price_interval
])
</h4>
@endif
</div>
<div class="card-footer text-center">
<a href="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'pay'], [$package->id])}}" class="btn btn-block btn-success btn-sm">
@lang('messages.subscribe')
</a>
{{$package->description}}
</div>
</div>
</div>
@if($loop->iteration%3 == 0)
<div class="clearfix"></div>
@endif
@endforeach
</div>
<div class="col-md-12">
{{ $active_packages->links() }}
</div>
</div>
</div>
@endif
</div>
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function(){
//notification after payment
@if (!empty(session('status')) && session('status')['success'] == 1)
var msg = '{!!session('status')['msg']!!}';
toastr.success(msg);
@elseif(!empty(session('status')) && session('status')['success'] == 0)
var msg = '{!!session('status')['msg']!!}';
toastr.error(msg);
@endif
var package_subscription_table = $("#package_subscription_table").DataTable({
processing: true,
serverSide: true,
ajax: '/all-subscriptions',
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
columnDefs: [
{
targets: [0],
orderable: false,
searchable: false,
},
],
columns: [
{ data: 'package' , name: 'package'},
{ data: 'start_date' , name: 'start_date'},
{ data: 'end_date', name: 'end_date'},
{ data: 'package_price' , name: 'package_price'},
{ data: 'paid_via', name: 'paid_via'},
{ data: 'payment_transaction_id' , name: 'payment_transaction_id'},
{ data: 'status' , name: 'status'},
{ data: 'created_at', name: 'created_at'},
{ data: 'action', name: 'action', sortable:false}
],
"fnDrawCallback": function (oSettings) {
__convert_currency_in_datatable($('#package_subscription_table'));
}
});
$(document).on('click', '.view_subscription', function(){
var url = $(this).data('href');
$.ajax({
url:url,
dataType:'html',
method:'GET',
success: function(response){
$("#modal_div").html(response).modal("show");
}
});
});
$('span.currency').each(function(index, element){
var money = __formatCurrency($(this).text());
$(this).text(money);
});
});
</script>
@endsection

View File

@@ -0,0 +1,113 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
@lang('messages.view_package')
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="col-md-7 offset-md-2">
<div class="card card-outline card-success">
<div class="card-header">
<div class="text-center">
{{$subscription->package_details['name']}}
</div>
</div>
<div class="card-body text-center">
@if($subscription->package_details['no_of_active_forms'] != 0)
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.no_of_forms',[
'active_form' => $subscription->package_details['no_of_active_forms']])
</span>
@else
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.unlimited_forms')
</span>
@endif
<br>
@if($subscription->package_details['is_form_downloadable'])
<span>
<i class="far fa-check-circle text-success"></i>
@lang('messages.form_code_download')
</span>
@else
<span>
<i class="far fa-times-circle text-danger"></i>
@lang('messages.form_code_download')
</span>
@endif
<br><br>
@php
$price_interval = __('messages.'.$subscription->package_details['price_interval']);
@endphp
@if($subscription->package_price != 0)
<h4>
<span class="convert_currency">
{{$subscription->package_price}}
</span>
<small class="text-muted">
@lang('messages.subscription_price',[
'interval' => $subscription->package_details['interval'],
'price_interval' => $price_interval
])
</small>
</h4>
@else
<h4>
@lang('messages.free_for_interval', [
'interval' => $subscription->package_details['interval'],
'price_interval' => $price_interval
])
</h4>
@endif
</div>
<div class="card-footer text-center">
{{$subscription->package_details['description']}}
</div>
</div>
</div>
<div class="row">
<div class="col">
<strong>@lang('messages.start_date'): </strong> {{\Carbon\Carbon::parse($subscription->start_date)->isoFormat("D/M/YY")}}
</div>
<div class="col">
<strong>@lang('messages.end_date'): </strong>{{\Carbon\Carbon::parse($subscription->end_date)->isoFormat("D/M/YY")}}
</div>
</div>
<div class="row">
<div class="col">
<strong>@lang('messages.paid_via'): </strong>
@if($subscription->paid_via == "offline")
@lang("messages.offline")
@else
{{ucfirst($subscription->paid_via)}}
@endif
</div>
<div class="col">
<strong>@lang('messages.transaction_id'): </strong>
{{$subscription->payment_transaction_id}}
</div>
</div>
<div class="row">
<div class="col">
<strong>@lang('messages.status'): </strong>
{{__('messages.'.$subscription->status)}}
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">
@lang('messages.close')
</button>
</div>
</div>
</div>
<script type="text/javascript">
var money = $(document).find('span.convert_currency');
money.text(__formatCurrency(money.text()));
</script>

View File

@@ -0,0 +1,216 @@
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 200;
height: 100vh;
margin: 0;
background: rgb(9,9,121);
background: linear-gradient(90deg, rgba(9,9,121,1) 100%, rgba(0,212,255,1) 100%);
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
position: absolute;
}
.title {
font-size: 84px;
}
a {
color: #636b6f;
padding: 0 25px;
font-size: 13px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
.links{
color: white;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height" id="particles_js">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a class="links" href="{{ url('/home') }}">Home</a>
@else
<a class="links" href="{{ route('login') }}">Login</a>
@if (Route::has('register'))
<a class="links" href="{{ route('register') }}">Register</a>
@endif
@endauth
</div>
@endif
<div class="content">
<div class="links">
<h1>{{ config('app.name', 'Laravel') }}</h1>
<h4>{{ config('app.title', 'Laravel') }}</h4>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>
<script type="text/javascript">
particlesJS('particles_js', {
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 5,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true,
"config_demo": {
"hide_card": false,
"background_color": "#b61924",
"background_image": "",
"background_position": "50% 50%",
"background_repeat": "no-repeat",
"background_size": "cover"
}
});
</script>
</html>