//sample scripts
--------------------------------------
// JavaScript Document
var popDiv="";
function sortBoxscoreDetail(RedirectURL){
var vSort = $('#selBoxsort').val()
$("#hidBoxSort").val(vSort);
document.frmstatistics.action = RedirectURL;
document.frmstatistics.submit();
}
function loadStatistics(pmtestTeamid,pmtestTeamname,pmplayerid)
{
$.ajax({
type : "POST",
url :g_site_path+"/statistics/add-statistics",
data :'testTeamid='+pmtestTeamid+'&testTeamname='+pmtestTeamname+'&playerid='+pmplayerid,
dataType: "html",
success: function(html){
popDiv = new Popup();
popDiv.showDiv("sample","sample","",html)
}
});
}
function settestTeamname(val)
{
// alert(val.value)
$('#divOpptestTeam').html(val.value);
}
//For adding statistics
function validateStatistics(RedirectURL)
{
//validation
var Plyrscore="",Plyrscoreid="",j=0;
var Scoretotsize=document.frmstatistics.testTeamPlyrScore.length;
for (var i=0; i < Scoretotsize; i++){
var getVal=document.frmstatistics.testTeamPlyrScore[i].value;
var getIds=document.frmstatistics.scoreIds[i].value;
if (getVal!="" && numeric_validate(getVal)){
Plyrscore=Plyrscore+getVal+",";
Plyrscoreid=Plyrscoreid+getIds+",";
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FFFFFF";
}
else
{
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FF0000";
j++;
}
}
if($("#frmstatistics").valid())
{
//validation
if(j>=1)
return false
var vPlyrid= document.frmstatistics.selPlyrName.options[document.frmstatistics.selPlyrName.selectedIndex].value
var vtestTeamid = $('#hidtestTeamid').val()
var vGdate = $('#txtGamedate').val()
var vOpponent = $('#txtOpponent').val()
var vScrCnt = $('#hidScorefldcnt').val()
$.ajax({
type : "POST",
url :g_site_path+"/statistics/add-statistics-details",
data :'testTeamid='+vtestTeamid+'&gameDate='+vGdate+'&playerid='+vPlyrid+'&opponent='+vOpponent+'&Plyrscoreid='+Plyrscoreid+'&plyrscore='+Plyrscore,
dataType: "html",
success: function(html){
$('#divMsg').html("Score details added successfully");
//redirectUrl=g_site_path+"/"+vtestTeamname+"/boxscore/";
//setTimeout("window.location.href="+"'"+redirectUrl+"'",1000);
}
});
}
}
function statistics_validate()
{
var Scoretotsize=document.frmstatistics.testTeamPlyrScore.length;
for (var i=0; i < Scoretotsize; i++){
var getVal=document.frmstatistics.testTeamPlyrScore[i].value;
if (getVal!=''&& numeric_validate(getVal))
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FFFFFF";
else
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FF0000";
}
}
//For Updating the statistics
function updateStatistics(RedirectURL)
{
if($("#frmstatistics").valid())
{
var Plyrscore="",Plyrscoreid="",j=0;
var Scoretotsize=document.frmstatistics.testTeamPlyrScore.length;
for (var i=0; i < Scoretotsize; i++){
var getVal=document.frmstatistics.testTeamPlyrScore[i].value;
var getIds=document.frmstatistics.scoreIds[i].value;
if (getVal!=''&& numeric_validate(getVal)){
Plyrscore=Plyrscore+getVal+",";
Plyrscoreid=Plyrscoreid+getIds+",";
}
else
{
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FF0000";
j++;
}
}
//validation
if(j>=1)
return false
var vGdate = $('#txtGamedate').val()
var vOpponent = $('#txtOpponent').val()
var stst_id=$('#hidstst_id').val()
var chk='stst_id='+stst_id+'&gameDate='+vGdate+'&opponent='+vOpponent+'&Plyrscoreid='+Plyrscoreid+'&plyrscore='+Plyrscore;
$.ajax({
type : "POST",
url :g_site_path+"/statistics/update-statistics-details",
data :'stst_id='+stst_id+'&gameDate='+vGdate+'&opponent='+vOpponent+'&Plyrscoreid='+Plyrscoreid+'&plyrscore='+Plyrscore,
dataType: "html",
success: function(html){
$('#divMsg').html("Score details Updated successfully");
//redirectUrl=g_site_path+"/"+vtestTeamname+"/boxscore/";
//setTimeout("window.location.href="+"'"+redirectUrl+"'",1000);
}
});
}
}
//For Updating the statistics
function deleteStatistics(RedirectURLS)
{
var status=confirmSubmit();
if(status==true)
{
var stst_id=$('#hidstst_id').val()
var testTeamURL=$('#hidtestTeamURL').val()
var RedirectURL=g_site_path+"/"+testTeamURL+"/statistics";
$.ajax({
type : "POST",
url :g_site_path+"/statistics/delete-statistics-details",
data :'stst_id='+stst_id,
dataType: "html",
success: function(html){
$('#divMsg').html("Score details successfully deleted");
//redirectUrl=g_site_path+"/"+vtestTeamname+"/boxscore/";
setTimeout(closetimepopup(RedirectURL),3000);
}
});
}
}
function closetimepopup(testTeamURL)
{
document.frmRoaster.action = testTeamURL;
document.frmRoaster.submit();
popDiv.Hide();
}
function ClosePopUp(testTeamURL)
{
var vPlyrid= document.frmstatistics.selPlyrName.options[document.frmstatistics.selPlyrName.selectedIndex].value
$("#hidplayerID").val(vPlyrid);
var redirectURL=g_site_path+"/"+testTeamURL+"/statistics"
document.frmRoaster.action = redirectURL;
document.frmRoaster.submit();
popDiv.Hide();
}
function CloseeditPopUp(testTeamURL)
{
var vPlyrid= document.getElementById('hidplayerID').value;
$("#hidplayerID").val(vPlyrid);
var testTeamURL=g_site_path+"/"+testTeamURL+"/statistics"
document.frmRoaster.action = testTeamURL;
document.frmRoaster.submit();
popDiv.Hide();
}
//Edit statistics details
function loadStatisticseditform(stst_id)
{
$.ajax({
type : "POST",
url :g_site_path+"/statistics/edit-statistics",
data :'stst_id='+stst_id,
dataType: "html",
success: function(html){
popDiv = new Popup();
popDiv.showDiv("sample","sample","",html)
}
});
}
function numeric_validate(val)
{
var rege = /^\d+$/;
if(rege.test(val))
return true
else
return false
}
function confirmSubmit()
{
var agree=confirm("Are sure you to remove Statistics detail?");
if (agree)
return true ;
else
return false ;
}
function sortStatisticsSummary(playerID,testTeamURL){
var vSort = $('#selSort').val()
$("#hidSorting").val(vSort);
$("#hidplayerID").val(playerID);
document.frmRoaster.action = testTeamURL;
document.frmRoaster.submit();
}
--------------------------------------
// JavaScript Document
var popDiv="";
function sortBoxscoreDetail(RedirectURL){
var vSort = $('#selBoxsort').val()
$("#hidBoxSort").val(vSort);
document.frmstatistics.action = RedirectURL;
document.frmstatistics.submit();
}
function loadStatistics(pmtestTeamid,pmtestTeamname,pmplayerid)
{
$.ajax({
type : "POST",
url :g_site_path+"/statistics/add-statistics",
data :'testTeamid='+pmtestTeamid+'&testTeamname='+pmtestTeamname+'&playerid='+pmplayerid,
dataType: "html",
success: function(html){
popDiv = new Popup();
popDiv.showDiv("sample","sample","",html)
}
});
}
function settestTeamname(val)
{
// alert(val.value)
$('#divOpptestTeam').html(val.value);
}
//For adding statistics
function validateStatistics(RedirectURL)
{
//validation
var Plyrscore="",Plyrscoreid="",j=0;
var Scoretotsize=document.frmstatistics.testTeamPlyrScore.length;
for (var i=0; i < Scoretotsize; i++){
var getVal=document.frmstatistics.testTeamPlyrScore[i].value;
var getIds=document.frmstatistics.scoreIds[i].value;
if (getVal!="" && numeric_validate(getVal)){
Plyrscore=Plyrscore+getVal+",";
Plyrscoreid=Plyrscoreid+getIds+",";
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FFFFFF";
}
else
{
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FF0000";
j++;
}
}
if($("#frmstatistics").valid())
{
//validation
if(j>=1)
return false
var vPlyrid= document.frmstatistics.selPlyrName.options[document.frmstatistics.selPlyrName.selectedIndex].value
var vtestTeamid = $('#hidtestTeamid').val()
var vGdate = $('#txtGamedate').val()
var vOpponent = $('#txtOpponent').val()
var vScrCnt = $('#hidScorefldcnt').val()
$.ajax({
type : "POST",
url :g_site_path+"/statistics/add-statistics-details",
data :'testTeamid='+vtestTeamid+'&gameDate='+vGdate+'&playerid='+vPlyrid+'&opponent='+vOpponent+'&Plyrscoreid='+Plyrscoreid+'&plyrscore='+Plyrscore,
dataType: "html",
success: function(html){
$('#divMsg').html("Score details added successfully");
//redirectUrl=g_site_path+"/"+vtestTeamname+"/boxscore/";
//setTimeout("window.location.href="+"'"+redirectUrl+"'",1000);
}
});
}
}
function statistics_validate()
{
var Scoretotsize=document.frmstatistics.testTeamPlyrScore.length;
for (var i=0; i < Scoretotsize; i++){
var getVal=document.frmstatistics.testTeamPlyrScore[i].value;
if (getVal!=''&& numeric_validate(getVal))
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FFFFFF";
else
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FF0000";
}
}
//For Updating the statistics
function updateStatistics(RedirectURL)
{
if($("#frmstatistics").valid())
{
var Plyrscore="",Plyrscoreid="",j=0;
var Scoretotsize=document.frmstatistics.testTeamPlyrScore.length;
for (var i=0; i < Scoretotsize; i++){
var getVal=document.frmstatistics.testTeamPlyrScore[i].value;
var getIds=document.frmstatistics.scoreIds[i].value;
if (getVal!=''&& numeric_validate(getVal)){
Plyrscore=Plyrscore+getVal+",";
Plyrscoreid=Plyrscoreid+getIds+",";
}
else
{
document.frmstatistics.testTeamPlyrScore[i].style.borderColor = "#FF0000";
j++;
}
}
//validation
if(j>=1)
return false
var vGdate = $('#txtGamedate').val()
var vOpponent = $('#txtOpponent').val()
var stst_id=$('#hidstst_id').val()
var chk='stst_id='+stst_id+'&gameDate='+vGdate+'&opponent='+vOpponent+'&Plyrscoreid='+Plyrscoreid+'&plyrscore='+Plyrscore;
$.ajax({
type : "POST",
url :g_site_path+"/statistics/update-statistics-details",
data :'stst_id='+stst_id+'&gameDate='+vGdate+'&opponent='+vOpponent+'&Plyrscoreid='+Plyrscoreid+'&plyrscore='+Plyrscore,
dataType: "html",
success: function(html){
$('#divMsg').html("Score details Updated successfully");
//redirectUrl=g_site_path+"/"+vtestTeamname+"/boxscore/";
//setTimeout("window.location.href="+"'"+redirectUrl+"'",1000);
}
});
}
}
//For Updating the statistics
function deleteStatistics(RedirectURLS)
{
var status=confirmSubmit();
if(status==true)
{
var stst_id=$('#hidstst_id').val()
var testTeamURL=$('#hidtestTeamURL').val()
var RedirectURL=g_site_path+"/"+testTeamURL+"/statistics";
$.ajax({
type : "POST",
url :g_site_path+"/statistics/delete-statistics-details",
data :'stst_id='+stst_id,
dataType: "html",
success: function(html){
$('#divMsg').html("Score details successfully deleted");
//redirectUrl=g_site_path+"/"+vtestTeamname+"/boxscore/";
setTimeout(closetimepopup(RedirectURL),3000);
}
});
}
}
function closetimepopup(testTeamURL)
{
document.frmRoaster.action = testTeamURL;
document.frmRoaster.submit();
popDiv.Hide();
}
function ClosePopUp(testTeamURL)
{
var vPlyrid= document.frmstatistics.selPlyrName.options[document.frmstatistics.selPlyrName.selectedIndex].value
$("#hidplayerID").val(vPlyrid);
var redirectURL=g_site_path+"/"+testTeamURL+"/statistics"
document.frmRoaster.action = redirectURL;
document.frmRoaster.submit();
popDiv.Hide();
}
function CloseeditPopUp(testTeamURL)
{
var vPlyrid= document.getElementById('hidplayerID').value;
$("#hidplayerID").val(vPlyrid);
var testTeamURL=g_site_path+"/"+testTeamURL+"/statistics"
document.frmRoaster.action = testTeamURL;
document.frmRoaster.submit();
popDiv.Hide();
}
//Edit statistics details
function loadStatisticseditform(stst_id)
{
$.ajax({
type : "POST",
url :g_site_path+"/statistics/edit-statistics",
data :'stst_id='+stst_id,
dataType: "html",
success: function(html){
popDiv = new Popup();
popDiv.showDiv("sample","sample","",html)
}
});
}
function numeric_validate(val)
{
var rege = /^\d+$/;
if(rege.test(val))
return true
else
return false
}
function confirmSubmit()
{
var agree=confirm("Are sure you to remove Statistics detail?");
if (agree)
return true ;
else
return false ;
}
function sortStatisticsSummary(playerID,testTeamURL){
var vSort = $('#selSort').val()
$("#hidSorting").val(vSort);
$("#hidplayerID").val(playerID);
document.frmRoaster.action = testTeamURL;
document.frmRoaster.submit();
}
No comments:
Post a Comment