<?php
function passwordreset($id,$newpass){
$service = new NetSuiteService();
$emp = new Employee();
$emp->internalId = $id;
$emp->password = $newpass;
$emp->password2 = $newpass;
$updateRequest = new UpdateRequest();
$updateRequest->record = $emp;
$updateResponse = $service->update($updateRequest);
if (!$updateResponse->writeResponse->status->isSuccess) {
echo "UPDATE ERROR";
} else {
echo "UPDATE SUCCESS ID " . $updateResponse->writeResponse->baseRef->internalId."\n";
}
}
?>
<form id="form" name="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="password" id="empid" name="empid" value="" />
<input type="password" id="emppass" name="emppass" value="" />
<input type="submit" id="searchsubmit" name="searchsubmit" value="Save" />
</form>
<?php
if(isset($_POST['searchsubmit'])){if($_POST['searchsubmit'] == "Save"){
if(isset($_POST['emppass'])){
passwordreset($_POST['empid'],$_POST['emppass']);
}
}}
?>
No comments:
Post a Comment