Skip to content

Instantly share code, notes, and snippets.

Nathan Parikh nathanp

Block or report user

Report or block nathanp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nathanp
nathanp / rock-pending-registration-payments.lava
Created May 29, 2019
Show a user their registrations with pending payments
View rock-pending-registration-payments.lava
<div class="panel panel-default">
<div class="panel-heading">Registrations</div>
<ul class="list-group list-group-panel">
{% registration where:'PersonAliasId == {{ CurrentPerson.PrimaryAliasId }}' %}
{% for reg in registrationItems %}
{% if reg.BalanceDue > 0 %}
<li class="list-group-item">
{{ reg.RegistrationInstance.Name }} <br />
Balance due - {{ reg.BalanceDue | FormatAsCurrency }} <br />
<a href="{{ 'Global' | Attribute:'PublicApplicationRoot' }}Registration?RegistrationId={{ reg.Id }}">Complete Payment</a>
View cumulative sunday attendance.lava
{%metricvalue where:'MetricId == 990' sort:'MetricValueDateTime desc' limit:'1'%}
{% for metricvalue in metricvalueItems %}
{% capture currentWorshipAttendance %}{{ metricvalue.YValue | Format:'#,##0' }}{% endcapture %}
{% endfor %}
{% endmetricvalue %}
{%metricvalue where:'MetricId == 1117' sort:'MetricValueDateTime desc' limit:'1'%}
{% for metricvalue in metricvalueItems %}
{% capture currentChapelAttendance %}{{ metricvalue.YValue | Format:'#,##0' }}{% endcapture %}
{% endfor %}
{% endmetricvalue %}
@nathanp
nathanp / Button that links to Connect Group report.lava
Created Feb 12, 2019
Only visible if the current person is a leader of the group being viewed. Relies on query strings.
View Button that links to Connect Group report.lava
@nathanp
nathanp / Connect Group Follow Up.lava
Last active Feb 12, 2019
Follow up for Connect Group Leaders
View Connect Group Follow Up.lava
<script src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready( function () {
$('#CGFollowUp').DataTable( {
paging: false,
"searching": false,
"order": [3, 'asc'],
"info": false
} );
} );
@nathanp
nathanp / pathway.lava
Last active Feb 6, 2019
RockRMS - Discipleship Pathway
View pathway.lava
<div class="row">
<div class="col-sm-12">
<div class="persondetails-group">
<header>
<h1>Hallmark's Discipleship Pathway</h1>
</header>
</div><!-- .persondetails-group-->
</div>
View Listing Events via Attribute.lava
<div class="panel panel-block">
<div class="panel-heading">
<h4 class="panel-title">Important Events</h4>
</div>
<div class="">
{% eventcalendaritem where:'EventCalendarId == 1' %}
<ul class="list-group list-group-panel">
{% for eventcalendaritem in eventcalendaritemItems %}
{% if eventcalendaritem.EventItem.IsActive == true %}
{% assign level = eventcalendaritem | Attribute:'EventLevel' %}
@nathanp
nathanp / Adult Connect Groups Count.lava
Last active May 3, 2018
RockRMS - Metric SQL and Lava
View Adult Connect Groups Count.lava
{% assign previousSunday = 'Now' | SundayDate | DateAdd:-7 | Date:'M/dd/yyyy' %}
Metric Date: {{ previousSunday }}
<br />
{% group where:'ParentGroupId == 49 || ParentGroupId == 10603 && IsActive == true' %}
{% for group in groupItems %}
{% attendance where:'DidAttend == true && GroupId == {{ group.Id }} && SundayDate == "{{ previousSunday }}"' count:'true' %}
{% if count > 0 %}
Metric Partition: {{ group.Name }}
<br />
Metric Value: {{ count }}
View dl-file.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# BEGIN THIS DL-FILE.PHP ADDITION
@nathanp
nathanp / dl-file.php
Last active Apr 5, 2017
File that helps restrict access to uploads in a specific folder. Use in conjunction with .htaccess file - https://gist.github.com/nathanp/02a615fbc7e8bac6ca139c6c3bea38e7
View dl-file.php
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
* @link https://gist.github.com/hakre/1552239
*
* @author Nathan Parikh <https://ndzynes.com/>
You can’t perform that action at this time.