/**
  * api/v1/{category}/{slug}/reviews
  * Get reviews for a node.
  *
  * @param  int  $id
  * @return Response
  */
 public static function reviews($category, $slug)
 {
     $node = Node::where('category', $category)->where('slug', $slug)->first();
     $filter = isset($_GET['filter']) ? $_GET['filter'] : null;
     $skip = isset($_GET['skip']) ? $_GET['skip'] : 0;
     $take = isset($_GET['take']) ? $_GET['take'] : 10;
     switch ($filter) {
         case 'newest':
             $reviews = DB::collection('reviews')->where('node.reference', $node->_id)->orderBy('created_at', 'desc')->skip($skip)->take($take)->get();
             break;
         case 'oldest':
             $reviews = DB::collection('reviews')->where('node.reference', $node->_id)->orderBy('created_at', 'asc')->skip($skip)->take($take)->get();
             break;
         case 'highest':
             $reviews = DB::collection('reviews')->where('node.reference', $node->_id)->orderBy('score', 'desc')->skip($skip)->take($take)->get();
             break;
         case 'lowest':
             $reviews = DB::collection('reviews')->where('node.reference', $node->_id)->orderBy('score', 'asc')->skip($skip)->take($take)->get();
             break;
         default:
             $reviews = DB::collection('reviews')->where('node.reference', $node->_id)->orderBy('created_at', 'desc')->skip($skip)->take($take)->get();
             break;
     }
     return response()->json($reviews);
 }
Exemple #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     //
     $nodes = \App\Node::where('ping_success', '100')->where('snmp_success', '100')->get();
     $counter = 0;
     foreach ($nodes as $node) {
         print "{$counter} {$node->ip_address} = ";
         $discover_result = \App\Http\Controllers\NodesController::execDiscover($node->id);
         print $discover_result . PHP_EOL;
         $counter++;
     }
 }
Exemple #3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     //
     print \Carbon\Carbon::now() . ' Start snmpPoller...' . "\n";
     $nodes = \App\Node::where('ping_method', 'ping')->where('ping_params', '')->where('ping_success', 100)->get();
     $start_timestamp = time();
     $counter = 0;
     foreach ($nodes as $node) {
         // try v2c
         $snmp = new \App\Lnms\Snmp($node->ip_address, $node->snmp_comm_ro, '2c');
         $snmp->setOptions('-r 1 -t 1');
         $get_result = $snmp->get(OID_sysUpTime);
         if ($get_result) {
             $snmp_version = 2;
         } else {
             // try v1
             $snmp = new \App\Lnms\Snmp($node->ip_address, $node->snmp_comm_ro);
             $snmp->setOptions('-r 1 -t 1');
             $get_result = $snmp->get(OID_sysUpTime);
             $snmp_version = 1;
         }
         if ($get_result) {
             // snmp ok
             $snmp_success = 100;
             $get_sysUpTime = $get_result[OID_sysUpTime];
             // get sysObjectID
             $get_result2 = $snmp->get([OID_sysObjectID, OID_sysName]);
             $get_sysObjectID = $get_result2[OID_sysObjectID];
             $get_sysName = $get_result2[OID_sysName];
         } else {
             // snmp fail
             $snmp_version = 0;
             $snmp_success = 0;
             $get_sysUpTime = 0;
             $get_sysObjectID = '';
             $get_sysName = '';
         }
         $current_timestamp = time();
         $diff_timestamp = $current_timestamp - $start_timestamp;
         print \Carbon\Carbon::now() . " {$counter} ({$diff_timestamp} s.) - {$node->ip_address} {$node->snmp_comm_ro} = (v{$snmp_version}) {$snmp_success} {$get_sysUpTime} = {$get_sysObjectID} {$get_sysName}\n";
         $u_node = \App\Node::find($node->id);
         $u_node->snmp_version = $snmp_version;
         $u_node->snmp_success = $snmp_success;
         $u_node->snmp_updated = \Carbon\Carbon::now();
         $u_node->sysObjectID = $get_sysObjectID;
         $u_node->sysName = $get_sysName;
         $u_node->sysUpTime = $get_sysUpTime;
         $u_node->save();
         $counter++;
     }
     print \Carbon\Carbon::now() . ' Stop snmpPoller...' . "\n";
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $author = User::where('name', '=', 'Jamie Shepherd')->first();
     $node = Node::where('category', '=', 'films')->where('title', '=', 'Inception')->first();
     $review = new Review();
     $review->author = array('reference' => $author->_id, 'name' => $author->name, 'gravatar' => md5(strtolower(trim($author->email))));
     $review->node = array('reference' => $node->_id, 'title' => $node->title);
     $review->score = 7.9;
     $review->review = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.';
     $review->thumbs = 0;
     $review->save();
     $node->avg = number_format(round(Review::where('node.reference', $node->_id)->avg('score'), 1), 1);
     $node->increment('reviewCount');
     $node->save();
 }
 public function initializeNodes()
 {
     DB::table('nodes')->truncate();
     $node_array = ['PHP' => ['php' => ['slug' => 'php', 'description' => 'PHP(PHP: Hypertext Preprocessor的缩写,中文名:“PHP:超文本预处理器”)是一种通用开源脚本语言。'], 'Laravel' => ['slug' => 'laravel', 'description' => 'Laravel是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。'], 'Composer & Packagist' => ['slug' => 'composer-and-packagist', 'description' => 'Composer[1]是PHP中用来管理依赖(dependency)关系的工具。你可以在自己的项目中声明所依赖的外部工具库(libraries),Composer会帮你安装这些依赖的库文件。'], '重构' => ['slug' => 'refactoring', 'description' => '由于软件发展本身不可能是完美的,因此改进的过程是持续且必然的,重构的方式将作为改善软件设计的一种手段和方式,更加地拥有现实意义。'], '设计模式' => ['slug' => 'design-pattern', 'description' => '设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。'], 'Testing' => ['slug' => 'testing', 'description' => '软件测试(英语:software testing),描述一种用来促进鉴定软件的正确性、完整性、安全性和质量的过程。'], '部署' => ['slug' => 'deployment', 'description' => ''], '开源项目' => ['slug' => 'opensource-project', 'description' => '']], 'Web 开发' => ['MySQL' => ['slug' => 'mysql', 'description' => 'MySQL是一个关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司。'], 'Database' => ['slug' => 'database', 'description' => '数据库(Database)是按照数据结构来组织、存储和管理数据的仓库'], 'Git' => ['slug' => 'git', 'description' => 'Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。'], 'Linux' => ['slug' => 'linux', 'description' => 'Linux是一种自由和开放源码的类Unix操作系统,存在着许多不同的Linux版本,但它们都使用了Linux内核。'], 'WebServer' => ['slug' => 'web-server', 'description' => 'WEB服务器也称为WWW(WORLD WIDE WEB)服务器,主要功能是提供网上信息浏览服务。常见的有 Nginx, Apache..'], '算法' => ['slug' => 'algrithm', 'description' => '算法(Algorithm)是指解题方案的准确而完整的描述,是一系列解决问题的清晰指令,算法代表着用系统的方法描述解决问题的策略机制。'], '运维' => ['slug' => 'operations', 'description' => ''], '安全' => ['slug' => 'security', 'description' => ''], '云服务' => ['slug' => 'cloud-service', 'description' => '云服务开发这一概念包含几种不同的开发类型 - 软件即服务(SaaS), 平台即服务(PaaS), Web服务, 按需(on—demand)计算']], 'Mobile' => ['iPhone' => ['slug' => 'iphone-development', 'description' => 'iPhone 开发'], 'Android' => ['slug' => 'android-development', 'description' => 'Android 开发']], 'Languages' => ['JavaScript' => ['slug' => 'javascript', 'description' => 'JavaScript是一种基于对象和事件驱动并具有相对安全性的客户端脚本语言。'], 'Ruby' => ['slug' => 'ruby', 'description' => 'Ruby,一种为简单快捷的面向对象编程(面向对象程序设计)而创的脚本语言'], 'Python' => ['slug' => 'python', 'description' => 'Python, 是一种面向对象、直译式计算机程序设计语言'], 'GoLang' => ['slug' => 'golang', 'description' => 'Go语言是谷歌推出的一种全新的编程语言,可以在不损失应用程序性能的情况下降低代码的复杂性。'], 'Erlang' => ['slug' => 'erlang', 'description' => 'Erlang是一种通用的面向并发的编程语言,它由瑞典电信设备制造商爱立信所辖的CS-Lab开发,目的是创造一种可以应对大规模并发活动的编程语言和运行环境。']], '社区' => ['公告' => ['slug' => 'announcement', 'description' => ''], '反馈' => ['slug' => 'feedback', 'description' => '对于社区的优化或者 bug report , 可以在此节点下提'], '社区开发' => ['slug' => 'community-development', 'description' => '构建此社区软件的开发讨论节点'], '线下聚会' => ['slug' => 'gathering', 'description' => '']], '分享' => ['健康' => ['slug' => 'health', 'description' => ''], '工具' => ['slug' => 'toolings', 'description' => '使用工具, 是人类文明的标志'], '其他' => ['slug' => 'other-share', 'description' => '抱歉, 如果你分享的话题不属于其他节点的话, 只能选择这里咯. '], '书籍' => ['slug' => 'book-share', 'description' => '书籍是知识载体, 让我们一起站在巨人的肩膀上. '], '求职' => ['slug' => 'request-a-job', 'description' => '介绍下你自己, 让大家帮你找到一份好的工作'], '招聘' => ['slug' => 'hire', 'description' => '这里有高质量的 PHPer, 记得认真填写你的需求, 薪资待遇是必须写的哦.'], '创业' => ['slug' => 'start-up', 'description' => ''], '移民' => ['slug' => 'immigration', 'description' => '']]];
     $top_nodes = array();
     foreach ($node_array as $key => $value) {
         $top_nodes[] = ['name' => $key];
     }
     DB::table('nodes')->insert($top_nodes);
     $nodes = array();
     foreach ($node_array as $key => $value) {
         $top_node = Node::where('name', '=', $key)->first();
         foreach ($value as $snode => $svalue) {
             $nodes[] = ['parent_node' => $top_node->id, 'name' => $snode, 'slug' => $svalue['slug'], 'description' => $svalue['description']];
         }
     }
     DB::table('nodes')->insert($nodes);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function create($category, $slug)
 {
     $node = Node::where('category', $category)->where('slug', $slug)->first();
     $score = 0.0;
     if (Input::get('score') == 10) {
         $score = 10;
     } else {
         $score = Input::get('score');
     }
     // If it's the first review, reward the user
     if (Review::where('node.reference', $node->_id)->count() == 0) {
         Auth::user()->points += 1000;
         Auth::user()->save();
     }
     // Create the review
     $review = new Review();
     $review->node = array('reference' => $node->_id, 'title' => $node->title);
     $review->author = array('reference' => Auth::user()->_id, 'name' => Auth::user()->name, 'gravatar' => md5(strtolower(trim(Auth::user()->email))));
     $review->score = (double) $score;
     $review->review = Input::get('review');
     $review->thumbs = 0;
     $review->spoilers = Input::has('spoilers');
     $review->save();
     if ($review->score < 4) {
         $node->increment('overall_negative');
     } else {
         if ($review->score < 7) {
             $node->increment('overall_mixed');
         } else {
             $node->increment('overall_positive');
         }
     }
     $node->avg = number_format(round(Review::where('node.reference', $node->_id)->avg('score'), 1), 1);
     $node->increment('reviewCount');
     $node->save();
     return back();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param string $category
  * @param string $slug
  * @return Response
  */
 public function update($category, $slug)
 {
     $node = Node::where('category', $category)->where('slug', $slug)->first();
     $node->backgroundPosition = Input::get('position');
     $node->save();
     return redirect('/' . $category . '/' . $slug);
 }
Exemple #8
0
 public static function sysObjectID_select()
 {
     $_ret = array();
     $_ret[''] = '-- sysObjectID --';
     $sysObjectIDes = \App\Node::where('sysObjectID', '<>', '')->groupBy('sysObjectID')->orderBy('sysObjectID')->get();
     foreach ($sysObjectIDes as $sysObjectID) {
         $_ret[$sysObjectID->sysObjectID] = $sysObjectID->sysObjectID;
     }
     return $_ret;
 }
Exemple #9
0
 /**
  * poller ap bssid
  *
  * @return Array
  */
 public function poll_apBssid()
 {
     // return
     $_ret = [];
     $snmp = new \App\Lnms\Snmp($this->node->ip_address, $this->node->snmp_comm_ro);
     // oid.apMacDec(6).bssidIndex.bssidMacDec(6) = bssidCurrentChannel
     $walk_wlanAPCurrentChannel = $snmp->walk(OID_Aruba_wlanAPCurrentChannel);
     if (count($walk_wlanAPCurrentChannel) == 0) {
         return $_ret;
     }
     foreach ($walk_wlanAPCurrentChannel as $key1 => $bssidCurrentChannel) {
         $bssidSuffix = str_replace(OID_Aruba_wlanAPCurrentChannel . '.', '', $key1);
         $tmp1 = explode('.', $bssidSuffix);
         $apMacDec = $tmp1[0] . '.' . $tmp1[1] . '.' . $tmp1[2] . '.' . $tmp1[3] . '.' . $tmp1[4] . '.' . $tmp1[5];
         $apMacAddress = sprintf("%02s", dechex($tmp1[0])) . ':' . sprintf("%02s", dechex($tmp1[1])) . ':' . sprintf("%02s", dechex($tmp1[2])) . ':' . sprintf("%02s", dechex($tmp1[3])) . ':' . sprintf("%02s", dechex($tmp1[4])) . ':' . sprintf("%02s", dechex($tmp1[5]));
         $bssidIndex = $tmp1[6];
         $bssidMacAddress = sprintf("%02s", dechex($tmp1[7])) . ':' . sprintf("%02s", dechex($tmp1[8])) . ':' . sprintf("%02s", dechex($tmp1[9])) . ':' . sprintf("%02s", dechex($tmp1[10])) . ':' . sprintf("%02s", dechex($tmp1[11])) . ':' . sprintf("%02s", dechex($tmp1[12]));
         // get more details about bssid
         $bssidDetails = $snmp->get([OID_Aruba_wlanAPESSID . '.' . $bssidSuffix, OID_Aruba_wlanAPRadioType . '.' . $apMacDec . '.' . $bssidIndex, OID_Aruba_wlanAPRadioNumAssociatedClients . '.' . $apMacDec . '.' . $bssidIndex, OID_Aruba_wlanAPTxBytes . '.' . $bssidSuffix, OID_Aruba_wlanAPRxBytes . '.' . $bssidSuffix]);
         // bssidName
         if ($bssidDetails[OID_Aruba_wlanAPESSID . '.' . $bssidSuffix] === false) {
             $bssidName = '';
         } else {
             $bssidName = $bssidDetails[OID_Aruba_wlanAPESSID . '.' . $bssidSuffix];
         }
         // bssidSpec
         if ($bssidDetails[OID_Aruba_wlanAPRadioType . '.' . $apMacDec . '.' . $bssidIndex] === false) {
             $bssidSpec = '';
         } else {
             $bssidSpec = $bssidDetails[OID_Aruba_wlanAPRadioType . '.' . $apMacDec . '.' . $bssidIndex];
         }
         // bssidClients_count
         if ($bssidDetails[OID_Aruba_wlanAPRadioNumAssociatedClients . '.' . $apMacDec . '.' . $bssidIndex] === false) {
             $bssidClients_count = '';
         } else {
             $bssidClients_count = $bssidDetails[OID_Aruba_wlanAPRadioNumAssociatedClients . '.' . $apMacDec . '.' . $bssidIndex];
         }
         // OID_Aruba_wlanAPTxBytes
         if ($bssidDetails[OID_Aruba_wlanAPTxBytes . '.' . $bssidSuffix] === false) {
             $bssidTxBytes = '';
         } else {
             $bssidTxBytes = $bssidDetails[OID_Aruba_wlanAPTxBytes . '.' . $bssidSuffix];
         }
         // OID_Aruba_wlanAPRxBytes
         if ($bssidDetails[OID_Aruba_wlanAPRxBytes . '.' . $bssidSuffix] === false) {
             $bssidRxBytes = '';
         } else {
             $bssidRxBytes = $bssidDetails[OID_Aruba_wlanAPRxBytes . '.' . $bssidSuffix];
         }
         //
         $apNode = \App\Node::where('mac_address', $apMacAddress)->first();
         if ($apNode) {
             // found apNode
             $_ret[] = ['table' => 'bssids', 'action' => 'sync', 'key' => ['node_id' => $apNode->id, 'bssidIndex' => $bssidIndex], 'data' => ['bssidMacAddress' => $bssidMacAddress, 'bssidName' => $bssidName, 'bssidSpec' => $bssidSpec, 'bssidMaxRate' => 0, 'bssidCurrentChannel' => $bssidCurrentChannel, 'bssidClients_count' => $bssidClients_count, 'bssidClients_updated' => \Carbon\Carbon::now()]];
             if (\App\Bssid::where('bssidIndex', $bssidIndex)->first()) {
                 // insert
                 $_ret[] = ['table' => 'bds', 'action' => 'insert', 'key' => ['node_id' => $apNode->id, 'bssid_id' => \App\Bssid::where('bssidIndex', $bssidIndex)->first()->id, 'clientMacAddress' => $bssidMacAddress, 'timestamp' => \Carbon\Carbon::now()], 'data' => ['clientIpAddress' => '', 'clientSignalStrength' => '', 'clientUserAgent' => '', 'clientUserType' => '', 'clientBytesReceived' => $bssidRxBytes, 'clientBytesSent' => $bssidTxBytes]];
                 print \App\Bssid::where('bssidIndex', $bssidIndex)->first()->id . ' count=' . count($_ret) . "\n";
             }
         }
     }
     return $_ret;
 }
Exemple #10
0
 /**
  * get status
  *
  */
 public function api_status($ip)
 {
     $node = \App\Node::where('ip_address', $ip)->first();
     if ($node) {
         $result = 'found';
         $ping_success = $node->ping_success;
     } else {
         $result = 'not found';
         $ping_success = false;
     }
     return response()->json(['result' => $result, 'ping_success' => $ping_success]);
 }
Exemple #11
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $start_timestamp = time();
     // options
     $option_node_class = $this->option('node_class');
     $option_poller_class = $this->option('poller_class');
     $option_poller_method = $this->option('poller_method');
     // check class
     $poller_class = '\\App\\Lnms\\' . $option_poller_class;
     if ($option_poller_class == '' || !class_exists($poller_class)) {
         print 'Error: class "' . $option_poller_class . '" not exist' . "\n";
         die(1);
     }
     $nodes = \App\Node::where('poll_class', $option_node_class)->where('ping_success', 100)->where('snmp_success', 100)->orderBy('ip_address')->get();
     $counter = 0;
     foreach ($nodes as $node) {
         $poller_object = new $poller_class($node);
         if ($option_poller_method == '' || !method_exists($poller_object, $option_poller_method)) {
             print 'Error: method "' . $option_poller_class . '::' . $option_poller_method . '" not exist' . "\n";
             die(1);
         }
         $poller_result = $poller_object->{$option_poller_method}();
         print \Carbon\Carbon::now() . ' ' . $counter . ' ';
         print $node->ip_address . ' ' . $option_poller_method . ' ';
         print 'count=' . count($poller_result);
         print "\n";
         for ($i = 0; $i < count($poller_result); $i++) {
             switch ($poller_result[$i]['action']) {
                 case 'insert':
                     // insert new
                     if (isset($poller_result[$i]['key'])) {
                         \DB::table($poller_result[$i]['table'])->insert(array_merge($poller_result[$i]['key'], $poller_result[$i]['data']));
                     } else {
                         \DB::table($poller_result[$i]['table'])->insert($poller_result[$i]['data']);
                     }
                     break;
                 case 'sync':
                 case 'update':
                     // query existing data by key
                     $poll_db = \DB::table($poller_result[$i]['table']);
                     foreach ($poller_result[$i]['key'] as $poll_key => $poll_value) {
                         $poll_db = $poll_db->where($poll_key, $poll_value);
                     }
                     if ($poll_db->count() > 0) {
                         // update
                         \DB::table($poller_result[$i]['table'])->where('id', $poll_db->first()->id)->update($poller_result[$i]['data']);
                     } else {
                         if ($poller_result[$i]['action'] == 'sync') {
                             // just insert for 'sync'
                             if (isset($poller_result[$i]['key'])) {
                                 \DB::table($poller_result[$i]['table'])->insert(array_merge($poller_result[$i]['key'], $poller_result[$i]['data']));
                             } else {
                                 \DB::table($poller_result[$i]['table'])->insert($poller_result[$i]['data']);
                             }
                         }
                     }
                     // TODO : detect and delete removed Port from DB
                     break;
             }
         }
         $counter++;
     }
     $current_timestamp = time();
     $total_runtime = $current_timestamp - $start_timestamp;
     print \Carbon\Carbon::now() . ' ';
     print $poller_class . '(' . $option_node_class . ')::' . $option_poller_method . ' ' . count($nodes) . ' nodes, ';
     print 'runtime = ' . $total_runtime . " s.\n";
 }
Exemple #12
0
 /**
  *
  * @return view
  */
 public function dashboard_by_project()
 {
     // summary by project
     $projects = \App\Project::orderBy('name')->get();
     for ($i = 0; $i < count($projects); $i++) {
         $nodesAll = \App\Node::where('project_id', $projects[$i]->id)->get();
         $nodesUp = \App\Node::where('project_id', $projects[$i]->id)->where('ping_success', '100')->get();
         $projects[$i]->nodesUp = $nodesUp->count();
         $projects[$i]->nodesDown = $nodesAll->count() - $nodesUp->count();
         // no node assigned in this project
         if ($nodesAll->count() == 0) {
             $projects[$i]->nodesUpnPercent = 0;
             $projects[$i]->nodesDownPercent = 0;
         } else {
             $projects[$i]->nodesUpPercent = $nodesUp->count() / $nodesAll->count() * 100;
             $projects[$i]->nodesDownPercent = 100 - $projects[$i]->nodesUpPercent;
             // to prevent too small click area
             if ($projects[$i]->nodesDownPercent > 0 && $projects[$i]->nodesDownPercent < 10) {
                 $projects[$i]->nodesUpPercent -= 10;
                 $projects[$i]->nodesDownPercent += 10;
             }
             if ($projects[$i]->nodesUpPercent > 0 && $projects[$i]->nodesUpPercent < 10) {
                 $projects[$i]->nodesUpPercent += 10;
                 $projects[$i]->nodesDownPercent -= 10;
             }
         }
     }
     return view('pages.dashboard_by_project', compact('projects'));
 }
Exemple #13
0
@section('content')
 <h1>locations.show</h1>

  @include('locations.info')

  <a href="/locations/{{ $location->id }}/edit" class="btn btn-primary">Edit Location</a>

  {!! Form::button('Delete', ['class' => 'btn btn-danger',
                              'data-toggle' => 'modal',
                              'data-target' => '#confirmModal']) !!}
  <a href="/locations" class="btn btn-default">Back</a>

<?php 
$child_locations = \App\Location::where('parent_id', $location->id)->get();
$nodes_in_location = \App\Node::where('location_id', $location->id)->get();
?>
<!-- Confirm Modal -->
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true">
 <div class="modal-dialog">
  <div class="modal-content">
   <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title" id="confirmModalLabel">Confirm?</h4>
   </div>
   <div class="modal-body">
    @if ( $child_locations->count() > 0 || $nodes_in_location->count() > 0 )
     <p>Cannot Delete <strong>{{ $location->name }}</strong></p>
     @if ( $child_locations->count() > 0 )
      <p><li> There are locations use this location as parent.</p>
     @endif