X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=inc%2Fclass.eq.inc.php;h=850129bf5ea7f2df04d6b382ba1a6d9794f188ff;hb=5f9a574d6d8aa73a22afe75d08ed1c16f4af81f4;hp=1c25d7ace95cfcfcc977fe99cdac21f5ff65a44c;hpb=d606bcf23ab3cc274e432950364fa783c52c9c00;p=eq%2F.git diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 1c25d7a..850129b 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -763,7 +763,7 @@ class eq . " AND date='".$activity['date']."' AND notes='".$activity['notes']."'"; $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { - print "activity: " . $this->db->f('activity') . "
"; + //print "activity: " . $this->db->f('activity') . "
"; $activity['activity'] = $this->db->f('activity'); } @@ -1683,6 +1683,7 @@ class eq $elder_name = $entry['elder_name']; $int_pri = $entry['pri']; $aaronic = $entry['aaronic']; + //print "int_notes: $int_notes elder_name: $elder_name aaronic: $aaronic
"; if($aaronic == 0) { // Perform database save actions here $this->db->query("UPDATE eq_elder set " . @@ -1886,20 +1887,24 @@ class eq $table_data.= "$name"; $table_data.= "$phone"; $table_data.= ""; - $table_data.= ''; + foreach(range(0,6) as $num) { + if($num == 0) { $num = 1; } else {$num = $num*5; } + if($int_pri == $num) { $selected[$num] = 'selected="selected"'; } else { $selected[$num] = ''; } + $table_data.= ''; + } + $table_data.= ''; } - $table_data.= ''; $table_data.= "$date"; - $table_data.= ''; + if($aaronic == 0) { + $table_data.= ''; + } $table_data.= ''; $table_data.= ''; $table_data.= ''; $table_data.= ''; - $table_data.= ''; + $table_data.= ''."\n"; $i++; } else { $link_data['menuaction'] = 'eq.eq.int_update'; @@ -2212,7 +2217,7 @@ class eq } } - $name_width=175; $phone_width=100; $date_width=100; $notes_width=300; + $name_width=190; $phone_width=100; $date_width=100; $notes_width=300; $completed_table_width=$name_width + $phone_width + $date_width + $notes_width; $completed_header_row = "Family Name"; $completed_header_row.= "Phone"; @@ -3519,40 +3524,64 @@ class eq $time = $hour.':'.$minute.':'.'00'; $uid = 0; + // Zero out the family or elder if date = NULL + if($date == "") { + $elder = 0; + $family = 0; + } + // Update an existing appointment if($appointment < $this->max_appointments) { //Only perform a database update if we have made a change to this appointment $sql = "SELECT * FROM eq_appointment where " . "appointment='$appointment'" . - "and elder='$elder'" . - "and family='$family'" . - "and date='$date'" . - "and time='$time'"; + " and presidency='$presidency'" . + " and elder='$elder'" . + " and family='$family'" . + " and date='$date'" . + " and time='$time'"; $this->db->query($sql,__LINE__,__FILE__); if(!$this->db->next_record()) { - $this->db->query("UPDATE eq_appointment set" . + $old_date = $this->db->f('date'); + $old_time = $this->db->f('time'); + $this->db2->query("UPDATE eq_appointment set" . " family=" . $family . " ,elder=" . $elder . " ,date='" . $date . "'" . " ,time='" . $time . "'" . + " ,presidency='" . $presidency . "'" . " WHERE appointment=" . $appointment,__LINE__,__FILE__); // Email the appointment - if(($date != "") && ($time != "")) { - $this->email_appt($appointment); - } + $this->email_appt($appointment); } } // Add a new appointment else if(($appointment >= $this->max_appointments) && ($date != "") && ($time != "")) { - $this->db->query("INSERT INTO eq_appointment (appointment,presidency,family,elder,date,time,uid) " + //print "adding entry: appt=$appointment date: $date time: $time elder: $elder family: $family
"; + $this->db2->query("INSERT INTO eq_appointment (appointment,presidency,family,elder,date,time,uid) " . "VALUES (NULL,'" . $presidency . "','" . $family . "','" . $elder . "','" . $date . "','" . $time . "','" . $uid ."')",__LINE__,__FILE__); - - //print "adding entry: appt=$appointment date: $date time: $time elder: $elder family: $family
"; + + // Now reselect this entry from the database to see if we need + // to send an appointment out for it. + $sql = "SELECT * FROM eq_appointment where " . + "elder='$elder'" . + " and family='$family'" . + " and presidency='$presidency'" . + " and date='$date'" . + " and time='$time'" . + " and uid='$uid'"; + $this->db3->query($sql,__LINE__,__FILE__); + if($this->db3->next_record()) { + // Email the appointment if warranted + if(($date != "") && ($time != "") && (($elder > 0) || $family > 0)) { + $this->email_appt($this->db3->f('appointment')); + } + } } } }