add sutudent details

This commit is contained in:
resicovenba 2017-11-27 18:11:24 +05:30
parent 318c5c4fc7
commit 7f9c940dcf
6 changed files with 383 additions and 127 deletions

View File

@ -100,6 +100,7 @@ defined('LEAD_DETAILS') OR define('LEAD_DETAILS','T_Lead_Details');
defined('LEAD_TRACKING') OR define('LEAD_TRACKING','T_Lead_Tracking');
defined('LEAD_TRACKING_FOLLOWUP') OR define('LEAD_TRACKING_FOLLOWUP','T_Lead_Tracking_Followup');
defined('PICK_LIST_DETAILS') OR define('PICK_LIST_DETAILS','T_PickListDetails');
defined('BATCH') OR define('BATCH','T_BatchMaster');
//end of database table name

View File

@ -93,8 +93,9 @@ $route['updateActivityStatus'] = 'University_Controller/updateActivityStatus';
$route['changePassword'] = 'Login_Controller/changePassword';
// student
$route['insertStudent'] = 'Student_Controller/addStudent';
$route['getCourseBatchForUniv'] = 'Student_Controller/getCourseBatch';

View File

@ -0,0 +1,112 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
/** @noinspection PhpIncludeInspection */
require_once APPPATH . '/libraries/REST_Controller.php';
/**
* This is an example of a few basic user interaction methods you could use
* all done with a hardcoded array
*
* @package CodeIgniter
* @subpackage Rest Server
* @category Controller
* @author
* @license MIT
* @link
*/
class Student_Controller extends REST_Controller {
/*
* get student details
* params:
* created by kdk
* */
function __construct()
{
// Construct the parent class
parent::__construct();
// Configure limits on our controller methods
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
$this->methods['addStudent_post']['limit'] = 100;
// load the employee model
$this->load->model('Student_model', 'student_model');
}
public function getCourseBatch_post() {
$data = $this->post('data');
$getCourseBatchListDetails = $this->student_model->get_courseBatch_list($data);// Check if the employee exist
if ($getCourseBatchListDetails)
{
$getCourseBatchListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getCourseBatchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
// add student
public function addStudent_post() {
$data = $this->post('data');
$createdBy = $this->post('createdBy');
$createdBranch = $this->post('loginBranch');
$req['Firstname'] = $data['firstname'];
$req['Lastname'] = $data['lastname'];
$req['Fathername'] = $data['fathername'];
$req['EmailID'] = $data['emailId'];
$req['MotherName'] = $data['mothername'];
$req['MobileNumber'] = $data['primaryPhone'];
$req['AlternateNumber'] = $data['secondaryPhone'];
$req['Gender'] = $data['gender'];
$req['DOB'] = $data['dateofbirth'];
$req['PresentAddress'] = $data['address2'];
$req['PermanentAddress'] = $data['address1'];
$req['AadharNumber'] = $data['aadharNumber'];
$req['OtherID'] = $data['otherId'];
$req['OtherIDDetails'] = $data['otherIdDetails'];
$req['Caste'] = $data['caste'];
$req['Category'] = $data['category'];
$req['Religion'] = $data['religion'];
$req['Nationality'] = $data['nationality'];
$req['Occupation'] = $data['occupation'];
$req['Designation'] = $data['designation'];
$req['Companyname'] = $data['companyname'];
$req['ReferredBy'] = $data['referredby'];
$req['ReferersMobileNumber'] = $data['referredmobilenumber'];
$req['PreQualification'] = $data['prequalification'];
$req['IsActive'] = $data['switchsetting'];
$req['CreatedBy'] = $createdBy;
$date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date;
print_r($req);exit();
$studentAdd = $this->student_model->add_student( $req );// Check if the employee exist
if ($studentAdd)
{
$studentAdd['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
}

View File

@ -0,0 +1,86 @@
<?php
/**
* Date: 11/9/17
* Time: 5:28 PM
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Student_model extends CI_Model
{
/*
* student details
*
* created by kdk
* */
//get course for university
public function get_courseBatch_list($univId) {
$this->db->select('C.CourseID, C.CourseName');
$this->db->from(COURSE.' as C');
$this->db->where('UniversityID',$univId);
$this->db->where('IsActive',1);
$courseDetails = $this->db->get();
if($courseDetails->result()){
$this->db->select('B.BatchCode, B.BatchName');
$this->db->from(BATCH.' as B');
$this->db->where('UniversityID',$univId);
$this->db->where('IsActive',1);
$batchDetails = $this->db->get();
if( $batchDetails->result()) {
$result['courseStatus'] = true;
$result['course_details'] = $courseDetails->result();
$result['batch_details'] = $batchDetails->result();
} else {
$result['courseStatus'] = false;
$result['message'] = "No records found!";
}
}
else {
$result['courseStatus'] = false;
$result['message'] = "No records found!";
}
return $result;
}
// add student
public function add_employee($empArr, $createdBy)
{
$this->db->insert(STAFF, $empArr);
if ($this->db->affected_rows() == '1') {
$branchArr['StaffID'] = $empArr['StaffID'];
$branchArr['BranchCode'] = $empArr['BranchCode'];
$branchArr['IsActive'] = $empArr['IsActive'];
$branchArr['CreatedBy'] = $createdBy;
$this->db->insert(STAFF_BRANCH, $branchArr);
if ($this->db->affected_rows() == '1') {
$loginArr['StaffID'] = $empArr['StaffID'];
$loginArr['ListCode'] = $empArr['ListCode'];
$loginArr['MobileNumber'] = $empArr['MobileNumber'];
$loginArr['EmailId'] = $empArr['EmailID'];
$loginArr['IsActive'] = $empArr['IsActive'];
$loginArr['CreatedBy'] = $createdBy;
$loginArr['Password'] = ENCR_PASSWORD;
$this->db->insert(LOGIN, $loginArr);
if ($this->db->affected_rows() == '1') {
$result['addEmpStatus'] = true;
$result['message'] = "Successfully employee details added";
} else {
$result['addEmpStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
} else {
$result['addEmpStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
} else {
$result['addEmpStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
return $result;
}
}

View File

@ -32,16 +32,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
'occupation': '',
'designation': '',
'companyname': '',
'referredby': '',
'referredby': '',
'referredmobilenumber': '',
'switchsetting': true,
};
var data = '';
$scope.roleDetails = '';
$scope.branchDetails = '';
$scope.employeeDetails = '';
$scope.loader = false;
$scope.emptyData;
// 2017-11-23T00:00:00+0530
// sorting function for table params
$scope.sort = function (keyname) {
@ -57,6 +52,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
$scope.init = function () {
if (localDetail != null) {
$scope.currentDate = new Date();
$scope.getUniversityList();
// $scope.currentPage = 1;
} else {
}
@ -70,27 +67,71 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
$scope.setEditBranchId = function (id) {
$scope.getEmpBranchDetails(id);
$scope.editBranchId = id;
$scope.editId = -1;
$scope.branchEditLoading = true;
}
$scope.cancel = function () {
$scope.getEmployeeList();
$scope.editId = -1;
$scope.editBranchId = -1;
}
$scope.empBranchDetails = '';
$scope.empRoleDetail = '';
$scope.universityData = '';
// add empolyee
$scope.getUniversityList = function () {
var empListreq = {
method: 'POST',
url: apiPoint.url + 'getUniversity/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: localDetails
}
};
$http(empListreq).then(function (response) {
if (response.data.univList) {
$scope.universityData = response.data.university_details;
} else {
}
});
}
$scope.courseData = '';
$scope.batchData = '';
$scope.courseLoading = false;
$scope.onSlecetUniv = function() {
$scope.myModel.course= '';
$scope.myModel.batch= '';
$scope.courseLoading = true;
var univListreq = {
method: 'POST',
url: apiPoint.url + 'getCourseBatchForUniv/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: $scope.myModel.university
}
};
$http(univListreq).then(function (response) {
if (response.data.courseStatus) {
$scope.courseLoading = false;
$scope.courseData = response.data.course_details;
$scope.batchData = response.data.batch_details;
} else {
$scope.courseLoading = false;
}
});
}
// add student
$scope.studentFORM = {
submit: function (form, myModel) {
var firstError = null;
if (form.$invalid) {
alert('error');
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
@ -105,30 +146,29 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
alert('ok');
// var formate = "dd-MM-yyyy";
// $scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
// $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
// $scope.myModel.dateofjoining = $filter('date')(new Date($scope.myModel.dateofjoining), formate);
// var req = {
// method: 'POST',
// url: apiPoint.url + 'insertEmployee/',
// headers: {
// 'Content-Type': 'application/json'
// },
// data: {
// data: $scope.myModel,
// createdBy: localDetails.localUserID,
// }
// };
// $http(req).then(function (response) {
// if (response.data.addEmpStatus == true) {
// swal("Success!", response.data.message, "success");
// $state.go($state.current, {}, { reload: true });
// } else {
// swal("Failed!", response.data.message, "error");
// }
// });
var formate = "dd-MM-yyyy";
$scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
var req = {
method: 'POST',
url: apiPoint.url + 'insertStudent/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: $scope.myModel,
loginBranch: localDetails.localBranchID,
createdBy: localDetails.localUserID,
}
};
$http(req).then(function (response) {
if (response.data.addEmpStatus == true) {
swal("Success!", response.data.message, "success");
$state.go($state.current, {}, { reload: true });
} else {
swal("Failed!", response.data.message, "error");
}
});
}
},
reset: function (form) {

View File

@ -116,37 +116,31 @@
<legend>
Personal Details
</legend>
<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.primaryPhone.$dirty && Form.primaryPhone.$invalid, 'has-success':Form.primaryPhone.$valid}">
<label>
Mobile Number <span
class="symbol required"></span>
</label>
<input type="text" name="primaryPhone" tabindex="7" placeholder="Enter Mobile Number" class="form-control" ng-model="myModel.primaryPhone"
<input type="text" name="primaryPhone" tabindex="1" placeholder="Enter Mobile Number" class="form-control" ng-model="myModel.primaryPhone"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" ng-blur='checkMobileExist()'
required/>
<span class="error text-small block" ng-if="Form.primaryPhone.$dirty && Form.primaryPhone.$invalid" ng-hide="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Mobile Number is required.</span>
<span class="error text-small block" ng-if="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Enter a Valid Phone Number</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.firstname.$dirty && Form.firstname.$invalid, 'has-success':Form.firstname.$valid}">
<label>
First Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter First Name" tabindex="2" class="form-control" name="firstname" ng-model="myModel.firstname"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.firstname.$dirty && Form.firstname.$error.required">First Name required</span>
<span class="error text-small block" ng-if="Form.firstname.$dirty && Form.firstname.$error.pattern">Invalid First Name </span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.lastname.$dirty && Form.lastname.$invalid, 'has-success':Form.lastname.$valid}">
<label>
Last Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Last Name" tabindex="3" class="form-control" name="lastname" ng-model="myModel.lastname"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.lastname.$dirty && Form.lastname.$error.required">Last Name required</span>
@ -158,13 +152,11 @@
<label>
Father Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Father Name" tabindex="4" class="form-control" name="fathername" ng-model="myModel.fathername"
ng-pattern="/^[a-zA-Z.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.fathername.$dirty && Form.fathername.$error.required">Father Name required</span>
<span class="error text-small block" ng-if="Form.fathername.$dirty && Form.fathername.$error.pattern">Invalid Father Name </span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.mothername.$dirty && Form.mothername.$invalid, 'has-success':Form.mothername.$valid}">
<label>
Mother Name <span class="symbol required"></span>
@ -172,10 +164,9 @@
<input type="text" placeholder="Enter Mother Name" tabindex="5" class="form-control" name="mothername" ng-model="myModel.mothername"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.mothername.$dirty && Form.mothername.$error.required">Mother Name required</span>
<span class="error text-small block" ng-if="Form.mothername.$dirty && Form.mothername.$error.required">Mother Name required</span>
<span class="error text-small block" ng-if="Form.mothername.$dirty && Form.mothername.$error.pattern">Invalid Last Name </span>
</div>
<div class=" col-md-4 form-group" ng-class="{'has-error':Form.emailId.$dirty && Form.emailId.$invalid, 'has-success':Form.emailId.$valid}">
<label>
Email ID <span class="symbol required"></span>
@ -187,12 +178,11 @@
</div>
</div>
<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.secondaryPhone.$dirty && Form.secondaryPhone.$invalid, 'has-success':Form.secondaryPhone.$valid}">
<label class="control-label">
Alternate Mobile Number <span class="symbol required"></span>
</label>
<input type="text" name="secondaryPhone" tabindex="8" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="myModel.secondaryPhone"
<input type="text" name="secondaryPhone" tabindex="7" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="myModel.secondaryPhone"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" required/>
<span class="error text-small block" ng-if="Form.secondaryPhone.$dirty && Form.secondaryPhone.$invalid" ng-hide="Form.secondaryPhone.$error.maxlength || Form.secondaryPhone.$error.minlength || Form.secondaryPhone.$error.pattern">Alternate Mobile Number is required.</span>
<span class="error text-small block" ng-if="Form.secondaryPhone.$error.maxlength || Form.secondaryPhone.$error.minlength || Form.secondaryPhone.$error.pattern">Enter a Valid Phone Number</span>
@ -204,7 +194,7 @@
Date Of Birth <span
class="symbol required"></span>
</label>
<input type="text" tabindex="9" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofbirth"
<input type="text" tabindex="8" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofbirth"
is-open="startOpen" ng-init="startOpen = false" name="dateofbirth" datepicker-options="dateOptions"
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" max-date="currentDate" />
@ -219,7 +209,7 @@
Gender <span class="symbol required"></span>
</label>
<div class="clip-radio radio-primary">
<input type="radio" tabindex="10" id="female" name="gender" value="female" ng-model="myModel.gender" required>
<input type="radio" tabindex="9" id="female" name="gender" value="female" ng-model="myModel.gender" required>
<label for="female">
Female
</label>
@ -238,14 +228,14 @@
<label>
Permanent Address
</label>
<textarea placeholder="Enter Permanent Address" tabindex="15" class="form-control textdsc" name="address1" ng-model="myModel.address1"></textarea>
<textarea placeholder="Enter Permanent Address" tabindex="10" class="form-control textdsc" name="address1" ng-model="myModel.address1"></textarea>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permanent Address is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address2.$dirty && Form.address2.$invalid}">
<label>
Current Address
</label>
<textarea placeholder="Enter Current Address" tabindex="16" class="form-control textdsc" name="address2" ng-model="myModel.address2"></textarea>
<textarea placeholder="Enter Current Address" tabindex="11" class="form-control textdsc" name="address2" ng-model="myModel.address2"></textarea>
<span class="error text-small block" ng-if="Form.address2.$dirty && Form.address2.$invalid">Current Address is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.aadharNumber.$dirty && Form.aadharNumber.$invalid, 'has-success':Form.aadharNumber.$valid}">
@ -291,8 +281,8 @@
Caste
</label>
<input type="text" placeholder="Enter Caste" tabindex="4" class="form-control" name="caste" ng-model="myModel.caste"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<input type="text" placeholder="Enter Caste" tabindex="15" class="form-control" name="caste" ng-model="myModel.caste" ng-pattern="/^[a-zA-Z.\s]*$/"
/>
<span class="error text-small block" ng-if="Form.caste.$dirty && Form.caste.$error.pattern">Invalid Caste Name </span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.category.$dirty && Form.category.$invalid}">
@ -300,8 +290,8 @@
Category
</label>
<input type="text" placeholder="Enter Category" tabindex="4" class="form-control" name="category" ng-model="myModel.category"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<input type="text" placeholder="Enter Category" tabindex="16" class="form-control" name="category" ng-model="myModel.category"
/>
<span class="error text-small block" ng-if="Form.category.$dirty && Form.category.$error.pattern">Invalid Category Name </span>
</div>
</div>
@ -312,7 +302,7 @@
Religion
</label>
<input type="text" placeholder="Enter Religion" tabindex="4" class="form-control" name="religion" ng-model="myModel.religion"
<input type="text" placeholder="Enter Religion" tabindex="17" class="form-control" name="religion" ng-model="myModel.religion"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.religion.$dirty && Form.religion.$error.pattern">Invalid Religion Name </span>
</div>
@ -321,7 +311,7 @@
Nationality
</label>
<input type="text" placeholder="Enter Nationality" tabindex="4" class="form-control" name="nationality" ng-model="myModel.nationality"
<input type="text" placeholder="Enter Nationality" tabindex="18" class="form-control" name="nationality" ng-model="myModel.nationality"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.nationality.$dirty && Form.nationality.$error.pattern">Invalid Nationality Name </span>
</div>
@ -330,8 +320,8 @@
Pre Qualification
</label>
<input type="text" placeholder="Enter Qualification" tabindex="11" class="form-control" name="qualificaion" ng-model="myModel.prequalification"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<input type="text" placeholder="Enter Qualification" tabindex="19" class="form-control" name="qualificaion" ng-model="myModel.prequalification"
/>
<span class="error text-small block" ng-if="Form.qualificaion.$dirty && Form.qualificaion.$error.pattern">Enter a Valid Qualification</span>
</div>
</div>
@ -342,7 +332,7 @@
Occupation
</label>
<input type="text" placeholder="Enter Occupation" tabindex="4" class="form-control" name="occupation" ng-model="myModel.occupation"
<input type="text" placeholder="Enter Occupation" tabindex="20" class="form-control" name="occupation" ng-model="myModel.occupation"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.occupation.$dirty && Form.occupation.$error.pattern">Invalid Occupation </span>
</div>
@ -351,7 +341,7 @@
Designation
</label>
<input type="text" placeholder="Enter Designation" tabindex="4" class="form-control" name="designation" ng-model="myModel.designation"
<input type="text" placeholder="Enter Designation" tabindex="21" class="form-control" name="designation" ng-model="myModel.designation"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.designation.$dirty && Form.designation.$error.pattern">Invalid Designation </span>
</div>
@ -360,8 +350,8 @@
Company Name
</label>
<input type="text" placeholder="Enter Company Name" tabindex="4" class="form-control" name="companyname" ng-model="myModel.companyname"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<input type="text" placeholder="Enter Company Name" tabindex="22" class="form-control" name="companyname" ng-model="myModel.companyname"
/>
<span class="error text-small block" ng-if="Form.companyname.$dirty && Form.companyname.$error.pattern">Invalid Company </span>
</div>
</div>
@ -371,102 +361,128 @@
Referred By
</label>
<input type="text" placeholder="Enter Refer's Name" tabindex="4" class="form-control" name="referredby" ng-model="myModel.referredby"
<input type="text" placeholder="Enter Refer's Name" tabindex="23" class="form-control" name="referredby" ng-model="myModel.referredby"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.referredby.$dirty && Form.referredby.$error.pattern">Invalid Referred By </span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.referredmobilenumber.$dirty && Form.referredmobilenumber.$invalid}">
<label>
Refer's Mobile No
Refer's Mobile Number
</label>
<input type="text" name="referredmobilenumber" tabindex="8" placeholder="Enter Refer's Mobile No" class="form-control" ng-model="myModel.referredmobilenumber"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" />
<input type="text" name="referredmobilenumber" tabindex="24" placeholder="Enter Refer's Mobile Number" class="form-control"
ng-model="myModel.referredmobilenumber" ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/"
/>
<span class="error text-small block" ng-if="Form.referredmobilenumber.$dirty && Form.referredmobilenumber.$invalid" ng-hide="Form.referredmobilenumber.$error.maxlength || Form.referredmobilenumber.$error.minlength || Form.referredmobilenumber.$error.pattern">Refer's Mobile Number is required.</span>
<span class="error text-small block" ng-if="Form.referredmobilenumber.$error.maxlength || Form.referredmobilenumber.$error.minlength || Form.referredmobilenumber.$error.pattern">Enter a Valid Phone Number</span>
</div>
</div>
<pre> {{ myModel | json }}</pre>
<div class="row">
<div class="col-md-3">
<label>
Active/De-Active
</label>
<div ng-switch="myModel.switchsetting">
<div ng-switch-when="true">
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = true" class="green"></switch>
</div>
<div ng-switch-when="false">
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = false" class="green"></switch>
</div>
<div ng-switch-default>
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = true" class="green"></switch>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>
Course Details
</legend>
<!--<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.homeBranch.$dirty && Form.homeBranch.$invalid, 'has-success':Form.homeBranch.$valid}">
<div class="row">
<div class="col-md-3 form-group" ng-class="{'has-error':Form.university.$dirty && Form.university.$invalid, 'has-success':Form.university.$valid}">
<label for="form-field-select-2">
Home Branch <span class="symbol required"></span>
University <span class="symbol required"></span>
</label>
<select class="form-control" tabindex="17" class="cs-select cs-skin-elastic" name="homeBranch" ng-model="myModel.homeBranch"
required>
<option value="" disabled selected>Select Home Branch</option>
<option ng-repeat="item in branchDetails" value="{{item.BranchCode}}">{{item.BranchName}}</option>
<select class="form-control" tabindex="25" class="cs-select cs-skin-elastic" name="university" ng-model="myModel.university"
ng-change="onSlecetUniv()" required>
<option value="" disabled selected>Select University</option>
<option ng-repeat="item in universityData" value="{{item.UniversityID}}">{{item.UniversityName}}</option>
</select>
<span class="error text-small block" ng-if="Form.homeBranch.$dirty && Form.homeBranch.$error.required">Home Branch is Required</span>
<span class="error text-small block" ng-if="Form.university.$dirty && Form.university.$error.required">University is Required</span>
</div>
<div data-ng-controller="DatepickerDemoCtrl">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.dateofjoining.$dirty && Form.dateofjoining.$invalid, 'has-success':Form.dateofjoining.$valid}">
<label>
Date Of Joining <span class="symbol required"></span>
<div class="col-md-3 form-group" ng-class="{'has-error':Form.course.$dirty && Form.course.$invalid, 'has-success':Form.course.$valid}">
<label>
Course <span class="symbol required"></span>
</label>
<input type="text" tabindex="18" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofjoining"
<div ng-if="courseLoading == true">
<span style="padding: auto 0; color: #007AFF; font-weight: bold;">fetching...</span>
</div>
<div ng-if="courseLoading == false">
<select class="form-control" tabindex="26" name="course" ng-model="myModel.course" class="cs-select cs-skin-elastic" required>
<option value="" disabled selected>Select Course</option>
<option ng-repeat="item in courseData" value="{{item.CourseID}}">{{item.CourseName}}</option>
</select>
</div>
<span class="error text-small block" ng-if="Form.course.$dirty && Form.course.$error.required">Course is required</span>
</div>
<div class="col-md-3 form-group" ng-class="{'has-error':Form.batch.$dirty && Form.batch.$invalid, 'has-success':Form.batch.$valid}">
<label>
Batch <span class="symbol required"></span>
</label>
<div ng-if="courseLoading == true">
<span style="padding: auto 0; color: #007AFF; font-weight: bold;">fetching...</span>
</div>
<div ng-if="courseLoading == false">
<select class="form-control" tabindex="26" name="batch" ng-model="myModel.batch" class="cs-select cs-skin-elastic" required>
<option value="" disabled selected>Select Batch</option>
<option ng-repeat="item in batchData" value="{{item.BatchCode}}">{{item.BatchName}}</option>
</select>
</div>
<span class="error text-small block" ng-if="Form.batch.$dirty && Form.batch.$error.required">Batch is required</span>
</div>
<div class="col-md-3 form-group" ng-class="{'has-error':Form.dateofjoining.$dirty && Form.dateofjoining.$invalid, 'has-success':Form.dateofjoining.$valid}">
<label>
Date of Joining <span class="symbol required"></span>
</label>
<input type="text" tabindex="27" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofjoining"
is-open="startOpen" ng-init="startOpen = false" name="dateofjoining" datepicker-options="dateOptions"
placeholder="Select Date of Joining" close-text="Close" required="required"
/>
<span class="error text-small block" ng-if="Form.dateofjoining.$dirty && Form.dateofjoining.$error.required">Date of Joining required</span>
</div>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.role.$dirty && Form.role.$invalid, 'has-success':Form.role.$valid}">
<label>
Role <span class="symbol required"></span>
</label>
<select class="form-control" tabindex="19" name="role" ng-model="myModel.role" class="cs-select cs-skin-elastic" required>
<option value="" disabled selected>Select Role</option>
<option ng-repeat="item in roleDetails" value="{{item.ListCode}}">{{item.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.role.$dirty && Form.role.$error.required">Role is required</span>
</div>
</div>-->
<div class="row">
<div class="col-md-4">
<label>
Active/De-Active
</label>
<div ng-switch="myModel.switchsetting">
<div ng-switch-when="true">
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = true" class="green"></switch>
</div>
<div ng-switch-when="false">
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = false" class="green"></switch>
</div>
<div ng-switch-default>
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = true" class="green"></switch>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="submit" tabindex="21" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in">
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="submit" tabindex="30" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in">
Submit
</button>
<button type="reset" tabindex="22" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.reset(Form)">
<button type="reset" tabindex="31" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.reset(Form)">
Reset
</button>
</div>
</div>
</div>
</div>
</fieldset>
<pre> {{ myModel | json }}</pre>
</div>
</div>
</div>
</form>
</div>
</div>
</tab>
</tabset>
</div>
</div>
</div>
<!-- end: LIST GROUP -->
<!-- end: LIST GROUP -->