whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
public_html
/
application
/
views
/
menu
/
Upload File:
files >> //proc/self/root/home/papecmvm/public_html/application/views/menu/menu_view.php
<?php require_once(APPPATH.'views/header.php');?> <?php require_once(APPPATH.'views/menu.php');?> <!-- Content Wrapper. Contains Navigation content --> <div class="content-wrapper"> <!-- Content Header (Navigation header) --> <section class="content-header"> <h1> Navigation </h1> <ol class="breadcrumb"> <li><a href="<?php echo site_url('admin/Welcome')?>"><i class="fa fa-dashboard"></i> Dashboard</a></li> <li class="active">Navigation</li> </ol> </section> <!-- Main content --> <section class="content"> <!-- /.row --> <div class="row"> <div class="col-md-4"> <!-- Page --> <div class="box box-success"> <div class="box-header with-border"> <h3 class="box-title">Pages</h3> <div class="box-tools pull-right"> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i> </button> </div> </div> <div class="box-body box-profile"> <form id='myFormId' method='post'> <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>"> <ul class="list-group list-group-unbordered" style="height: 300px; overflow-y: auto;"> <?php foreach($page as $key) { ?> <li class="list-group-item"> <b><?php echo $key['content_title'] ?></b> <a class="pull-right"><input class='minimal' name='pageid' value='<?php echo $key['content_id'] ?>' type='checkbox'></a> </li> <?php }?> </ul> <button type='button' id='movetomenu' class="btn btn-success btn-block"><b>Move To Menu</b></button> </form> </div><!-- /.box-body --> </div><!-- /.box --> <!-- Menu Group --> <?php echo form_open("admin/menumanagement/addgroup"); ?> <div class="box box-success collapsed-box"> <div class="box-header with-border"> <h3 class="box-title">Create Menu Group</h3> <div class="box-tools pull-right"> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i> </button> </div> </div> <div class="box-body box-profile"> <ul class="list-group list-group-unbordered" > <input class="form-control input-lg" type="text" required name='menugroupname' placeholder="Menu Name"> </ul> <button type='submit' class="btn btn-success btn-block"><b>Save</b></button> </div><!-- /.box-body --> </div><!-- /.box --> <?php echo form_close(); ?> <!-- Custom Menu Create --> <div class="box box-success collapsed-box"> <div class="box-header with-border"> <h3 class="box-title">Create Custom Menu</h3> <div class="box-tools pull-right"> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i> </button> </div> </div> <div class="box-body box-profile"> <ul class="list-group list-group-unbordered" > <input class="form-control input-md" type="text" required id='custommenuname' placeholder="Custom Menu Name"> </ul> <ul class="list-group list-group-unbordered" > <input class="form-control input-md" type="text" required id='custommenuurl' value='http://'> </ul> <button type='submit' id='Custommovetomenu' class="btn btn-success btn-block"><b>Move to Menu</b></button> </div><!-- /.box-body --> </div><!-- /.box --> </div> <!--Display Menu--> <div class='col-md-8'> <div class="box box-success"> <form id='mysaveid' method='post'> <div class="box-body "> <div class="input-group input-group-md"> <select class='form-control' name='menugroup' id='menugroup'> <?php echo $menugroup_id=$this->uri->segment(3); foreach($menugroup as $key) { ?> <option value='<?php echo $key['menugroup_id'] ?>' <?php if($menugroup_id==$key['menugroup_id']){ echo 'selected="selected"';}?> ><?php echo $key['menugroupname'] ?></option> <?php }?> </select> <span class="input-group-btn"> <button type="submit" id='deletemenu' class="btn btn-danger btn-flat">Delete Menu</button> </span> </div> <br> <div class="input-group input-group-md"> <h3>Menu Stucture</h3> <span class="input-group-btn"> <button type="button" id='addmenus' class="btn btn-success btn-flat">Save Menu</button> </span> </div> <div id='alertmsg'> </div> <div class="cf nestable-lists" > <div class="dd" id="nestable"> <ol class="dd-list" id='lidata'> <?php $i=0; while($i <count($menu)) { ?><!--Level Zero menu Display--> <li class="dd-item rem_<?php echo $menu[$i]['menu_content'];?>" data-id="<?php echo $menu[$i]['menu_content'];?>"> <div class="pull-right out-line"> <?php if ($menu[$i]['menu_url']!='') { echo ' <b> Custom Menu </b>'; }?> <button class="btnclick btn btn-link" type='button' value="<?php echo $menu[$i]['menu_content'];?>" > <span class="caret my-caret"></span> </button> </div> <div class="dd-handle"><?php echo $menu[$i]['menu_name'];?></div> <div class="box-body ids_<?php echo $menu[$i]['menu_content'];?>" style="display: none;"> <div class="form-group"> <label>Menu Lable</label> <input type="text" id='lable[]' class="form-control" name='lable[]' value='<?php echo $menu[$i]['menu_displayname'];?>' placeholder="Enter ..."> <input type="hidden" class="form-control" id='menu[]' name='menu[]' value='<?php echo $menu[$i]['menu_name'];?>' placeholder="Enter ..."> </div> <?php if ($menu[$i]['menu_url']!='') { ?> <div class="form-group"> <label>Menu Lable</label> <input type="text" id='urllink[]' class="form-control" name='urllink[]' value='<?php echo $menu[$i]['menu_url'];?>' placeholder="Enter ..."> </div> <?php }else{?> <input type="hidden" id='urllink[]' class="form-control" name='urllink[]' value='<?php echo $menu[$i]['menu_url'];?>' placeholder="Enter ..."> <?php }?> <button type="button" value='<?php echo $menu[$i]['menu_content'];?>' class="btn btn-default remove">Remove</button> </div> <!--Level one Dispaly--> <?php $levels=0; for ($j=$i; $j <count($menu) ; $j++) { if($menu[$i]['menu_content']==$menu[$j]['submenu']) { $levels++; } } for ($k=0; $k <$levels; $k++) { if ($k==0) {echo "<ol class='dd-list'>";} $i++; ?> <li class="dd-item rem_<?php echo $menu[$i]['menu_content'];?>" data-id="<?php echo $menu[$i]['menu_content'];?>"> <div class="pull-right out-line"> <?php if ($menu[$i]['menu_url']!='') { echo ' <b> Custom Menu </b>'; }?> <button class="btnclick btn btn-link" type='button' value="<?php echo $menu[$i]['menu_content'];?>" > <span class="caret my-caret"></span> </button> </div> <div class="dd-handle"><?php echo $menu[$i]['menu_name'];?></div> <div class="box-body ids_<?php echo $menu[$i]['menu_content'];?>" style="display: none;"> <div class="form-group"> <label>Menu Lable</label> <input type="text" id='lable[]' class="form-control" name='lable[]' value='<?php echo $menu[$i]['menu_displayname'];?>' placeholder="Enter ..."> <input type="hidden" class="form-control" id='menu[]' name='menu[]' value='<?php echo $menu[$i]['menu_name'];?>' placeholder="Enter ..."> </div> <?php if ($menu[$i]['menu_url']!='') { ?> <div class="form-group"> <label>Menu Lable</label> <input type="text" id='urllink[]' class="form-control" name='urllink[]' value='<?php echo $menu[$i]['menu_url'];?>' placeholder="Enter ..."> </div> <?php }else{?> <input type="hidden" id='urllink[]' class="form-control" name='urllink[]' value='<?php echo $menu[$i]['menu_url'];?>' placeholder="Enter ..."> <?php }?> <button type="button" value='<?php echo $menu[$i]['menu_content'];?>' class="btn btn-default remove">Remove</button> </div> <!--Level Two Dispaly--> <?php $level2=0; for ($j=$i; $j <count($menu) ; $j++) { if($menu[$i]['menu_content']==$menu[$j]['submenu']) { $level2++; } } for ($l=0; $l <$level2; $l++) { if ($l==0) {echo "<ol class='dd-list'>";} $i++; ?> <li class="dd-item rem_<?php echo $menu[$i]['menu_content'];?>" data-id="<?php echo $menu[$i]['menu_content'];?>"> <div class="pull-right out-line"> <?php if ($menu[$i]['menu_url']!='') { echo ' <b> Custom Menu </b>'; }?> <button class="btnclick btn btn-link" type='button' value="<?php echo $menu[$i]['menu_content'];?>" > <span class="caret my-caret"></span> </button> </div> <div class="dd-handle"><?php echo $menu[$i]['menu_name'];?></div> <div class="box-body ids_<?php echo $menu[$i]['menu_content'];?>" style="display: none;"> <div class="form-group"> <label>Menu Lable</label> <input type="text" id='lable[]' class="form-control" name='lable[]' value='<?php echo $menu[$i]['menu_displayname'];?>' placeholder="Enter ..."> <input type="hidden" class="form-control" id='menu[]' name='menu[]' value='<?php echo $menu[$i]['menu_name'];?>' placeholder="Enter ..."> </div> <?php if ($menu[$i]['menu_url']!='') { ?> <div class="form-group"> <label>Menu Lable</label> <input type="text" id='urllink[]' class="form-control" name='urllink[]' value='<?php echo $menu[$i]['menu_url'];?>' placeholder="Enter ..."> </div> <?php }else{?> <input type="hidden" id='urllink[]' class="form-control" name='urllink[]' value='<?php echo $menu[$i]['menu_url'];?>' placeholder="Enter ..."> <?php }?> <button type="button" value='<?php echo $menu[$i]['menu_content'];?>' class="btn btn-default remove">Remove</button> </div> </li> <?php if ($l==($level2-1)) {echo "</ol></li>";} } ?><!-- End Level Two Display --> </li> <?php if ($k==($levels-1)) {echo "</ol></li>";} }?><!-- End Level one Display --> </li> <?php $i++; }?> <!-- End Zero one Display --> </ol> </div> </div> <textarea style='display:none' name='postion' id="nestable-output"></textarea> </div><!-- /.box-body --> </form> </div><!-- /.box --> </div> </div> <!-- /.row --> </section><!-- /.content --> </div><!-- /.content-wrapper --> <div id="wait" style="display:none" > <img id='centerimg' src='<?php echo base_url().'dist/img/now-loading.gif';?>'/> </div> <style> #wait { position: fixed; z-index: 999; height: 100%; width: 100%; top: 0; left: 0; background-color: Black; filter: alpha(opacity=60); opacity: 0.6; -moz-opacity: 0.8; } #centerimg { z-index: 1000; margin: 183px auto; width: 18%; margin-left:39%; padding: 10px; background-color: White; border-radius: 10px; filter: alpha(opacity=100); opacity: 1; -moz-opacity: 1; } </style> <?php require_once(APPPATH.'views/footer.php');?> <script src="<?php echo base_url();?>bootstrap/js/jquery.nestable.js" type="text/javascript"></script> <script> $(document).ready(function() { $(document).ajaxStart(function(){ $("#wait").css("display", "block"); }); $(document).ajaxComplete(function(){ $("#wait").css("display", "none"); }); window.onbeforeunload = function(e) { e = e || window.event; e.preventDefault = true; e.cancelBubble = true; e.returnValue = 'Save the data'; } var updateOutput = function(e) { var list = e.length ? e : $(e.target), output = list.data('output'); if (window.JSON) { output.val(window.JSON.stringify(list.nestable('serialize')));//, null, 2)); } else { output.val('JSON browser support required for this demo.'); } }; // activate Nestable for list 1 $('#nestable').nestable({ group: 1 }) .on('change', updateOutput); // output initial serialised data updateOutput($('#nestable').data('output', $('#nestable-output'))); // Move to Menu $( "#movetomenu" ).click(function() { var queryString = $('#myFormId').serialize(); var cct = $.cookie("<?php echo $this->config->item('csrf_cookie_name'); ?>"); $('.minimal').iCheck('uncheck'); $.post("menumanagement/Menustu", { pageid: queryString, '<?php echo $this->security->get_csrf_token_name(); ?>': cct }, function(data,status){ if (status=='success') { $("#lidata").append(data); }; }); }); $( "#lidata" ).on('click', '.btnclick', function() { var id=$(this).val(); $( ".ids_"+id ).toggle( "slow" ); }); // Add to Menu $( "#addmenus" ).click(function() { var cct = $.cookie("<?php echo $this->config->item('csrf_cookie_name'); ?>"); updateOutput($('#nestable').data('output', $('#nestable-output'))); var postionval = $('#nestable-output').val(); var menugroupval = $('#menugroup').val(); var lable = '' var menu = ''; var urllink=''; $("input[name='menu[]'").each(function() { menu=menu+","+$(this).val(); }); $("input[name='lable[]'").each(function() { lable=lable+","+$(this).val(); }); $("input[name='urllink[]'").each(function() { urllink=urllink+","+$(this).val(); }); $.post("menumanagement/addmenu", { postions: postionval, menugroup: menugroupval, lable: lable, menu: menu, url:urllink, '<?php echo $this->security->get_csrf_token_name(); ?>': cct }, function(data,status){ if (status=='success') { $('#alertmsg').html(data); }; }); }); //remove li $( "#lidata" ).on('click', '.remove', function() { var id=$(this).val(); var menugroupval = $('#menugroup').val(); $('.rem_'+id).remove(); var cct = $.cookie("<?php echo $this->config->item('csrf_cookie_name'); ?>"); $.post("menumanagement/deleteMenuData/"+id+'/'+menugroupval,{'<?php echo $this->security->get_csrf_token_name(); ?>': cct}, function(data,status){ if (status=='success') { $('#alertmsg').html(data); }; }); }); }); $( "#menugroup" ).on('change', function() { var menugroupval = $('#menugroup').val(); var cct = $.cookie("<?php echo $this->config->item('csrf_cookie_name'); ?>"); $.post("menumanagement/menuviewload/"+menugroupval,{'<?php echo $this->security->get_csrf_token_name(); ?>': cct}, function(data,status){ if (status=='success') { $('#lidata').html(data); }; }); }); $( "#deletemenu" ).on('click', function() { var del=confirm('Please confirm deletion'); if (del==true){ var menugroupval = $('#menugroup').val(); var cct = $.cookie("<?php echo $this->config->item('csrf_cookie_name'); ?>"); $.post("menumanagement/deletegroup/"+menugroupval,{'<?php echo $this->security->get_csrf_token_name(); ?>': cct}, function(data,status){ if (status=='success') { alert('Successfully Delete Menu.'); }; }); } }); //Custom Move to Menu $( "#Custommovetomenu" ).click(function() { var menu=$('#custommenuname').val(); var url=$('#custommenuurl').val(); var number= Math.floor((Math.random() * 10000) + 1); if ((menu=='') || (url=='')) { alert('Please fill the input...'); } else { var html='<li class="dd-item rem_'+number+'" data-id="'+number+'">'+ '<div class="pull-right out-line">'+ '<b>Custom Menu</b><button class="btnclick btn btn-link" type="button" value="'+number+'" > <span class="caret my-caret"></span>'+ '</button></div>'+ '<div class="dd-handle">'+menu+'</div>'+ '<div class="box-body ids_'+number+'" style="display: none;">'+ '<div class="form-group">'+ '<label>Menu Lable</label>'+ '<input type="text" id="lable[]"" class="form-control" name="lable[]" value="'+menu+'" placeholder="Enter ...">'+ '<input type="hidden" id="menu[]"" class="form-control" name="menu[]" value="'+menu+'" placeholder="Enter ...">'+ '</div>'+ '<div class="form-group">'+ '<label>Menu url</label>'+ '<input type="text" id="urllink[]" class="form-control" name="urllink[]" value="'+url+'" placeholder="Enter ...">'+ '</div>'+ '<button type="button" value="'+number+'" class="btn btn-default remove">Remove</button>'+ '</div>'+ '</li>'; $("#lidata").append(html); $('#custommenuname').val(''); $('#custommenuurl').val(''); } }); </script>
Copyright ©2021 || Defacer Indonesia