MINI Sh3ll
<?
$client_id = $urlparts[1] == 'add-client' ? '0' : encrypt_decrypt('decrypt', $urlparts[1]);
if($client_id > 0){
$user = $objUser->getUserDetailsById($client_id);
}{
$user =[];
$user['firstname'] = $user['lastname'] = $user['company'] = $user['address'] = $user['gstno'] = $user['contactno'] = $user['email']= $user['password'] = "";
}
//print '<pre>'; print_r($user); print '</pre>';
?>
<link href="<?=SITE_ROOT_URL?>css/select2.min.css" rel="stylesheet" />
<script src="<?=SITE_ROOT_URL?>js/select2.min.js"></script>
<div class="row">
<div class="col-md-8 offset-md-2">
<!-- Account details card-->
<div class="card card-header-actions mb-4">
<div class="card-header">Client Information
<a class="btn btn-yellow btn-sm" href="<?=SITE_ROOT_URL.'clients/'?>">Back</a></div>
<div class="card-body">
<form id="CertForm" class="needs-validation" novalidate method="post" autocomplete="Off">
<div class="form-row">
<div class="form-group col-md-3">
<label class="small mb-1" for="firstname">Firstname</label>
<input class="form-control form-control-sm" id="firstname" name="firstname" type="text" placeholder="Enter the name of the user" value="<?=$user['firstname']?>" required/>
<div class="invalid-feedback">
Please enter the firstname of the client
</div>
</div>
<div class="form-group col-md-3">
<label class="small mb-1" for="lastname">Lastname</label>
<input class="form-control form-control-sm" id="lastname" name="lastname" type="text" placeholder="Enter the name of the user" value="<?=$user['lastname']?>" required />
<div class="invalid-feedback">
Please enter the lastname of the client
</div>
</div>
</div>
<div class="form-group">
<label class="small mb-1" for="company">Company</label>
<input class="form-control form-control-sm" id="company" name="company" type="text" placeholder="Enter the company" value="<?=$user['company']?>" required />
<div class="invalid-feedback">
Please enter the company
</div>
</div>
<div class="form-group">
<label class="small mb-1" for="address">Address</label>
<textarea class="form-control form-control-sm" id="address" name="address" type="text" placeholder="Enter the address" required><?=$user['address']?></textarea>
<div class="invalid-feedback">
Please enter the address
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label class="small mb-1" for="contactno">Contact Number</label>
<input class="form-control form-control-sm" id="contactno" name="contactno" type="text" placeholder="Enter the contact number" value="<?=$user['contactno']?>" required />
<div class="invalid-feedback">
Please enter the contact number
</div>
</div>
<div class="form-group col-md-6">
<label class="small mb-1" for="email">Email</label>
<input class="form-control form-control-sm" id="email" name="email" type="text" placeholder="Enter the email address" value="<?=$user['email']?>" required <?=$client_id > 0 ? 'readonly' : ''?>/>
<div class="invalid-feedback">
Please enter the email address
</div>
</div>
<div class="form-group col-md-3">
<label class="small mb-1" for="gstno">GST Number:</label>
<input class="form-control form-control-sm" id="gstno" name="gstno" type="text" placeholder="Enter the GST number" value="<?=$user['gstno']?>"/>
<div class="invalid-feedback">
Please enter the GST number
</div>
</div>
</div>
<div class="form-row">
<? if($client_id > 0){?>
<div class="form-group col-md-4">
<label class="small mb-1" for="loginid">Login ID</label>
<input class="form-control form-control-sm" id="loginid" name="loginid" type="text" placeholder="Enter the loginid" value="<?=$user['loginid']?>" required autocomplete="Off" />
<div class="invalid-feedback">
Please enter the loginid
</div>
</div>
<? } ?>
<? if($client_id == 0){?>
<div class="form-group col-md-4">
<label class="small mb-1" for="password">Password</label>
<input class="form-control form-control-sm" id="password" name="password" type="password" placeholder="Enter the password" value="<?=$user['password']?>" required autocomplete="Off"/>
<div class="invalid-feedback">
Please enter the password
</div>
</div>
<? } ?>
</div>
<div class="text-right">
<input type="hidden" name="formtype" value="<?=$client_id > 0 ? 'update-client' : 'add-client'?>" />
<button id="btnSubmit" class="btn btn-primary text-right" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$("#btnSubmit").on("click", function (e) {
var form = $("#CertForm")[0];
var isValid = form.checkValidity();
if (!isValid) {
e.preventDefault();
e.stopPropagation();
}
form.classList.add('was-validated');
//return false; // For testing only to stay on this page
});
</script>
OHA YOOOO