File: /var/www/html/company_app/company/add.php
<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
require '../include/functions.php';
if(!isset($_SESSION["email"]))
{
header('Location: '.getParentDir().'/index.html');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Add company | API</title>
<?php include '../include/head.php'; ?>
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<?php include '../include/sidenav.php'; ?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h2 class="page-header">Campany Add</h2>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-6">
<form role="form" method="post" action="<?php echo getParentDir();?>/include/functions.php?option=add_company">
<div class="form-group">
<label>Company ID</label>
<input class="form-control" placeholder="Enter Company ID" name="company_id" value="<?php echo generateRandomNumber(16); ?>" onkeypress='return formats(this,event)' onkeyup="return numberValidation(event)" required>
<p class="help-block">Ex: 0000-0000-0000-0000</p>
</div>
<div class="form-group">
<label>Company Name</label>
<input class="form-control" placeholder="Enter Company Name" name="company_name" required>
<p class="help-block">Ex: xyz</p>
</div>
<div class="form-group">
<label>Salesforce API End URL</label>
<input class="form-control" placeholder="Enter API End URL" name="end_url" required>
<p class="help-block">Ex: https://login.salesforce.com</p>
</div>
<br/>
<button type="submit" class="btn btn-primary">Submit Button</button>
</form>
<?php
?>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<?php include '../include/footer.php'; ?>
<script>
function formats(ele,e){
if(ele.value.length<19){
ele.value= ele.value.replace(/\W/gi, '').replace(/(.{4})/g, '$1 ');
return true;
}else{
return false;
}
}
function numberValidation(e){
e.target.value = e.target.value.replace(/[^\d ]/g,'');
return false;
}
</script>
</body>
</html>