96 lines
5.2 KiB
PHP
96 lines
5.2 KiB
PHP
<?php
|
|
function col($size, $title="", $color="0", $options=[], $topButtons=[], $columns=[]) {
|
|
$id = str_slug($title);
|
|
$colors = colors();
|
|
$u = u();
|
|
?>
|
|
|
|
|
|
|
|
<div class="<?php echo $size ?>">
|
|
<div class="block block-themed block-rounded <?php echo isset($options['border']) ? "border" : "" ?>" id="<?php echo $id; ?>">
|
|
<?php if($title!="") {
|
|
?>
|
|
<div class="block-header
|
|
<?php if($color!=-1) {
|
|
?>
|
|
bg-<?php echo $colors[$color]; ?>
|
|
<?php
|
|
} ?>
|
|
">
|
|
<div class="block-title"><?php echo e2($title) ?></div>
|
|
<?php if(!isset($options['no-options'])) {
|
|
?>
|
|
<div class="block-options">
|
|
<div type="button" class="btn-block-option select-columns d-none" data-toggle="modal" data-target="#select-columns" >
|
|
<i class="fa fa-table-columns"></i>
|
|
</div>
|
|
<?php foreach($options AS $icon => $href) {
|
|
?>
|
|
<a href="<?php echo $href ?>" class="btn-block-option"><i class="fa fa-<?php echo $icon ?>"></i></a>
|
|
<?php
|
|
} ?>
|
|
<?php if(isAuth($id, "write")) { ?>
|
|
<div class="btn btn-outline-success add-btn d-none" onclick="$('#new-modal').modal()"><i class="fa fa-plus"></i></div>
|
|
<?php } ?>
|
|
|
|
<!-- To toggle fullscreen a block, just add the following properties to your button: data-toggle="block-option" data-action="fullscreen_toggle" -->
|
|
<button type="button" class="btn-block-option d-none" data-toggle="block-option"
|
|
<?php if(oturumesit("full-screen-block", $id)) {
|
|
?>
|
|
onclick="$.get('?ajax=full-screen-block-remove')"
|
|
<?php
|
|
} else {
|
|
?>
|
|
onclick="$.get('?ajax=full-screen-block&id=<?php echo($id) ?>')"
|
|
<?php } ?>
|
|
data-action="fullscreen_toggle"><i class="si si-size-fullscreen"></i></button>
|
|
<?php if(isset($options['export'])) { ?>
|
|
<?php if($u->level == "Admin") { ?>
|
|
|
|
<a href="<?php echo url("admin/truncate/". $options['export']) ?>" <?php echo delete_teyit() ?> class="btn-block-option " title="<?php echo e2("Delete All") ?>" ><i class="fa fa-trash"></i></a>
|
|
|
|
<?php } ?>
|
|
<?php //if(is_stellar()) {
|
|
?>
|
|
<a target="_blank" href="<?php echo url("admin-ajax/export-query?table_name=". $options['export']) ?>&module=<?php echo $id ?>&columns=<?php echo base64_encode(implode(",", $columns)) ?>" class="btn-block-option" title="<?php echo e2("Export to CSV") ?>" ><i class="fa fa-download"></i> CSV</a>
|
|
<a target="_blank" href="<?php echo url("admin-ajax/export-query?file_type=xlsx&table_name=". $options['export']) ?>&module=<?php echo $id ?>&columns=<?php echo base64_encode(implode(",", $columns)) ?>" class="btn-block-option" title="<?php echo e2("Export to XLSX") ?>" ><i class="fa fa-download"></i> XLSX</a>
|
|
|
|
<a href="<?php echo url("admin/export/". $options['export']) ?>?&module=<?php echo $id ?>&columns=<?php echo base64_encode(implode(",", $columns)) ?>" class="btn-block-option d-none" title="<?php echo e2("Export to Excel") ?>" ><i class="fa fa-download"></i></a>
|
|
<?php // } ?>
|
|
<?php if(isAuth($id, "write")) {
|
|
?>
|
|
<label
|
|
for="excel-file"
|
|
class="btn-block-option d-none" click="" title="<?php echo e2("Import to Excel") ?>" ><i class="fa fa-upload"></i></label>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<?php if(isset($topButtons)) {
|
|
foreach($topButtons AS $topButton) {
|
|
?>
|
|
<a href="<?php echo $topButton['href'] ?>" class="<?php echo @$topButton['class'] ?>"><?php echo $topButton['html'] ?></a>
|
|
<?php
|
|
}
|
|
} ?>
|
|
|
|
|
|
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
<?php
|
|
} ?>
|
|
|
|
<div class="block-content <?php echo isset($options['content-class']) ? $options['content-class'] : "" ?>">
|
|
|
|
|
|
<?php
|
|
}
|
|
function _col() {
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|