Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by dada ( 6 years ago )
function getSelectedContactDetailsForUpdate($master_id) {
$display_block2 = "";
//Get the Contact Address Details
$this->db->select("address, city, town, type", false);
$query = $this->db->get_where('address', array('master_id' => $master_id));
if ($query->num_rows() > 0) {
$result = $query->row();
$display_block2 .= "<strong>Address: </strong>";
$display_block2 .= "<input type=\"text\" name=\"address\" size=\"55\" maxlength=\"60\" value=$result->address></p>";
$display_block2 .= "<strong>City: </strong>";
$display_block2 .= "<input type=\"text\" name=\"city\" size=\"20\" maxlength=\"50\" value=$result->city></p>";
$display_block2 .= "<strong>Town: </strong>";
$display_block2 .= "<input type=\"text\" name=\"town\" size=\"20\" maxlength=\"30\" value=$result->town></p>";
$display_block2 .= "<strong>Address Type: </strong>";
if ($result->type = 'home') {
$display_block2 .="<input type=\"radio\" name=\"AddressType\" value=\"home\" checked> home
<input type=\"radio\" name=\"aAddressType\" value=\"work\"> work
<input type=\"radio\" name=\"AddressType\" value=\"other\"> other</p>";
} else if ($result->type = 'work') {
$display_block2 .="<input type=\"radio\" name=\"AddressType\" value=\"home\"> home
<input type=\"radio\" name=\"AddressType\" value=\"work\" checked> work
<input type=\"radio\" name=\"AddressType\" value=\"other\"> other</p>";
}
else {
$display_block2 .="<input type=\"radio\" name=\"AddressType\" value=\"home\"> home
<input type=\"radio\" name=\"AddressType\" value=\"work\"> work
<input type=\"radio\" name=\"AddressType\" value=\"other\" checked> other</p>";
}
}
//Get the Contact Telephone Details
$this->db->select("telephoneNo, type", false);
$query = $this->db->get_where('telephone', array('master_id' => $master_id));
if ($query->num_rows() > 0) {
$result = $query->row();
$display_block2 .= "<strong>Telephone: </strong>";
$display_block2 .= "<input type=\"text\" name=\"tel_number\" size=\"18\" maxlength=\"45\" value=$result->telephoneNo></p>";
$display_block2 .= "<strong>Telephone Type: </strong>";
if ($result->type = 'home') {
$display_block2 .="<input type=\"radio\" name=\"tel_type\" value=\"home\" checked> home
<input type=\"radio\" name=\"tel`_type\" value=\"work\"> work
<input type=\"radio\" name=\"tel_type\" value=\"other\"> other</p>";
} else if ($result->type = 'work') {
$display_block2 .="<input type=\"radio\" name=\"tel_type\" value=\"home\"> home
<input type=\"radio\" name=\"tel_type\" value=\"work\" checked> work
<input type=\"radio\" name=\"tel_type\" value=\"other\"> other</p>";
}
else {
$display_block2 .="<input type=\"radio\" name=\"tel_type\" value=\"home\"> home
<input type=\"radio\" name=\"tel_type\" value=\"work\"> work
<input type=\"radio\" name=\"tel_type\" value=\"other\" checked> other</p>";
}
}
//Get the Contact Email Details
$this->db->select("email, type", false);
$query = $this->db->get_where('email', array('master_id' => $master_id));
if ($query->num_rows() > 0) {
$result = $query->row();
$display_block2 .= "<strong>Email: </strong>";
$display_block2 .= "<input type=\"text\" name=\"email\" size=\"30\" maxlength=\"150\" value=$result->email></p>";
$display_block2 .= "<strong>Email Type: </strong>";
if ($result->type = 'home') {
$display_block2 .="<input type=\"radio\" name=\"email_type\" value=\"home\" checked> home
<input type=\"radio\" name=\"email_type\" value=\"work\"> work
<input type=\"radio\" name=\"email_type\" value=\"other\"> other</p>";
} else if ($result->type = 'work') {
$display_block2 .="<input type=\"radio\" name=\"email_type\" value=\"home\"> home
<input type=\"radio\" name=\"email_type\" value=\"work\" checked> work
<input type=\"radio\" name=\"email_type\" value=\"other\"> other</p>";
}
else {
$display_block2 .="<input type=\"radio\" name=\"email_type\" value=\"home\"> home
<input type=\"radio\" name=\"email_type\" value=\"work\"> work
<input type=\"radio\" name=\"email_type\" value=\"other\" checked> other</p>";
}
}
//Get the fax Details
$this->db->select("fax_number, type", false);
$query = $this->db->get_where('fax', array('master_id' => $master_id));
if ($query->num_rows() > 0) {
$result = $query->row();
$display_block2 .= "<strong>Fax: </strong>";
$display_block2 .= "<input type=\"text\" name=\"fax\" size=\"30\" maxlength=\"150\" value=$result->fax_number></p>";
$display_block2 .= "<strong>Fax Type: </strong>";
if ($result->type = 'home') {
$display_block2 .="<input type=\"radio\" name=\"fax_type\" value=\"home\" checked> home
<input type=\"radio\" name=\"fax_type\" value=\"work\"> work
<input type=\"radio\" name=\"fax_type\" value=\"other\"> other</p>";
} else if ($result->type = 'work') {
$display_block2 .="<input type=\"radio\" name=\"fax_type\" value=\"home\"> home
<input type=\"radio\" name=\"fax_type\" value=\"work\" checked> work
<input type=\"radio\" name=\"fax_type\" value=\"other\"> other</p>";
}
else {
$display_block2 .="<input type=\"radio\" name=\"fax_type\" value=\"home\"> home
<input type=\"radio\" name=\"fax_type\" value=\"work\"> work
<input type=\"radio\" name=\"fax_type\" value=\"other\" checked> other</p>";
}
}
//Get the personal_notes Details
$this->db->select("note", false);
$query = $this->db->get_where('personal_notes', array('master_id' => $master_id));
if ($query->num_rows() > 0) {
$result = $query->row();
$display_block2 .= "<strong>Personal Notes: </strong>";
$display_block2 .= "<input type=\"text\" name=\"note\" size=\"80\" maxlength=\"80\" value=$result->note></p>";
}
return $display_block2;
}
Revise this Paste