From d2c832bc281350c3a7aeeae71e4b7da57275bd39 Mon Sep 17 00:00:00 2001 From: Rutesh <ruteshr@mkcl.org> Date: Mon, 2 Dec 2019 15:07:30 +0530 Subject: [PATCH] Sprint 1 Commit Committe Creation, Applicant Registration and Login. and User (Creation, Deleation) Updation Yet to be Done --- package.json | 5 +- src/App.vue | 70 +- src/components/common/headerbar.vue | 182 +++++ src/components/common/sidebar.vue | 193 +++++ src/main.js | 1 + src/router.js | 64 +- src/views/Applicant.vue | 1002 +++++++++++++++++++++++++ src/views/ApplicantLogin.vue | 167 +++++ src/views/Applicant_Registration.vue | 1003 ++++++++++++++++++++++++++ src/views/IndiLogin.vue | 167 +++++ src/views/TableDemo.vue | 115 --- src/views/User_Creation.vue | 366 +++++++--- src/views/emailv.vue | 64 +- src/views/individualReg.vue | 491 +++++++------ src/views/instituteReg.vue | 410 ++++++----- src/views/roles.vue | 142 +--- 16 files changed, 3655 insertions(+), 787 deletions(-) create mode 100644 src/components/common/headerbar.vue create mode 100644 src/components/common/sidebar.vue create mode 100644 src/views/Applicant.vue create mode 100644 src/views/ApplicantLogin.vue create mode 100644 src/views/Applicant_Registration.vue create mode 100644 src/views/IndiLogin.vue diff --git a/package.json b/package.json index ad96c8d..69d249d 100644 --- a/package.json +++ b/package.json @@ -16,14 +16,16 @@ "@fortawesome/vue-fontawesome": "^0.1.8", "axios": "^0.18.0", "babel-minify-webpack-plugin": "^0.3.1", - "bootstrap": "^4.3.1", + "bootstrap": "^4.4.1", "bootstrap-vue": "^2.0.0-rc.28", + "cities-states-countries": "0.0.4", "crypto-js": "^3.1.9-1", "datepicker": "0.0.0", "fs-extra": "^8.1.0", "gulp-prompt": "^1.2.0", "jquery": "^3.4.1", "pako": "^1.0.10", + "randomatic": "^3.1.1", "readline-sync": "^1.4.10", "register-service-worker": "^1.6.2", "timepicker": "^1.11.15", @@ -32,6 +34,7 @@ "vue-cli-plugin-webpack-bundle-analyzer": "^1.4.0", "vue-good-wizard": "^1.4.1", "vue-i18n": "^8.11.2", + "vue-js-toggle-button": "^1.3.3", "vue-localstorage": "^0.6.2", "vue-recaptcha": "^1.2.0", "vue-router": "^3.0.6", diff --git a/src/App.vue b/src/App.vue index f51be25..ca22522 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,21 +1,30 @@ <template> <div id="app"> - <div id="app-loader" v-if="$store.getters.isPageBlocked"> - <img src="../public/assets/tail-spin.svg" alt="loader" /> + <div + id="app-loader" + v-if="$store.getters.isPageBlocked" + > + <img + src="../public/assets/tail-spin.svg" + alt="loader" + > </div> <div id="nav"> <router-link to="/"> <i class="mdi mdi-home" /> Home </router-link>| - <router-link to="/about">About</router-link>| - <!-- <router-link name="loginlink" -to="/login"> -Login -</router-link>| + <router-link to="/about"> + About + </router-link>| + <router-link + to="/ApplicantLogin" + > + Applicant Login + </router-link>|<!-- <router-link to="/registration"> Register </router-link>| - + <router-link to="/mqlRequestDemo"> MQL Request </router-link>| @@ -31,17 +40,40 @@ Cdn Upload <router-link to="/tableDemo"> Table Demo--> <!-- </router-link>| --> - <router-link to="/meetings">Meetings</router-link>| - <router-link to="/emailv">Email Verification</router-link>| - <router-link to="/i18Demo">Individual Registration</router-link>| - <router-link to="/instituteReg">Institute Registration</router-link>| - <router-link to="/individualReg">OTP Test</router-link>| - <router-link to="/dataDisplay">dataDisplay</router-link>| - <router-link to="/otpdemo">OTPDEMO</router-link>| - <router-link to="/Grand">Registration</router-link>| - <router-link to="/committee">Committee</router-link>| - <router-link to="/User_Creation">User_Creation</router-link> - + <router-link to="/IndiLogin"> + Individual Login + </router-link>| + <router-link to="/meetings"> + Meetings + </router-link>| + <router-link to="/emailv"> + Email Verification + </router-link>| + <router-link to="/Applicant_Registration"> + Applicant Registration + </router-link>| + + <router-link to="/individualReg"> + OTP Test + </router-link>| + <router-link to="/dataDisplay"> + dataDisplay + </router-link>| + <router-link to="/otpdemo"> + OTPDEMO + </router-link>| + <router-link to="/Grand"> + Registration + </router-link>| + <router-link to="/committee"> + Committee + </router-link>| + <router-link to="/User_Creation"> + User_Creation + </router-link>| + <router-link to="/roles"> + Add Roles + </router-link> </div> <router-view /> </div> diff --git a/src/components/common/headerbar.vue b/src/components/common/headerbar.vue new file mode 100644 index 0000000..e056c1a --- /dev/null +++ b/src/components/common/headerbar.vue @@ -0,0 +1,182 @@ +<template> + <div class="header"> + <!-- Header start --> + <div class="header-left"> + <a href="javascript:void();" class="logo"> + <img src="assets/images/logo.png" width="40" height="40" alt=""> + <span class="text-uppercase">RGSTC</span> + </a> + </div> + <div class="page-title-box float-left"> + <h3 class="text-uppercase">Preschool</h3> + </div> + <a id="mobile_btn" @click="togglesidebar" class="mobile_btn float-left" href="javascript:void();"><i class="la la-bars" aria-hidden="true"></i></a> + <!-- <a id="mobile_btn" class="mobile_btn float-left" href="#">fdssfddf</a> --> + <ul class="nav user-menu float-right"> + <b-dropdown size="sm btn-noti" variant="link" toggle-class="text-decoration-none" no-caret> + <template slot="button-content"><i class="la la-bell"></i> <span class="badge badge-pill bg-primary float-right">3</span></template> + <div class="notification-wrapper"> + <b-dropdown-item href="#"> + <div class="media"> + <span class="avatar"> + <img alt="John Doe" src="assets/images/user.jpg" class="img-fluid rounded-circle"> + </span> + <div class="media-body"> + <p class="noti-details"><span class="noti-title">John Doe</span> is now following you </p> + <p class="noti-time"><span class="notification-time">4 mins ago</span></p> + </div> + </div> + + </b-dropdown-item> + + </div> + <div class="notification-wrapper"> + <b-dropdown-item href="#"> + <div class="media"> + <span class="avatar">T</span> + <div class="media-body"> + <p class="noti-details"><span class="noti-title">Tarah Shropshire</span> sent you a message.</p> + <p class="noti-time"><span class="notification-time">6 mins ago</span></p> + </div> + </div> + </b-dropdown-item> + </div> + <div class="notification-wrapper"> + <b-dropdown-item href="#"> + <div class="media"> + <span class="avatar">L</span> + <div class="media-body"> + <p class="noti-details"><span class="noti-title">Misty Tison</span> like your photo.</p> + <p class="noti-time"><span class="notification-time">8 mins ago</span></p> + </div> + </div> + </b-dropdown-item> + </div> + <div class="notification-wrapper"> + <b-dropdown-item href="#"> + <div class="media"> + <span class="avatar">G</span> + <div class="media-body"> + <p class="noti-details"><span class="noti-title">Rolland Webber</span> booking appoinment for meeting.</p> + <p class="noti-time"><span class="notification-time">12 mins ago</span></p> + </div> + </div> + </b-dropdown-item> + </div> + </b-dropdown> + <b-dropdown size="sm" variant="link" toggle-class="text-decoration-none" no-caret> + <template slot="button-content"><img src="assets/images/user.png" alt="" class="user-pic"></template> + <b-dropdown-item href="#">My Profile</b-dropdown-item> + <b-dropdown-item href="#">Edit Profile</b-dropdown-item> + <b-dropdown-item href="#">Settings</b-dropdown-item> + <b-dropdown-item href="#">Logout</b-dropdown-item> + </b-dropdown> + </ul> + <div class="dropdown mobile-user-menu float-right"> + <!-- mobile menu --> + <b-dropdown size="" variant="link" toggle-class="text-decoration-none" no-caret> + <template slot="button-content"><img src="assets/images/user.png" alt="" class="user-pic"></template> + <b-dropdown-item href="#">My Profile</b-dropdown-item> + <b-dropdown-item href="#">Edit Profile</b-dropdown-item> + <b-dropdown-item href="#">Settings</b-dropdown-item> + <b-dropdown-item href="#">Logout</b-dropdown-item> + </b-dropdown> + </div> + </div> +</template> + +<script> +import Vue from "vue"; +// import axios from 'axios' +// import lodashOrderBy from 'lodash/orderBy' + +export default { + name: "headerbar", + data() { + return { + isActive: false, + isOpen: false, + isOpen2: false, + + }; + }, + methods: { + + togglesidebar() { + + var html = document.querySelector('html'); + var mainwrapper = document.querySelector('.main-wrapper'); + var sidebar = document.querySelector('.sidebar'); + var mobilebtn = document.querySelector('#mobile_btn'); + + mainwrapper.classList.toggle("slide-nav"); + sidebar.classList.toggle("opened"); + html.classList.toggle("menu-opened"); + + + + + }, + logout() { + this.$store + .dispatch("AUTH_LOGOUT") + .then(res => { + // Redirect to next page after suucessfull login + Vue.toasted.success("Logout succesfully!", { + theme: "bubble", + duration: 6000 + }); + this.$router.push("/Login") + }) + .catch(err => { + this.$toasted.error(err, { + duration: 4000 + }) + Vue.$log.error(err) + }) + + // let vm = this + // window.MKCLAPI.logout() + // .then(() => { + // vm.$store.dispatch('clearStore') + // vm.$router.push('/') + // }) + // .catch(e => { + // vm.$toasted.error(vm.$t('logOut.failToLogout')) + // }) + } + }, + +} +</script> + +<style> +.sidebar-inner .router-link-exact-active { + background: rgba(0, 0, 0, 0.1); + color: #fff; +} + +.sidebar-inner .router-link-exact-active:before { + background: rgba(255, 255, 255, 0.5); +} + + .sidebar-inner .navbar-nav>li>a.router-link-exact-active:before { + opacity: 1; +} + +.navbar-dark .navbar-toggler { + margin-left: auto !important; +} + +@media(max-width: 425px) { + .header-top .text-right span { + display: none; + } +} + +.user-pic { + width: 40px; + height: 40px; + border-radius: 50%; +} +</style> \ No newline at end of file diff --git a/src/components/common/sidebar.vue b/src/components/common/sidebar.vue new file mode 100644 index 0000000..c80def6 --- /dev/null +++ b/src/components/common/sidebar.vue @@ -0,0 +1,193 @@ + <template> + <div class="sidebar" +id="sidebar"> + <!-- sidebar --> + <div class="sidebar-inner slimscroll"> + <div id="sidebar-menu" +class="sidebar-menu"> + <ul> + <li class="menu-title"> +Main +</li> + <li> + <router-link to="theme"> + <i class="la la-tachometer" +aria-hidden="true"/> + Theme +</router-link> + </li> + <!-- <li> + <router-link to="form"><i class="la la-user" aria-hidden="true"></i>Form</router-link> + </li> + <li> + <router-link to="ui-kit"><i class="la la-share-alt" aria-hidden="true"></i>UI Kit</router-link> + </li> + <li> + <router-link to="components"><i class="la la-share-alt" aria-hidden="true"></i>Components</router-link> + </li> --> + <li><router-link to="/"> +<i class="mdi mdi-home" /> Home +</router-link></li> + <li><router-link to="/about"> +About +</router-link></li> + <li><router-link to="/meetings"> +Meetings +</router-link></li> + <li><router-link to="/emailv"> +Email Verification +</router-link></li> + <li><router-link to="/i18Demo"> +Individual Registration +</router-link></li> + <li><router-link to="/instituteReg"> +Institute Registration +</router-link></li> + <li><router-link to="/individualReg"> +OTP Test +</router-link></li> + <li><router-link to="/dataDisplay"> +dataDisplay +</router-link></li> + <li><router-link to="/otpdemo"> +OTPDEMO +</router-link></li> + <li><router-link to="/Grand"> +Registration +</router-link></li> + <li><router-link to="/committee"> +Committee +</router-link></li> + <li><router-link to="/User_Creation"> +User_Creation +</router-link></li> + </ul> + </div> + </div> + </div> +</template> + +<script> +export default { + name: 'Sidebar', + data () { + return { + name: '', + addressLocations: '', + designation: '', + menuList: [] + } + }, + methods: { + + // togglesidebar: function() { + // if (window.matchMedia("(max-width: 700px)").matches) { + // var element3 = document.getElementById("left-sidebar"); + // element3.classList.add("active"); + // var element4 = document.getElementById("main-content"); + // element4.classList.add("active"); + // } + + // } + + }, + mounted () { + + // var dropdown1 = document.querySelectorAll('.submenu'); + // var dropdownArray = Array.prototype.slice.call(dropdown1, 0); + // dropdownArray.forEach(function(el) { + // var button = el.querySelector('a[data-toggle="submenu"]'), + // menu1 = el.querySelector('.list-unstyled'), + // arrow = button.querySelector('.menu-arrow'); + + // button.onclick = function(event) { + + // if (!menu1.hasClass('show')) { + // menu1.classList.add('show'); + // menu1.classList.remove('hide'); + // button.classList.add('subdrop'); + // button.parentElement.parentElement.classList.add('fdssdfd'); + + // arrow.classList.add('open'); + // arrow.classList.remove('close'); + // event.preventDefault(); + // } else { + // menu1.classList.remove('show'); + // menu1.classList.add('hide'); + // button.classList.remove('subdrop'); + // arrow.classList.remove('open'); + // arrow.classList.add('close'); + // event.preventDefault(); + // } + + // }; + // }) + + // Element.prototype.hasClass = function(className) { + // return this.className && new RegExp("(^|\\s)" + className + "(\\s|$)").test(this.className); + // }; + + }, + computed: {} +} +</script> + +<style> +.hide { + display: none; +} + +.show { + display: block; +} + +.list-unstyled { + transition: all .2s ease-in; +} + +.vb>.vb-dragger { + z-index: 5; + width: 12px; + right: 0; +} + +.vb>.vb-dragger>.vb-dragger-styler { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform: rotate3d(0, 0, 0, 0); + transform: rotate3d(0, 0, 0, 0); + -webkit-transition: + background-color 100ms ease-out, + margin 100ms ease-out, + height 100ms ease-out; + transition: + background-color 100ms ease-out, + margin 100ms ease-out, + height 100ms ease-out; + background-color: rgba(48, 121, 244, .1); + margin: 5px 5px 5px 0; + border-radius: 20px; + height: calc(100% - 10px); + display: block; +} + +.vb.vb-scrolling-phantom>.vb-dragger>.vb-dragger-styler { + background-color: rgba(48, 121, 244, .3); +} + +.vb>.vb-dragger:hover>.vb-dragger-styler { + background-color: rgba(48, 121, 244, .5); + margin: 0px; + height: 100%; +} + +.vb.vb-dragging>.vb-dragger>.vb-dragger-styler { + background-color: rgba(48, 121, 244, .5); + margin: 0px; + height: 100%; +} + +.vb.vb-dragging-phantom>.vb-dragger>.vb-dragger-styler { + background-color: rgba(48, 121, 244, .5); +} +</style> diff --git a/src/main.js b/src/main.js index 376514c..cccc9b7 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,7 @@ import '../public/assets/plugins/materialdesignicons/css/materialdesignicons.min import 'vue-select/dist/vue-select.css' import '../public/assets/css/template.scss' import VueTimepicker from 'vuejs-timepicker' +import { getCountries, getStates, getCities } from 'cities-states-countries'; Vue.config.productionTip = false diff --git a/src/router.js b/src/router.js index cd7e123..6a30150 100644 --- a/src/router.js +++ b/src/router.js @@ -40,14 +40,14 @@ export default new Router({ title: 'Committee' } }, - { - path: '/individualReg', - name: 'individualReg', - component: loadView('individualReg'), - meta: { - title: 'Individual Registration' - } - }, + // { + // path: '/individualReg', + // name: 'individualReg', + // component: loadView('individualReg'), + // meta: { + // title: 'Individual Registration' + // } + // }, { path: '/instituteReg', @@ -77,12 +77,12 @@ export default new Router({ } }, { - path: '/login', - name: 'login', - component: loadView('Login'), + path: '/ApplicantLogin', + name: 'ApplicantLogin', + component: loadView('ApplicantLogin'), meta: { - title: 'Login', - lang: 'mr' + title: 'ApplicantLogin', + } }, { @@ -103,11 +103,11 @@ export default new Router({ } }, { - path: '/i18Demo', - name: 'i18Demo', - component: loadView('I18Demo'), + path: '/Applicant_Registration', + name: 'Applicant_Registration', + component: loadView('Applicant_Registration'), meta: { - title: 'Language Demo' + title: 'Applicant Registration' } }, { @@ -126,14 +126,7 @@ export default new Router({ title: 'Validator' } }, - { - path: '/encryption', - name: 'encryption', - component: loadView('Encryption'), - meta: { - title: 'Encrypt' - } - }, + { path: '/cdnUpload', name: 'cdnUpload', @@ -167,6 +160,25 @@ export default new Router({ title: 'User Creation' } - } + }, + { + path: '/IndiLogin', + name: 'IndiLogin', + component: loadView('IndiLogin'), + meta: { + title: 'IndiLogin' + } + + }, + + { + path: '/roles', + name: 'roles', + component: loadView('roles'), + meta: { + title: 'Add Roles' + } + + } ] }) \ No newline at end of file diff --git a/src/views/Applicant.vue b/src/views/Applicant.vue new file mode 100644 index 0000000..b680e13 --- /dev/null +++ b/src/views/Applicant.vue @@ -0,0 +1,1002 @@ + +<template> + <div + class="validator" + id="app" + > + <form + class="ui form" + @submit.prevent="onSubmit" + /> + <div class="container"> + <div class="row left-content-center text-left"> + <div class="col-sm-8"> + <form + class="card p-4 mb-1" + @submit.prevent="onSubmit" + > + <h4 class="text-Left sb-3"> + Individual Registration + </h4> + <template v-if="flag==1"> + <div + class="form-group" + :class="{error: errors.has('Mobile')}" + > + <label>Mobile no</label> + <input + type="mobile" + class="form-control" + autocomplete + name="mobile" + placeholder="Mobile Number" + maxlength="10" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('mobile')" + >{{ $t(errors.first('mobile')) }}</small> + </div> + + <button + type="submit" + class="btn btn-sm btn-primary" + @click="sendsms" + > + Submit Number + </button> + </template> + + <template v-else-if="flag==2"> + <div + class="form-group" + :class="{error: errors.has('otp')}" + > + <label>OTP</label> + <input + type="numeric" + class="form-control" + autocomplete + name="otp" + placeholder="OTP" + maxlength="6" + minlength="6" + v-validate="'required|numeric'" + v-model="regotp.otp" + > + </div> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="verfiyOtp" + > + Submit OTP + </button> + </template> + <template v-else> + <div class="form-group"> + <div class="row-sm-3"> + <form class="card p-1 mb-2"> + <label>Title</label> + <v-select + :options="titles" + name="title" + v-model="regUser.title" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </form> + </div> + + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('first_name')}" + > + <label>First Name</label> + <input + type="text" + class="form-control" + autocomplete + name="fname" + placeholder="First Name" + v-validate="'required'" + v-model="regUser.first_name" + > + <small + class="form-text text-danger" + v-if="errors.has('first_name')" + >{{ $t(errors.first('first_name')) }}</small> + + <input + type="text" + class="form-control" + autocomplete + name="mname" + placeholder="Middle Name" + v-validate="'required'" + v-model="regUser.middle_name" + > + <small + class="form-text text-danger" + v-if="errors.has('mname')" + >{{ $t(errors.first('mname')) }}</small> + + <input + type="text" + class="form-control" + autocomplete + name="lname" + placeholder="last Name" + v-validate="'required'" + v-model="regUser.last_name" + > + + <small + class="form-text text-danger" + v-if="errors.has('lname')" + >{{ $t(errors.first('lname')) }}</small> + </div> + + <div class="form-group"> + <div class="row-md-4"> + <form class="card p-1 mb-2"> + <label>Gender</label> + <v-select + :options="Genders" + name="title" + v-model="regUser.gender" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </form> + </div> + + <small + class="form-text text-danger" + v-if="errors.has('gender')" + >{{ $t(errors.first('gender')) }}</small> + </div> + + <div class="form-group"> + <label for="email">Email</label> + <input + type="email" + class="form-control" + autocomplete + aria-describedby="emailHelp" + name="email" + placeholder="Email" + v-validate="'required|email'" + v-model="regUser.email" + > + <small + id="emailHelp" + class="form-text text-danger" + v-if="errors.has('email')" + >{{ $t(errors.first('email')) }}</small> + + <label for="eemail">Alternate Email</label> + <input + type="email" + class="form-control" + autocomplete + name="eemail" + placeholder="Extra-Email" + v-model="regUser.alternate_email" + > + </div> + + <div + class="form-group" + :class="{error: errors.has('landline')}" + > + <label>Phone no</label> + <input + type="landline" + class="form-control" + autocomplete + name="landline" + placeholder="landline Number" + maxlength="12" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.landline" + > + <small + class="form-text text-danger" + v-if="errors.has('landline')" + >{{ $t(errors.first('landline')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Mobile')}" + > + <label>Mobile no</label> + <input + type="mobile" + class="form-control" + autocomplete + name="mobile" + placeholder="Mobile Number" + maxlength="10" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('mobile')" + >{{ $t(errors.first('mobile')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Alternate Mobile')}" + > + <label>Alternate Mobile no</label> + <input + type="Altmobile" + class="form-control" + autocomplete + name="Altmobile" + placeholder="Alternate Mobile Number" + maxlength="10" + minlength="10" + v-model="regUser.alternate_mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('Altmobile')" + >{{ $t(errors.first('Altmobile')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Address')}" + > + <label>Address</label> + <input + type="Address" + class="form-control" + autocomplete + name="Address" + placeholder="Address Please" + v-validate="'required'" + v-model="regUser.address" + > + <small + class="form-text text-danger" + v-if="errors.has('Address')" + >{{ $t(errors.first('Address')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('country')}" + > + <label>Select Country</label> + <v-select + :options="countries" + name="country" + v-model="regUser.country" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('country')" + >{{ $t(errors.first('country')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('state')}" + > + <label>Select State</label> + <div v-if="regUser.country==='India'"> + <v-select + :options="India" + name="india" + v-model="regUser.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else> + <v-select + :options="Australia" + name="Aus" + v-model="regUser.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('city')}" + > + <label>Select City</label> + <div v-if="regUser.state==='Goa'"> + <v-select + :options="Goa" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.state==='Maharashtra'"> + <v-select + :options="Maharashtra" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else-if="regUser.state==='Sydney'"> + <v-select + :options="Sydney" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.state==='Sydney3'"> + <v-select + :options="Sydney3" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else> + <v-select + :options="Haryana" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('city')" + >{{ $t(errors.first('city')) }}</small> + </div> + + <div class="form-group mb-4 mt-2"> + <h5>Upload Your Photo</h5> + + <input + class="form-control mb-2" + id="files" + @change="submitFile" + type="file" + > + <button + type="button" + class="btn btn-primary btn-sm" + id="uploadtBtn" + @click.stop.prevent="uploadFile" + > + Upload + </button> + </div> + + <div + class="form-group" + :class="{error: errors.has('Fax')}" + > + <label>Fax no</label> + <input + type="fax" + class="form-control" + autocomplete + name="fax" + placeholder="Fax Number" + maxlength="8" + minlength="5" + v-model="regUser.fax" + > + <small + class="form-text text-danger" + v-if="errors.has('fax')" + >{{ $t(errors.first('fax')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Designation')}" + > + <label>Designation</label> + <input + type="Designation" + class="form-control" + autocomplete + name="Designation" + placeholder="Designation" + v-validate="'required'" + v-model="regUser.designation" + > + <small + class="form-text text-danger" + v-if="errors.has('Designation')" + >{{ $t(errors.first('Designation')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Department')}" + > + <label>Department Name</label> + <input + type="Department" + class="form-control" + autocomplete + name="Department" + placeholder="Department" + v-validate="'required'" + v-model="regUser.department" + > + <small + class="form-text text-danger" + v-if="errors.has('Department')" + >{{ $t(errors.first('Department')) }}</small> + </div> + + <div class="field"> + <label>Date of Birth</label> + <datepicker + v-model="regUser.date" + placeholder="Select a date" + /> + </div> + + <!-- <CDNUplod /> --> + <div class="form-group mb-4 mt-2"> + <h5>Upload Your Project Documents</h5> + + <input + class="form-control mb-2" + id="files" + @change="submitFile" + type="file" + > + <button + type="button" + class="btn btn-primary btn-sm" + id="uploadtBtn" + @click.stop.prevent="uploadFile" + > + Upload + </button> + </div> + + <div class="form-group mb-4 mt-2"> + <h5>Upload Your Resume</h5> + + <input + class="form-control mb-2" + id="files" + @change="submitFile" + type="file" + > + <button + type="button" + class="btn btn-primary btn-sm" + id="uploadtBtn" + @click.stop.prevent="uploadFile" + > + Upload + </button> + </div> + + <h5 class="text-Left sb-3"> + Institute Registration + </h5> + + <div + class="form-group" + :class="{error: errors.has('Institute name')}" + > + <label>Institute Name</label> + <input + type="text" + class="form-control" + autocomplete + name="institute_name" + placeholder="Institute Name" + v-validate="'required'" + v-model="regUser.regInst.institute_name" + > + <small + class="form-text text-danger" + v-if="errors.has('institute_name')" + >{{ $t(errors.first('institute_name')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('University Name')}" + > + <label>University Name</label> + <input + type="text" + class="form-control" + autocomplete + name="university_name" + placeholder="University Name" + v-validate="'required'" + v-model="regUser.regInst.university_name" + > + <small + class="form-text text-danger" + v-if="errors.has('university_name')" + >{{ $t(errors.first('university_name')) }}</small> + </div> + + <div class="field"> + <label>Registered Date</label> + <datepicker + v-model="regUser.regInst.date" + placeholder="Select a date" + /> + </div> + <br> + <div + class="form-group" + :class="{error: errors.has('Registered Number')}" + > + <label>Registration Number</label> + <input + type="text" + class="form-control" + autocomplete + name="registration_number" + placeholder="Registration Number" + v-validate="'required|numeric'" + v-model="regUser.regInst.registration_number" + > + + <small + class="form-text text-danger" + v-if="errors.has('registration_number')" + >{{ $t(errors.first('registration_number')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('is_affiliated')}" + > + <label>Whether Institute Affliated ?</label> + <v-select + :options="affiliations" + name="is_affiliated" + v-model="regUser.regInst.is_affiliated" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('is_affiliated')" + >{{ $t(errors.first('is_affiliated')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('department')}" + > + <label>Department Name</label> + <input + type="Department" + class="form-control" + autocomplete + name="department" + placeholder="Department Name" + v-validate="'required'" + v-model="regUser.regInst.department" + > + <small + class="form-text text-danger" + v-if="errors.has('department')" + >{{ $t(errors.first('department')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('institute_address')}" + > + <label>Address of Institute</label> + <input + type="address" + class="form-control" + autocomplete + name="institute_Address" + placeholder="Address Please" + v-validate="'required'" + v-model="regUser.regInst.institute_address" + > + <small + class="form-text text-danger" + v-if="errors.has('institute_address')" + >{{ $t(errors.first('institute_address')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('country')}" + > + <label>Select Country</label> + <v-select + :options="countries" + name="country" + v-model="regUser.regInst.country" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('country')" + >{{ $t(errors.first('country')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('state')}" + > + <label>Select State</label> + <div v-if="regUser.regInst.country==='India'"> + <v-select + :options="India" + name="india" + v-model="regUser.regInst.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else> + <v-select + :options="Australia" + name="Aus" + v-model="regUser.regInst.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('city')}" + > + <label>Select City</label> + <div v-if="regUser.regInst.state==='Goa'"> + <v-select + :options="Goa" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.regInst.state==='Maharashtra'"> + <v-select + :options="Maharashtra" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else-if="regUser.regInst.state==='Sydney'"> + <v-select + :options="Sydney" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.regInst.state==='Sydney3'"> + <v-select + :options="Sydney3" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else> + <v-select + :options="Haryana" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('city')" + >{{ $t(errors.first('city')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('registered_landline')}" + > + <label>Phone no</label> + <input + type="landline" + class="form-control" + autocomplete + name="registered_landline" + placeholder="Registered landline Number" + maxlength="12" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.regInst.registered_landline" + > + <small + class="form-text text-danger" + v-if="errors.has('registered_landline')" + >{{ $t(errors.first('registered_landline')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Fax')}" + > + <label>Fax no</label> + <input + type="fax" + class="form-control" + autocomplete + name="fax" + placeholder="Fax Number" + maxlength="8" + minlength="5" + v-model="regUser.regInst.fax" + > + <small + class="form-text text-danger" + v-if="errors.has('fax')" + >{{ $t(errors.first('fax')) }}</small> + </div> + + <div class="form-group"> + <label for="email">Email</label> + <input + type="email" + class="form-control" + autocomplete + aria-describedby="emailHelp" + name="email" + placeholder="Email" + v-validate="'required|email'" + v-model="regUser.regInst.email" + > + <small + id="emailHelp" + class="form-text text-danger" + v-if="errors.has('email')" + >{{ $t(errors.first('email')) }}</small> + </div> + <div class="form-group text-right mb-0"> + <button + type="button" + class="btn btn-sm btn-outline-dark mr-2" + > + Clear + </button> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="addUser" + > + Submit + </button> + </div> + </template> + </form> + </div> + </div> + </div> + </div> +</template> + +<script> +import Vue from 'vue' +import vSelect from 'vue-select' +import VeeValidate from 'vee-validate' +import Datepicker from 'vuejs-datepicker' +import MQL from '@/plugins/mql.js' +Vue.use(VeeValidate, { events: 'input|blur' }) +// var randomo = require('randomatic') + +export default { + components: { Datepicker, vSelect }, + data () { + return { + regUser: { + // password: randomo('*', 8), + + regInst: { + + } + }, + regotp: { + o_mobile: '', + otp: '' + }, + India: ['Maharashtra', 'Goa', 'Haryana'], + Australia: ['Sydney', 'Sydney3'], + Sydney: ['Random City1', 'Random City2'], + Sydney3: ['Ultra Random 1', 'Las Vegas'], + Maharashtra: ['Mumbai', 'Pune', 'Aurangabad', 'jalna'], + Goa: ['Madgaon', 'Kolva', 'old goa'], + Haryana: ['Haryana City1', 'Haryana City2', 'Haryana City3'], + Genders: ['Male', 'Female', 'Transgender', 'Prefer not to Say'], + titles: ['Mr.', 'Miss.', 'Mrs.', 'Dr.'], + countries: ['India', 'Australia'], + affiliations: ['Yes', 'No'], + + flag: 1 + // cities: ["Mumbai", "Pune", "Aurangabad", "Kolhapur", "Chandrapur"] + } + }, + methods: { + onSubmit () { + this.$validator.validateAll() + if (this.errors === null) { + alert('ok') + } + }, + submitFile (event) { + this.files = event.target.files[0] + }, + + sendsms () { + new MQL() + .setActivity('o.[RGSTC Demo]') + .setData(this.regUser) + .fetch() + .then(rs => { + let res = rs.getActivity('RGSTC Demo', false) + if (rs.isValid('RGSTC Demo')) { + console.log(this.regUser) + this.flag = 2 + console.log(this.flag, res.result) + alert('Entered successfully') + this.regotp.o_mobile = this.regUser.mobile + } else { + rs.showErrorToast('RGSTC Demo') + } + }) + }, + addUser () { + new MQL() + .setActivity('o.[ApplicantReg]') + .setData(this.regUser) + .fetch() + .then(rs => { + let res = rs.getActivity('ApplicantReg', false) + if (rs.isValid('ApplicantReg')) { + alert('Entered successfully') + this.flag = 0 + this.regUser = { regInst: {} } + } else { + rs.showErrorToast('ApplicantReg') + } + }) + }, + + uploadFile () { + let formData = new FormData() + formData.append('file', this.files) // append your file as 'file' in formdata. + new MQLCdn() + .enablePageLoader(true) + .setFormData(formData) // (required) sets file data + .setFileName(this.inputFileName) // (optional field) if you want to set name to file that is being uploaded + .setBucketKey('client2') // (required) valid bucket key need to set in which file will be uploaded. + .uploadFile('uploadtBtn') + .then(res => { + // (required) this will upload file takes element id (optional param) which will be blocked while file upload.. + if (res.isValid()) { + this.uploadedFilePath = res.uploadedFileURL() // returns uploaded file url.. + } else { + res.showErrorToast() + } + }) + }, + verfiyOtp () { + // this.regotp.o_mobile=this.regUser.mobile + + new MQL() + .setActivity('o.[rgstcotpverification]') + .setData(this.regotp) + .fetch() + .then(rs => { + let res = rs.getActivity('rgstcotpverification', false) + if (rs.isValid('rgstcotpverification')) { + console.log(res.result.otp) + if (res.result.otp == 'OTPFOUND') { + this.flag = 3 + alert('Congrats Mobile Verified') + } else { + alert('Invalid OTP') + } + // this.regotp.o_mobile=this.regUser.mobile + } else { + alert('Wrong OTP ') + rs.showErrorToast('rgstcotpverification') + } + }) + } + }, + created () { + const customMessage = { + custom: { + mobile: { + numeric: 'validation.phoneNumeric', + min: 'validation.phoneMinLength', + required: 'validation.phoneRequired' + }, + name: { + required: 'validation.nameRequired', + alpha: 'validation.nameAlpha' + }, + email: { + required: 'validation.emailRequired', + email: 'validation.emailValid' + }, + // fullname: { + // required: "validation.fullnameRequired", + // alpha_spaces: "validation.fullnameValidate", + // alpha: "validation.alpha" + // }, + state: { + state: 'validation.stateValid' + } + } + } + this.$validator.localize('en', customMessage) + } +} +</script> diff --git a/src/views/ApplicantLogin.vue b/src/views/ApplicantLogin.vue new file mode 100644 index 0000000..dd785d6 --- /dev/null +++ b/src/views/ApplicantLogin.vue @@ -0,0 +1,167 @@ +<template> + <section id="login"> + <div class="container-fluid"> + <div class="col-md-4 offset-md-4"> + <div class="login-card"> + <img + src="../assets/RGSTC.jpg" + alt="mkcl logo" + class="mb-4" + width="100px" + > + <div + class="form-group" + :class="{error: errors.has('email_id')}" + > + <label>Email Id</label> + <input + type="email" + placeholder="Email" + class="form-control" + autocomplete + name="email_id" + v-model="em.email_id" + > + + <small + class="form-text text-danger" + v-if="errors.has(email_id)" + >{{ $t(errors.first('email_id')) }}</small> + + <div + class="form-group" + :class="{error: errors.has('email_id')}" + > + <label>Password</label> + <input + type="password" + placeholder="password" + class="form-control" + autocomplete + name="password" + v-model="em.password" + > + + <small + class="form-text text-danger" + v-if="errors.has(email_id)" + >{{ $t(errors.first('email_id')) }}</small> + </div> + </div> + </div> + <div class="form-control text right-mb-0"> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="abx" + > + Submit Email + </button> + </div> + </div> + </div> + </section> +</template> + +<script> +import VeeValidate from 'vee-validate' +import MQL from '@/plugins/mql.js' +import Vue from 'vue' +Vue.use(VeeValidate, { events: 'input|blur' }) +export default { + data () { + return { + em: { + + // email: "", + // sender: "ruteshrathod@gmail.com" + } + } + }, + methods: { + onSubmit () { + this.$validator.validateAll() + if (this.errors === null) { + alert('ok') + } + }, + + abx () { + console.log(this.em) + new MQL() + .setActivity('o.[RGSTC_Login(Applicant)]') + .setData(this.em) + .fetch() + .then(rs => { + let res = rs.getActivity('RGSTC_Login(Applicant)', false) + if (rs.isValid('RGSTC_Login(Applicant)')) { + alert('Entered successfully') + console.log('Hello') + this.em = {} + } else { + rs.showErrorToast('RGSTC_Login(Applicant)') + } + }) + } + } +} +</script> +<style lang="scss"> +#login { + .login-card { + box-shadow: 0 0 10px #ccc; + padding: 30px; + } +} +#pswd_info { + background: #dfdfdf none repeat scroll 0 0; + color: #fff; + left: 20px; + position: absolute; + top: 115px; +} +#pswd_info h4 { + background: black none repeat scroll 0 0; + display: block; + font-size: 14px; + letter-spacing: 0; + padding: 17px 0; + text-align: center; + text-transform: uppercase; +} +#pswd_info ul { + list-style: outside none none; +} +#pswd_info ul li { + padding: 10px 45px; +} + +.valid { + background: rgba(0, 0, 0, 0) + url("https://s19.postimg.org/vq43s2wib/valid.png") no-repeat scroll 2px 6px; + color: green; + line-height: 21px; + padding-left: 22px; +} + +.invalid { + background: rgba(0, 0, 0, 0) + url("https://s19.postimg.org/olmaj1p8z/invalid.png") no-repeat scroll 2px + 6px; + color: red; + line-height: 21px; + padding-left: 22px; +} + +#pswd_info::before { + background: #dfdfdf none repeat scroll 0 0; + content: ""; + height: 25px; + left: -13px; + margin-top: -12.5px; + position: absolute; + top: 50%; + transform: rotate(45deg); + width: 25px; +} +</style> diff --git a/src/views/Applicant_Registration.vue b/src/views/Applicant_Registration.vue new file mode 100644 index 0000000..1c91559 --- /dev/null +++ b/src/views/Applicant_Registration.vue @@ -0,0 +1,1003 @@ + +<template> + <div + class="validator" + id="app" + > + <form + class="ui form" + @submit.prevent="onSubmit" + /> + <div class="container"> + <div class="row left-content-center text-left"> + <div class="col-sm-8"> + <form + class="card p-4 mb-1" + @submit.prevent="onSubmit" + > + <h4 class="text-Left sb-3"> + Individual Registration + </h4> + <template v-if="flag==1"> + <div + class="form-group" + :class="{error: errors.has('Mobile')}" + > + <label>Mobile no</label> + <input + type="mobile" + class="form-control" + autocomplete + name="mobile" + placeholder="Mobile Number" + maxlength="10" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('mobile')" + >{{ $t(errors.first('mobile')) }}</small> + </div> + + <button + type="submit" + class="btn btn-sm btn-primary" + @click="sendsms" + > + Submit Number + </button> + </template> + + <template v-else-if="flag==2"> + <div + class="form-group" + :class="{error: errors.has('otp')}" + > + <label>OTP</label> + <input + type="numeric" + class="form-control" + autocomplete + name="otp" + placeholder="OTP" + maxlength="6" + minlength="6" + v-validate="'required|numeric'" + v-model="regotp.otp" + > + </div> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="verfiyOtp" + > + Submit OTP + </button> + </template> + <template v-else> + <div class="form-group"> + <div class="row-sm-3"> + <form class="card p-1 mb-2"> + <label>Title</label> + <v-select + :options="titles" + name="title" + v-model="regUser.title" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </form> + </div> + + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('first_name')}" + > + <label>First Name</label> + <input + type="text" + class="form-control" + autocomplete + name="fname" + placeholder="First Name" + v-validate="'required'" + v-model="regUser.first_name" + > + <small + class="form-text text-danger" + v-if="errors.has('first_name')" + >{{ $t(errors.first('first_name')) }}</small> + + <input + type="text" + class="form-control" + autocomplete + name="mname" + placeholder="Middle Name" + v-validate="'required'" + v-model="regUser.middle_name" + > + <small + class="form-text text-danger" + v-if="errors.has('mname')" + >{{ $t(errors.first('mname')) }}</small> + + <input + type="text" + class="form-control" + autocomplete + name="lname" + placeholder="last Name" + v-validate="'required'" + v-model="regUser.last_name" + > + + <small + class="form-text text-danger" + v-if="errors.has('lname')" + >{{ $t(errors.first('lname')) }}</small> + </div> + + <div class="form-group"> + <div class="row-md-4"> + <form class="card p-1 mb-2"> + <label>Gender</label> + <v-select + :options="Genders" + name="title" + v-model="regUser.gender" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </form> + </div> + + <small + class="form-text text-danger" + v-if="errors.has('gender')" + >{{ $t(errors.first('gender')) }}</small> + </div> + + <div class="form-group"> + <label for="email">Email</label> + <input + type="email" + class="form-control" + autocomplete + aria-describedby="emailHelp" + name="email" + placeholder="Email" + v-validate="'required|email'" + v-model="regUser.email" + > + <small + id="emailHelp" + class="form-text text-danger" + v-if="errors.has('email')" + >{{ $t(errors.first('email')) }}</small> + + <label for="eemail">Alternate Email</label> + <input + type="email" + class="form-control" + autocomplete + name="eemail" + placeholder="Extra-Email" + v-model="regUser.alternate_email" + > + </div> + + <div + class="form-group" + :class="{error: errors.has('landline')}" + > + <label>Phone no</label> + <input + type="landline" + class="form-control" + autocomplete + name="landline" + placeholder="landline Number" + maxlength="12" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.landline" + > + <small + class="form-text text-danger" + v-if="errors.has('landline')" + >{{ $t(errors.first('landline')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Mobile')}" + > + <label>Mobile no</label> + <input + type="mobile" + class="form-control" + autocomplete + name="mobile" + placeholder="Mobile Number" + maxlength="10" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('mobile')" + >{{ $t(errors.first('mobile')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Alternate Mobile')}" + > + <label>Alternate Mobile no</label> + <input + type="Altmobile" + class="form-control" + autocomplete + name="Altmobile" + placeholder="Alternate Mobile Number" + maxlength="10" + minlength="10" + v-model="regUser.alternate_mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('Altmobile')" + >{{ $t(errors.first('Altmobile')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Address')}" + > + <label>Address</label> + <input + type="Address" + class="form-control" + autocomplete + name="Address" + placeholder="Address Please" + v-validate="'required'" + v-model="regUser.address" + > + <small + class="form-text text-danger" + v-if="errors.has('Address')" + >{{ $t(errors.first('Address')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('country')}" + > + <label>Select Country</label> + <v-select + :options="countries" + name="country" + v-model="regUser.country" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('country')" + >{{ $t(errors.first('country')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('state')}" + > + <label>Select State</label> + <div v-if="regUser.country==='India'"> + <v-select + :options="India" + name="india" + v-model="regUser.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else> + <v-select + :options="Australia" + name="Aus" + v-model="regUser.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('city')}" + > + <label>Select City</label> + <div v-if="regUser.state==='Goa'"> + <v-select + :options="Goa" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.state==='Maharashtra'"> + <v-select + :options="Maharashtra" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else-if="regUser.state==='Sydney'"> + <v-select + :options="Sydney" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.state==='Sydney3'"> + <v-select + :options="Sydney3" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else> + <v-select + :options="Haryana" + name="gcity" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('city')" + >{{ $t(errors.first('city')) }}</small> + </div> + + <div class="form-group mb-4 mt-2"> + <h5>Upload Your Photo</h5> + + <input + class="form-control mb-2" + id="files" + @change="submitFile" + type="file" + > + <button + type="button" + class="btn btn-primary btn-sm" + id="uploadtBtn" + @click.stop.prevent="uploadFile" + > + Upload + </button> + </div> + + <div + class="form-group" + :class="{error: errors.has('Fax')}" + > + <label>Fax no</label> + <input + type="fax" + class="form-control" + autocomplete + name="fax" + placeholder="Fax Number" + maxlength="8" + minlength="5" + v-model="regUser.fax" + > + <small + class="form-text text-danger" + v-if="errors.has('fax')" + >{{ $t(errors.first('fax')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Designation')}" + > + <label>Designation</label> + <input + type="Designation" + class="form-control" + autocomplete + name="Designation" + placeholder="Designation" + v-validate="'required'" + v-model="regUser.designation" + > + <small + class="form-text text-danger" + v-if="errors.has('Designation')" + >{{ $t(errors.first('Designation')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Department')}" + > + <label>Department Name</label> + <input + type="Department" + class="form-control" + autocomplete + name="Department" + placeholder="Department" + v-validate="'required'" + v-model="regUser.department" + > + <small + class="form-text text-danger" + v-if="errors.has('Department')" + >{{ $t(errors.first('Department')) }}</small> + </div> + + <div class="field"> + <label>Date of Birth</label> + <datepicker + v-model="regUser.date" + placeholder="Select a date" + /> + </div> + + <!-- <CDNUplod /> --> + <div class="form-group mb-4 mt-2"> + <h5>Upload Your Project Documents</h5> + + <input + class="form-control mb-2" + id="files" + @change="submitFile" + type="file" + > + <button + type="button" + class="btn btn-primary btn-sm" + id="uploadtBtn" + @click.stop.prevent="uploadFile" + > + Upload + </button> + </div> + + <div class="form-group mb-4 mt-2"> + <h5>Upload Your Resume</h5> + + <input + class="form-control mb-2" + id="files" + @change="submitFile" + type="file" + > + <button + type="button" + class="btn btn-primary btn-sm" + id="uploadtBtn" + @click.stop.prevent="uploadFile" + > + Upload + </button> + </div> + + <h5 class="text-Left sb-3"> + Institute Registration + </h5> + + <div + class="form-group" + :class="{error: errors.has('Institute name')}" + > + <label>Institute Name</label> + <input + type="text" + class="form-control" + autocomplete + name="institute_name" + placeholder="Institute Name" + v-validate="'required'" + v-model="regUser.regInst.institute_name" + > + <small + class="form-text text-danger" + v-if="errors.has('institute_name')" + >{{ $t(errors.first('institute_name')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('University Name')}" + > + <label>University Name</label> + <input + type="text" + class="form-control" + autocomplete + name="university_name" + placeholder="University Name" + v-validate="'required'" + v-model="regUser.regInst.university_name" + > + <small + class="form-text text-danger" + v-if="errors.has('university_name')" + >{{ $t(errors.first('university_name')) }}</small> + </div> + + <div class="field"> + <label>Registered Date</label> + <datepicker + v-model="regUser.regInst.date" + placeholder="Select a date" + /> + </div> + <br> + <div + class="form-group" + :class="{error: errors.has('Registered Number')}" + > + <label>Registration Number</label> + <input + type="text" + class="form-control" + autocomplete + name="registration_number" + placeholder="Registration Number" + v-validate="'required|numeric'" + v-model="regUser.regInst.registration_number" + > + + <small + class="form-text text-danger" + v-if="errors.has('registration_number')" + >{{ $t(errors.first('registration_number')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('is_affiliated')}" + > + <label>Whether Institute Affliated ?</label> + <v-select + :options="affiliations" + name="is_affiliated" + v-model="regUser.regInst.is_affiliated" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('is_affiliated')" + >{{ $t(errors.first('is_affiliated')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('department')}" + > + <label>Department Name</label> + <input + type="Department" + class="form-control" + autocomplete + name="department" + placeholder="Department Name" + v-validate="'required'" + v-model="regUser.regInst.department" + > + <small + class="form-text text-danger" + v-if="errors.has('department')" + >{{ $t(errors.first('department')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('institute_address')}" + > + <label>Address of Institute</label> + <input + type="address" + class="form-control" + autocomplete + name="institute_Address" + placeholder="Address Please" + v-validate="'required'" + v-model="regUser.regInst.institute_address" + > + <small + class="form-text text-danger" + v-if="errors.has('institute_address')" + >{{ $t(errors.first('institute_address')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('country')}" + > + <label>Select Country</label> + <v-select + :options="countries" + name="country" + v-model="regUser.regInst.country" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('country')" + >{{ $t(errors.first('country')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('state')}" + > + <label>Select State</label> + <div v-if="regUser.regInst.country==='India'"> + <v-select + :options="India" + name="india" + v-model="regUser.regInst.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else> + <v-select + :options="Australia" + name="Aus" + v-model="regUser.regInst.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('city')}" + > + <label>Select City</label> + <div v-if="regUser.regInst.state==='Goa'"> + <v-select + :options="Goa" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.regInst.state==='Maharashtra'"> + <v-select + :options="Maharashtra" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else-if="regUser.regInst.state==='Sydney'"> + <v-select + :options="Sydney" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else-if="regUser.regInst.state==='Sydney3'"> + <v-select + :options="Sydney3" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + + <div v-else> + <v-select + :options="Haryana" + name="gcity" + v-model="regUser.regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <!-- {{ state }} --> + <small + class="form-text text-danger" + v-if="errors.has('city')" + >{{ $t(errors.first('city')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('registered_landline')}" + > + <label>Phone no</label> + <input + type="landline" + class="form-control" + autocomplete + name="registered_landline" + placeholder="Registered landline Number" + maxlength="12" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.regInst.registered_landline" + > + <small + class="form-text text-danger" + v-if="errors.has('registered_landline')" + >{{ $t(errors.first('registered_landline')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('Fax')}" + > + <label>Fax no</label> + <input + type="fax" + class="form-control" + autocomplete + name="fax" + placeholder="Fax Number" + maxlength="8" + minlength="5" + v-model="regUser.regInst.fax" + > + <small + class="form-text text-danger" + v-if="errors.has('fax')" + >{{ $t(errors.first('fax')) }}</small> + </div> + + <div class="form-group"> + <label for="email">Email</label> + <input + type="email" + class="form-control" + autocomplete + aria-describedby="emailHelp" + name="email" + placeholder="Email" + v-validate="'required|email'" + v-model="regUser.regInst.email" + > + <small + id="emailHelp" + class="form-text text-danger" + v-if="errors.has('email')" + >{{ $t(errors.first('email')) }}</small> + </div> + <div class="form-group text-right mb-0"> + <button + type="button" + class="btn btn-sm btn-outline-dark mr-2" + > + Clear + </button> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="addUser" + > + Submit + </button> + </div> + </template> + </form> + </div> + </div> + </div> + </div> +</template> + +<script> +import Vue from 'vue' +import vSelect from 'vue-select' +import VeeValidate from 'vee-validate' +import Datepicker from 'vuejs-datepicker' +import MQL from '@/plugins/mql.js' +Vue.use(VeeValidate, { events: 'input|blur' }) +var randomo = require('randomatic') + +export default { + components: { Datepicker, vSelect }, + data () { + return { + regUser: { + + regInst: { + + }, + password: randomo('*', 8), + + }, + regotp: { + o_mobile: '', + otp: '' + }, + India: ['Maharashtra', 'Goa', 'Haryana'], + Australia: ['Sydney', 'Sydney3'], + Sydney: ['Random City1', 'Random City2'], + Sydney3: ['Ultra Random 1', 'Las Vegas'], + Maharashtra: ['Mumbai', 'Pune', 'Aurangabad', 'jalna'], + Goa: ['Madgaon', 'Kolva', 'old goa'], + Haryana: ['Haryana City1', 'Haryana City2', 'Haryana City3'], + Genders: ['Male', 'Female', 'Transgender', 'Prefer not to Say'], + titles: ['Mr.', 'Miss.', 'Mrs.', 'Dr.'], + countries: ['India', 'Australia'], + affiliations: ['Yes', 'No'], + + flag: 1 + // cities: ["Mumbai", "Pune", "Aurangabad", "Kolhapur", "Chandrapur"] + } + }, + methods: { + onSubmit () { + this.$validator.validateAll() + if (this.errors === null) { + alert('ok') + } + }, + submitFile (event) { + this.files = event.target.files[0] + }, + + sendsms () { + new MQL() + .setActivity('o.[RGSTC Demo]') + .setData(this.regUser) + .fetch() + .then(rs => { + let res = rs.getActivity('RGSTC Demo', false) + if (rs.isValid('RGSTC Demo')) { + console.log(this.regUser) + this.flag = 2 + console.log(this.flag, res.result) + alert('Entered successfully') + this.regotp.o_mobile = this.regUser.mobile + } else { + rs.showErrorToast('RGSTC Demo') + } + }) + }, + addUser () { + new MQL() + .setActivity('o.[ApplicantReg]') + .setData(this.regUser) + .fetch() + .then(rs => { + let res = rs.getActivity('ApplicantReg', false) + if (rs.isValid('ApplicantReg')) { + alert('Entered successfully') + this.flag = 0 + this.regUser = { regInst: {} } + } else { + rs.showErrorToast('ApplicantReg') + } + }) + }, + + uploadFile () { + let formData = new FormData() + formData.append('file', this.files) // append your file as 'file' in formdata. + new MQLCdn() + .enablePageLoader(true) + .setFormData(formData) // (required) sets file data + .setFileName(this.inputFileName) // (optional field) if you want to set name to file that is being uploaded + .setBucketKey('client2') // (required) valid bucket key need to set in which file will be uploaded. + .uploadFile('uploadtBtn') + .then(res => { + // (required) this will upload file takes element id (optional param) which will be blocked while file upload.. + if (res.isValid()) { + this.uploadedFilePath = res.uploadedFileURL() // returns uploaded file url.. + } else { + res.showErrorToast() + } + }) + }, + verfiyOtp () { + // this.regotp.o_mobile=this.regUser.mobile + + new MQL() + .setActivity('o.[rgstcotpverification]') + .setData(this.regotp) + .fetch() + .then(rs => { + let res = rs.getActivity('rgstcotpverification', false) + if (rs.isValid('rgstcotpverification')) { + console.log(res.result.otp) + if (res.result.otp == 'OTPFOUND') { + this.flag = 3 + alert('Congrats Mobile Verified') + } else { + alert('Invalid OTP') + } + // this.regotp.o_mobile=this.regUser.mobile + } else { + alert('Wrong OTP ') + rs.showErrorToast('rgstcotpverification') + } + }) + } + }, + created () { + const customMessage = { + custom: { + mobile: { + numeric: 'validation.phoneNumeric', + min: 'validation.phoneMinLength', + required: 'validation.phoneRequired' + }, + name: { + required: 'validation.nameRequired', + alpha: 'validation.nameAlpha' + }, + email: { + required: 'validation.emailRequired', + email: 'validation.emailValid' + }, + // fullname: { + // required: "validation.fullnameRequired", + // alpha_spaces: "validation.fullnameValidate", + // alpha: "validation.alpha" + // }, + state: { + state: 'validation.stateValid' + } + } + } + this.$validator.localize('en', customMessage) + } +} +</script> diff --git a/src/views/IndiLogin.vue b/src/views/IndiLogin.vue new file mode 100644 index 0000000..cfb95b3 --- /dev/null +++ b/src/views/IndiLogin.vue @@ -0,0 +1,167 @@ +<template> + <section id="login"> + <div class="container-fluid"> + <div class="col-md-4 offset-md-4"> + <div class="login-card"> + <img + src="../assets/RGSTC.jpg" + alt="mkcl logo" + class="mb-4" + width="100px" + > + <div + class="form-group" + :class="{error: errors.has('email_id')}" + > + <label>Email Id</label> + <input + type="email" + placeholder="Email" + class="form-control" + autocomplete + name="email_id" + v-model="em.email_id" + > + + <small + class="form-text text-danger" + v-if="errors.has(email_id)" + >{{ $t(errors.first('email_id')) }}</small> + + <div + class="form-group" + :class="{error: errors.has('email_id')}" + > + <label>Password</label> + <input + type="password" + placeholder="password" + class="form-control" + autocomplete + name="password" + v-model="em.password" + > + + <small + class="form-text text-danger" + v-if="errors.has(email_id)" + >{{ $t(errors.first('email_id')) }}</small> + </div> + </div> + </div> + <div class="form-control text right-mb-0"> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="abx" + > + Submit Email + </button> + </div> + </div> + </div> + </section> +</template> + +<script> +import VeeValidate from 'vee-validate' +import MQL from '@/plugins/mql.js' +import Vue from 'vue' +Vue.use(VeeValidate, { events: 'input|blur' }) +export default { + data () { + return { + em: { + + // email: "", + // sender: "ruteshrathod@gmail.com" + } + } + }, + methods: { + onSubmit () { + this.$validator.validateAll() + if (this.errors === null) { + alert('ok') + } + }, + + abx () { + console.log(this.em) + new MQL() + .setActivity('o.[RGSTC_Login(Individual)]') + .setData(this.em) + .fetch() + .then(rs => { + let res = rs.getActivity('RGSTC_Login(Individual)', false) + if (rs.isValid('RGSTC_Login(Individual)')) { + alert('Entered successfully') + console.log('Hello') + this.em = {} + } else { + rs.showErrorToast('RGSTC_Login(Individual)') + } + }) + } + } +} +</script> +<style lang="scss"> +#login { + .login-card { + box-shadow: 0 0 10px #ccc; + padding: 30px; + } +} +#pswd_info { + background: #dfdfdf none repeat scroll 0 0; + color: #fff; + left: 20px; + position: absolute; + top: 115px; +} +#pswd_info h4 { + background: black none repeat scroll 0 0; + display: block; + font-size: 14px; + letter-spacing: 0; + padding: 17px 0; + text-align: center; + text-transform: uppercase; +} +#pswd_info ul { + list-style: outside none none; +} +#pswd_info ul li { + padding: 10px 45px; +} + +.valid { + background: rgba(0, 0, 0, 0) + url("https://s19.postimg.org/vq43s2wib/valid.png") no-repeat scroll 2px 6px; + color: green; + line-height: 21px; + padding-left: 22px; +} + +.invalid { + background: rgba(0, 0, 0, 0) + url("https://s19.postimg.org/olmaj1p8z/invalid.png") no-repeat scroll 2px + 6px; + color: red; + line-height: 21px; + padding-left: 22px; +} + +#pswd_info::before { + background: #dfdfdf none repeat scroll 0 0; + content: ""; + height: 25px; + left: -13px; + margin-top: -12.5px; + position: absolute; + top: 50%; + transform: rotate(45deg); + width: 25px; +} +</style> diff --git a/src/views/TableDemo.vue b/src/views/TableDemo.vue index b0eb647..e69de29 100644 --- a/src/views/TableDemo.vue +++ b/src/views/TableDemo.vue @@ -1,115 +0,0 @@ -<template> - <!-- <m-table - id-table="tblPlaces"//tableId -> for having different kind of table view - restriction="o" //restriction -> activity / query restriction ('o' for open, 'r' for restriction, 'c' for casbin rolebased) - activity="GetUser" //activity -> provide activityName of activity created in corestudio - //activity -> "query_1QMEsbbZE5l8pOoymSzgUxRo5HP" //query -> provide queryId of query created in corestudio - msg="Table Component" //msg -> provide table header - responsive="sm" //responsive -> to provide responsiveness 'sm/md/lg/xl' - table-variant="success" //tableVariant -> to provide table variant (display) can have values 'success/info/danger etc.' - foot-clone="1" //footClone -> to give the table header fields at bottom also - striped="1" //striped -> to give css formatting to the table. For details do visit: Table style options on https://bootstrap-vue.js.org/docs/components/table/ - :fields="fields" //fields -> if provided it will shown only given and mapped fields, else it will show all fields - /> --> - - <!-- Sample of query without parameters --> - <m-table - id-table="tblPlaces" - restriction="o" - activity="query_1REU8xWgCIFo2CroM6vhuIvyrke" - msg="Table Component" - responsive="sm" - bordered - foot-clone - /> - - <!-- Sample of query with parameters (check commented code in data part of script section) --> - <!-- <m-table - id-table="tblPlaces" - restriction="o" - activity="query_1REWWZgEL1LR03QPfUdx3WlCKsf" - msg="Table Component" - responsive="sm" - :params="params" - bordered - foot-clone - /> --> - - <!-- Sample of activity without parameters --> - <!-- <m-table - id-table="tblPlaces" - restriction="o" - activity="GetEmployeeData" - msg="Table Component" - responsive="sm" - result-key="GetDataValue" - bordered - foot-clone - /> --> - - <!-- Sample of activity with parameters (check commented code in data part of script section) --> - <!-- <m-table - id-table="tblPlaces" - restriction="o" - activity="GetEmpData" - msg="Table Component" - responsive="sm" - result-key="GetDataOneEmployee" - :params="params" - bordered - foot-clone - /> --> -</template> - -<script> -// @ is an alias to /src -import MTable from '@/components/MTable.vue' - -export default { - components: { - mTable: MTable - }, - data () { - return { - // If provided, it will shown only those mapped columns. Else it will show all the fetched columns. - // fields: [ - // { - // key: 'empCode', - // label: 'Id', - // stickyColumn: true - // }, - // { - // key: 'userName', - // label: 'User Name', - // sortable: true - // }, - // { - // key: 'fullName', - // label: 'Full Name', - // sortable: true - // }, - // { - // key: 'officeLocation', - // label: 'Office Location' - // } - // ], - - // To call m-table with parameters - // params: { - // 'emp': { - // 'employeeCode': '9105' - // } - // } - } - } -} -</script> - -<style lang="scss"> -#login { - .login-card { - box-shadow: 0 0 10px #ccc; - padding: 30px; - } -} -</style> diff --git a/src/views/User_Creation.vue b/src/views/User_Creation.vue index 5b3366a..725de87 100644 --- a/src/views/User_Creation.vue +++ b/src/views/User_Creation.vue @@ -1,12 +1,16 @@ <template> - <div> - <form class="ui form" @submit.prevent="onSubmit" /> - <div class="container"> - <div class="row left-content-center text-left"> - <div class="col-sm-8"> - <form class="card p-4 mb-1" @submit.prevent="onSubmit"> - <h4 class="text-Left sb-3">User Creation</h4> - <!-- <div class="card p-2 mb-4"> + <div> + <form + class="ui form" + @submit.prevent="onSubmit" /> + <div class="container"> + <div class="row left-content-center text-left"> + <div class="col-sm-8"> + <form + class="card p-4 mb-1" + @submit.prevent="onSubmit"> + <h4 class="text-Left sb-3">User Creation</h4> + <!-- <div class="card p-2 mb-4"> <h5><b>Name of Committe</b></h5> <div class="form-group" > <input @@ -17,92 +21,187 @@ v-model="users.name" v-validate="'required | alpha'" data-vv-validate-on="blur" - /> + /> </div> </div> --> - <div class="card p-2 mb-4"> - <!-- <h5>` + <div class="card p-2 mb-4"> + <!-- <h5>` <b>Users</b> </h5> --> - <div class="form-group"> - - <label><b>Name</b></label><br> - <input - type="text" - placeholder="First Name" - autocomplete - name="First Name" - v-model="users.firstName" - v-validate="'required | alpha'" - data-vv-validate-on="blur" - /> - <input - type="text" - placeholder="Middle Name" - autocomplete - name="Middle Name" - v-model="users.middleName" + <div class="form-group"> - v-validate="'required | alpha'" - data-vv-validate-on="blur" - /> - <input - type="text" - placeholder="Last Name" - autocomplete - name="Last Name" - v-model="users.lastName" - v-validate="'required'" - data-vv-validate-on="blur" - /> + <label><b>Name</b></label><br> + <input + type="text" + placeholder="First Name" + autocomplete + name="First Name" + v-model="users.firstName" + data-vv-validate-on="blur" + > + <input + type="text" + placeholder="Middle Name" + autocomplete + name="Middle Name" + v-model="users.middleName" + data-vv-validate-on="blur" + > + <input + type="text" + placeholder="Last Name" + autocomplete + name="Last Name" + v-model="users.lastName" + data-vv-validate-on="blur" + > - - - </div> - <div class="form-group"> - <label><b>Email Id</b></label> - <br> - <input - type="email" - placeholder="Your Email Will Username" - autocomplete - name="email" - v-model="users.email_id" - v-validate="'required | email'" - /> - <!--             + + + </div> + <div class="form-group"> + <label><b>Email Id</b></label> + <br> + <input + type="email" + placeholder="Your Email Will Username" + autocomplete + name="email" + v-model="users.email_id" + v-validate="'required | email'" + > + <!--             <button type="submit" class="btn btn-sm btn-primary" @click="sendPass">Send Password</button> --> - </div> + </div> - <div class="form-group"> - <label><b>Roles</b></label> - <br> - <input - type="text" - placeholder="Member Type" - name="Member Type" + <div class="form-group"> + <label><b>Roles</b></label> + <br> + <!-- <v-select + :options="role" + placeholder="Roles" + name="roles" autocomplete - v-model="users.roles" - v-validate="'required | text'" - /> - </div> - - </div> - - - <div class="form-group text-right mb-0"> - <button type="button" class="btn btn-sm btn-outline-dark mr-2" @click="clear">Clear</button> - <button type="submit" class="btn btn-sm btn-primary" @click="addusers">Submit</button> + v-model="role" + /> --> + <!-- <select v-model="users.roles"> + <option value="" v-for="rl in role" > + {{rl.role}} + + </option> + </select> --> + + + <select +v-model="users.roles" + multiple > + + <option v-for="rl in role" > + {{rl.role}} + + </option> + </select> <br><br> + <span><b>Selected:</b> {{ users.roles }}</span> + </div> + + <br><br><br> + <div class=form-group> + <label><b>Is-Active ?</b></label> +             + <toggle-button v-model="users.isActive"/> + </div> + + + <div class="form-group"> + <label><b>User Creation Date:-</b></label> +         + <span>{{Date()}}</span> + + </div> + </div> - </form> - </div> - </div> - </div> - </form> + + <div class="form-group text-right mb-0"> + <button +type="button" + class="btn btn-sm btn-outline-dark mr-2" +@click="clear">Clear</button> + <button +type="submit" + class="btn btn-sm btn-primary" +@click="addusers">Submit</button> + </div> + + <br><br><br> + <div class="card p-2 mb-4"> + <div class="form-group"> + <h5>Delete User</h5> + <label><b>Username</b></label> + <br> + <input + type="email" + placeholder="email as username" + autocomplete + name="email" + v-model="userd.email_id" + v-validate="'required | email'" + /> + </div> + <div> + <button +type="submit" + class="btn btn-sm btn-warning" +@click="deluser">Delete User</button> + </div> + </div> + + + <br><br><br> + <div class="card p-2 mb-4"> + <div class="form-group"> + <h5>Update User</h5> + <label><b>Username</b></label> + <br> + <input + type="email" + placeholder="email as username" + autocomplete + name="email" + v-model="useru.email_id" + v-validate="'required | email'" + > + <input + type="text" + placeholder="active or not" + autocomplete + name="IsActiveu" + v-model="useru.IsActiveu" + /> + + </div> + + <br /> + <div> + <button +type="submit" + class="btn btn-sm btn-warning" +@click="fetchuser">Fetch User</button> + <button +type="submit" + class="btn btn-sm btn-warning" +@click="updateUser">Update User</button> + </div> + </div> + </form> + </div> + </div> </div> + </form> + + </div> </template> @@ -113,22 +212,48 @@ import VeeValidate from "vee-validate"; import Datepicker from "vuejs-datepicker"; import VueTimepicker from "vuejs-timepicker"; import MQL from "@/plugins/mql.js"; +import ToggleButton from 'vue-js-toggle-button' + +Vue.use(ToggleButton) Vue.use(VeeValidate, { events: "input|blur" }); +var randomo = require('randomatic'); +var creationDate= new Date() + + export default { components: { vSelect, Datepicker, VueTimepicker }, data() { return { - // k: 0, - // disabledDates: { - // to: new Date(Date.now() - 8640000) - // }, + selected:{role:null}, users: { - + password:randomo('*', 8), + roles:[], + creationDate }, - roles:["Head","Refree","Co-Head","Investigator","",""] + role:[], + userd:{}, + useru:{}, + fuser:[] + }; }, + created(){ + new MQL() + .setActivity("o.[query_1U8qGAL8FDrEMBA8vb3TGMhY81e]") + // .setData(data) + .fetch() + .then(rs => { + let res = rs.getActivity("query_1U8qGAL8FDrEMBA8vb3TGMhY81e",false) + if (rs.isValid("query_1U8qGAL8FDrEMBA8vb3TGMhY81e")) { + console.log(res) + this.role=res + } else + { + rs.showErrorToast("query_1U8qGAL8FDrEMBA8vb3TGMhY81e") + } + }) + }, methods: { doSelection: function(payload) { console.log(payload); @@ -145,33 +270,84 @@ export default { this.$validator.validateAll(); if (this.errors === null) { alert("ok"); + + + } }, clear() { this.users = { users: { - firstName: "", - middleName: "", - lastName: "", - designation: "", - memberType: "" + + } }; }, addusers() { new MQL() - .setActivity("o.[CommitteAddition]") + .setActivity("o.[userCreation]") .setData(this.users) .fetch() .then(rs => { - let res = rs.getActivity("CommitteAddition", false); - if (rs.isValid("CommitteAddition")) { + let res = rs.getActivity("userCreation", false); + if (rs.isValid("userCreation")) { alert("Users Addded Sucessfully"); this.users = {}; + console.log(randomo('*', 8)) + } else { - rs.showErrorToast("CommitteAddition"); + rs.showErrorToast("userCreation"); } }); + }, + deluser(){ + new MQL() + .setActivity("o.[DeleteUserC]") + .setData(this.userd) + .fetch() + .then(rs => { + let res = rs.getActivity("DeleteUserC",false) + if (rs.isValid("DeleteUserC")) { + alert("Users Deleted Sucessfully"); + this.userd = {}; + } else + { + rs.showErrorToast("DeleteUserC") + } + }) + }, + fetchuser(){ + new MQL() + .setActivity("o.[fetchUsers]") + .fetch() + .then(rs => { + let res = rs.getActivity("fetchUsers",false) + if (rs.isValid("fetchUsers")) { + this.fuser.push(res); + + } else + { + rs.showErrorToast("fetchUsers") + } + }) + } + + , + updateUser(){ + new MQL() + .setActivity("o.[UpdateUserC]") + .setData(this.useru) + .fetch() + .then(rs => { + let res = rs.getActivity("UpdateUserC",false) + if (rs.isValid("UpdateUserC")) { + alert("Users Updated Sucessfully"); + this.useru = {}; + } else + { + rs.showErrorToast("UpdateUserC") + } + }) } } }; diff --git a/src/views/emailv.vue b/src/views/emailv.vue index a6b6dd1..0bc6701 100644 --- a/src/views/emailv.vue +++ b/src/views/emailv.vue @@ -1,6 +1,9 @@ - <template> +<template> <div> - <div class="form-group" :class="{error: errors.has('email')}"> + <div + class="form-group" + :class="{error: errors.has('email')}" + > <label>Email Id</label> <input type="email" @@ -9,58 +12,69 @@ autocomplete name="email" v-model="em.email" - /> + > - <small class="form-text text-danger" v-if="errors.has(email)">{{ $t(errors.first('email')) }}</small> + <small + class="form-text text-danger" + v-if="errors.has(email)" + >{{ $t(errors.first('email')) }}</small> <div class="form-control text right-mb-0"> - <button type="submit" class="btn btn-sm btn-primary" @click="abx">Submit Email</button> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="abx" + > + Submit Email + </button> </div> </div> </div> </template> <script> -import VeeValidate from "vee-validate"; -import MQL from "@/plugins/mql.js"; -import Vue from "vue"; -Vue.use(VeeValidate, { events: "input|blur" }); +import VeeValidate from 'vee-validate' +import MQL from '@/plugins/mql.js' +import Vue from 'vue' +Vue.use(VeeValidate, { events: 'input|blur' }) export default { - data() { + data () { return { em: { + eotp: ' ' // email: "", // sender: "ruteshrathod@gmail.com" } - }; + } }, methods: { - onSubmit() { - this.$validator.validateAll(); + onSubmit () { + this.$validator.validateAll() if (this.errors === null) { - alert("ok"); + alert('ok') } }, + - abx() { - console.log(this.em.sender); + abx () { + console.log(this.em.sender) new MQL() - .setActivity("o.[EmailOTP]") + .setActivity('o.[EmailOTP Global]') .setData(this.em) .fetch() .then(rs => { - let res = rs.getActivity("EmailOTP", false); - if (rs.isValid("EmailOTP")) { - alert("Entered successfully"); - this.em = {}; + let res = rs.getActivity('EmailOTP Global', false) + if (rs.isValid('EmailOTP Global')) { + alert('Entered successfully') + this.em = {} } else { - rs.showErrorToast("EmailOTP"); + rs.showErrorToast('EmailOTP Global') } - }); + }) } } -}; +} </script> <style scoped> -</style> \ No newline at end of file +</style> diff --git a/src/views/individualReg.vue b/src/views/individualReg.vue index ef74c34..d4dfba2 100644 --- a/src/views/individualReg.vue +++ b/src/views/individualReg.vue @@ -1,35 +1,40 @@ -/* eslint-disable semi */ -/* eslint-disable semi */ -/* eslint-disable semi */ + <template> - <div class="validator" id="app"> - <form class="ui form" @submit.prevent="onSubmit" /> + <div + class="validator" + id="app" + > + <form + class="ui form" + @submit.prevent="onSubmit" + /> <div class="container"> <div class="row left-content-center text-left"> <div class="col-sm-8"> - - <h4 class="text-Left sb-3">Individual Registration</h4> - <div class="form-group"> - <div class="row-sm-3"> - <form class="card p-1 mb-2"> - <label>Title</label> - <v-select - :options="titles" - name="title" - v-model="regUser.title" - v-validate="'required'" - data-vv-validate-on="blur" - /> - </form> - </div> - - <small - class="form-text text-danger" - v-if="errors.has('title')" - >{{ $t(errors.first('title')) }}</small> + <h4 class="text-Left sb-3"> + Individual Registration + </h4> + <div class="form-group"> + <div class="row-sm-3"> + <form class="card p-1 mb-2"> + <label>Title</label> + <v-select + :options="titles" + name="title" + v-model="regUser.title" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </form> </div> - <!-- <div class="form-group" :class="{error: errors.has('first_name')}"> + <small + class="form-text text-danger" + v-if="errors.has('title')" + >{{ $t(errors.first('title')) }}</small> + </div> + + <!-- <div class="form-group" :class="{error: errors.has('first_name')}"> <label>First Name</label> <input type="text" @@ -143,26 +148,29 @@ >{{ $t(errors.first('landline')) }}</small> </div>--> - <div class="form-group" :class="{error: errors.has('Mobile')}"> - <label>Mobile no</label> - <input - type="mobile" - class="form-control" - autocomplete - name="mobile" - placeholder="Mobile Number" - maxlength="10" - minlength="10" - v-validate="'required|numeric'" - v-model="regUser.mobile" - /> - <small - class="form-text text-danger" - v-if="errors.has('mobile')" - >{{ $t(errors.first('mobile')) }}</small> - </div> - - <!-- <div class="form-group" :class="{error: errors.has('Alternate Mobile')}"> + <div + class="form-group" + :class="{error: errors.has('Mobile')}" + > + <label>Mobile no</label> + <input + type="mobile" + class="form-control" + autocomplete + name="mobile" + placeholder="Mobile Number" + maxlength="10" + minlength="10" + v-validate="'required|numeric'" + v-model="regUser.mobile" + > + <small + class="form-text text-danger" + v-if="errors.has('mobile')" + >{{ $t(errors.first('mobile')) }}</small> + </div> + + <!-- <div class="form-group" :class="{error: errors.has('Alternate Mobile')}"> <label>Alternate Mobile no</label> <input type="Altmobile" @@ -197,52 +205,64 @@ >{{ $t(errors.first('Address')) }}</small> </div>--> - <!-- <div class="form-group" :class="{error: errors.has('country')}"> - <label>Select Country</label> - <v-select - :options="countries" - name="country" - v-model="regUser.country" - v-validate="'required'" - data-vv-validate-on="blur" - /> - <small - class="form-text text-danger" - v-if="errors.has('country')" - >{{ $t(errors.first('country')) }}</small> - </div> - - <div class="form-group" :class="{error: errors.has('state')}"> - <label>Select State</label> - <v-select - :options="states" - name="state" - v-model="regUser.state" - v-validate="'required'" - data-vv-validate-on="blur" - /> - <small - class="form-text text-danger" - v-if="errors.has('state')" - >{{ $t(errors.first('state')) }}</small> - </div> - - <div class="form-group" :class="{error: errors.has('city')}"> - <label>Select City</label> - <v-select - :options="cities" - name="city" - v-model="regUser.city" - v-validate="'required'" - data-vv-validate-on="blur" - /> - <small - class="form-text text-danger" - v-if="errors.has('city')" - >{{ $t(errors.first('city')) }}</small> - </div> + <div + class="form-group" + + :class="{error: errors.has('country')}" + > + <label>Select Country</label> + <v-select + label="name" + :options="listOfCountries" + @click="setCountry" + v-model="regUser.country" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <small + class="form-text text-danger" + v-if="errors.has('country')" + >{{ $t(errors.first('country')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('state')}" + > + <label>Select State</label> + <v-select + label="name" + + :options="listState" + v-model="regUser.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <small + class="form-text text-danger" + v-if="errors.has('state')" + >{{ $t(errors.first('state')) }}</small> + </div> + + <div + class="form-group" + :class="{error: errors.has('city')}" + > + <label>Select City</label> + <v-select + :options="cities" + name="city" + v-model="regUser.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> + <small + class="form-text text-danger" + v-if="errors.has('city')" + >{{ $t(errors.first('city')) }}</small> + </div> - <div class="form-group mb-4 mt-2"> + <!-- <div class="form-group mb-4 mt-2"> <h5>Upload Your Photo</h5> <input class="form-control mb-2" id="files" @change="submitFile" type="file" /> @@ -309,10 +329,10 @@ <div class="field"> <label>Date of Birth</label> <datepicker v-model="regUser.date" placeholder="Select a date" /> - </div>--> + </div>--> --> - <!-- <CDNUplod /> --> - <!-- <div class="form-group mb-4 mt-2"> + <!-- <CDNUplod /> --> + <!-- <div class="form-group mb-4 mt-2"> <h5>Upload Your Project Documents</h5> <input class="form-control mb-2" id="files" @change="submitFile" type="file" /> @@ -335,197 +355,242 @@ @click.stop.prevent="uploadFile" >Upload</button> </div>--> - <div class="form-group" :class="{error: errors.has('otp')}"> - <label>OTP</label> - <input - type="numeric" - class="form-control" - autocomplete - name="otp" - placeholder="OTP" - maxlength="6" - minlength="6" - v-validate="'required|numeric'" - v-model="regotp.otp" - /> - </div> - <div class="form-group text-right mb-0"> - <button type="button" class="btn btn-sm btn-outline-dark mr-2">Clear</button> - <button type="submit" class="btn btn-sm btn-primary" @click="smssend">Send SMS</button> - <button type="submit" class="btn btn-sm btn-primary" @click="verfiyOtp">Verify</button> - - </div> - - - </div> - </div> - </form> + <div + class="form-group" + :class="{error: errors.has('otp')}" + > + <label>OTP</label> + <input + type="numeric" + class="form-control" + autocomplete + name="otp" + placeholder="OTP" + maxlength="6" + minlength="6" + v-validate="'required|numeric'" + v-model="regotp.otp" + > + </div> + <div class="form-group text-right mb-0"> + <button + type="button" + class="btn btn-sm btn-outline-dark mr-2" + > + Clear + </button> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="smssend" + > + Send SMS + </button> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="verfiyOtp" + > + Verify + </button> + </div> </div> </div> + </form> </div> </div> + </div> + </div> </template> <script> -import Vue from "vue"; -import vSelect from "vue-select"; -import VeeValidate from "vee-validate"; -import Datepicker from "vuejs-datepicker"; -import MQL from "@/plugins/mql.js"; -Vue.use(VeeValidate, { events: "input|blur" }); +import Vue from 'vue' +import vSelect from 'vue-select' +import VeeValidate from 'vee-validate' +import Datepicker from 'vuejs-datepicker' +import MQL from '@/plugins/mql.js' + +import { getCountries, getStates, getCities } from 'cities-states-countries' +Vue.use(VeeValidate, { events: 'input|blur' }) + +const listOfCountries = getCountries() +const listState = getStates('India') +var listOfCitiesOfCountry = getCountries('India') +var listOfCitiesOfCountryAndState = getCountries('country-name', 'state-name') export default { components: { Datepicker, vSelect }, - data() { + data () { return { - regotp: { - o_mobile:'', - otp:"" - }, + regotp: { + o_mobile: '', + otp: '' + }, regUser: { - title: "", - first_name: "", - middle_name: "", - last_name: "", - email: "", - alternate_email: "", - address: "", - alternate_email: "", - landline: "", - mobile: "", - alternate_mobile: "", - fax: "", - date: "", - country: "", - city: "", - state: "", - date: "", - department: "", - designation: "", - gender: "" + country: { + name: "" + } }, - - states: ["Maharashtra", "Goa", "Haryana", "Orissa"], - Genders: ["Male", "Female", "Transgender", "Prefer not to Say"], - titles: ["Mr.", "Miss.", "Mrs.", "Dr."], - countries: ["India", "Bharat", "Hindustan"], - cities: ["Mumbai", "Pune", "Aurangabad", "Kolhapur", "Chandrapur"] - }; + listOfCountries: getCountries(), + listState: getStates('India'), + + // state: [ 'Andhra Pradesh', + // 'Arunachal Pradesh', + // 'Assam', + // 'Bihar', + // 'Chhattisgarh', + // 'Goa', + // 'Gujarat', + // 'Haryana', + // 'Himachal Pradesh', + // 'Jammu and Kashmir', + // 'Jharkhand', + // 'Karnataka', + // 'Kerala', + // 'Madhya Pradesh', + // 'Maharashtra', + // 'Manipur', + // 'Meghalaya', + // 'Mizoram', + // 'Nagaland', + // 'Odisha', + // 'Punjab', + // 'Rajasthan', + // 'Sikkim', + // 'Tamil Nadu', + // 'Telangana', + // 'Tripura', + // 'Uttarakhand', + // 'Uttar Pradesh', + // 'West Bengal', + // 'Andaman and Nicobar Islands', + // 'Chandigarh', + // 'Dadra and Nagar Haveli', + // 'Daman and Diu', + // 'Delhi', + // 'Lakshadweep', + // 'Puducherry'], + Genders: ['Male', 'Female', 'Transgender', 'Prefer not to Say'], + titles: ['Mr.', 'Miss.', 'Mrs.', 'Dr.'] + // countries: ['India', 'Bharat', 'Hindustan'], + // cities: ['Mumbai', 'Pune', 'Aurangabad', 'Kolhapur', 'Chandrapur'] + } }, methods: { - onSubmit() { - this.$validator.validateAll(); + onSubmit () { + this.$validator.validateAll() if (this.errors === null) { - alert("ok"); + alert('ok') } }, - submitFile(event) { - this.files = event.target.files[0]; + submitFile (event) { + this.files = event.target.files[0] }, - verfiyOtp() { - // this.regotp.o_mobile=this.regUser.mobile + verfiyOtp () { + // this.regotp.o_mobile=this.regUser.mobile - console.log(this.regotp.o_mobile) + console.log(this.regotp.o_mobile) new MQL() - .setActivity("o.[rgstcotpverification]") + .setActivity('o.[rgstcotpverification]') .setData(this.regotp) .fetch() .then(rs => { - let res = rs.getActivity("rgstcotpverification", false); - if (rs.isValid("rgstcotpverification")) { - console.log(res) + let res = rs.getActivity('rgstcotpverification', false) + if (rs.isValid('rgstcotpverification')) { + // console.log(res) + alert('Congrats Mobile Verified') // this.regotp.o_mobile=this.regUser.mobile - } else { - rs.showErrorToast("rgstcotpverification"); + alert('Wrong OTP ') + rs.showErrorToast('rgstcotpverification') } - }); + }) }, - addUser() { + addUser () { new MQL() - .setActivity("o.[RegRGSTC1]") + .setActivity('o.[RegRGSTC1]') .setData(this.regUser) .fetch() .then(rs => { - let res = rs.getActivity("RegRGSTC1", true); - if (rs.isValid("RegRGSTC1")) { - alert("Entered successfully"); - this.regUser = {}; + let res = rs.getActivity('RegRGSTC1', true) + if (rs.isValid('RegRGSTC1')) { + alert('Entered successfully') + this.regUser = {} } else { - rs.showErrorToast("RegRGSTC1"); + rs.showErrorToast('RegRGSTC1') } - }); + }) }, - smssend() { - - // this.regotp.o_mobile=this.regUser.mobile - // console.log(this.regotp.o_mobile) + smssend () { + // this.regotp.o_mobile=this.regUser.mobile + // console.log(this.regotp.o_mobile) new MQL() - - .setActivity("o.[RGSTC Demo]") + + .setActivity('o.[RGSTC Demo]') .setData(this.regUser) .fetch() .then(rs => { - let res = rs.getActivity("RGSTC Demo", false); - if (rs.isValid("RGSTC Demo")) { - alert("Entered successfully"); + let res = rs.getActivity('RGSTC Demo', false) + if (rs.isValid('RGSTC Demo')) { + alert('Entered successfully') console.log(res) - this.regotp.o_mobile=this.regUser.mobile + this.regotp.o_mobile = this.regUser.mobile } else { - rs.showErrorToast("RGSTC Demo"); + rs.showErrorToast('RGSTC Demo') } - }); + }) }, - uploadFile() { - let formData = new FormData(); - formData.append("file", this.files); // append your file as 'file' in formdata. + uploadFile () { + let formData = new FormData() + formData.append('file', this.files) // append your file as 'file' in formdata. new MQLCdn() .enablePageLoader(true) .setFormData(formData) // (required) sets file data .setFileName(this.inputFileName) // (optional field) if you want to set name to file that is being uploaded - .setBucketKey("client2") // (required) valid bucket key need to set in which file will be uploaded. - .uploadFile("uploadtBtn") + .setBucketKey('client2') // (required) valid bucket key need to set in which file will be uploaded. + .uploadFile('uploadtBtn') .then(res => { // (required) this will upload file takes element id (optional param) which will be blocked while file upload.. if (res.isValid()) { - this.uploadedFilePath = res.uploadedFileURL(); // returns uploaded file url.. + this.uploadedFilePath = res.uploadedFileURL() // returns uploaded file url.. } else { - res.showErrorToast(); + res.showErrorToast() } - }); + }) } }, - created() { + created () { + const customMessage = { custom: { mobile: { - numeric: "validation.phoneNumeric", - min: "validation.phoneMinLength", - required: "validation.phoneRequired" + numeric: 'validation.phoneNumeric', + min: 'validation.phoneMinLength', + required: 'validation.phoneRequired' }, name: { - required: "validation.nameRequired", - alpha: "validation.nameAlpha" + required: 'validation.nameRequired', + alpha: 'validation.nameAlpha' }, email: { - required: "validation.emailRequired", - email: "validation.emailValid" + required: 'validation.emailRequired', + email: 'validation.emailValid' }, - + // fullname: { // required: "validation.fullnameRequired", // alpha_spaces: "validation.fullnameValidate", // alpha: "validation.alpha" // }, state: { - state: "validation.stateValid" + state: 'validation.stateValid' } } - }; - this.$validator.localize("en", customMessage); + } + this.$validator.localize('en', customMessage) } -}; +} </script> diff --git a/src/views/instituteReg.vue b/src/views/instituteReg.vue index 0ca0a56..64ddc8a 100644 --- a/src/views/instituteReg.vue +++ b/src/views/instituteReg.vue @@ -1,16 +1,28 @@ -/* eslint-disable semi */ -/* eslint-disable semi */ -/* eslint-disable semi */ + <template> - <div class="validator" id="app"> - <form class="ui form" @submit.prevent="onSubmit" /> + <div + class="validator" + id="app" + > + <form + class="ui form" + @submit.prevent="onSubmit" + /> <div class="container"> <div class="row left-content-center text-left"> <div class="col-sm-8"> - <form class="card p-4 mb-1" @submit.prevent="onSubmit"> - <h4 class="text-Left sb-3">Institute Registration</h4> - - <div class="form-group" :class="{error: errors.has('Institute name')}"> + <form + class="card p-4 mb-1" + @submit.prevent="onSubmit" + > + <h5 class="text-Left sb-3"> + Institute Registration + </h5> + + <div + class="form-group" + :class="{error: errors.has('Institute name')}" + > <label>Institute Name</label> <input type="text" @@ -20,14 +32,17 @@ placeholder="Institute Name" v-validate="'required'" v-model="regInst.institute_name" - /> + > <small class="form-text text-danger" v-if="errors.has('institute_name')" >{{ $t(errors.first('institute_name')) }}</small> </div> - <div class="form-group" :class="{error: errors.has('University Name')}"> + <div + class="form-group" + :class="{error: errors.has('University Name')}" + > <label>University Name</label> <input type="text" @@ -37,7 +52,7 @@ placeholder="University Name" v-validate="'required'" v-model="regInst.university_name" - /> + > <small class="form-text text-danger" v-if="errors.has('university_name')" @@ -46,10 +61,16 @@ <div class="field"> <label>Registered Date</label> - <datepicker v-model="regInst.date" placeholder="Select a date" /> + <datepicker + v-model="regInst.date" + placeholder="Select a date" + /> </div> - <br /> - <div class="form-group" :class="{error: errors.has('Registered Number')}"> + <br> + <div + class="form-group" + :class="{error: errors.has('Registered Number')}" + > <label>Registration Number</label> <input type="text" @@ -59,7 +80,7 @@ placeholder="Registration Number" v-validate="'required|numeric'" v-model="regInst.registration_number" - /> + > <small class="form-text text-danger" @@ -67,7 +88,10 @@ >{{ $t(errors.first('registration_number')) }}</small> </div> - <div class="form-group" :class="{error: errors.has('is_affiliated')}"> + <div + class="form-group" + :class="{error: errors.has('is_affiliated')}" + > <label>Whether Institute Affliated ?</label> <v-select :options="affiliations" @@ -83,7 +107,10 @@ >{{ $t(errors.first('is_affiliated')) }}</small> </div> - <div class="form-group" :class="{error: errors.has('department')}"> + <div + class="form-group" + :class="{error: errors.has('department')}" + > <label>Department Name</label> <input type="Department" @@ -93,14 +120,17 @@ placeholder="Department Name" v-validate="'required'" v-model="regInst.department" - /> + > <small class="form-text text-danger" v-if="errors.has('department')" >{{ $t(errors.first('department')) }}</small> </div> - <div class="form-group" :class="{error: errors.has('institute_address')}"> + <div + class="form-group" + :class="{error: errors.has('institute_address')}" + > <label>Address of Institute</label> <input type="address" @@ -110,16 +140,17 @@ placeholder="Address Please" v-validate="'required'" v-model="regInst.institute_address" - /> + > <small class="form-text text-danger" v-if="errors.has('institute_address')" >{{ $t(errors.first('institute_address')) }}</small> </div> - - -<div class="form-group" :class="{error: errors.has('country')}"> + <div + class="form-group" + :class="{error: errors.has('country')}" + > <label>Select Country</label> <v-select :options="countries" @@ -135,85 +166,88 @@ >{{ $t(errors.first('country')) }}</small> </div> - <div class="form-group" :class="{error: errors.has('state')}"> - <label>Select State</label> - <div v-if="regInst.country==='India'"> - <v-select - :options="India" - name="india" - v-model="regInst.state" - v-validate="'required'" - data-vv-validate-on="blur" - /> - - </div> - <div v-else> - <v-select - :options="Australia" - name="Aus" - v-model="regInst.state" - v-validate="'required'" - data-vv-validate-on="blur" - /> - - </div> + <div + class="form-group" + :class="{error: errors.has('state')}" + > + <label>Select State</label> + <div v-if="regInst.country==='India'"> + <v-select + :options="India" + name="india" + v-model="regInst.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> + <div v-else> + <v-select + :options="Australia" + name="Aus" + v-model="regInst.state" + v-validate="'required'" + data-vv-validate-on="blur" + /> + </div> <!-- {{ state }} --> <small class="form-text text-danger" v-if="errors.has('state')" >{{ $t(errors.first('state')) }}</small> - </div> - <div class="form-group" :class="{error: errors.has('city')}"> + <div + class="form-group" + :class="{error: errors.has('city')}" + > <label>Select City</label> <div v-if="regInst.state==='Goa'"> - <v-select - :options="Goa" - name="gcity" - v-model="regInst.city" - v-validate="'required'" - data-vv-validate-on="blur" - /> + <v-select + :options="Goa" + name="gcity" + v-model="regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> </div> - <div v-else-if="regInst.state==='Maharashtra'"> - <v-select - :options="Maharashtra" - name="gcity" - v-model="regInst.city" - v-validate="'required'" - data-vv-validate-on="blur" - /> + <div v-else-if="regInst.state==='Maharashtra'"> + <v-select + :options="Maharashtra" + name="gcity" + v-model="regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> </div> - <div v-else-if="regInst.state==='Sydney'"> - <v-select - :options="Sydney" - name="gcity" - v-model="regInst.city" - v-validate="'required'" - data-vv-validate-on="blur" - /> + <div v-else-if="regInst.state==='Sydney'"> + <v-select + :options="Sydney" + name="gcity" + v-model="regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> </div> - <div v-else-if="regInst.state==='Sydney3'"> - <v-select - :options="Sydney3" - name="gcity" - v-model="regInst.city" - v-validate="'required'" - data-vv-validate-on="blur" - /> + <div v-else-if="regInst.state==='Sydney3'"> + <v-select + :options="Sydney3" + name="gcity" + v-model="regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> </div> - <div v-else> - <v-select - :options="Haryana" - name="gcity" - v-model="regInst.city" - v-validate="'required'" - data-vv-validate-on="blur" - /> + <div v-else> + <v-select + :options="Haryana" + name="gcity" + v-model="regInst.city" + v-validate="'required'" + data-vv-validate-on="blur" + /> </div> <!-- {{ state }} --> <small @@ -222,13 +256,10 @@ >{{ $t(errors.first('city')) }}</small> </div> - - - - - - - <div class="form-group" :class="{error: errors.has('registered_landline')}"> + <div + class="form-group" + :class="{error: errors.has('registered_landline')}" + > <label>Phone no</label> <input type="landline" @@ -240,14 +271,17 @@ minlength="10" v-validate="'required|numeric'" v-model="regInst.registered_landline" - /> + > <small class="form-text text-danger" v-if="errors.has('registered_landline')" >{{ $t(errors.first('registered_landline')) }}</small> </div> - <div class="form-group" :class="{error: errors.has('Fax')}"> + <div + class="form-group" + :class="{error: errors.has('Fax')}" + > <label>Fax no</label> <input type="fax" @@ -258,7 +292,7 @@ maxlength="8" minlength="5" v-model="regInst.fax" - /> + > <small class="form-text text-danger" v-if="errors.has('fax')" @@ -276,7 +310,7 @@ placeholder="Email" v-validate="'required|email'" v-model="regInst.email" - /> + > <small id="emailHelp" class="form-text text-danger" @@ -286,8 +320,12 @@ <label> <b>Add CO-PI's</b> </label> - <div class="form-group" v-for="(input,k) in inputs" :key="k"> - <label>CO-PI No:- {{k+1}}</label> + <div + class="form-group" + v-for="(input,k) in inputs" + :key="k" + > + <label>CO-PI No:- {{ k+1 }}</label> <button class="form-control" /> <label>First Name</label> <input @@ -298,7 +336,7 @@ placeholder="First Name" v-validate="'required'" v-model="inputs[k].regCo.co_first_name" - /> + > <label>Middle Name</label> <input type="text" @@ -308,7 +346,7 @@ placeholder="Middle Name" v-validate="'required'" v-model="inputs[k].regCo.co_middle_name" - /> + > <label>Last Name</label> <input type="text" @@ -318,7 +356,7 @@ placeholder="Last Name" v-validate="'required'" v-model="inputs[k].regCo.co_last_name" - /> + > <label>Designation</label> <input type="text" @@ -328,7 +366,7 @@ placeholder="Designation" v-validate="'required'" v-model="inputs[k].regCo.co_designation" - /> + > <label>Co-PI's Organization/Institute Name</label> <input type="text" @@ -338,7 +376,7 @@ placeholder="Organization Name" v-validate="'required'" v-model="inputs[k].regCo.co_organization" - /> + > <label>Department</label> <input type="text" @@ -348,7 +386,7 @@ placeholder="Department" v-validate="'required'" v-model="inputs[k].regCo.co_department" - /> + > <label>Email</label> <input type="email" @@ -358,7 +396,7 @@ placeholder="Email" v-validate="'required|email'" v-model="inputs[k].regCo.co_email" - /> + > <label>Mobile</label> <input type="numeric" @@ -370,7 +408,7 @@ placeholder="Mobile Number" v-validate="'required | numeric'" v-model="inputs[k].regCo.co_mobile" - /> + > <label>Phone</label> <input type="numeric" @@ -382,16 +420,22 @@ placeholder="Landline Number" v-validate="'required | numeric'" v-model="inputs[k].regCo.co_landline" - /> + > <p> Have a cup of coffee: <font-awesome-icon icon="coffee" /> </p> <span> - <button @click="remove(k)" v-show="k || ( !k && inputs.length > 1)">âž–</button> - - <button @click="add(k)" v-show="k == inputs.length-1">âž•</button> + <button + @click="remove(k)" + v-show="k || ( !k && inputs.length > 1)" + >âž–</button> + + <button + @click="add(k)" + v-show="k == inputs.length-1" + >âž•</button> </span> </div> @@ -411,7 +455,6 @@ <!-- <div class="form-group mb-4 mt-2"> <h5>Upload Your Project Documents</h5> - <!-- <div class="form-group mb-4 mt-2"> <h5>Upload Your Resume</h5> @@ -425,8 +468,19 @@ </div>--> <div class="form-group text-right mb-0"> - <button type="button" class="btn btn-sm btn-outline-dark mr-2">Clear</button> - <button type="submit" class="btn btn-sm btn-primary" @click="addInstitute">Submit</button> + <button + type="button" + class="btn btn-sm btn-outline-dark mr-2" + > + Clear + </button> + <button + type="submit" + class="btn btn-sm btn-primary" + @click="addInstitute" + > + Submit + </button> </div> </form> </div> @@ -436,29 +490,29 @@ </template> <script> -import Vue from "vue"; -import vSelect from "vue-select"; -import VeeValidate from "vee-validate"; -import Datepicker from "vuejs-datepicker"; -import MQL from "@/plugins/mql.js"; -import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; -import { library } from "@fortawesome/fontawesome-svg-core"; -import { faCoffee } from "@fortawesome/free-solid-svg-icons"; +import Vue from 'vue' +import vSelect from 'vue-select' +import VeeValidate from 'vee-validate' +import Datepicker from 'vuejs-datepicker' +import MQL from '@/plugins/mql.js' +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' +import { library } from '@fortawesome/fontawesome-svg-core' +import { faCoffee } from '@fortawesome/free-solid-svg-icons' -Vue.use(VeeValidate, { events: "input|blur" }); -Vue.component("font-awesome-icon", FontAwesomeIcon); +Vue.use(VeeValidate, { events: 'input|blur' }) +Vue.component('font-awesome-icon', FontAwesomeIcon) -library.add(faCoffee); +library.add(faCoffee) export default { components: { Datepicker, vSelect, FontAwesomeIcon }, - data() { + data () { return { regCo: {}, regInst: {}, inputs: [ { - regInst:{}, + regInst: {}, regCo: { // co_first_name: "", // co_middle_name: "", @@ -473,91 +527,91 @@ export default { } } ], - India: ["Maharashtra", "Goa", "Haryana"], - Australia: ["Sydney", "Sydney3"], - Sydney:["Random City1","Random City2"], - Sydney3:["Ultra Random 1", "Las Vegas"], - Maharashtra:["Mumbai", "Pune", "Aurangabad", "jalna"], - Goa:["Madgaon", "Kolva", "old goa"], - Haryana:["Haryana City1", "Haryana City2", "Haryana City3"], - Genders: ["Male", "Female", "Transgender", "Prefer not to Say"], - titles: ["Mr.", "Miss.", "Mrs.", "Dr."], - countries: ["India","Australia"], - affiliations: ["Yes", "No"], + India: ['Maharashtra', 'Goa', 'Haryana'], + Australia: ['Sydney', 'Sydney3'], + Sydney: ['Random City1', 'Random City2'], + Sydney3: ['Ultra Random 1', 'Las Vegas'], + Maharashtra: ['Mumbai', 'Pune', 'Aurangabad', 'jalna'], + Goa: ['Madgaon', 'Kolva', 'old goa'], + Haryana: ['Haryana City1', 'Haryana City2', 'Haryana City3'], + Genders: ['Male', 'Female', 'Transgender', 'Prefer not to Say'], + titles: ['Mr.', 'Miss.', 'Mrs.', 'Dr.'], + countries: ['India', 'Australia'], + affiliations: ['Yes', 'No'], // titles: ["Mr.", "Miss.", "Mrs.", "Dr."], - + k: 1 - }; + } }, methods: { - add(index) { - this.inputs.push({ regCo: {} }); + add (index) { + this.inputs.push({ regCo: {} }) }, - remove(index) { - this.inputs.splice(index, 1); + remove (index) { + this.inputs.splice(index, 1) }, - onSubmit() { - this.$validator.validateAll(); + onSubmit () { + this.$validator.validateAll() if (this.errors === null) { - alert("ok"); + alert('ok') } }, - submitFile(event) { - this.files = event.target.files[0]; + submitFile (event) { + this.files = event.target.files[0] }, - addInstitute() { + addInstitute () { // var regAlpha = { regInst: this.regInst, inputs: this.inputs }; new MQL() - .setActivity("o.[RGSTC Demo]") + .setActivity('o.[RGSTC Demo]') .setData(inputs) // .setData(this.regCo) .fetch() .then(rs => { - let res = rs.getActivity("RGSTC Demo", true); - if (rs.isValid("RGSTC Demo")) { - alert("Entered successfully"); - this.regInst = {}; + let res = rs.getActivity('RGSTC Demo', true) + if (rs.isValid('RGSTC Demo')) { + alert('Entered successfully') + this.regInst = {} } else { - rs.showErrorToast("RGSTC Demo"); + rs.showErrorToast('RGSTC Demo') } - }); + }) }, - uploadFile() { - let formData = new FormData(); - formData.append("file", this.files); // append your file as 'file' in formdata. + uploadFile () { + let formData = new FormData() + formData.append('file', this.files) // append your file as 'file' in formdata. new MQLCdn() .enablePageLoader(true) .setFormData(formData) // (required) sets file data .setFileName(this.inputFileName) // (optional field) if you want to set name to file that is being uploaded - .setBucketKey("client2") // (required) valid bucket key need to set in which file will be uploaded. - .uploadFile("uploadtBtn") + .setBucketKey('client2') // (required) valid bucket key need to set in which file will be uploaded. + .uploadFile('uploadtBtn') .then(res => { // (required) this will upload file takes element id (optional param) which will be blocked while file upload.. if (res.isValid()) { - this.uploadedFilePath = res.uploadedFileURL(); // returns uploaded file url.. + this.uploadedFilePath = res.uploadedFileURL() // returns uploaded file url.. } else { - res.showErrorToast(); + res.showErrorToast() } - }); + }) } }, - created() { + created () { const customMessage = { custom: { mobile: { - numeric: "validation.phoneNumeric", - min: "validation.phoneMinLength", - required: "validation.phoneRequired" + numeric: 'validation.phoneNumeric', + min: 'validation.phoneMinLength', + required: 'validation.phoneRequired' }, name: { - required: "validation.nameRequired", - alpha: "validation.nameAlpha" + required: 'validation.nameRequired', + alpha: 'validation.nameAlpha' }, email: { - required: "validation.emailRequired", - email: "validation.emailValid" + required: 'validation.emailRequired', + email: 'validation.emailValid' }, // fullname: { // required: "validation.fullnameRequired", @@ -565,11 +619,11 @@ export default { // alpha: "validation.alpha" // }, state: { - state: "validation.stateValid" + state: 'validation.stateValid' } } - }; - this.$validator.localize("en", customMessage); + } + this.$validator.localize('en', customMessage) } -}; +} </script> diff --git a/src/views/roles.vue b/src/views/roles.vue index e6570b6..9f65b5b 100644 --- a/src/views/roles.vue +++ b/src/views/roles.vue @@ -5,87 +5,16 @@ <div class="row left-content-center text-left"> <div class="col-sm-8"> <form class="card p-4 mb-1" @submit.prevent="onSubmit"> - <h4 class="text-Left sb-3">User Creation</h4> - <!-- <div class="card p-2 mb-4"> - <h5><b>Name of Committe</b></h5> - <div class="form-group" > - <input + <h4 class="text-Left sb-3">Roles Addittion</h4> + <div class="card p-2 mb-4"> + <div class= "form-group"> + <input type="text" - placeholder="Users Name" - name="users name" + placeholder="Roles" autocomplete - v-model="users.name" - v-validate="'required | alpha'" - data-vv-validate-on="blur" - /> - </div> - </div> --> - <div class="card p-2 mb-4"> - <!-- <h5> - <b>Users</b> - </h5> - --> - <div class="form-group"> - - <label><b>Name</b></label><br> - <input - type="text" - placeholder="First Name" - autocomplete - name="First Name" - v-model="users.firstName" - v-validate="'required | alpha'" - data-vv-validate-on="blur" - /> - <input - type="text" - placeholder="Middle Name" - autocomplete - name="Middle Name" - v-model="users.middleName" - - v-validate="'required | alpha'" - data-vv-validate-on="blur" - /> - <input - type="text" - placeholder="Last Name" - autocomplete - name="Last Name" - v-model="users.lastName" - v-validate="'required'" - data-vv-validate-on="blur" - /> - - - - </div> - <div class="form-group"> - <label><b>Email Id</b></label> - <br> - <input - type="email" - placeholder="Your Email Will Username" - autocomplete - name="email" - v-model="users.email_id" - v-validate="'required | email'" - /> - <!--             - <button type="submit" class="btn btn-sm btn-primary" @click="sendPass">Send Password</button> --> - </div> - - - <div class="form-group"> - <label><b>Roles</b></label> - <br> - <input - type="text" - placeholder="Member Type" - name="Member Type" - autocomplete - v-model="users.memberType" - v-validate="'required | text'" + name="role" + v-model="roles.role" + v-validate= "'required | text'" /> </div> @@ -94,7 +23,7 @@ <div class="form-group text-right mb-0"> <button type="button" class="btn btn-sm btn-outline-dark mr-2" @click="clear">Clear</button> - <button type="submit" class="btn btn-sm btn-primary" @click="addusers">Submit</button> + <button type="submit" class="btn btn-sm btn-primary" @click="rolesadd">Add Role</button> </div> </form> </div> @@ -119,28 +48,14 @@ export default { components: { vSelect, Datepicker, VueTimepicker }, data() { return { - // k: 0, - // disabledDates: { - // to: new Date(Date.now() - 8640000) - // }, - users: { - - }, - roles:["Head","Refree","Co-Head","Investigator","",""] + roles:{ + role:"" + } + }; - }, + +}, methods: { - doSelection: function(payload) { - console.log(payload); - this.disabledDates = { to: new Date(new Date(payload) - 8640000) }; - }, - - add(index) { - this.users.inputs.push({ users: {} }); - }, - remove(index) { - this.users.inputs.splice(index, 1); - }, onSubmit() { this.$validator.validateAll(); if (this.errors === null) { @@ -148,28 +63,25 @@ export default { } }, clear() { - this.users = { - users: { - firstName: "", - middleName: "", - lastName: "", - designation: "", - memberType: "" + this.roles = { + roles:{ + role:"" } + }; }, - addusers() { + rolesadd() { new MQL() - .setActivity("o.[CommitteAddition]") - .setData(this.users) + .setActivity("o.[UserRoles]") + .setData(this.roles) .fetch() .then(rs => { - let res = rs.getActivity("CommitteAddition", false); - if (rs.isValid("CommitteAddition")) { - alert("Users Addded Sucessfully"); - this.users = {}; + let res = rs.getActivity("UserRoles", false); + if (rs.isValid("UserRoles")) { + alert("roles Addded Sucessfully"); + this.roles = {}; } else { - rs.showErrorToast("CommitteAddition"); + rs.showErrorToast("UserRoles"); } }); } -- GitLab