/**
  * Delete record FROM table
  * @param rpHeader primary key
  */
 public function delete($id, $batch_id, $dummy1 = 0, $dummy2 = 0, $dummy3 = 0)
 {
     $sql = 'DELETE FROM rp_header WHERE id = ?  AND batch_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($id);
     $sql_query->set_number($batch_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpEventCiteMySql rpEventCite
  */
 public function update($rp_event_cite)
 {
     $sql = 'UPDATE rp_event_cite SET update_datetime = now() WHERE event_id = ?  AND cite_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($rp_event_cite->event_id);
     $sql_query->set_number($rp_event_cite->cite_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpNameNameMySql rpNameName
  */
 public function update($rp_name_name)
 {
     $sql = 'UPDATE rp_name_name SET assoc_name_type = ?, update_datetime = ? WHERE name_id = ?  AND assoc_name_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_name_name->assoc_name_type);
     $sql_query->set_number($rp_name_name->update_datetime);
     $sql_query->set_number($rp_name_name->name_id);
     $sql_query->set_number($rp_name_name->assoc_name_id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpEventNoteMySql rpEventNote
  */
 public function update($rp_event_note)
 {
     $sql = 'UPDATE rp_event_note SET event_id = ?, note = ?, update_datetime = ? WHERE id = ?';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($rp_event_note->event_id);
     $sql_query->set($rp_event_note->note);
     $sql_query->set_number($rp_event_note->update_datetime);
     $sql_query->set_number($rp_event_note->id);
     return $this->execute_update($sql_query);
 }
 /**
  * Update record in table
  *
  * @param RpFamCiteMySql rpFamCite
  */
 public function update($rp_fam_cite)
 {
     $sql = 'UPDATE rp_fam_cite SET update_datetime = ? WHERE fam_id = ?  AND fam_batch_id = ?  AND cite_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_fam_cite->update_datetime);
     $sql_query->set_number($rp_fam_cite->fam_id);
     $sql_query->set_number($rp_fam_cite->fam_batch_id);
     $sql_query->set_number($rp_fam_cite->cite_id);
     return $this->execute_update($sql_query);
 }
 /**
  * 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 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);
 }
Exemplo n.º 8
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 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 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);
 }
 public function get_persons_with_pages($batch_id)
 {
     $sql = "SELECT ri.id AS id, ri.batch_id AS batch_id" . ",CONCAT_WS(' ', (trim(replace(rnp.personal_name,'/',' '))), NULLIF(rnp.suffix,'')) AS fullname" . ",ri.wp_page_id AS page" . " FROM rp_indi ri" . " JOIN rp_indi_name rip ON ri.id = rip.indi_id AND ri.batch_id = rip.indi_batch_id AND rip.seq_nbr = 1" . " JOIN rp_name_personal rnp ON rip.name_id = rnp.id" . " WHERE ri.wp_page_id IS NOT NULL AND ri.batch_id=?";
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($batch_id);
     $rows = RP_Query_Executor::execute($sql_query);
     $cnt = count($rows);
     $persons = array();
     if ($cnt > 0) {
         for ($idx = 0; $idx < $cnt; $idx++) {
             $p = array();
             $p['id'] = $rows[$idx]['id'];
             $p['batch_id'] = $rows[$idx]['batch_id'];
             $p['name'] = $rows[$idx]['fullname'];
             $p['page_id'] = $rows[$idx]['page'];
             $persons[$idx] = $p;
         }
     }
     return $persons;
 }
 /**
  * Update record in table
  *
  * @param RpIndiEventMySql rpIndiEvent
  */
 public function update($rp_indi_event)
 {
     $sql = 'UPDATE rp_indi_event SET update_datetime = now() WHERE indi_id = ?  AND indi_batch_id = ?  AND event_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set($rp_indi_event->indi_id);
     $sql_query->set_number($rp_indi_event->indi_batch_id);
     $sql_query->set_number($rp_indi_event->event_id);
     return $this->execute_update($sql_query);
 }
Exemplo n.º 13
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);
 }
 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;
 }
Exemplo n.º 15
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 RpIndiNameMySql rpIndiName
  */
 public function update($rp_indi_name)
 {
     $sql = 'UPDATE rp_indi_name SET seq_nbr = ?, update_datetime = now() WHERE indi_id = ?  AND indi_batch_id = ?  AND name_id = ? ';
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $sql_query->set_number($rp_indi_name->seq_nbr);
     $sql_query->set($rp_indi_name->indi_id);
     $sql_query->set_number($rp_indi_name->indi_batch_id);
     $sql_query->set_number($rp_indi_name->name_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);
 }
 /**
  * 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);
 }
 public function get_sources_with_pages($batch_id)
 {
     $sql = "SELECT rs.id AS id, rs.batch_id AS batch_id" . ",rs.abbr AS abbr" . ",rs.wp_page_id AS page" . " FROM rp_source rs" . " WHERE rs.wp_page_id IS NOT NULL AND rs.batch_id = ?";
     $sql_query = new RP_Sql_Query($sql, $this->prefix);
     $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++) {
             $s = array();
             $s['id'] = $rows[$idx]['id'];
             $s['batch_id'] = $rows[$idx]['batch_id'];
             $s['title'] = $rows[$idx]['abbr'];
             $s['page_id'] = $rows[$idx]['page'];
             $sources[$idx] = $s;
         }
     }
     return $sources;
 }
 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;
 }