X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=inc%2Fclass.tc.inc.php;h=bcf18e26a79ba6cfb9ee1f9b721ed95a6b287e56;hb=be758016f3cd29cef9b854c3473df80c12668763;hp=9684e8e114691f1970584e306b2a62e9cd3db97d;hpb=67b802629eb336cdec0eb8212a9ca2474377fe8f;p=eq%2F.git diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index 9684e8e..bcf18e2 100644 --- a/inc/class.tc.inc.php +++ b/inc/class.tc.inc.php @@ -426,7 +426,7 @@ class tc $unassigned_family_list = get_var('unassignedFamilies',array('POST')); if ($assignedHT_list || $unassignedHT_list) { - $sql = "INSERT INTO tc_companionship_sandbox (district) VALUES (\"$district\")"; + $sql = "INSERT INTO tc_companionship_sandbox (tc_companionship,district) VALUES (\"NULL\",\"$district\")"; $this->db2->query($sql,__LINE__,__FILE__); $companionship_sandbox = mysql_insert_id(); @@ -540,11 +540,11 @@ class tc while ($this->db->next_record()) { $companionship = $this->db->f('companionship'); $district = $this->db->f('district'); - $sql = "INSERT INTO tc_companionship_sandbox (district) VALUES (\"$district\")"; + $sql = "INSERT INTO tc_companionship_sandbox (tc_companionship,district) VALUES (\"$companionship\",\"$district\")"; $this->db2->query($sql,__LINE__,__FILE__); $companionship_sandbox = mysql_insert_id(); - $sql = "SELECT * FROM tc_companion WHERE companionship=$companionship AND valid=1"; + $sql = "SELECT * FROM tc_companion AS tc JOIN tc_individual AS ti WHERE tc.individual=ti.individual AND tc.companionship=$companionship AND tc.valid=1 AND ti.valid=1"; $this->db2->query($sql,__LINE__,__FILE__); while ($this->db2->next_record()) { $individual = $this->db2->f('individual'); @@ -664,8 +664,10 @@ class tc $companion_names .= " / " . $this->db2->f('name'); } } - $sandbox_table_data .= "$companion_names"; - $sandbox_table_data .= ""; + $this->nextmatchs->template_alternate_row_color(&$this->t); + $sandbox_table_data .= ""; + $sandbox_table_data .= ""; + $sandbox_table_data .= "
$companion_names
"; # get families they visit $sql = "SELECT * FROM tc_companionship_sandbox AS tcp JOIN (tc_family_sandbox AS tf, tc_individual AS ti) WHERE tcp.companionship=$companionship AND tcp.companionship=tf.companionship AND tf.individual=ti.individual"; @@ -673,11 +675,13 @@ class tc while ($this->db2->next_record()) { $family_name = $this->db2->f('name') . " Family"; $family_id = $this->db2->f('tc_family'); - $sandbox_table_data .= ""; - $sandbox_table_data .= ""; + $tc_companionship = $this->db2->f('tc_companionship'); + $this->nextmatchs->template_alternate_row_color(&$this->t); + $sandbox_table_data .= ""; + $sandbox_table_data .= ""; # get 12 months visit data for given family - for($m=12; $m >= 0; $m--) { + for($m=$this->sandbox_stats_num_months; $m > 0; $m--) { $month = $this->current_month - $m; $year = $this->current_year; if($month <= 0) { $remainder = $month; $month = 12 + $remainder; $year=$year-1; } @@ -686,7 +690,11 @@ class tc $month_end = "$year"."-"."$month"."-"."31"; $month = "$month"."/"."$year"; - $sql = "SELECT * FROM tc_visit WHERE date >= '$month_start' AND date <= '$month_end' AND companionship!=0 AND family=". $family_id; + if ($this->sandbox_visits_comp_only == 0) { + $sql = "SELECT * FROM tc_visit WHERE date >= '$month_start' AND date <= '$month_end' AND companionship!=0 AND family=". $family_id; + } else { + $sql = "SELECT * FROM tc_visit WHERE date >= '$month_start' AND date <= '$month_end' AND companionship=$tc_companionship AND family=". $family_id; + } $query_id = $this->db3->query($sql,__LINE__,__FILE__); if($this->db3->next_record()) { @@ -1677,7 +1685,7 @@ class tc $this->t->set_file(array('ppi_sched_t' => 'ppi_sched.tpl')); $this->t->set_block('ppi_sched_t','individual_list','indivlist'); $this->t->set_block('ppi_sched_t','appt_list','apptlist'); - $action = get_var('action',array('GET','POST')); + $action = get_var('action',array('GET','POST')); $this->t->set_var('lang_save','Save Appt / Pri / Notes'); $this->t->set_var('lang_reset','Clear Changes'); @@ -1691,13 +1699,11 @@ class tc $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_sched&action=save')); $this->t->set_var('title',$this->ppi_frequency_label . ' PPI Scheduler'); - $indiv_width=500; $phone_width=25; $pri_width=10; $notes_width=128; $ppi_date_width=20; - $table_width=$indiv_width + $phone_width + $pri_width + $notes_width + $ppi_date_width; - $header_row = ""; - $header_row.= ""; - $header_row.= ""; - $header_row.= ""; - $header_row.= ""; + $header_row = ""; + $header_row.= ""; + $header_row.= ""; + $header_row.= ""; + $header_row.= ""; $table_data=""; $completed_data=""; $totals_data=""; $year = date('Y'); @@ -1768,12 +1774,10 @@ class tc array_multisort($indiv_name, $individual); // APPOINTMENT TABLE - $date_width=250; $time_width=100; $indiv_width=200; $location_width=100; - $appt_table_width=$date_width + $time_width + $indiv_width + $location_width; - $appt_header_row = ""; - $appt_header_row.= ""; - $appt_header_row.= ""; - $appt_header_row.= ""; + $appt_header_row = ""; + $appt_header_row.= ""; + $appt_header_row.= ""; + $appt_header_row.= ""; $appt_table_data = ""; $table_data=""; @@ -1795,10 +1799,8 @@ class tc $appt_table_data = ""; // Display a scheduling table for this presidency member - $district_number = '*'; - $district_name = $presidency_name; - $not_completed_table_title = "District ".$district_number.": ".$district_name.": All indivs with " . $this->ppi_frequency_label . " PPI Not Completed"; - $appt_table_title = "District ".$district_number.": ".$district_name.": ".$this->ppi_frequency_label." PPI Appointment Slots"; + $not_completed_table_title = "All individuals with " . $this->ppi_frequency_label . " PPI Not Completed"; + $appt_table_title = $presidency_name . ": " . $this->ppi_frequency_label." PPI Appointment Slots"; $this->t->set_var('not_completed_table_title',$not_completed_table_title); $this->t->set_var('appt_table_title',$appt_table_title); @@ -1849,7 +1851,8 @@ class tc } $this->t->set_var('appt_table_data',$appt_table_data); $this->t->set_var('appt_header_row',$appt_header_row); - $this->t->set_var('appt_table_width',$appt_table_width); + $this->t->set_var('lang_save','Save Appts for ' . $presidency_name); + $this->t->fp('apptlist','appt_list',True); } @@ -1947,27 +1950,22 @@ class tc } } // End for individuals Loop - $completed_table_title = "District ".$district_number.": ".$district_name.": All indivs with " . $this->ppi_frequency_label . " PPI Completed"; - $name_width=175; $phone_width=100; $date_width=100; $notes_width=300; - $completed_table_width=$name_width + $phone_width + $date_width + $notes_width; - $completed_header_row = ""; - $completed_header_row.= ""; - $completed_header_row.= ""; - $completed_header_row.= ""; + $completed_table_title = "All individuals with " . $this->ppi_frequency_label . " PPI Completed"; + $completed_header_row = ""; + $completed_header_row.= ""; + $completed_header_row.= ""; + $completed_header_row.= ""; $this->t->set_var('completed_table_title',$completed_table_title); - $this->t->set_var('table_width',$table_width); $this->t->set_var('header_row',$header_row); $this->t->set_var('table_data',$table_data); $this->t->set_var('completed_header_row',$completed_header_row); - $this->t->set_var('completed_table_width',$completed_table_width); $this->t->set_var('completed',$completed_data); + $this->t->set_var('lang_save','Save Pri / Notes'); $this->t->fp('indivlist','individual_list',True); - $indivs_width=300; $totals_width=100; - $totals_table_width=$indivs_width + $totals_width; - $totals_header_row = ""; - $totals_header_row.= ""; + $totals_header_row = ""; + $totals_header_row.= ""; $totals_data.= ""; $totals_data.= ""; $totals_data.= ""; @@ -1981,7 +1979,7 @@ class tc $this->t->set_var('totals',$totals_data); $this->t->set_var('totals_header_row',$totals_header_row); - $this->t->set_var('totals_table_width',$totals_table_width); + $this->t->set_var('ppi_frequency_label',$this->ppi_frequency_label); $this->t->pfp('out','ppi_sched_t'); $this->save_sessiondata(); @@ -1995,7 +1993,6 @@ class tc $this->t->set_block('int_sched_t','appt_list','apptlist'); $action = get_var('action',array('GET','POST')); - $this->t->set_var('lang_save','Save Appt / Pri / Notes'); $this->t->set_var('lang_reset','Clear Changes'); $this->t->set_var('int_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_view')); @@ -2007,13 +2004,11 @@ class tc $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_sched&action=save')); $this->t->set_var('title','Hometeaching Interviews Scheduler'); - $indiv_width=500; $phone_width=25; $pri_width=10; $notes_width=128; $int_date_width=20; - $table_width=$indiv_width + $phone_width + $pri_width + $notes_width + $int_date_width; - $header_row = ""; - $header_row.= ""; - $header_row.= ""; - $header_row.= ""; - $header_row.= ""; + $header_row = ""; + $header_row.= ""; + $header_row.= ""; + $header_row.= ""; + $header_row.= ""; $table_data=""; $completed_data=""; $totals_data=""; $year = date('Y'); @@ -2126,12 +2121,10 @@ class tc // APPOINTMENT TABLE $district = 1; - $date_width=250; $time_width=100; $indiv_width=200; $location_width=100; - $appt_table_width=$date_width + $time_width + $indiv_width + $location_width; - $appt_header_row = ""; - $appt_header_row.= ""; - $appt_header_row.= ""; - $appt_header_row.= ""; + $appt_header_row = ""; + $appt_header_row.= ""; + $appt_header_row.= ""; + $appt_header_row.= ""; $appt_table_data = ""; $total_comps=0; $comps_with_quarterly_int=0; @@ -2204,7 +2197,6 @@ class tc $this->t->set_var('appt_table_data',$appt_table_data); $this->t->set_var('appt_header_row',$appt_header_row); - $this->t->set_var('appt_table_width',$appt_table_width); // INTERVIEW SCHEDULING TABLE @@ -2317,28 +2309,24 @@ class tc } } - $name_width=175; $phone_width=100; $date_width=100; $notes_width=300; - $completed_table_width=$name_width + $phone_width + $date_width + $notes_width; - $completed_header_row = ""; - $completed_header_row.= ""; - $completed_header_row.= ""; - $completed_header_row.= ""; + $completed_header_row = ""; + $completed_header_row.= ""; + $completed_header_row.= ""; + $completed_header_row.= ""; - $this->t->set_var('table_width',$table_width); $this->t->set_var('header_row',$header_row); $this->t->set_var('table_data',$table_data); $this->t->set_var('completed_header_row',$completed_header_row); - $this->t->set_var('completed_table_width',$completed_table_width); $this->t->set_var('completed',$completed_data); + $this->t->set_var('lang_save_appt','Save Appts for ' . $districts[$d]['name']); + $this->t->set_var('lang_save_pri_notes','Save Pri / Notes for '. $districts[$d]['name']); $this->t->fp('indivlist','individual_list',True); } // End for each district loop - $indivs_width=300; $totals_width=100; - $totals_table_width=$indivs_width + $totals_width; - $totals_header_row = ""; - $totals_header_row.= ""; + $totals_header_row = ""; + $totals_header_row.= ""; $totals_data.= ""; $totals_data.= ""; $totals_data.= ""; @@ -2352,7 +2340,6 @@ class tc $this->t->set_var('totals',$totals_data); $this->t->set_var('totals_header_row',$totals_header_row); - $this->t->set_var('totals_table_width',$totals_table_width); $this->t->pfp('out','int_sched_t'); $this->save_sessiondata(); @@ -2366,7 +2353,6 @@ class tc $this->t->set_block('vis_sched_t','appt_list','apptlist'); $action = get_var('action',array('GET','POST')); - $this->t->set_var('lang_save','Save Appt / Pri / Notes'); $this->t->set_var('lang_reset','Clear Changes'); $this->t->set_var('vis_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.vis_view')); @@ -2378,13 +2364,11 @@ class tc $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.vis_sched&action=save')); $this->t->set_var('title','Presidency Yearly Visit Scheduler'); - $family_width=500; $phone_width=40; $pri_width=10; $notes_width=128; $visit_date_width=20; - $table_width=$family_width + $phone_width + $pri_width + $notes_width + $visit_date_width; - $header_row = ""; - $header_row.= ""; - $header_row.= ""; - $header_row.= ""; - $header_row.= ""; + $header_row = ""; + $header_row.= ""; + $header_row.= ""; + $header_row.= ""; + $header_row.= ""; $table_data=""; $completed_data=""; $totals_data=""; $year = date('Y'); @@ -2454,12 +2438,10 @@ class tc } // APPOINTMENT TABLE - $date_width=250; $time_width=100; $family_width=250; $location_width=100; - $appt_table_width=$date_width + $time_width + $family_width + $location_width; - $appt_header_row = ""; - $appt_header_row.= ""; - $appt_header_row.= ""; - $appt_header_row.= ""; + $appt_header_row = ""; + $appt_header_row.= ""; + $appt_header_row.= ""; + $appt_header_row.= ""; $appt_table_data = ""; // Find out what the President ID is @@ -2524,7 +2506,6 @@ class tc $this->t->set_var('appt_table_data',$appt_table_data); $this->t->set_var('appt_header_row',$appt_header_row); - $this->t->set_var('appt_table_width',$appt_table_width); // VISIT SCHEDULING TABLE @@ -2605,17 +2586,13 @@ class tc } } - $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 = ""; - $completed_header_row.= ""; - $completed_header_row.= ""; - $completed_header_row.= ""; + $completed_header_row = ""; + $completed_header_row.= ""; + $completed_header_row.= ""; + $completed_header_row.= ""; - $family_width=300; $totals_width=100; - $totals_table_width=$family_width + $totals_width; - $totals_header_row = ""; - $totals_header_row.= ""; + $totals_header_row = ""; + $totals_header_row.= ""; $totals_data.= ""; $totals_data.= ""; $totals_data.= ""; @@ -2627,16 +2604,15 @@ class tc $totals_data.= ""; $totals_data.= ""; - $this->t->set_var('table_width',$table_width); $this->t->set_var('header_row',$header_row); $this->t->set_var('table_data',$table_data); $this->t->set_var('totals_header_row',$totals_header_row); - $this->t->set_var('totals_table_width',$totals_table_width); $this->t->set_var('completed_header_row',$completed_header_row); - $this->t->set_var('completed_table_width',$completed_table_width); $this->t->set_var('completed',$completed_data); $this->t->set_var('totals',$totals_data); $this->t->fp('familylist','family_list',True); + $this->t->set_var('lang_save_appt','Save Appts'); + $this->t->set_var('lang_save_pri_notes','Save Pri / Notes'); $this->t->fp('apptlist','appt_list',True); $this->t->pfp('out','vis_sched_t');
$family_name
$family_nameindividual NamePhonePriorityLast PPIScheduling NotesIndividual NamePhonePriorityLast PPIScheduling NotesDateTimeIndividualLocationDateTimeIndividualLocationIndividualPhoneDatePPI NotesIndividualPhoneDatePPI NotesIndividuals$yearIndividuals$year
Total Individuals with " . $this->ppi_frequency_label . " PPIs completed:$indivs_with_yearly_ppi / $total_indivsIndividualPhonePriorityLast InterviewScheduling NotesIndividualPhonePriorityLast InterviewScheduling NotesDateTimeIndividualLocationDateTimeIndividualLocationIndividualPhoneDateInterview NotesIndividualPhoneDateInterview NotesIndividuals$yearIndividuals$year
Total Companionships with interviews completed:$comps_with_quarterly_int / $total_compsFamily NamePhonePriorityLast VisitScheduling NotesFamily NamePhonePriorityLast VisitScheduling NotesDateTimeFamilyLocationDateTimeFamilyLocationFamily NamePhoneDateVisit NotesFamily NamePhoneDateVisit NotesFamilies$yearFamilies$year
Total Families with yearly Visits completed:$families_with_yearly_visit / $total_families$percent%