//script
---------------------------------
$.ajax({
type : "POST",
url: g_site_path+'/teamregister/teamupdateform',
data : $('#frmTeamstepone').serialize(),
dataType: "json",
success: function(data) {
$('#hidPlyrAvalFlag').val(data.plyrAvalFlag)
$('#hidplyrUsrid').val(data.plyrUsrid)
if(data.teamUrl!="")
{
var redirectUrl=g_site_path+"/"+data.teamUrl+"/summary";
setTimeout("window.location.href="+"'"+redirectUrl+"'",1000);
}
else
{
document.frmTeamstepone.action = g_site_path+"/teamregister/teamsteptwo";
document.frmTeamstepone.submit()
}
}
});
//controller action code
----------------------------------------
$vRegPostVar = $this->_request->getPost();
$oTeam = new Team();
$res = $oTeam->insertTeamregdetails($vRegPostVar,$this->view->userid);
//model code
---------------------------------------
public function insertTeamregdetails($params,$userid)
{
$usr_values = array(
'user_fname' => $params['plfname'],
'user_lname' => $params['pllname'],
'user_dob' => $dob,
'user_address' => $params['pladdr'],
'user_city' => $params['plcity'],
);
$usrupdateID = $oUser->update($usr_values,array('user_id = ?'=>$userid));
}
No comments:
Post a Comment