$this->t->set_var('edit',$GLOBALS['phpgw']->link('/eq/index.php',$link_data));
$this->t->set_var('lang_edit','Edit');
- $link_data['menuaction'] = 'eq.eq.act_update';
- $link_data['activity'] = '0';
- $link_data['action'] = 'add';
- $this->t->set_var('add','<form method="POST" action="' . $GLOBALS['phpgw']->link('/eq/index.php',$link_data)
- . '"><input type="submit" name="Add" value="' . 'Add Activity' .'"></font></form>');
-
$this->t->fp('list','act_list',True);
}
+ $link_data['menuaction'] = 'eq.eq.act_update';
+ $link_data['activity'] = '0';
+ $link_data['action'] = 'add';
+ $this->t->set_var('add','<form method="POST" action="' . $GLOBALS['phpgw']->link('/eq/index.php',$link_data)
+ . '"><input type="submit" name="Add" value="' . 'Add Activity' .'"></font></form>');
+
$this->t->pfp('out','act_list_t');
$this->save_sessiondata();
}
// Re-add the elders who are checked as having participated in this activity
$elders = get_var('elder_name',array('POST'));
- foreach ($elders as $elder)
- {
- $this->db->query("INSERT INTO eq_participation (elder,activity) "
- . "VALUES (" . $elder . ",". $activity['activity'] . ")",__LINE__,__FILE__);
- }
-
+ if(is_array($elders)) { // Only do the foreach loop if we have a valid array of elders to work with
+ foreach ($elders as $elder)
+ {
+ $this->db->query("INSERT INTO eq_participation (elder,activity) "
+ . "VALUES (" . $elder . ",". $activity['activity'] . ")",__LINE__,__FILE__);
+ }
+ }
+
$this->act_list();
return false;
}
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
- $sql = "SELECT * FROM eq_ppi WHERE elder=" . $id . " ORDER BY date DESC";
+ $sql = "SELECT * FROM eq_ppi WHERE elder=" . $id . " AND eqpresppi=1 ORDER BY date DESC";
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) { $date = $this->db->f('date'); } else { $date = ""; }
$link_data['menuaction'] = 'eq.eq.ppi_update';
$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_elder WHERE elder=" . $interviewer;
+
+ $sql = "SELECT * FROM eq_presidency where valid=1 and (president=1 or counselor=1 or secretary=1)";
$this->db2->query($sql,__LINE__,__FILE__);
- $this->db2->next_record();
- $interviewer_name = $this->db2->f('name');
- $this->t->set_var('interviewer',$interviewer . ' selected');
- $this->t->set_var('interviewer_name',$interviewer_name);
- $this->t->set_var('eqpresppi_checked','');
- $this->t->fp('int_list','interviewer_list',True);
+ 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->set_var('eqpresppi_checked','');
+ $this->t->fp('int_list','interviewer_list',True);
+ }
if($action == 'save')
{
$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')
{
$this->t->set_var('schedule_ppi_link',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.ppi_sched'));
$this->t->set_var('schedule_ppi_link_title','Schedule Yearly PPIs');
- $date_width=150; $time_width=225; $elder_width=200; $family_width=200; $location_width=100;
+ $date_width=150; $time_width=220; $elder_width=170; $family_width=180; $location_width=100;
$table_width=$date_width + $time_width + $elder_width + $family_width + $location_width;
$header_row = "<th width=$date_width><font size=-2>Date</th>";
$header_row.= "<th width=$time_width><font size=-2>Time</th>";
$table_data.= "</td>";
// Elder drop down list (for PPIs)
- $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][elder]>';
+ $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][elder] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
for ($j=0; $j < count($elder_id); $j++) {
$id = $elder_id[$j];
$table_data.='</select></td>';
// Family drop down list (for Visits)
- $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][family]>';
+ $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][family] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
for ($j=0; $j < count($elder_id); $j++) {
$id = $family_id[$j];
// Location text box
$table_data.= '<td align=center><input type=text size="25" maxlength="120" ';
- $table_data.= 'name="sched['.$presidency.']['.$appointment.'][location]" value="'.$location.'">';
+ $table_data.= 'name="sched['.$presidency.']['.$appointment.'][location]" value="'.$location.'" STYLE="font-size : 8pt">';
$table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][appointment]" value="'.$appointment.'">';
$table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][presidency]" value="'.$presidency.'">';
$table_data.= "</td>";
// Elder drop down list
- $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][elder]>';
+ $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][elder] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
for ($j=0; $j < count($elder_id); $j++) {
$id = $elder_id[$j];
$table_data.='</select></td>';
// Family drop down list
- $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][family]>';
+ $table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][family] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
for ($j=0; $j < count($elder_id); $j++) {
$id = $family_id[$j];
// Location text box
$table_data.= '<td align=center><input type=text size="25" maxlength="120" ';
- $table_data.= 'name="sched['.$presidency.']['.$appointment.'][location]" value="">';
+ $table_data.= 'name="sched['.$presidency.']['.$appointment.'][location]" value="" STYLE="font-size : 8pt">';
$table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][appointment]" value="'.$appointment.'">';
$table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][presidency]" value="'.$presidency.'">';
if(!move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
$uploadstatus = "<b><font color=red> -E- Unable to move the uploaded file to ";
$uploadstatus.= "the target path (check the path and permissions) of: $target_path</font></b>";
+ $uploadstatus = "<b>The following file was uploaded successfully: </b><br><br>";
+ $uploadstatus.= "Tmp Filename : " . $_FILES['uploadedfile']['tmp_name'] . "<br>";
+ $uploadstatus.= "Filename : " . $_FILES['uploadedfile']['name'] . "<br>";
+ $uploadstatus.= "Type : " . $_FILES['uploadedfile']['type'] . "<br>";
+ $uploadstatus.= "Size : " . $_FILES['uploadedfile']['size'] . "<br>";
+ $uploadstatus.= "Error : " . $_FILES['uploadedfile']['error'] . "<br>";
$this->t->set_var('uploadstatus',$uploadstatus);
$this->t->pfp('uploadhandle','upload',True);
return 0;