MINI Sh3ll
<?
$type = isset($_REQUEST['type']) && $_REQUEST['type'] != '' ? $_REQUEST['type'] : '1';
$client_id = isset($_REQUEST['client_id']) && $_REQUEST['client_id'] != '' ? $_REQUEST['client_id'] : '';
$shortcode_id = isset($_REQUEST['shortcode_id']) && $_REQUEST['shortcode_id'] != '' ? $_REQUEST['shortcode_id'] : '';
$shortcode = $objShortcode->getShortcodeById($shortcode_id);
$active_clients = $objUser->getActiveClients();
if($urlparts[0] == 'shortcodes' && $urlparts[1] != '' && $urlparts[2] == 'keywords'){
$shortcode_id = encrypt_decrypt('decrypt', $urlparts[1]);
$shortcode = $objShortcode->getShortcodeById($shortcode_id);
$client_id = $loginUser['usertype'] == 'ADMIN' ? $shortcode['client_id'] : $loginUser['id'];
}
$client_id = $loginUser['usertype'] == 'CLIENT' ? $loginUser['id'] : $client_id;
$shortcodes = $objKeyword->getKeywordShortcodes($type, $client_id);
$keywords = $objKeyword->getKeywords($type, $client_id, $shortcode_id);
$param_shortcode_id = $shortcode_id;
if($urlparts[0] == 'keywords'){
}
//x($keywords);
//print '['.$client_id.']['.$shortcode_id.']';
?>
<? require_once SITE_PAGE_PATH.'notifier.php'; ?>
<div class="card mb-4">
<div class="card-body p-2">
<form method="post">
<div class="row">
<? if($loginUser['usertype'] == 'ADMIN'){?>
<div class="col-md-6 me-2 my-1">
</div>
<div class="col-md-2 col-sm-12">
<select class="form-control" name="client_id" onchange="this.form.submit()">
<option value="">All Clients</option>
<? foreach($active_clients as $ac){?>
<option value="<?=$ac['id']?>" <?=$client_id == $ac['id'] ? 'selected' : ''?>><?=$ac['client_name']?></option>
<? } ?>
</select>
</div>
<div class="col-md-2 col-sm-12">
<select class="form-control" name="shortcode_id" onchange="this.form.submit()">
<option value="">All Shortcodes</option>
<? foreach($shortcodes as $sh){?>
<option value="<?=$sh['id']?>" <?=$shortcode_id == $sh['id'] ? 'selected' : ''?>><?=$sh['shortcode']?></option>
<? } ?>
</select>
</div>
<div class="col-md-2 col-sm-12">
<select class="form-control" name="type" onchange="this.form.submit()">
<option value="0,1,2,3,5">All Keywords</option>
<option value="0" <?=$type == '0' ? 'selected' : ''?>>Suspended</option>
<option value="1" <?=$type == '1' ? 'selected' : ''?>>Active</option>
<option value="2,3" <?=$type == '2' || $type == '3' ? 'selected' : ''?>>Expired</option>
<option value="5" <?=$type == '5' ? 'selected' : ''?>>Blocked</option>
</select>
</div>
<? } else { ?>
<div class="col-md-8 me-2 my-1">
</div>
<div class="col-md-2 col-sm-12">
<select class="form-control" name="shortcode_id" onchange="this.form.submit()">
<option value="">All Shortcodes</option>
<? foreach($shortcodes as $sh){?>
<option value="<?=$sh['id']?>" <?=$shortcode_id == $sh['id'] ? 'selected' : ''?>><?=$sh['shortcode']?></option>
<? } ?>
</select>
</div>
<div class="col-md-2 col-sm-12">
<select class="form-control" name="type" onchange="this.form.submit()">
<option value="0,1,2,3,5">All Keywords</option>
<option value="0" <?=$type == '0' ? 'selected' : ''?>>Suspended</option>
<option value="1" <?=$type == '1' ? 'selected' : ''?>>Active</option>
<option value="2,3" <?=$type == '2' || $type == '3' ? 'selected' : ''?>>Expired</option>
<option value="5" <?=$type == '5' ? 'selected' : ''?>>Blocked</option>
</select>
</div>
<? } ?>
</div>
</form>
</div>
</div>
<div class="card card-header-actions mb-4">
<div class="card-header"><?=$page_title?><div>
<a class="btn btn-primary btn-sm" href="<?=SITE_ROOT_URL.'keywords/add-keyword'?>">Add Keyword</a>
</div></div>
<div class="card-body">
<table class="saathi_datatable" id="shcodesTable" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-right" width="5%">#</th>
<th class="text-center" width="8%">Keyword</th>
<th class="text-center" width="8%">Shortcode</th>
<th class="text-left" width="20%">Client</th>
<th class="text-center" width="8%">Response Type</th>
<th class="text-center" width="10%">Start Date</th>
<th class="text-center" width="10%">End Date</th>
<th class="text-center" width="12%">Created</th>
<th class="text-center" width="8%">Status</th>
<th class="text-center" width="12%">Action</th>
</tr>
</thead>
<tbody>
<? if($keywords){
foreach($keywords as $sh){
$status = $sh['status'] == 1 ? 'Deactivate' : 'Activate';
?>
<tr>
<td class="text-right"><?=$sh['id']?></td>
<td class="text-center"><?=$sh['keyword']?></td>
<td class="text-center"><?=$sh['shortcode']?></td>
<td><?=$sh['client_name']?></td>
<td class="text-center"><?=$sh['response_type_text']?></td>
<td class="text-center"><?=$sh['startdate']?></td>
<td class="text-center"><?=$sh['enddate']?></td>
<td class="text-center"><?=$sh['created'].'('.$sh['createdby_name'].')'?></td>
<td class="text-center"><?=$sh['enddate']?></td>
<td class="text-center">
<? if($loginUser['usertype'] == 'ADMIN'){?>
<div class="list-icons">
<a href="<?=SITE_ROOT_URL?>keywords/<?=encrypt_decrypt('encrypt', $sh['id'])?>" class="list-icons-item text-primary-600 zoom" title="View Shortcode Details">Edit</a> |
<a style="cursor:pointer;" id="btnActivate<?=encrypt_decrypt('encrypt', $sh['id'])?>" class="text-danger left"><?=$status?></a>
</div>
<? } else if($loginUser['usertype'] == 'CLIENT'){?>
<div class="list-icons">
<a href="<?=SITE_ROOT_URL?>keywords/<?=encrypt_decrypt('encrypt', $sh['id'])?>" class="list-icons-item text-primary-600 zoom" title="View Shortcode Details">View</a>
</div>
<? } ?>
</td>
</tr>
<? }
}
?>
</tbody>
</table>
</div>
</div>
<form method="post" id="frmUserUpdate">
<input type="hidden" name="formtype" value="update-order-status" />
<input type="hidden" id="id" name="id" value="" />
<input type="hidden" id="status" name="status" value="" />
</form>
<!-- Modal -->
<div class="modal fade" id="orderModal" tabindex="-1" role="dialog" aria-labelledby="orderModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="orderModalLabel">Order Details</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form id="orderForm" method="post" class="needs-validation" novalidate="">
<div class="modal-body">
<p>Order items are listed in detail below:</p>
<div id="orderItems"></div>
<hr/>
<div class="form-group text-left">
<label class="small mb-1" for="order_status">Order Status : </label>
<select class="form-control" id="order_status" name="order_status" required>
<option value="">Select Order Status</option>
<option value="0">Pending</option>
<option value="1">Processed</option>
<option value="2">Cancelled</option>
</select>
<div class="invalid-feedback">Please select the option</div>
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="order_id" id="order_id" value="" />
<input type="hidden" name="formtype" value="update-order-status" />
<button id="btnSubmitOrder" class="btn btn-sm btn-primary" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#shcodesTable').DataTable({
"pageLength": 50,
"order": [[ 0, 'desc' ]]
});
});
</script>
OHA YOOOO