X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;ds=inline;f=inc%2Fclass.eq.inc.php;h=fbf82aabc95218eb70a17c473a5d24168d667558;hb=7bb95f6080564d04a568f55287e17c7fad88c7d0;hp=8c2984e511210cbe2e203254bdb40552d074112f;hpb=4d253dd156e29b53b2b2d0307d71eaef3379df8d;p=eq%2F.git
diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php
index 8c2984e..fbf82aa 100644
--- a/inc/class.eq.inc.php
+++ b/inc/class.eq.inc.php
@@ -37,7 +37,8 @@ class eq
'vis_view' => True,
'vis_update' => True,
'att_view' => True,
- 'att_update' => True
+ 'att_update' => True,
+ 'dir_view' => True
);
function eq()
@@ -105,6 +106,9 @@ class eq
$link_data['menuaction'] = 'eq.eq.att_view';
$this->t->set_var('link_attendance',$GLOBALS['phpgw']->link('/eq/index.php',$link_data));
$this->t->set_var('lang_attendance','Attendance');
+ $link_data['menuaction'] = 'eq.eq.dir_view';
+ $this->t->set_var('link_dir',$GLOBALS['phpgw']->link('/eq/index.php',$link_data));
+ $this->t->set_var('lang_dir','Directory');
$this->t->pparse('out','eq_header');
}
@@ -143,6 +147,7 @@ class eq
{
$elder_id[$i] = $this->db->f('elder');
$elder_name[$i] = $this->db->f('name');
+ $elder_phone[$elder_id[$i]] = $this->db->f('phone');
$i++;
}
array_multisort($elder_name, $elder_id);
@@ -192,15 +197,16 @@ class eq
while ($this->db->next_record())
{
// Get this companions information
- if($companion_table_entry != "") { $companion_table_entry .= " / "; }
+ if($companion_table_entry != "") { $companion_table_entry .= "
/ | "; }
$companionship = $this->db->f('companionship');
$elder_id = $this->db->f('elder');
$aaronic_id = $this->db->f('aaronic');
+ $phone = $elder_phone[$elder_id];
if($elder_id) { $name = $elders[$elder_id]; }
else if($aaronic_id) { $name = $aaronic[$aaronic_id]['name']; }
- $companion_table_entry .= "$name";
+ $companion_table_entry .= "$name | ";
}
- $table_data.= "$companion_table_entry
|
";
+ $table_data.= "
|
";
// Get the names of the families assigned this home teaching companionship
$sql = "SELECT * from eq_family where valid=1 AND companionship=".$unique_companionships[$j]['companionship'];
@@ -367,6 +373,7 @@ class eq
{
$elder_id[$i] = $this->db->f('elder');
$elder_name[$i] = $this->db->f('name');
+ $elder_phone[$elder_id[$i]] = $this->db->f('phone');
$i++;
}
array_multisort($elder_name, $elder_id);
@@ -386,7 +393,7 @@ class eq
}
// Select all the unique companionship numbers for this district
- $sql = "SELECT distinct companionship FROM eq_companionship where district=". $district;
+ $sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $district;
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships='';
while ($this->db->next_record())
@@ -395,7 +402,7 @@ class eq
$j++;
}
- $comp_width=300; $visit_width=25; $table_width=$comp_width + $num_months*$visit_width;
+ $comp_width=300; $visit_width=25; $table_width=$comp_width + $visit_width;
$table_data=""; $num_companionships = 0; $num_families = 0; $visits=0;
for ($j=0; $j < count($unique_companionships); $j++) {
$companion_table_entry = "";
@@ -407,15 +414,16 @@ class eq
while ($this->db->next_record())
{
// Get this companions information
- if($companion_table_entry != "") { $companion_table_entry .= " / "; }
+ if($companion_table_entry != "") { $companion_table_entry .= " / | "; }
$companionship = $this->db->f('companionship');
$elder_id = $this->db->f('elder');
$aaronic_id = $this->db->f('aaronic');
+ $phone = $elder_phone[$elder_id];
if($elder_id) { $name = $elders[$elder_id]; }
else if($aaronic_id) { $name = $aaronic[$aaronic_id]['name']; }
- $companion_table_entry .= "$name";
+ $companion_table_entry .= "$name | ";
}
- $table_data.= "$companion_table_entry
|
";
+ $table_data.= "
|
";
// Get the names of the families assigned this home teaching companionship
$sql = "SELECT * from eq_family where valid=1 AND companionship=".$unique_companionships[$j]['companionship'];
@@ -852,6 +860,7 @@ class eq
{
$elder_id[$i] = $this->db->f('elder');
$elder_name[$i] = $this->db->f('name');
+ $elder_phone[$elder_id[$i]] = $this->db->f('phone');
$i++;
}
array_multisort($elder_name, $elder_id);
@@ -918,6 +927,7 @@ class eq
$companionship = $this->db->f('companionship');
$elder_id = $this->db->f('elder');
$aaronic_id = $this->db->f('aaronic');
+ $phone = $elder_phone[$elder_id];
if($elder_id) { $name = $elders[$elder_id]; }
else if($aaronic_id) { $name = $aaronic[$aaronic_id]['name']; }
$link_data['menuaction'] = 'eq.eq.ppi_update';
@@ -930,7 +940,7 @@ class eq
$link_data['action'] = 'add';
$link = $GLOBALS['phpgw']->link('/eq/index.php',$link_data);
if($aaronic_id == 0) {
- $table_data.= "$name | ";
+ $table_data.= "
$name | ";
} else {
$table_data.= "
$name | ";
}
@@ -1694,6 +1704,14 @@ class eq
$this->save_sessiondata();
}
+ function dir_view()
+ {
+ $this->t->set_file(array('form' => 'dir_view.tpl'));
+
+ $this->t->pfp('out','form');
+ $this->save_sessiondata();
+ }
+
}
?>