/**
  * Update record in table
  *
  * @param RpSubmitterNoteMySql rpSubmitterNote
  */
 public function update($rp_submitter_note)
 {
     $sql = 'UPDATE rp_submitter_note SET submitter_id = ?, submitter_batch_id = ?, note = ?, update_datetime = ? WHERE id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_submitter_note->submitter_id);
     $sql_query->set_number($rp_submitter_note->submitter_batch_id);
     $sql_query->set($rp_submitter_note->note);
     $sql_query->set($rp_submitter_note->update_datetime);
     $sql_query->set_number($rp_submitter_note->id);
     return $this->execute_update($sql_query);
 }
Ejemplo n.º 2
0
 /**
  * Update record in table
  *
  * @param RpNoteMySql rpNote
  */
 public function update($rp_note)
 {
     $sql = 'UPDATE rp_note SET cite_id = ?, auto_rec_id = ?, ged_change_date = ?, update_datetime = now(), submitter_text = ? WHERE id = ? AND batch_id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($rp_note->cite_id);
     $sql_query->set($rp_note->auto_rec_id);
     $sql_query->set($rp_note->ged_change_date);
     $sql_query->set($rp_note->submitter_text);
     $sql_query->set($rp_note->id);
     $sql_query->set_number($rp_note->batch_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpSubmitterMySql rpSubmitter
  */
 public function update($rp_submitter)
 {
     $sql = 'UPDATE rp_submitter SET submitter_name = ?, addr_id = ?, lang1 = ?, lang2 = ?, lang3 = ?, registered_rfn = ?, auto_rec_id = ?, ged_change_date = ?, update_datetime = now() WHERE id = ?  AND batch_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_submitter->submitter_name);
     $sql_query->set_number($rp_submitter->addr_id);
     $sql_query->set($rp_submitter->lang1);
     $sql_query->set($rp_submitter->lang2);
     $sql_query->set($rp_submitter->lang3);
     $sql_query->set($rp_submitter->registered_rfn);
     $sql_query->set($rp_submitter->auto_rec_id);
     $sql_query->set($rp_submitter->ged_change_date);
     $sql_query->set($rp_submitter->id);
     $sql_query->set_number($rp_submitter->batch_id);
     return $this->execute_update($sql_query);
 }
Ejemplo n.º 4
0
 public function delete($table_name, $id_col, $batch_col, $id, $batch_id)
 {
     $sql = "DELETE FROM {$table_name} WHERE {$id_col} = {$id} AND {$batch_col} = {$batch_id}";
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($id);
     $sql_query->set_number($batch_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpNameCiteMySql rpNameCite
  */
 public function update($rp_name_cite)
 {
     $sql = 'UPDATE rp_name_cite SET update_datetime = ? WHERE name_id = ?  AND cite_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_name_cite->update_datetime);
     $sql_query->set_number($rp_name_cite->name_id);
     $sql_query->set_number($rp_name_cite->cite_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpIndiCiteMySql rpIndiCite
  */
 public function update($rp_indi_cite)
 {
     $sql = 'UPDATE rp_indi_cite SET update_datetime = now() WHERE indi_id = ?  AND indi_batch_id = ?  AND cite_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_indi_cite->indi_id);
     $sql_query->set_number($rp_indi_cite->indi_batch_id);
     $sql_query->set_number($rp_indi_cite->cite_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpFamNoteMySql rpFamNote
  */
 public function update($rp_fam_note)
 {
     $sql = 'UPDATE rp_fam_note SET update_datetime = ? WHERE fam_id = ?  AND fam_batch_id = ?  AND note_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_fam_note->update_datetime);
     $sql_query->set_number($rp_fam_note->fam_id);
     $sql_query->set_number($rp_fam_note->fam_batch_id);
     $sql_query->set_number($rp_fam_note->note_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpNamePersonalMySql rpNamePersonal
  */
 public function update($rp_name_personal)
 {
     $sql = 'UPDATE rp_name_personal SET personal_name = ?, name_type = ?, prefix = ?, given = ?, nickname = ?, surname_prefix = ?, surname = ?, suffix = ?, update_datetime = now() WHERE id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_name_personal->personal_name);
     $sql_query->set($rp_name_personal->name_type);
     $sql_query->set($rp_name_personal->prefix);
     $sql_query->set($rp_name_personal->given);
     $sql_query->set($rp_name_personal->nickname);
     $sql_query->set($rp_name_personal->surname_prefix);
     $sql_query->set($rp_name_personal->surname);
     $sql_query->set($rp_name_personal->suffix);
     $sql_query->set_number($rp_name_personal->id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpEventDetailMySql rpEventDetail
  */
 public function update($rp_event_detail)
 {
     $sql = 'UPDATE rp_event_detail SET event_type = ?, classification = ?, event_date = ?, place = ?, addr_id = ?, resp_agency = ?, religious_aff = ?, cause = ?, restriction_notice = ?, update_datetime = now() WHERE id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_event_detail->event_type);
     $sql_query->set($rp_event_detail->classification);
     $sql_query->set($rp_event_detail->event_date);
     $sql_query->set($rp_event_detail->place);
     $sql_query->set_number($rp_event_detail->addr_id);
     $sql_query->set($rp_event_detail->resp_agency);
     $sql_query->set($rp_event_detail->religious_aff);
     $sql_query->set($rp_event_detail->cause);
     $sql_query->set($rp_event_detail->restriction_notice);
     $sql_query->set_number($rp_event_detail->id);
     return $this->execute_update($sql_query);
 }
 public function query_by_src($src_id, $src_batch_id)
 {
     $sql = 'SELECT *' . ' FROM rp_source_note' . ' WHERE source_id = ? and source_batch_id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($src_id);
     $sql_query->set_number($src_batch_id);
     $notes = $this->get_list($sql_query);
     if (isset($notes) && count($notes) > 0) {
         foreach ($notes as $note) {
             if ((!isset($note->note) || empty($note->note)) && isset($note->note_rec_id)) {
                 $rec = RP_Dao_Factory::get_rp_note_dao($this->prefix)->load($note->note_rec_id, $src_batch_id);
                 $note->note = $rec->submitter_text;
             }
         }
     }
     return $notes;
 }
Ejemplo n.º 11
0
 public function update_spouse2($rp_fam)
 {
     $sql = 'UPDATE rp_fam SET spouse2 = ?, indi_batch_id_2 = ?, update_datetime = now() WHERE id = ?  AND batch_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_fam->wife);
     $sql_query->set_number($rp_fam->batch_id);
     $sql_query->set($rp_fam->id);
     $sql_query->set_number($rp_fam->batch_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpFamChildMySql rpFamChild
  */
 public function update($rp_fam_child)
 {
     $sql = 'UPDATE rp_fam_child SET update_datetime = now() WHERE fam_id = ?  AND fam_batch_id = ?  AND child_id = ?  AND indi_batch_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_fam_child->fam_id);
     $sql_query->set_number($rp_fam_child->fam_batch_id);
     $sql_query->set($rp_fam_child->child_id);
     $sql_query->set_number($rp_fam_child->indi_batch_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpFamEventMySql rpFamEvent
  */
 public function update($rp_fam_event)
 {
     $sql = 'UPDATE rp_fam_event SET update_datetime = now() WHERE fam_id = ?  AND fam_batch_id = ?  AND event_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_fam_event->fam_id);
     $sql_query->set_number($rp_fam_event->fam_batch_id);
     $sql_query->set_number($rp_fam_event->event_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RP_Indi_Note $rp_indi_note
  */
 public function update($rp_indi_note)
 {
     $sql = 'UPDATE rp_indi_note SET indi_id = ?, indi_batch_id = ?, note_rec_id = ?, note = ?, update_datetime = now() WHERE id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_indi_note->indi_id);
     $sql_query->set_number($rp_indi_note->indi_batch_id);
     $sql_query->set($rp_indi_note->note_rec_id);
     $sql_query->set($rp_indi_note->note);
     $sql_query->set_number($rp_indi_note->id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpIndiFamMySql rpIndiFam
  */
 public function update($rp_indi_fam)
 {
     $sql = 'UPDATE rp_indi_fam SET link_status = ?, pedigree = ?, update_datetime = ? WHERE indi_id = ?  AND indi_batch_id = ?  AND fam_id = ?  AND fam_batch_id = ?  AND link_type = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_indi_fam->link_status);
     $sql_query->set($rp_indi_fam->pedigree);
     $sql_query->set($rp_indi_fam->indi_id);
     $sql_query->set_number($rp_indi_fam->indi_batch_id);
     $sql_query->set($rp_indi_fam->fam_id);
     $sql_query->set_number($rp_indi_fam->fam_batch_id);
     $sql_query->set($rp_indi_fam->link_type);
     return $this->execute_update($sql_query);
 }
 /**
  * @todo Description of function getPersonaSources
  * @param  $id
  * @param  $batchId
  * @return
  */
 public function get_persona_sources($id, $batch_id)
 {
     $sql = 'SELECT DISTINCT id,page,title,abbr FROM' . ' (SELECT rs.id AS id, rs.wp_page_id AS page,rs.source_title AS title,rs.abbr AS abbr' . ' FROM rp_indi_cite ric' . ' JOIN rp_source_cite rsc ON ric.cite_id = rsc.id' . ' JOIN rp_source rs ON rs.id = rsc.source_id AND rs.batch_id = rsc.source_batch_id' . ' WHERE ric.indi_id = ? AND ric.indi_batch_id = ?' . ' UNION' . ' SELECT rs.id AS id, rs.wp_page_id AS page,rs.source_title AS title,rs.abbr AS abbr' . ' FROM rp_indi_event rie' . ' JOIN rp_event_cite rec ON rie.event_id = rec.event_id' . ' JOIN rp_source_cite rsc ON rsc.id = rec.cite_id' . ' JOIN rp_source rs ON rs.id = rsc.source_id AND rs.batch_id = rsc.source_batch_id' . ' WHERE rie.indi_id = ? AND rie.indi_batch_id = ?' . ' UNION' . ' SELECT rs.id AS id, rs.wp_page_id AS page,rs.source_title AS title,rs.abbr AS abbr' . ' FROM rp_indi_fam rif' . ' JOIN rp_fam_cite rfc ON rfc.fam_id = rif.fam_id AND rfc.fam_batch_id = rif.fam_batch_id' . ' JOIN rp_source_cite rsc ON rsc.id = rfc.cite_id' . ' JOIN rp_source rs ON rs.id = rsc.source_id AND rs.batch_id = rsc.source_batch_id' . ' WHERE rif.indi_id = ? AND rif.indi_batch_id = ?' . ' UNION' . ' SELECT rs.id AS id, rs.wp_page_id AS page,rs.source_title AS title,rs.abbr AS abbr' . ' FROM rp_indi_name rin' . ' JOIN rp_name_cite rnc ON rnc.name_id = rin.name_id' . ' JOIN rp_source_cite rsc ON rsc.id = rnc.cite_id' . ' JOIN rp_source rs ON rs.id = rsc.source_id AND rs.batch_id = rsc.source_batch_id' . ' WHERE rin.indi_id = ? AND rin.indi_batch_id = ? ) AS t1';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($id);
     $sql_query->set_number($batch_id);
     $sql_query->set($id);
     $sql_query->set_number($batch_id);
     $sql_query->set($id);
     $sql_query->set_number($batch_id);
     $sql_query->set($id);
     $sql_query->set_number($batch_id);
     $rows = RP_Query_Executor::execute($sql_query);
     $cnt = count($rows);
     $sources = null;
     if ($cnt > 0) {
         $sources = array();
         for ($idx = 0; $idx < $cnt; $idx++) {
             $src = array();
             $src['src_id'] = $rows[$idx]['id'];
             $src['src_title'] = $rows[$idx]['title'];
             $src['src_abbr'] = $rows[$idx]['abbr'];
             $src['page_id'] = $rows[$idx]['page'];
             $sources[$idx] = $src;
         }
     }
     return $sources;
 }
Ejemplo n.º 17
0
 /**
  * Update record in table
  *
  * @param RpIndiMySql rpIndi
  */
 public function update($rp_indi)
 {
     $sql = 'UPDATE rp_indi SET restriction_notice = ?, gender = ?, perm_rec_file_nbr = ?, anc_rec_file_nbr = ?, auto_rec_id = ?, ged_change_date = ?, update_datetime = now() WHERE id = ?  AND batch_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_indi->restriction_notice);
     $sql_query->set($rp_indi->gender);
     $sql_query->set($rp_indi->perm_rec_file_nbr);
     $sql_query->set($rp_indi->anc_rec_file_nbr);
     $sql_query->set($rp_indi->auto_rec_id);
     $sql_query->set($rp_indi->ged_change_date);
     $sql_query->set($rp_indi->id);
     $sql_query->set_number($rp_indi->batch_id);
     return $this->execute_update($sql_query);
 }
 private function get_persons($src, $options)
 {
     $sql = 'SELECT DISTINCT ri.id AS id' . ',rnp.surname AS surname' . ',rnp.given AS given' . ',ri.wp_page_id AS page' . ',rio.privacy_code AS privacy_code' . ' FROM rp_indi ri' . ' LEFT OUTER JOIN rp_indi_option rio' . ' ON rio.indi_batch_id = ri.batch_id AND rio.indi_id = ri.id' . ' JOIN rp_indi_name rip' . ' ON ri.id = rip.indi_id AND ri.batch_id = rip.indi_batch_id' . ' JOIN rp_name_personal rnp ON rip.name_id = rnp.id' . " WHERE ri.batch_id = ? AND ri.wp_page_id IS NOT null" . " AND IFNULL(rio.privacy_code,'Def') != '" . RP_Persona_Helper::EXC . "' AND ri.id IN " . '(SELECT ric.indi_id AS id' . ' FROM rp_indi_cite ric' . ' JOIN rp_source_cite rsc ON ric.cite_id = rsc.id' . ' WHERE rsc.source_id = ? AND rsc.source_batch_id = ?' . ' UNION' . ' SELECT rie.indi_id AS id' . ' FROM rp_indi_event rie' . ' JOIN rp_event_cite rec ON rie.event_id = rec.event_id' . ' JOIN rp_source_cite rsc ON rsc.id = rec.cite_id' . ' WHERE rsc.source_id = ? AND rsc.source_batch_id = ?' . ' UNION' . ' SELECT rif.indi_id AS id' . ' FROM rp_indi_fam rif' . ' JOIN rp_fam_cite rfc ON rfc.fam_id = rif.fam_id AND rfc.fam_batch_id = rif.fam_batch_id' . ' JOIN rp_source_cite rsc ON rsc.id = rfc.cite_id' . ' WHERE rsc.source_id = ? AND rsc.source_batch_id = ?' . ' UNION' . ' SELECT rin.indi_id AS id' . ' FROM rp_indi_name rin' . ' JOIN rp_name_cite rnc ON rnc.name_id = rin.name_id' . ' JOIN rp_source_cite rsc ON rsc.id = rnc.cite_id' . ' WHERE rsc.source_id = ? AND rsc.source_batch_id = ?)' . ' ORDER BY rnp.surname, rnp.given';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($src->batch_id);
     $sql_query->set($src->id);
     $sql_query->set_number($src->batch_id);
     $sql_query->set($src->id);
     $sql_query->set_number($src->batch_id);
     $sql_query->set($src->id);
     $sql_query->set_number($src->batch_id);
     $sql_query->set($src->id);
     $sql_query->set_number($src->batch_id);
     $rows = RP_Query_Executor::execute($sql_query);
     $cnt = count($rows);
     $persons = null;
     if ($cnt > 0) {
         $persons = array();
         for ($idx = 0; $idx < $cnt; $idx++) {
             $persona = new RP_Persona();
             $persona->surname = $rows[$idx]['surname'];
             $persona->given = $rows[$idx]['given'];
             $persona->page = $rows[$idx]['page'];
             $persona->privacy = $rows[$idx]['privacy_code'];
             $persona->birth_date = RP_Dao_Factory::get_rp_persona_dao($this->prefix)->get_birth_date($src->batch_id, $rows[$idx]['id']);
             $persona->death_date = RP_Dao_Factory::get_rp_persona_dao($this->prefix)->get_death_date($src->batch_id, $rows[$idx]['id']);
             $pscore = RP_Persona_Helper::score_persona($persona, $options);
             if (!RP_Persona_Helper::is_restricted($options['uscore'], $pscore)) {
                 $persons[$idx] = $persona;
             }
         }
     }
     return $persons;
 }
 public function query_by_src($src_id, $src_batch_id)
 {
     $sql = 'SELECT DISTINCT source_page, source_description' . ' FROM rp_source_cite' . ' WHERE source_id = ? and source_batch_id = ?' . ' ORDER BY source_page';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($src_id);
     $sql_query->set_number($src_batch_id);
     $rows = RP_Query_Executor::execute($sql_query);
     $sources = null;
     if ($rows > 0) {
         $sources = array();
         $cnt = count($rows);
         for ($idx = 0; $idx < $cnt; $idx++) {
             $src = new RP_Source_Cite();
             $src->source_page = $rows[$idx]['source_page'];
             $src->source_description = $rows[$idx]['source_description'];
             $sources[$idx] = $src;
         }
     }
     return $sources;
 }