Skip to content

Commit

Permalink
Merge branch 'develop' into testing-orm-#8
Browse files Browse the repository at this point in the history
  • Loading branch information
DawoudIO committed Jan 15, 2016
2 parents 17dd80d + 0a22300 commit f54d945
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 40 deletions.
90 changes: 63 additions & 27 deletions churchinfo/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
require 'Include/Header.php';
?>
<!-- this page specific styles -->
<script src="<?= $sURLPath; ?>/vendor/almasaeed2010/adminlte/plugins/morris/morris.min.js"></script>
<script src="<?= $sURLPath; ?>/vendor/AdminLTE/plugins/raphael/raphael-min.js"></script>
<script src="<?= $sURLPath; ?>/vendor/almasaeed2010/adminlte/plugins/chartjs/Chart.min.js"></script>

<?php while ($row = mysql_fetch_array($rsQuickStat)) { ?>
<!-- Small boxes (Stat box) -->
Expand Down Expand Up @@ -267,13 +266,16 @@
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="box box-solid">
<div class="box box-info">
<div class="box-header">
<i class="ion ion-android-contacts"></i>
<h3 class="box-title">Gender Demographics</h3>
<div class="box-tools pull-right">
<div id="gender-donut-legend" class="chart-legend"></div>
</div>
</div><!-- /.box-header -->
<div class="main-box-body clearfix">
<div class="chart" id="gender-donut" style="height: 300px; position: relative;"></div>
<div class="box-body">
<canvas id="gender-donut" style="height:250px"></canvas>
</div>
</div>
</div>
Expand All @@ -282,30 +284,64 @@
<!-- this page specific inline scripts -->
<script>

var genderDonut = Morris.Donut({
element: 'gender-donut',
data: [
<?php while ($row = mysql_fetch_array($rsAdultsGender)) {
if ($row['per_Gender'] == 1 ) {
echo "{label: \"Men\", value: ". $row['numb'] ."},";
}
if ($row['per_Gender'] == 2 ) {
echo "{label: \"Women\", value: ". $row['numb'] ."},";
}
}
while ($row = mysql_fetch_array($rsKidsGender)) {
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.
var PieData = [
<?php while ($row = mysql_fetch_array($rsAdultsGender)) {
if ($row['per_Gender'] == 1 ) {
echo "{label: \"Boys\", value: ". $row['numb'] ."},";
}
if ($row['per_Gender'] == 2 ) {
echo "{label: \"Girls\", value: ". $row['numb'] ."}";
}
echo "{value: ". $row['numb'] ." , color: \"#003399\", highlight: \"#3366ff\", label: \"Men\" },";
}
if ($row['per_Gender'] == 2 ) {
echo "{value: ". $row['numb'] ." , color: \"#9900ff\", highlight: \"#ff66cc\", label: \"Women\"},";
}
}
while ($row = mysql_fetch_array($rsKidsGender)) {
if ($row['per_Gender'] == 1 ) {
echo "{value: ". $row['numb'] ." , color: \"#3399ff\", highlight: \"#99ccff\", label: \"Boys\"},";
}
if ($row['per_Gender'] == 2 ) {
echo "{value: ". $row['numb'] ." , color: \"#009933\", highlight: \"#99cc00\", label: \"Girls\",}";
}
?>
],
colors: ['Navy', 'Pink', 'Blue', 'DarkMagenta'],
resize: true
});
}
?>
];
var pieOptions = {

//String - Point label font colour
pointLabelFontColor : "#666",

//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: "#fff",
//Number - The width of each segment stroke
segmentStrokeWidth: 2,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: false,
//Boolean - whether to make the chart responsive to window resizing
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: true,
//String - A legend template
legendTemplate: "<% for (var i=0; i<segments.length; i++){%><span style=\"color: white;padding-right: 4px;padding-left: 2px;background-color:<%=segments[i].fillColor%>\"><%if(segments[i].label){%><%=segments[i].label%><%}%></span> <%}%></ul>"
};

var pieChartCanvas = $("#gender-donut").get(0).getContext("2d");
var pieChart = new Chart(pieChartCanvas);

//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
pieChart = pieChart.Doughnut(PieData, pieOptions);

//then you just need to generate the legend
var legend = pieChart.generateLegend();

//and append it to your page somewhere
$('#gender-donut-legend').append(legend);
</script>

<?php
Expand Down
10 changes: 0 additions & 10 deletions churchinfo/vendor/AdminLTE/plugins/raphael/raphael-min.js

This file was deleted.

6 changes: 3 additions & 3 deletions vagrant/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ echo "Database: tables and metadata deployed"

echo "============================================================================="
echo "======== Church CRM is now hosted @ http://192.168.33.10/ =============="
echo "======== CRM User Name: Admin =============="
echo "======== 1st time login password for Admin: changeme =============="
echo "======== churchinfo is active project source =============="
echo "======== CRM User Name: admin =============="
echo "======== 1st time login password for admin: changeme =============="
echo "======== churchCRM is active project source =============="
echo "============================================================================="

0 comments on commit f54d945

Please sign in to comment.