Example #1
0
        }
    }
}
if ($_SESSION['hcard_idcontact'] != '') {
    $do_add_cont = new Contact();
    $do_add_cont->addNew();
    $do_add_cont->firstname = $_SESSION['do_contact']->firstname;
    $do_add_cont->lastname = $_SESSION['do_contact']->lastname;
    $do_add_cont->iduser = $_SESSION['do_User']->iduser;
    $do_add_cont->add();
    $idcontact_inserted = $do_add_cont->getPrimaryKeyValue();
    $ContactPhone = $_SESSION['do_contact']->getChildContactPhone();
    $ContactPhoneAdd = new ContactPhone();
    if ($ContactPhone->getNumRows()) {
        while ($ContactPhone->next()) {
            $ContactPhoneAdd->addNew();
            $ContactPhoneAdd->idcontact = $idcontact_inserted;
            $ContactPhoneAdd->phone_type = $ContactPhone->phone_type;
            $ContactPhoneAdd->phone_number = $ContactPhone->phone_number;
            $ContactPhoneAdd->add();
        }
    }
    $ContactEmail = $_SESSION['do_contact']->getChildContactEmail();
    $ContactEmailAdd = new ContactEmail();
    if ($ContactEmail->getNumRows()) {
        while ($ContactEmail->next()) {
            $ContactEmailAdd->addNew();
            $ContactEmailAdd->idcontact = $idcontact_inserted;
            $ContactEmailAdd->email_type = $ContactEmail->email_type;
            $ContactEmailAdd->email_address = $ContactEmail->email_address;
            $ContactEmailAdd->add();