-
Notifications
You must be signed in to change notification settings - Fork 0
/
integration_join_code.php
50 lines (39 loc) · 1.3 KB
/
integration_join_code.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
// Require config file from command line argument
if (count($argv) > 1) {
require_once $argv[1];
} else {
echo "usage: $argv[0] [config_script].php\n";
exit;
}
// Initialize CiviCRM
require_once '/var/www/imba/sites/all/modules/civicrm/civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config =& CRM_Core_Config::singleton();
require_once "api/v2/Contact.php";
// Account for chapters without nicknames
if(!$nickname) $nickname = $name;
$message = "// CiviTracker Code
case xx:
\$_GET['custom_76'] = \"" . $region . "\";
\$_GET['custom_77'] = \"" . $chapter . "\";
break;
// Join Page Array
'" . $nickname . "'\t=> array(
'fam' => xx,
'ind' => xx,
'region' => '" . $region . "',
'name' => '" . $chapter . "'),
// Individual Link
<option class=\"xx\" value=\"<?=\$url['" . $nickname . "']['ind']?>\"><?=\$url['" . $nickname . "']['name']?></option>
// Retailer Link
<option class=\"xx\" value=\"<?=\$retail_url . '&custom_76=" . $region . "&custom_77=" . $chapter . "'?>\">" . $chapter . "</option>
";
// output
echo $message;
// Write stats to file
$outfile = getcwd() . "/integration_join_code-$nickname-" .date('Ymd-U') . ".txt";
$fh = fopen($outfile, 'w') or die("\nCan't open file $outfile");
fwrite($fh, $message);
fclose($fh);
?>