Sindbad~EG File Manager
<!-- Created by Saravanan On 2017 Nov 14 -->
@extends('poll.layout')
@section('title')
<title>Poll View form</title>
@stop
@section('scriptTop')
{{ HTML::script('/js/raphael-min.js') }}
{{ HTML::script('/js/morris.js') }}
@stop
@section('css')
{{ HTML::style('/css/morris.css') }}
<style type="text/css">
#bar-camp text
{
fill:#000;
}
.staticlabel
{
margin: 5px;
font-weight: bold;
font-size: 20px;
}
.color-box {
width: 15px;
height: 15px;
display: inline-block;
background-color: #ccc;
/* position: absolute; */
left: 5px;
top: 5px;
}
</style>
{{-- HTML::style('/css/polls.css') --}}
@stop
@section('content')
<?php
$colors = ["#003399","#cc0000","#4a148c","#f4511e","#006064","#880e4f"];
$json_color = json_encode($colors);
?>
{{ Form::open(array('url'=>''))}}
<div class="row">
<div class="col-sm-12 form-group text-center result-title">
<h2 class="margin20">{{$poll->title}}</h2>
</div>
</div>
<div class="row">
<div class="col-sm-12 ">
<div class="row">
<div class="col-sm-12 form-group ">
<p>{{ $poll->description }}</p>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group text-center">
<h2 class="margin15">{{$poll->hall_name}}</h2>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group text-center">
<h2 class="margin15">{{$poll->session_name}}</h2>
</div>
</div>
<div class="row">
<div class="col-sm-6 form-group">
<b>Started @ <strong>{{ date('d/m/Y H:i',strtotime($poll->start_at)) }}</strong></b>
</div>
<div class="col-sm-6 form-group">
<?php
$currnet_time = date('d/m/Y H:i');
$start_time = date('d/m/Y H:i',strtotime($poll->start_at));
$end_time = date('d/m/Y H:i',strtotime($poll->end_at));
$show_time = "";
if($start_time > $currnet_time)
{
$show_time = $end_time;
}
elseif($currnet_time < $end_time)
{
$show_time = $currnet_time;
}
else
{
$show_time = $end_time;
}
?>
<b>Ended @ <strong>{{ $show_time }}</strong></b>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group result">
<h2 class="margin10">Options</h2>
<ul class="nav nav-tabs">
<li><a class="active" data-toggle="tab" href="#chart">Chart</a></li>
<li><a data-toggle="tab" href="#table">Table</a></li>
</ul>
<div class="tab-content">
<div id="chart" class="tab-pane fade in active">
<div class="row">
<div class="col-sm-12 text-center boxcenter">
<?php
$dlist = json_decode($barData);
?>
@foreach($dlist as $value)
{{-- <div class="col-sm-3"> --}}
<span class="colorbox"></span> <span class="staticlabel"> {{ $value->x}} : {{ $value->y }}</span>
{{-- </div> --}}
@endforeach
</div>
<div class="col-sm-12">
<div id="bar-camp"></div>
</div>
</div>
</div>
<div id="table" class="tab-pane fade">
<div class="row">
<div class ="col-sm-12">
<table class="table table-bordered" id="tblOptions">
<thead>
<tr>
<th>#</th>
<th>Options</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<?php $sno=1; ?>
@foreach ($options as $key => $value)
<tr>
<td data-label="#">{{ $sno++ }}</td>
<td data-label="Option">{{ $value->option_text}}</td>
<td data-label="Count">{{ isset($respons[$value->poll_option_id])? count($respons[$value->poll_option_id]) : '0' }} </td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class ="col-sm-12 text-center">
<a href="{{ url('/').'/pollindex'}}"class="btn btn-primary" >back</a>
</div>
</div>
{{ Form::close() }}
<script>
//http://stackoverflow.com/questions/19800089/morris-graphs-have-custom-tooltip-when-hover
//https://stackoverflow.com/questions/26763825/varying-bar-colors-with-morris-js-bar-chart
var baseUrl = "{{ url('/') }}";
$(function () {
window.setInterval(chart, 1000);
morrisTemplate= {
element: 'bar-camp',
//data: {{ $barData }},
xkey: 'x',
ykeys: ['y'],
xLabels: ['y'],
ymax: 100,
labelColor: '#000',
//lineColors: ['#0b62a4','#09BDB8','#08A334','#8A2106','#E42106'],
barColors: function (row, series, type) {
return getColors(row.x);
},
labels: ['Percentage'],
parseTime: false,
behaveLikeLine: false,
//formatter: function (y) { return y + "%"}
yLabelFormat: function(y) {
return y + "%";
},
};
function chart(){
$.ajax({
url: baseUrl + "/getchart/"+ $("#hdnpollid").val(),
success: function (data){
morrisTemplate.data = data;
Morris.Bar(morrisTemplate);
},
});
}
});
function getColors(i)
{
var colors = ["#003399","#cc0000","#4a148c","#f4511e","#006064","#880e4f"];
return colors[i];
}
</script>
@stop
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists