$this->t->set_var('district_number',$districts[$i]['district']);
$this->t->set_var('district_name',$districts[$i]['name']);
$supervisor = $districts[$i]['supervisor'];
- $unique_companionships='';
// Select all the unique companionship numbers for this district
$sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $districts[$i]['district'];
$this->db->query($sql,__LINE__,__FILE__);
- $j=0;
+ $j=0; $unique_companionships = '';
while ($this->db->next_record())
{
$unique_companionships[$j]['companionship'] = $this->db->f('companionship');
// Get a list of all the companionships in this district
$sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $district;
$this->db->query($sql,__LINE__,__FILE__);
- $j=0;
+ $j=0; $unique_companionships = '';
while ($this->db->next_record())
{
$unique_companionships[$j]['companionship'] = $this->db->f('companionship');
// Select all the unique companionship numbers for this district
$sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $district;
$this->db->query($sql,__LINE__,__FILE__);
- $j=0; $unique_companionships='';
+ $j=0; $unique_companionships = '';
while ($this->db->next_record())
{
$unique_companionships[$j]['companionship'] = $this->db->f('companionship');
// Select all the unique companionship numbers for this district
$sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $districts[$d]['district'];
$this->db->query($sql,__LINE__,__FILE__);
- $j=0;
+ $j=0; $unique_companionships = '';
while ($this->db->next_record())
{
$unique_companionships[$j]['companionship'] = $this->db->f('companionship');
$notes = get_var('notes',array('GET','POST'));
$eqpresppi = get_var('eqpresppi',array('GET','POST'));
- $sql = "SELECT * FROM eq_presidency where valid=1 and eqpres=0";
+ $sql = "SELECT * FROM eq_presidency where valid=1 and (president=1 or counselor=1 or secretary=1)";
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record())
{
$this->t->set_var('district_number',$districts[$i]['district']);
$this->t->set_var('district_name',$districts[$i]['name']);
$supervisor = $districts[$i]['supervisor'];
- $unique_companionships='';
// Select all the unique companionship numbers for this district
$sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $districts[$i]['district'];
-
$this->db->query($sql,__LINE__,__FILE__);
- $j=0;
+ $j=0; $unique_companionships = '';
while ($this->db->next_record())
{
$unique_companionships[$j]['companionship'] = $this->db->f('companionship');
$date = get_var('date',array('GET','POST'));
$notes = get_var('notes',array('GET','POST'));
$eqpresppi = get_var('eqpresppi',array('GET','POST'));
-
- $sql = "SELECT * FROM eq_district where valid=1 ORDER BY district ASC";
- $this->db->query($sql,__LINE__,__FILE__);
- while ($this->db->next_record())
- {
- $supervisor = $this->db->f('supervisor');
- $sql = "SELECT * FROM eq_elder WHERE elder=" . $supervisor;
- $this->db2->query($sql,__LINE__,__FILE__);
- $this->db2->next_record();
- $interviewer_name = $this->db2->f('name');
-
- if($supervisor == $interviewer) {
- $this->t->set_var('interviewer',$supervisor . ' selected');
- } else {
- $this->t->set_var('interviewer',$interviewer);
- }
- $this->t->set_var('interviewer_name',$interviewer_name);
- $this->t->fp('int_list','interviewer_list',True);
- }
+
+ $sql = "SELECT * FROM eq_presidency where valid=1 and (president=1 or counselor=1 or secretary=1 or district!=0)";
+ $this->db2->query($sql,__LINE__,__FILE__);
+ while ($this->db2->next_record())
+ {
+ $elder = $this->db2->f('elder');
+ $interviewer_name = $this->db2->f('name');
+ if($elder == $interviewer) {
+ $this->t->set_var('interviewer',$interviewer . ' selected');
+ } else {
+ $this->t->set_var('interviewer',$interviewer);
+ }
+ $this->t->set_var('interviewer_name',$interviewer_name);
+ $this->t->fp('int_list','interviewer_list',True);
+ }
if($action == 'save')
{
$dtstart = gmdate("Ymd"."\T"."His"."\Z", mktime($hour,$minute,$seconds,$month,$day,$year));
$dtstartstr = date("l, F d, o g:i A", mktime($hour,$minute,$seconds,$month,$day,$year));
- // Set the email address of the person making the appointment
- $from = $GLOBALS['phpgw_info']['user']['fullname'] . "<" .
- $GLOBALS['phpgw_info']['user']['preferences']['email']['address'] . ">";
-
$sql = "SELECT * FROM eq_presidency where presidency='$presidency'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$interviewer = $this->db2->f('name');
}
+ // Set the email address of the interviewer
+ $from = $email;
+
if($elder > 0) {
$sql = "SELECT * FROM eq_elder where elder='$elder'";
$this->db2->query($sql,__LINE__,__FILE__);