MINI Sh3ll
<?
$shortcode_id = isset($urlparts[1]) && $urlparts[1] != '' ? encrypt_decrypt('decrypt', $urlparts[1]) : '';
$shortcode = $objShortcode->getShortcodeById($shortcode_id);
//y($shortcode);
?>
<div class="card">
<div class="card-header">Shortcode : <?=$shortcode['shortcode']?></div>
<div class="card-body">
<form id="CertForm" class="needs-validation" novalidate method="post" autocomplete="Off">
<div class="row">
<div class="col-xl-4">
<div class="card-body">
<h5 class="card-title text-primary mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2 mr-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
Client Information
</h5>
<p class="card-text"><?=$shortcode['client_name']?><br/>
<?=$shortcode['company']?><br/>
<?=$shortcode['address']?>
</p>
</div>
<div class="card-body">
<h5 class="card-title text-primary mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2 mr-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
Validity
</h5>
<p class="card-text">
Start Date : <?=date('d-M-Y', strtotime($shortcode['startdate']))?><br/>
End Date : <?=date('d-M-Y', strtotime($shortcode['enddate']))?>
</p>
</div>
</div>
<div class="col-xl-8">
<div class="card-body">
<h5 class="card-title text-primary mb-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2 mr-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
Response Configuration
</h5>
<h5>Response Configuration</h5>
<div class="form-row">
<div class="form-group col-md-4">
<label class="small mb-1" for="name">Response Type</label>
<select class="form-control" name="response_type" id="response_type" required>
<option value="">Select Type</option>
<option value="0">Default Response</option>
<option value="1">URL Forward</option>
<option value="2">URL Forward with Default Response</option>
</select>
<div class="invalid-feedback">
Please select the response type
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12" id="divDR" style="display: none;">
<label class="small mb-1" for="response_text">Response Text</label>
<textarea class="form-control form-control-sm" id="response_text" rows="3" name="response_text" type="text" placeholder="Enter the response text" /><?=$shortcode['response_text']?></textarea>
<div class="invalid-feedback">
Please enter the response text
</div>
</div>
<div class="form-group col-md-3" id="divUFRM" style="display: none;">
<label class="small mb-1" for="name">Request Method</label>
<select class="form-control" name="request_method" id="request_method">
<option value="">Select Type</option>
<option value="GET" selected>GET</option>
<?/*<option value="POST">POST</option>*/?>
</select>
<div class="invalid-feedback">
Please select the request method
</div>
</div>
<div class="form-group col-md-12" id="divUFRL" style="display: none;">
<label class="small mb-1" for="response_text">Response URL</label>
<textarea class="form-control form-control-sm" id="response_url" rows="3" name="response_url" type="text" placeholder="Enter the response URL" /><?=$shortcode['response_url']?></textarea>
<div class="invalid-feedback">
Please enter the response URL
</div>
</div>
<div class="form-group col-md-12" id="divUFUP" style="display: none;">
<label class="small mb-1" for="url_parameters">URL Parameters</label>
<textarea class="form-control form-control-sm" id="url_parameters" rows="3" name="url_parameters" type="text" placeholder="Enter the url parameters" /><?=$shortcode['url_parameters']?></textarea>
<div class="invalid-feedback">
Please enter the URL parameters
</div>
</div>
</div>
<div class="mb-4"></div>
<? if($loginUser['usertype'] == 'ADMIN' ){?>
<div class="text-right">
<input type="hidden" name="formtype" value="update-shortcode" />
<button id="btnSubmit" class="btn btn-primary text-right" type="submit">Submit</button>
</div>
<? } ?>
</div>
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$("#response_type").val('<?=$shortcode['response_type']?>');
function loadConfs(rt){
//var rt = $(this).val();
if(rt == 0){
$("#divDR").slideDown();
$("#divUFRM").slideUp();
$("#divUFRL").slideUp();
$("#divUFUP").slideUp();
}
else if(rt == 1){
$("#divDR").slideUp();
$("#divUFRM").slideDown();
$("#divUFRL").slideDown();
$("#divUFUP").slideDown();
}
else if(rt == 2){
$("#divDR").slideDown();
$("#divUFRM").slideDown();
$("#divUFRL").slideDown();
$("#divUFUP").slideDown();
}
}
loadConfs(<?=$shortcode['response_type']?>);
$("#response_type").change(function(){
var rt = $(this).val();
loadConfs(rt);
});
$("#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