コード例 #1
0
ファイル: RecordIniFacade.php プロジェクト: awgtek/myedb
 function filtered_search_by_mixed_criteria_csv(&$output_data, &$xslt_file = "")
 {
     $recordsearcher = new RecordSearcher();
     //echo microtime()."RecordIniFacade: filtered_search_by_mixed_criteria;  before executing ".'$recordsearcher->filtered_search_by_mixed_criteria();'." <br>";
     $eids = $recordsearcher->filtered_search_by_mixed_criteria(false);
     $_REQUEST['eids'] = $eids;
     if (!isset($_REQUEST['type_id'])) {
         $_REQUEST['type_id'] = $_SESSION['type_id'];
     }
     //$this->initializeRecordSet($xml_string, $xslt_file);
     //initialize MyEDB_Matrix with prop ids to be column names
     //get Property::get_property_list
     $property_list = Property::get_property_list();
     //print_r($property_list); echo "helloo";
     $myedb_matrix = new MyEDB_Matrix($property_list);
     //do loop through eids creating associative array of resulting recs
     foreach ($eids as $eid) {
         $type_id = RecordsSys_EntityManagementSystems::get_type_id($eid);
         //can't rely on request type_id, because search results may have generic type_id
         $one_row_rec = new One_Row_Record($eid, $type_id);
         $one_row_rec->exclude_properties = array(26, 27);
         $one_row_rec->setup();
         //add $one_row_rec to MyEDB_Matrix
         $myedb_matrix->add_one_row_record($one_row_rec);
         //add $complete_prop_matrix to $eid_recs
     }
     $myedb_matrix->finalize_matrix();
     $output_data = $myedb_matrix->get_matrix();
 }
コード例 #2
0
ファイル: RecordSearcher.php プロジェクト: awgtek/myedb
 function filtered_search_by_mixed_criteria($apply_page_filter = true)
 {
     $myedbsess = new MyEDB_SESSION();
     $ret_val = 0;
     $this->persist_search_values();
     //echo "here".microtime();
     //	echo "<br> session variabl: ".print_r($_SESSION,true);
     //	echo "<br> request variabl: ".print_r($_REQUEST,true);
     if (!isset($_REQUEST['init_post'])) {
         //echo "<br> session variabl: ".print_r($_SESSION,true);
         $ctns_prop_ids = $myedbsess->cspi;
         //$_SESSION['cspi'];
         $ctns_prop_vals = $myedbsess->cspv;
         //$_SESSION['cspv'];
         $ctns_prop_types = $myedbsess->cspt;
         //$_SESSION['cspt'];
         $ctns_prop_vals_exact_match = $myedbsess->cspve;
         //$_SESSION['cspve'];
         $ctns_prop_vals_inverse_match = $myedbsess->cspvi;
         //$_SESSION['cspvi'];
         $prop_ids = $myedbsess->spi;
         //$_SESSION['spi'];
         $prop_vals = $myedbsess->spv;
         //$_SESSION['spv'];
         $prop_comps = $myedbsess->spc;
         //$_SESSION['spc'];
         $type_id = $myedbsess->type_id;
         //$_SESSION['type_id']; //deprecated. Use 'spt' to match type for product id
         $type_ids = $myedbsess->spt;
         //$_SESSION['spt'];
         $group_nums = $myedbsess->spg;
         //$_SESSION['spg'];//see leftnavmember.xsl for explanation
         $sort_prop_ids = $myedbsess->srtpi;
         //$_SESSION['srtpi'];
         //echo "ctns_prop_vals: '".$ctns_prop_vals."'".print_r($ctns_prop_vals,true);
         /*print_r(array($ctns_prop_ids,$ctns_prop_vals,$ctns_prop_vals_exact_match,$ctns_prop_vals_inverse_match,
         		$prop_ids,
         				$prop_vals,$type_id,$sort_prop_ids, $prop_comps, $type_ids, $group_nums,
         				$ctns_prop_types));*/
         $eids = RecordSearcher::search_and_gather_eids($ctns_prop_ids, $ctns_prop_vals, $ctns_prop_vals_exact_match, $ctns_prop_vals_inverse_match, $prop_ids, $prop_vals, $type_id, $sort_prop_ids, $prop_comps, $type_ids, $group_nums, $ctns_prop_types);
         $_REQUEST["total_search_results"] = count($eids);
         //	echo "eids before apply_page_filter: ".print_r($eids,true);
         if ($apply_page_filter) {
             //	echo "<br>in apply_pge_fitler";
             $eids = RecordSearcher::apply_page_filter($eids);
         }
         $ret_val = $eids;
         //echo "eids after apply_page_filter: ".print_r($eids, true); //echo $apply_page_filter."|d";
     }
     return $ret_val;
 }