<html>
<meta http-equiv="Content-Security-Policy" content="default-src * self blob: data: gap:; style-src * self 'unsafe-inline' blob: data: gap:; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap:; object-src * 'self' blob: data: gap:; img-src * self 'unsafe-inline' blob: data: gap:; connect-src self * 'unsafe-inline' blob: data: gap:; frame-src * self blob: data: gap:;">
<script src="js/jScript.js"></script>
<script src="js/widgetsdk.js"></script>
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous">
</script>
<link rel=
'stylesheet' href=
'https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&
amp;
display=swap'><link rel=
"stylesheet" href=
"./style.css"> <script type='text/javascript'>
var userEmail ;
function loggedInUser(){
refreshToken = "1000.5c6de3ee*********";
clientID = "1000.FR9********";
clientSecret = "89fe0a85c0*******";
axios.post(urlAccess)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error.data);
});
}
function fetchInvoices(){
ZOHO.CREATOR.init()
.then(function(data) {
//Code goes here
var initparams = ZOHO.CREATOR.UTIL.getInitParams();
let empCode;
config = {
appName : "sns",
reportName : "All_Users",
criteria: "(Email == \""+initparams['loginUser']+"\")",
}
ZOHO.CREATOR.API.getAllRecords(config).then(function(response){
var recordEmp = response.data;
empCode = recordEmp[0]['Emp_Code']
var role = recordEmp[0]['Role']
var hq = recordEmp[0]['HQ_Name']
if(role === "Regional Sales Manager"){
filterHQ = "RSM_HQ"
}
configHQ = {
appName:"sns",
reportName:"HQ_Channel_Tree_Report",
criteria:"("+filterHQ+"==\""+hq+"\")",
}
ZOHO.CREATOR.API.getAllRecords(configHQ).then(function(responseHQ){
var recordHQ = responseHQ.data;
for(var index in recordHQ){
console.log(recordHQ[index]);
}
});
});
console.log(empCode);
});
}
function multipleFunction(){
loggedInUser();
fetchInvoices();
}
</script>
<head>
<meta charset="UTF-8">
</head>
<body onload=multipleFunction()>
<!-- <div class="screen-1">
<img src="./images/gardeniaLogo.png">
<div class="email">
<label for="email">Logged In User</label>
<div class="sec-2">
<input type="email" name="email" id="loggedInUser" placeholder="Username@gmail.com" disabled/> </div>
</div>
<div class="empCode">
<label for="empCode">Employee Code</label>
<div class="sec-2">
<input type="text" name="empCode" id="empCode" placeholder="GC1001"/>
</div>
</div>
<button class="login" onclick=checkuserExists()>Login </button>
</div> -->
</body>
</html>