-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from CON-In-A-Box/ARIC_cleanup_concom
Aric - Cleanup ConCom
- Loading branch information
Showing
8 changed files
with
128 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace concom; | ||
|
||
class POSITION | ||
{ | ||
|
||
|
||
public static function getConComPosition($account, $event = null) | ||
{ | ||
if ($event == null) { | ||
$event = current_eventID(); | ||
} | ||
$sql = <<<SQL | ||
SELECT | ||
*, | ||
( | ||
SELECT | ||
Name | ||
FROM | ||
Departments | ||
WHERE | ||
DepartmentID = c.DepartmentID | ||
) as Department, | ||
( | ||
SELECT | ||
Name | ||
FROM | ||
ConComPositions | ||
WHERE | ||
PositionID = c.PositionID | ||
) as Position | ||
FROM | ||
ConComList as c | ||
WHERE | ||
AccountID = $account | ||
AND EventID = $event; | ||
SQL; | ||
$result = \DB::run($sql); | ||
$value = $result->fetch(); | ||
$retvalue = null; | ||
while ($value !== false) { | ||
if ($retvalue == null) { | ||
$retvalue = array(); | ||
} | ||
$retvalue[] = ['position' => $value['Position'], | ||
'department' => $value['Department'], | ||
'departmentId' => $value['DepartmentID'], | ||
'note' => $value['Note']]; | ||
$value = $result->fetch(); | ||
} | ||
return $retvalue; | ||
|
||
} | ||
|
||
|
||
/* end POSITION */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace concom; | ||
|
||
class REGISTRATION | ||
{ | ||
|
||
|
||
public static function inRegistration($lookup) | ||
{ | ||
$sql = "SELECT count(ListRecordID) as count From ConComList"; | ||
$sql .= " WHERE AccountID = $lookup"; | ||
$sql .= " AND DepartmentID = (SELECT DepartmentID FROM Departments WHERE Name = 'Registration');"; | ||
$result = \DB::run($sql); | ||
$value = $result->fetch(); | ||
if ($value !== false && $value['count']) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
|
||
/* end REGISTRATION */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace concom; | ||
|
||
class VOLUNTEERS | ||
{ | ||
|
||
|
||
public static function inVolunteers($lookup) | ||
{ | ||
$sql = "SELECT count(ListRecordID) as count From ConComList"; | ||
$sql .= " WHERE AccountID = $lookup"; | ||
$sql .= " AND DepartmentID = (SELECT DepartmentID FROM Departments WHERE Name = 'Volunteers');"; | ||
$result = \DB::run($sql); | ||
$value = $result->fetch(); | ||
if ($value !== false && $value['count']) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
|
||
/* end VOLUNTEERS */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
require_once(__DIR__.'/functions/VOLUNTEERS.inc'); | ||
require_once(__DIR__.'/functions/POSITION.inc'); | ||
require_once(__DIR__.'/functions/REGISTRATION.inc'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters