| Server IP : 64.202.187.69 / Your IP : 216.73.217.33 Web Server : Apache System : Linux 69.187.202.64.host.secureserver.net 3.10.0-1160.144.1.el7.tuxcare.els6.x86_64 #1 SMP Fri May 29 16:22:24 UTC 2026 x86_64 User : transmarket ( 1001) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/transmarket/testadministrator/bak/ |
Upload File : |
<?php
// Detail page of fund request
include 'header.php';
$userId = 0;
if (isset($_GET['id'])) {
$userId = $_GET['id'];
} else {
// header("Location: users.php");
}
?>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<input type="hidden" id="userId" value="<?php echo $userId; ?>"/>
<div class="row">
<div class="col-lg-12">
<div class="card card-tab">
<div class="display-flex index-filter">
<p><button type="button" disabled class="btn btn-primary btn-excel mt-10 mr-10">Export Marketplace Suggestions</button></p>
</div>
<div class="card-header" style="overflow-x:hidden;overflow-y: hidden;">
<ul class="nav nav-tabs translator-page" style="overflow-x: auto;">
<li role="tab1" class="active">
<a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab">Profile</a>
</li>
<li role="tab2" >
<a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab">Reputation Suggestions</a>
</li>
<li role="tab3">
<a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab">Reputation Voting</a>
</li>
<li role="tab9">
<a href="#tab9" aria-controls="tab9" role="tab" data-toggle="tab">Reputation Skipped Voting</a>
</li>
<li role="tab4" >
<a href="#tab4" aria-controls="tab4" role="tab" data-toggle="tab">Marketplace Suggestions</a>
</li>
<li role="tab5">
<a href="#tab5" aria-controls="tab5" role="tab" data-toggle="tab">Marketplace Voting</a>
</li>
<li role="tab6">
<a href="#tab6" aria-controls="tab6" role="tab" data-toggle="tab">Claim History</a>
</li>
<li role="tab7">
<a href="#tab7" aria-controls="tab7" role="tab" data-toggle="tab">Proof Alignment</a>
</li>
<?php
/*
<li role="tab5">
<a href="#tab5" aria-controls="tab5" role="tab" data-toggle="tab">Skipped Sugesstion</a>
</li>
<li role="tab6">
<a href="#tab6" aria-controls="tab6" role="tab" data-toggle="tab">Skipped Votes</a>
</li>
*/ ?>
</ul>
</div>
<div class="card-body no-padding tab-content">
<div role="tabpanel" class="tab-pane active" id="tab1">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="section">
<div class="section-body">
<div class="col-sm-12 col-md-12">
<p class="section-title">User Profile</p>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<label class="col-md-3 control-label">Name </label>
<div class="col-md-9">
<input type="text" class="form-control" id="name" placeholder="" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<label class="col-md-3 control-label">Email </label>
<div class="col-md-9">
<input type="text" class="form-control" id="email" placeholder="">
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">NEO digital wallet</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="neo_address" placeholder="" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Language</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="language_id" placeholder="" readonly>
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Cell Phone Number</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="phone" placeholder="" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Country</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="country_id" placeholder="" readonly>
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Is NEO Verified?</label>
</div>
<div class="col-md-9" id="is_neo_verified">
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Is Email Verified?</label>
</div>
<div class="col-md-9" id="is_email_verified">
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">TMN Credits</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="tmn_credits" placeholder="" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Signup Date</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="created_at" placeholder="" readonly>
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<label class="col-md-3 control-label">Marketplace Access</label>
<div class="col-md-9 single-page-switch">
<label class="switch">
<input type="checkbox" class="trigger-switch">
<span class="slider round"></span>
</label>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<label class="col-md-3 control-label">Proof Alignment Access</label>
<div class="col-md-9 single-page-switch">
<label class="switch">
<input type="checkbox" class="trigger-switchA">
<span class="slider round"></span>
</label>
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<label class="col-md-3 control-label">Request Marketplace Access</label>
<div class="col-md-9" id="is_request_marketplace_access">
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">User Level</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="user_level" placeholder="" readonly>
</div>
</div>
</div>
<div class="row-slice mb-3">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Suggestions Success Ratio (%)</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="suggestions_success_ratio" placeholder="" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Voting Success Ratio (%)</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="voting_success_ratio" placeholder="" readonly>
</div>
</div>
</div>
<div id="test_score_div" class="row-slice mb-3" style="display: none;">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Test Voting Level</label>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="test_voting_level" placeholder="" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Test Score (Test voting level - 1, 2) </label>
</div>
<div class="col-md-3">
<input type="text" class="form-control" id="test_score" placeholder="" readonly>
</div>
<div class="col-md-6">
<a href='<?php echo "test-voting-details.php?id={$userId}"; ?>' target="_blank">View Test Result</a>
</div>
</div>
</div>
<div id="work_experience_assessment_score_div" class="row-slice mb-3 work-experience-assessment-info-div" style="display: none;">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Work experience assessment score</label>
</div>
<div class="col-md-9">
<span id="work_experience_assessment_score">0</span> out of 50 winning suggestions
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Test Score (Test voting level - 6, 7) </label>
</div>
<div class="col-md-3">
<input type="text" class="form-control" id="test_score2" placeholder="" readonly>
</div>
<div class="col-md-6">
<a href='<?php echo "test-voting-details.php?id={$userId}"; ?>' target="_blank">View Test Result</a>
</div>
</div>
</div>
<div id="work_experience_assessment_success_ratio_div" class="row-slice mb-3 work-experience-assessment-info-div" style="display: none;">
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Work experience assessment Suggestion success ratio (%)</label>
</div>
<div class="col-md-9">
<input type="text" id="work_exp_assess_suggestion_success_ratio" class="form-control" readonly>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<div class="col-md-3">
<label class="control-label">Work experience assessment Voting success ratio (%)</label>
</div>
<div class="col-md-9">
<input type="text" id="work_exp_assess_voting_success_ratio" class="form-control" readonly>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab2">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="display-flex justify-space align-end">
<div class="chart">
<div id="piechart"></div>
</div>
<div class="row button-row" style="width: 100%; margin-top: 15px;">
<div class="col-xs-12 display-flex other-filter other">
<p> <strong> Date:</strong> <input type="text" id="dater1" style="width: 230px;" class="form-control" readonly="" value=""></p>
<p> <strong>Select Status: </strong>
<select class="form-control" id="select-status">
<option value="">All</option>
<option value="1">Pending</option>
<option value="2">Voting</option>
<option value="3">Closed</option>
</select>
</p>
<p><button type="button" class="btn btn-primary" id="btn-filter">Filter</button></p>
</div>
</div>
</div>
<table class="suggestion-table table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Original Message</th>
<th>Suggestion</th>
<th>Suggested at</th>
<th>Votes received</th>
<th>Is Winning Suggestion?</th>
<th>TMN Earned</th>
</tr>
</thead>
<tbody class="suggestion-list">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab3">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="display-flex">
<div class="chart">
<div id="pieVotechart"></div>
</div>
<div class="row button-row" style=" width:100%; margin-top: 15px;">
<div class="col-xs-12 display-flex other-filter other">
<p> <strong> Date:</strong> <input type="text" id="dater2" style="width: 230px;" class="form-control" readonly="" value=""></p>
<p> <strong>Select Status: </strong>
<select class="form-control" id="select-statusv">
<option value="">All</option>
<option value="1">Pending</option>
<option value="2">Voting</option>
<option value="3">Closed</option>
</select>
</p>
<p><button type="button" class="btn btn-primary" id="btn-filterv">Filter</button></p>
</div>
</div>
</div>
<table class="voting-table table table-striped primary" cellspacing="0" width="100%">
<thead>
<tr>
<th>Original Message</th>
<th>Suggestion on which voted</th>
<th>Voted at</th>
<th>Votes received</th>
<th>Is Winning Vote?</th>
<th>TMN Earned</th>
</tr>
</thead>
<tbody class="voting-list">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab4">
<div class="card-header" style="overflow-x:hidden;overflow-y: hidden;border-left: 1px solid #dfe6e8;">
<ul class="nav nav-tabs" style="overflow-x: auto;">
<li role="tab1" class="active">
<a href="#tab11" aria-controls="tab11" role="tab" data-toggle="tab">Suggestions</a>
</li>
<li role="tab2" >
<a href="#tab21" aria-controls="tab21" role="tab" data-toggle="tab">Skipped Suggestions</a>
</li>
</ul>
</div>
<div class="card-body no-padding tab-content">
<div role="tabpanel" class="tab-pane active" id="tab11">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="display-flex">
<div class="chart">
<div id="piechartM"></div>
</div>
<div class="row button-row" style=" width:100%; margin-top: 15px;">
<div class="col-xs-12 display-flex other-filter other">
<p> <strong> Date:</strong> <input type="text" id="datem1" style="width: 230px;" class="form-control" readonly="" value=""></p>
<p> <strong>Select Status: </strong>
<select class="form-control" id="select-statusM">
<option value="">All</option>
<option value="1">Pending</option>
<option value="2">Voting</option>
<option value="3">Closed</option>
</select>
</p>
<p><button type="button" class="btn btn-primary" id="btn-filterM">Filter</button></p>
</div>
</div>
</div>
<table class="suggestion-tableM table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Original Message</th>
<th>Suggestion</th>
<th>Suggested at</th>
<th>Votes received</th>
<th>Is Winning Suggestion?</th>
<th>TMN Earned</th>
</tr>
</thead>
<tbody class="suggestion-listM">
</tbody>
</table>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab21">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<table class="skip-suggestion-tableM table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Original Message</th>
<th>Suggestion</th>
<th>Suggested at</th>
<th>Skipped Count</th>
</tr>
</thead>
<tbody class="skip-suggestion-listM">
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab5">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="display-flex">
<div class="chart">
<div id="pieVotechartM"></div>
</div>
<div class="row button-row" style=" width:100%; margin-top: 15px;">
<div class="col-xs-12 display-flex other-filter other">
<p> <strong> Date:</strong> <input type="text" id="datem2" style="width: 230px;" class="form-control" readonly="" value=""></p>
<p> <strong>Select Status: </strong>
<select class="form-control" id="select-statusvM">
<option value="">All</option>
<option value="1">Pending</option>
<option value="2">Voting</option>
<option value="3">Closed</option>
</select>
</p>
<p><button type="button" class="btn btn-primary" id="btn-filtervM">Filter</button></p>
</div>
</div>
</div>
<table class="voting-tableM table table-striped primary" cellspacing="0" width="100%">
<thead>
<tr>
<th>Original Message</th>
<th>Suggestion on which voted</th>
<th>Voted at</th>
<th>Votes received</th>
<th>Is Winning Vote?</th>
<th>TMN Earned</th>
</tr>
</thead>
<tbody class="voting-listM">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab6">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<table class="claims-table table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>TMN claimed</th>
<th>Claimed On</th>
<th>Status</th>
</tr>
</thead>
<tbody class="claims-list">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab7">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="text-right font-bold">Grand total of sentences: <span id="grandS-total"></span></div>
<div class="row button-row">
<div class="col-xs-12 mt-3 mb-3 display-flex index-filter">
<p><strong>Language: </strong>
<select id="language_id" class="form-control" searchable="Search here..">
<?php
$is_connection = 1;
$flag = 1;
$all = 1;
include 'controllers/get_category_options.php'; ?>
</select>
</p>
<p><strong>Select Date:</strong> <input type="text" id="date" class="form-control date-range-input" readonly="" value=""></p>
<p class="p-button mobile-left"><button type="button" class="btn btn-primary" id="btn-filterUD">Filter</button></p>
<p class="p-button mobile-right"><button type="button" class="btn btn-cancel" id="btn-clearUD">Clear Filter</button></p>
</div>
</div>
<table class="document-table table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Original Language</th>
<th>Translated Language</th>
<th>Original Document</th>
<th>Translated Document</th>
<th>Sentences</th>
<th>Submitted At</th>
</tr>
</thead>
<tbody class="document-list">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab8">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<table class="skip-suggestion-table table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Sentences</th>
</tr>
</thead>
<tbody class="skip-suggestion-list">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tab9">
<div class="row">
<div class="col-md-12 col-sm-12">
<form class="form form-horizontal">
<div class="row">
<div class="col-md-12 col-sm-12">
<table class="skip-vote-list-table table table-striped primary list-table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Sentences</th>
<th>Skipped At</th>
</tr>
</thead>
<tbody class="skip-vote-list">
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Small Size -->
<div class="modal fade" id="modalUsers" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Voted Users</h4>
</div>
<div class="modal-body">
<ul class="user-list"><div class="loader" style="display: block;"></div></ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal Small Size -->
<div class="modal fade" id="modalDocument" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Documents</h4>
</div>
<div class="modal-body">
<div class="div-document"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php include 'footer.php'; ?>
<script type="text/javascript">
var placementFrom = "top";
var placementAlign = "right";
var animateEnter = "";
var animateExit = "";
var colorName = "bg-green";
var start_date = '';
var end_date = '';
var load_flag = 0;
var load_offset = 0;
var data_end = 0;
var limit = 10;
var request_start = '';
var request_end = '';
var request_startr1 = '';
var request_endr1 = '';
var request_startr2 = '';
var request_endr2 = '';
var request_startm1 = '';
var request_endm1 = '';
var request_startm2 = '';
var request_endm2 = '';
getUserProfileInformation();
getSuggestionList();
getVotingList();
getSkippedVotingList();
getSkipSuggestionListM();
getSuggestionListM();
getVotingListM();
getClaimsList();
getDocumentsList();
/*getSkipSuggestionList();
getSkipVoteList();*/
//getUserActivities();
updateConfig();
function updateConfig() {
var options = {};
options.linkedCalendars = true;
options.autoUpdateInput = true;
options.showCustomRangeLabel = false;
options.alwaysShowCalendars = true;
// options.startDate = moment().startOf('week').add(1, 'days');
// options.endDate = moment().endOf('week').add(1, 'days');
options.startDate = false;
options.endDate = false;
options.opens = "left";
options.locale = {
direction: 'ltr',
format: 'DD MMM, YYYY',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
};
options.ranges = {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'This Week': [moment().startOf('week').add(1, 'days'), moment().endOf('week').add(1, 'days')],
'Last Week': [moment().startOf('week').subtract(6, 'days'), moment().endOf('week').subtract(6, 'days')],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
'This Year': [moment().startOf('year'), moment().endOf('year')],
'Last Year': [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')]
};
$('#date').daterangepicker(options, function (start, end, label) {
request_start = start.format('YYYY-MM-DD');
request_end = end.format('YYYY-MM-DD');
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$('#date').val('');
$('#dater1').daterangepicker(options, function (start, end, label) {
request_startr1 = start.format('YYYY-MM-DD');
request_endr1 = end.format('YYYY-MM-DD');
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$('#dater1').val('');
$('#dater2').daterangepicker(options, function (start, end, label) {
request_startr2 = start.format('YYYY-MM-DD');
request_endr2 = end.format('YYYY-MM-DD');
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$('#dater2').val('');
$('#datem1').daterangepicker(options, function (start, end, label) {
request_startm1 = start.format('YYYY-MM-DD');
request_endm1 = end.format('YYYY-MM-DD');
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$('#datem1').val('');
$('#datem2').daterangepicker(options, function (start, end, label) {
request_startm2 = start.format('YYYY-MM-DD');
request_endm2 = end.format('YYYY-MM-DD');
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$('#datem2').val('');
}
$('#date').on('apply.daterangepicker', function(ev, picker) {
request_start = picker.startDate.format('YYYY-MM-DD');
request_end = picker.endDate.format('YYYY-MM-DD');
console.log('New date range selected: ' + request_start + ' to ' + request_end);
});
$('#dater1').on('apply.daterangepicker', function(ev, picker) {
request_startr1 = picker.startDate.format('YYYY-MM-DD');
request_endr1 = picker.endDate.format('YYYY-MM-DD');
console.log('New date range selected: ' + request_startr1 + ' to ' + request_endr1);
});
$('#dater2').on('apply.daterangepicker', function(ev, picker) {
request_startr2 = picker.startDate.format('YYYY-MM-DD');
request_endr2 = picker.endDate.format('YYYY-MM-DD');
console.log('New date range selected: ' + request_startr2 + ' to ' + request_endr2);
});
$('#datem1').on('apply.daterangepicker', function(ev, picker) {
request_startm1 = picker.startDate.format('YYYY-MM-DD');
request_endm1 = picker.endDate.format('YYYY-MM-DD');
console.log('New date range selected: ' + request_startm1 + ' to ' + request_endm1);
});
$('#datem2').on('apply.daterangepicker', function(ev, picker) {
request_startm2 = picker.startDate.format('YYYY-MM-DD');
request_endm2 = picker.endDate.format('YYYY-MM-DD');
console.log('New date range selected: ' + request_startm2 + ' to ' + request_endm2);
});
function getUserProfileInformation() {
$.ajax({url: 'controllers/get_translator_profile.php',
data: {
id: '<?php echo $userId; ?>',
},
type: 'post',
dataType: 'json',
success: function (output) {
if (output.status == 200) {
$("#name").val(output.name);
$("#email").val(output.email);
$("#neo_address").val(output.neo_address);
$("#language_id").val(output.language_id);
$("#phone").val(output.phone);
$("#country_id").val(output.country_id);
$("#tmn_credits").val(output.tmn_credits);
$("#created_at").val(output.created_at);
$('.trigger-switch').attr('checked', output.checked);
$('.trigger-switchA').attr('checked', output.checkedA);
$('#is_neo_verified').html('<span style="background:#FFA500;padding:3px 12px;color:#FFFFFF;">No</span>');
$('#is_email_verified').html('<span style="background:#FFA500;padding:3px 12px;color:#FFFFFF;">No</span>');
$('#is_request_marketplace_access').html(output.request_marketplace_access_label);
if (output.is_neo_verified == 1) {
$('#is_neo_verified').html('<span style="background:#008000;padding:3px 12px;color:#FFFFFF;">Yes</span>');
}
if (output.is_verified == 1) {
$('#is_email_verified').html('<span style="background:#008000;padding:3px 12px;color:#FFFFFF;">Yes</span>');
}
if(output.marketplace_suggestions > 0) {
$('.btn-excel').attr('disabled', false);
} else {
$('.btn-excel').attr('disabled', true);
}
$("#user_level").val(output.user_level);
$("#suggestions_success_ratio").val(output.reputation_suggestions_success_ratio);
$("#voting_success_ratio").val(output.reputation_voting_success_ratio);
var test_score = parseInt(output.user_test_score);
var test_score2 = parseInt(output.user_test_score2);
var test_voting_level = output.test_voting_level;
if( test_voting_level > 0 ) {
$("#test_score").val(test_score+"%");
$("#test_voting_level").val(output.test_voting_level)
$("#test_score_div").css('display','block');
$("#work_experience_assessment_score").html(output.work_experience_assessment_score);
$("#work_exp_assess_suggestion_success_ratio").val(output.wea_suggestions_success_ratio);
$("#work_exp_assess_voting_success_ratio").val(output.wea_voting_success_ratio);
$(".work-experience-assessment-info-div").css('display','block');
$("#test_score2").val(test_score2+"%");
}
}
}
});
}
function getSuggestionList() {
$('.suggestion-table').dataTable().fnDestroy();
var dataTable = $('.suggestion-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": true,
"destroy": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
},
{
"targets": [2],
"searchable": true,
"orderable": true,
},
{
"targets": [3],
"searchable": true,
"orderable": true,
},
{
"targets": [4],
"searchable": true,
"orderable": true,
}, {
"targets": [5],
"searchable": true,
"orderable": true,
}
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"order": [
[3, "desc"]
],
"ajax": {
url: "controllers/get_suggestions_by_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
start_date: request_startr1,
end_date: request_endr1,
status: $('#select-status').val()
},
error: function () { // error handling
}},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
function getVotingList() {
$('.voting-table').dataTable().fnDestroy();
var dataTable = $('.voting-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": true,
"destroy": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
},
{
"targets": [2],
"searchable": true,
"orderable": true,
},
{
"targets": [3],
"searchable": true,
"orderable": true,
},
{
"targets": [4],
"searchable": true,
"orderable": true,
}, {
"targets": [5],
"searchable": true,
"orderable": true,
}
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"order": [
[2, "desc"]
],
"ajax": {
url: "controllers/get_voting_by_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
start_date: request_startr2,
end_date: request_endr2,
status: $('#select-statusv').val()
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
//Reputation skipped voting list
function getSkippedVotingList() {
$('.skip-vote-list-table').dataTable().fnDestroy();
var dataTable = $('.skip-vote-list-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": true,
"destroy": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
}
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"order": [
[1, "desc"]
],
"ajax": {
url: "controllers/get_skipped_voting_by_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
function getSuggestionListM() {
$('.suggestion-tableM').dataTable().fnDestroy();
var dataTable = $('.suggestion-tableM').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": true,
"destroy": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
},
{
"targets": [2],
"searchable": true,
"orderable": true,
},
{
"targets": [3],
"searchable": true,
"orderable": true,
},
{
"targets": [4],
"searchable": true,
"orderable": true,
}, {
"targets": [5],
"searchable": true,
"orderable": true,
}
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"order": [
[2, "desc"]
],
"ajax": {
url: "controllers/get_suggestions_by_user_id_marketplace.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
start_date: request_startm1,
end_date: request_endm1,
status: $('#select-statusM').val()
},
error: function () { // error handling
}},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
function getSkipSuggestionListM() {
$('.skip-suggestion-tableM').dataTable().fnDestroy();
var dataTable = $('.skip-suggestion-tableM').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": false,
"destroy": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
},
{
"targets": [2],
"searchable": false,
"orderable": true,
},
{
"targets": [3],
"searchable": false,
"orderable": false,
}
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"order": [
[2, "desc"]
],
"ajax": {
url: "controllers/get_skipped_suggestions_by_user_id_marketplace.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
},
error: function () { // error handling
}},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
function getVotingListM() {
$('.voting-tableM').dataTable().fnDestroy();
var dataTable = $('.voting-tableM').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": true,
"destroy": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
},
{
"targets": [2],
"searchable": true,
"orderable": true,
},
{
"targets": [3],
"searchable": true,
"orderable": true,
},
{
"targets": [4],
"searchable": true,
"orderable": true,
}, {
"targets": [5],
"searchable": true,
"orderable": true,
}
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"order": [
[2, "desc"]
],
"ajax": {
url: "controllers/get_voting_by_user_id_marketplace.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
start_date: request_startm2,
end_date: request_endm2,
status: $('#select-statusvM').val()
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
$('#btn-filter').on('click', function (e) {
getSuggestionList();
});
$('#btn-filterv').on('click', function (e) {
getVotingList();
});
$('#btn-filterM').on('click', function (e) {
getSuggestionListM();
});
$('#btn-filtervM').on('click', function (e) {
getVotingListM();
});
$('#btn-filterUD').on('click', function (e) {
getDocumentsList();
});
$("body").on('click', '#btn-clear', function () {
$('#date').val('');
request_start = '';
request_end = '';
$("#language_id").val(0);
getDocumentsList();
});
function getClaimsList() {
$('.claims-table').dataTable().fnDestroy();
var dataTable = $('.claims-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"serverSide": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
},
{
"targets": [1],
"searchable": true,
"orderable": true,
},
{
"targets": [2],
"searchable": true,
"orderable": true,
}
],
"bAutoWidth": false,
"searching": false,
"lengthChange": false,
"order": [
[1, "desc"]
],
"ajax": {
url: "controllers/get_claims_by_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
function getDocumentsList() {
$('.document-table').dataTable().fnDestroy();
var dataTable = $('.document-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"serverSide": true,
"columnDefs": [
{
"targets": [0],
"searchable": true,
"orderable": true,
"visible": true,
}, {
"targets": [1],
"searchable": true,
"orderable": true,
"visible": true,
}, {
"targets": [2],
"searchable": true,
"orderable": true,
"visible": true,
}, {
"targets": [3],
"searchable": false,
"orderable": false,
"visible": true,
}, {
"targets": [4],
"searchable": false,
"orderable": false,
"visible": true,
}, {
"targets": [5],
"searchable": false,
"orderable": true,
"visible": true,
}, {
"targets": [6],
"searchable": false,
"orderable": true,
"visible": true,
}
],
"bAutoWidth": false,
"searching": true,
"lengthChange": false,
"order": [
[6, "desc"]
],
"ajax": {
url: "controllers/get_documents_by_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
language_id: $("#language_id").val(),
start_date: request_start,
end_date: request_end,
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
$("#grandS-total").text(settings.json.data3);
}
});
displayPageInfo();
}
$("body").on('click', '.view-document', function () {
$.ajax({url: 'controllers/get_view_document.php',
data: {
id: $(this).attr('data-id'),
type: $(this).attr('data-dtype'),
},
type: 'post',
dataType: 'JSON',
success: function (output) {
console.log(output.status);
$('.div-document').html(output.html);
}
});
});
function getSkipSuggestionList() {
$('.skip-suggestion-table').dataTable().fnDestroy();
var dataTable = $('.skip-suggestion-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"serverSide": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
}
],
"bAutoWidth": false,
"searching": false,
"lengthChange": false,
"order": [
[0, "desc"]
],
"ajax": {
url: "controllers/get_skipped_sentences_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
type: 0,
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}
/*function getSkipVoteList() {
$('.skip-vote-table').dataTable().fnDestroy();
var dataTable = $('.skip-vote-table').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"serverSide": true,
"columnDefs": [{
"targets": [0],
"searchable": true,
"orderable": true,
}
],
"bAutoWidth": false,
"searching": false,
"lengthChange": false,
"order": [
[0, "desc"]
],
"ajax": {
url: "controllers/get_skipped_sentences_user_id.php", // json datasource
type: "post", // method , by default get
data: {
id:<?php echo $userId; ?>,
type: 1,
}, error: function () { // error handling
}
},
"drawCallback": function (settings) {
}
});
displayPageInfo();
}*/
$(document).on('click', '#btn-add-chars', function () {
var error = 0;
$(".err-msg[data-id='1']").hide();
if ($('#add-chars').val().trim() == '' || !$.isNumeric($('#add-chars').val().trim())) {
error = 1;
$(".err-msg[data-id='1']").show();
}
if (error == 0) {
$.ajax({url: 'controllers/add_characters.php',
data: {
user_id: <?php echo $userId; ?>,
chars: $('#add-chars').val().trim()
},
type: 'post',
dataType: 'json',
success: function (output) {
if (output.status == 200) {
$("#add-chars").val('');
$("#remaining-chars").val(output.new_chars);
showNotification(colorName, 'Characters added successfully', placementFrom, placementAlign, animateEnter, animateExit);
} else {
showNotification('bg-orange', 'Error in adding characters', placementFrom, placementAlign, animateEnter, animateExit);
}
}
});
}
});
$('body').on('click', '#btn-save', function () {
var error = 0;
$(".err-msg[data-id='0']").hide();
if ($('#credit').val().trim() == '' || !$.isNumeric($('#credit').val().trim())) {
error = 1;
$(".err-msg[data-id='0']").show();
}
if (error == 0) {
$.ajax({url: 'controllers/save_tmn_credits.php',
data: {
user_id: <?php echo $userId; ?>,
credits: $('#credit').val().trim()
},
type: 'post',
dataType: 'json',
success: function (output) {
if (output.status == 200) {
showNotification(colorName, 'TMN credits updated successfully', placementFrom, placementAlign, animateEnter, animateExit);
} else {
showNotification('bg-orange', 'Error in updating', placementFrom, placementAlign, animateEnter, animateExit);
}
}
});
}
});
$('body').on('click', '#btn-save-settings', function () {
var error = 0;
$(".err-msg[data-id='0']").hide();
if (error == 0) {
$.ajax({url: 'controllers/save_user_settings.php',
data: {
user_id: <?php echo $userId; ?>,
suggestion_count: $('#suggestion-count').val().trim(),
tmn_suggestion: $('#tmn-suggestion').val().trim(),
vote_count: $('#vote-count').val().trim(),
tmn_vote: $('#tmn-vote').val().trim(),
},
type: 'post',
dataType: 'json',
success: function (output) {
if (output.status == 200) {
showNotification(colorName, 'Saved successfully', placementFrom, placementAlign, animateEnter, animateExit);
} else {
showNotification('bg-orange', 'Error in updating', placementFrom, placementAlign, animateEnter, animateExit);
}
}
});
}
});
$("body").on('click', '.total-votes', function () {
$('.user-list').html('<div class="loader" style="display: block;"></div>');
$.ajax({url: 'controllers/get_vote_users.php',
data: {
id: $(this).attr('data-id'),
tele_id: $(this).attr('data-tele'),
},
type: 'post',
success: function (output) {
$('.user-list').html(output);
}
});
});
$.ajax({url: 'controllers/get_user_wise_winning_suggestion_value.php',
data: {
id: <?php echo $userId; ?>,
},
type: 'post',
dataType: 'json',
success: function (output) {
console.log(output);
var total_votes_given = parseInt(output.total_votes_given);
var total_suggestions_given = parseInt(output.total_suggestions_given);
var winning_suggestion_sentence = parseInt(output.winning_suggestion_sentence);
var winning_suggestion_vote = parseInt(output.winning_suggestion_vote);
var unwinning_suggestion_sentence = parseInt(output.unwinning_suggestion_sentence);
var unwinning_suggestion_vote = parseInt(output.unwinning_suggestion_vote);
var total_votes_givenM = parseInt(output.total_votes_givenM);
var total_suggestions_givenM = parseInt(output.total_suggestions_givenM);
var winning_suggestion_sentenceM = parseInt(output.winning_suggestion_sentenceM);
var winning_suggestion_voteM = parseInt(output.winning_suggestion_voteM);
var unwinning_suggestion_sentenceM = parseInt(output.unwinning_suggestion_sentenceM);
var unwinning_suggestion_voteM = parseInt(output.unwinning_suggestion_voteM);
// Load google charts
google.charts.load('current', {'packages': ['corechart']});
if (total_suggestions_given > 0)
google.charts.setOnLoadCallback(drawSuggestionChart);
if (total_votes_given > 0)
google.charts.setOnLoadCallback(drawVotingChart);
if (total_suggestions_givenM > 0)
google.charts.setOnLoadCallback(drawSuggestionChartM);
if (total_votes_givenM > 0)
google.charts.setOnLoadCallback(drawVotingChartM);
// Draw the chart and set the chart values
function drawSuggestionChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Winning suggestions for user'],
['Lost Suggestions', unwinning_suggestion_sentence],
['Winning Suggestions', winning_suggestion_sentence],
]);
// Optional; add a title and set the width and height of the chart
var options = {'title': 'Winning suggestion ratio', 'width': 400, 'height': 250, 'colors': ['#ff0000', '#008000']};
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
function drawVotingChart(total, winning) {
var data = google.visualization.arrayToDataTable([
['Task', 'Winning voted suggestions for user'],
['Lost Suggestions', unwinning_suggestion_vote],
['Winning Suggestions', winning_suggestion_vote],
]);
// Optional; add a title and set the width and height of the chart
var options = {'title': 'Winning suggestion ratio', 'width': 400, 'height': 250, 'colors': ['#ff0000', '#008000']};
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('pieVotechart'));
chart.draw(data, options);
}
// Draw the chart and set the chart values
function drawSuggestionChartM() {
var data = google.visualization.arrayToDataTable([
['Task', 'Winning suggestions for user'],
['Lost Suggestions', unwinning_suggestion_sentenceM],
['Winning Suggestions', winning_suggestion_sentenceM],
]);
// Optional; add a title and set the width and height of the chart
var options = {'title': 'Winning suggestion ratio', 'width': 400, 'height': 250, 'colors': ['#ff0000', '#008000']};
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('piechartM'));
chart.draw(data, options);
}
function drawVotingChartM(total, winning) {
var data = google.visualization.arrayToDataTable([
['Task', 'Winning voted suggestions for user'],
['Lost Suggestions', unwinning_suggestion_voteM],
['Winning Suggestions', winning_suggestion_voteM],
]);
// Optional; add a title and set the width and height of the chart
var options = {'title': 'Winning suggestion ratio', 'width': 400, 'height': 250, 'colors': ['#ff0000', '#008000']};
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('pieVotechartM'));
chart.draw(data, options);
}
}
});
function getUserActivities() {
$.ajax({url: 'controllers/get_user_activiti_log.php',
data: {
clientId: <?php echo $userId; ?>,
load_offset: load_offset,
},
type: 'post',
success: function (output) {
console.log('output: ' + output);
if (output == '') {
load_offset += 10;
getMoreUserActivities();
} else {
$(".activities-log").html(output);
}
$('#timeline-loader').css('display', 'none');
}
});
}
function getMoreUserActivities() {
$.ajax({url: 'controllers/get_user_activiti_log.php',
data: {
clientId: <?php echo $userId; ?>,
load_offset: load_offset,
},
type: 'post',
success: function (output) {
console.log('output: ' + output);
if (output == '') {
load_offset += 10;
getMoreUserActivities();
} else if (output == '0') {
date_end = 1;
$(".activities-log").append('<span>No more data found</span>');
$('#timeline-loader').css('display', 'none');
} else {
$(".activities-log").append(output);
load_flag = 0;
$('#timeline-loader').css('display', 'none');
}
}
});
}
$(window).scroll(function () {
if ($('li[role="tab6"]').hasClass('active') && data_end == 0) {
var hT = $('.activities-log').offset().top;
hH = $('.activities-log').outerHeight();
wH = $(window).height();
wS = $(this).scrollTop();
if (wS > (hT + hH - wH)) {
if (load_flag == 0) {
$('#timeline-loader').css('display', 'block');
load_flag = 1;
load_offset = load_offset + limit;
getMoreUserActivities();
console.log('end reached load_offset: ' + load_offset + ' load_flag: ' + load_flag);
}
}
}
});
$("body").on('click', '.btn-excel', function () {
translator_id = '<?php echo $userId; ?>';
window.location = "controllers/print_export_suggestions.php?id=" + translator_id;
});
$("body").on('click', '.trigger-switch', function () {
$(".loader").fadeIn("slow");
$.ajax({url: 'controllers/update_access_status.php',
data: {
status: $(this).is(":checked"),
id: $("#userId").val(),
type: 1,
},
type: 'post',
success: function (output) {
console.log(output);
showNotification(colorName, "Updated Successfully", placementFrom, placementAlign, animateEnter, animateExit);
$(".loader").fadeOut("slow");
}
});
});
$("body").on('click', '.trigger-switchA', function () {
$(".loader").fadeIn("slow");
$.ajax({url: 'controllers/update_access_status.php',
data: {
status: $(this).is(":checked"),
id: $("#userId").val(),
type: 2,
},
type: 'post',
success: function (output) {
console.log(output);
showNotification(colorName, "Updated Successfully", placementFrom, placementAlign, animateEnter, animateExit);
$(".loader").fadeOut("slow");
}
});
});
function displayPageInfo() {
$(".dataTables_info").each(function() {
$(this).prependTo($(this).closest(".dataTables_wrapper"));
});
}
$("body").on('blur', '#email', function () {
var email = $("#email").val();
if( email == '' ) {
showNotification('bg-orange', "Email can not be blank!", placementFrom, placementAlign, animateEnter, animateExit);
} else if( !isEmail(email) ) {
showNotification('bg-orange', "Please enter valid email", placementFrom, placementAlign, animateEnter, animateExit);
} else {
$(".loader").fadeIn("slow");
$.ajax({url: 'controllers/update_user_profile.php',
data: {
field_to_update: 'emailid',
field_value: $("#email").val(),
id: $("#userId").val(),
},
type: 'post',
success: function (status) {
if( status == 200 ) {
showNotification(colorName, "Updated Successfully", placementFrom, placementAlign, animateEnter, animateExit);
$(".loader").fadeOut("slow");
} else {
showNotification('bg-orange', "Error in updating", placementFrom, placementAlign, animateEnter, animateExit);
$(".loader").fadeOut("slow");
}
}
});
}
});
function isEmail(email) {
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(email);
}
</script>