/**
  * Transforms an object (contact) to a string (number).
  *
  * @param  contact|null $contact
  * @return string
  */
 public function transform($contact)
 {
     if (empty($contact)) {
         return null;
     }
     return $contact->getId();
 }
Exemplo n.º 2
0
    public function latest()
    {
        $contact = new contact();
        $sql = "SELECT * FROM {$this->table_notes} ORDER BY note_create_time DESC LIMIT 10";
        $result = mysql_query($sql);
        while ($row = mysql_fetch_array($result)) {
            $notetype = $row['note_type'];
            if ($notetype == "upload") {
                echo '
						<a href="contacts.php?q=view&id=' . $row['contact_id'] . '">
							<b><u>' . $contact->getbyname($row['contact_id']) . '</u></b> <u>on ' . date("m/d/Y", $row['note_create_time']) . '</u><br />
						</a>
					';
                echo '<b>[File Uploaded]</b>';
                echo '<br /><br />';
                //echo $row['note_text'] . '<br /><br />';
            } else {
                echo '
						<a href="contacts.php?q=view&id=' . $row['contact_id'] . '">
							<b><u>' . $contact->getbyname($row['contact_id']) . '</u></b> <u>on ' . date("m/d/Y", $row['note_create_time']) . '</u><br />
						</a>
					';
                echo $row['note_text'] . '<br /><br />';
            }
        }
    }
Exemplo n.º 3
0
 function delete($id)
 {
     $contact = new contact($id);
     //delete city
     $contact->delete();
     //redirect to city
     redirect($this->admin . 'contacts/list_all/');
 }
Exemplo n.º 4
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            if (isset($_POST['contact'])) {
                // Verification usage
                $con = new contact();
                $con->db = $db;
                $con->url = $CONF['url'];
                $con->phone = $_POST['phone'];
                $con->email = $_POST['email'];
                $con->address = $_POST['address'];
                $con->city = $_POST['city'];
                $con->state = $_POST['state'];
                $con->country = $_POST['country'];
                $TMPL['contactMsg'] = $con->process();
                if ($TMPL['contactMsg'] == 1) {
                    header("Location: " . $CONF['url'] . "/index.php?a=contact");
                }
            }
            if (isset($_SESSION['username'])) {
                if (filter_var($_SESSION['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                }
            } elseif (isset($_COOKIE['username'])) {
                if (filter_var($_COOKIE['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                }
            }
            while ($row = $result->fetch_assoc()) {
                $status = $row['status'];
            }
            if ($status == 1) {
                header("Location: " . $CONF['url'] . "/index.php?a=employee");
            } elseif ($status == 2) {
                header("Location: " . $CONF['url'] . "/index.php?a=feed");
            }
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['Contact'] . ' - ' . $settings['title'];
    $TMPL['ad'] = $settings['ad1'];
    $skin = new skin('register/contact');
    return $skin->make();
}
Exemplo n.º 5
0
 public function processedit()
 {
     $firstname = $_POST['firstname'];
     $middlename = $_POST['middlename'];
     $lastname = $_POST['lastname'];
     $id = $_POST['id'];
     $contact = new contact($id);
     $contact->firstname = $firstname;
     $contact->lastname = $lastname;
     $contact->middlename = $middlename;
     $contact->save();
     $this->deleteMethods($contact);
     $this->addMethods($_POST['type'], $contact);
     lib::sendto("/contacts/view/{$contact->id}");
 }
Exemplo n.º 6
0
 public function get_records()
 {
     $result = array();
     $query = 'SELECT ' . account::get_sf_fields() . ' FROM Account WHERE Data_Source__c = \'New Records Salesforce\' AND LastModifiedDate > ' . utcDateFormat(time() - 7200);
     $response = $this->conn->query($query);
     foreach ($response->records as $record) {
         $record->Contacts = array();
         $result[$record->Id] = $record;
     }
     $query = 'SELECT ' . contact::get_sf_fields() . ' FROM Contact WHERE Data_Source__c = \'New Records Salesforce\' AND LastModifiedDate > ' . utcDateFormat(time() - 7200);
     $response = $this->conn->query($query);
     foreach ($response->records as $record) {
         if (!isset($result[$record->AccountId]->Contacts)) {
             $result[$record->AccountId]->Contacts = array();
         }
         $result[$record->AccountId]->Contacts[] = $record;
     }
     return $result;
 }
Exemplo n.º 7
0
//-----------------------------------------------------------
// "qdb_exec()"
//-----------------------------------------------------------
//$data1->execute(array('issss', 12, 'todd', 'tomom', 'Where', 'FL'));
$id = 12;
$fname = 'todd';
$lname = 'tomrom';
$city = 'Where';
$state = 'FL';
qdb_exec($data_source, $strsql2, array('issss', &$id, &$fname, &$lname, &$city, &$state));
//-----------------------------------------------------------
// "DIO"
//-----------------------------------------------------------
//$data1->execute(array('issss', 13, 'ricky', 'richards', 'Here', 'OH'));
// Create New Object
$contact = new contact(false);
$contact->use_bind_params();
$contact->set_field_data('id', 13);
$contact->set_field_data('first_name', 'ricky');
$contact->set_field_data('last_name', 'richards');
$contact->set_field_data('city', 'Here');
$contact->set_field_data('state', 'OH');
//$contact->print_only();
//print $contact->save();
$contact->save();
//-----------------------------------------------------------
// Commit
//-----------------------------------------------------------
//print_array(qdb_list($data_source, $strsql0));
//$data1->rollback();
$data1->commit();
Exemplo n.º 8
0
</li>
			<?php 
}
?>
			<li class="ajout ajouterCoordonnees">Ajouter une nouvelle information de contact</li>
		</ul>
	</section>
	
	<section id="fichesLiees" class="contenu demi">
		<h4>Fiches liées</h4>
		
		<ul class="etatcivil">
			<?php 
$fiches = $data->linked_people();
foreach ($fiches as $identifiant => $fiche) {
    $ficheLiee = new contact($identifiant);
    ?>
			<li class="lien fiche-liee-<?php 
    echo $ficheLiee->get('id');
    ?>
"><a href="<?php 
    Core::goPage('contact', array('contact' => $ficheLiee->get('id')));
    ?>
"><?php 
    echo $ficheLiee->display_name();
    ?>
</a> <a href="#" class="retraitLiaison nostyle" data-fiche="<?php 
    echo $ficheLiee->get('id');
    ?>
"><small>&#xe8b0;</small></a></li>
			<?php 
Exemplo n.º 9
0
 function replace_user_action()
 {
     global $lang, $config;
     require_once $config['basepath'] . '/include/login.inc.php';
     $login = new login();
     switch ($_GET['action']) {
         case 'index':
             $_GET['PageID'] = 1;
             require_once $config['basepath'] . '/include/page_display.inc.php';
             $search = new page_display();
             $data = $search->display();
             break;
         case 'member_login':
             $data = $login->display_login('Member');
             break;
         case 'search_step_2':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->create_searchpage();
             break;
         case 'searchpage':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->create_search_page_logic();
             break;
         case 'searchresults':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->search_results();
             break;
         case 'listingview':
             require_once $config['basepath'] . '/include/listing.inc.php';
             $listing = new listing_pages();
             $data = $listing->listing_view();
             break;
         case 'addtofavorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->addtofavorites();
             break;
         case 'view_favorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->view_favorites();
             break;
         case 'view_saved_searches':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->view_saved_searches();
             break;
         case 'save_search':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->save_search();
             break;
         case 'delete_search':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->delete_search();
             break;
         case 'delete_favorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->delete_favorites();
             break;
         case 'page_display':
             require_once $config['basepath'] . '/include/page_display.inc.php';
             $search = new page_display();
             $data = $search->display();
             break;
         case 'calculator':
             require_once $config['basepath'] . '/include/calculators.inc.php';
             $calc = new calculators();
             $data = $calc->start_calc();
             break;
         case 'view_listing_image':
             require_once $config['basepath'] . '/include/images.inc.php';
             $image = new image_handler();
             $data = $image->view_image('listing');
             break;
         case 'view_user_image':
             require_once $config['basepath'] . '/include/images.inc.php';
             $image = new image_handler();
             $data = $image->view_image('userimage');
             break;
         case 'rss_featured_listings':
             require_once $config['basepath'] . '/include/rss.inc.php';
             $rss = new rss();
             $data = $rss->rss_view('featured');
             break;
         case 'rss_lastmodified_listings':
             require_once $config['basepath'] . '/include/rss.inc.php';
             $rss = new rss();
             $data = $rss->rss_view('lastmodified');
             break;
         case 'view_user':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             $data = $user->view_user();
             break;
         case 'view_users':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             $data = $user->view_users();
             break;
         case 'edit_profile':
             require_once $config['basepath'] . '/include/user_manager.inc.php';
             if (!isset($_GET['user_id'])) {
                 $_GET['user_id'] = 0;
             }
             $user_managment = new user_managment();
             $data = $user_managment->edit_member_profile($_GET['user_id']);
             break;
         case 'signup':
             if (isset($_GET['type'])) {
                 require_once $config['basepath'] . '/include/user_manager.inc.php';
                 $listing = new user_managment();
                 $data = $listing->user_signup($_GET['type']);
             }
             break;
         case 'show_vtour':
             if (isset($_GET['listingID'])) {
                 require_once $config['basepath'] . '/include/vtour.inc.php';
                 $vtour = new vtours();
                 $data = $vtour->show_vtour($_GET['listingID']);
             } else {
                 $data = 'No Listing ID';
             }
             break;
         case 'contact_friend':
             require_once $config['basepath'] . '/include/contact.inc.php';
             $contact = new contact();
             if (isset($_GET['listing_id'])) {
                 $data = $contact->ContactFriendForm($_GET['listing_id']);
             }
             break;
         case 'contact_agent':
             require_once $config['basepath'] . '/include/contact.inc.php';
             $contact = new contact();
             if (isset($_GET['listing_id']) && isset($_GET['agent_id'])) {
                 $data = $contact->ContactAgentForm($_GET['listing_id'], $_GET['agent_id']);
             } elseif (isset($_GET['listing_id'])) {
                 $data = $contact->ContactAgentForm($_GET['listing_id'], 0);
             } elseif (isset($_GET['agent_id'])) {
                 $data = $contact->ContactAgentForm(0, $_GET['agent_id']);
             } else {
                 $data = '';
             }
             break;
         case 'create_vcard':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             if (isset($_GET['user'])) {
                 $data = $user->create_vcard($_GET['user']);
             }
             break;
         case 'create_download':
             require_once $config['basepath'] . '/include/files.inc.php';
             $files = new file_handler();
             if (isset($_GET['ID']) && isset($_GET['file_id']) && isset($_GET['type'])) {
                 $data = $files->create_download($_GET['ID'], $_GET['file_id'], $_GET['type']);
             } elseif (isset($_POST['ID']) && isset($_POST['file_id']) && isset($_POST['type'])) {
                 $data = $files->create_download($_POST['ID'], $_POST['file_id'], $_POST['type']);
             }
             break;
         case 'blog_index':
             require_once $config['basepath'] . '/include/blog_display.inc.php';
             $blog = new blog_display();
             $data = $blog->disply_blog_index();
             break;
         case 'blog_view_article':
             require_once $config['basepath'] . '/include/blog_display.inc.php';
             $blog = new blog_display();
             $data = $blog->display();
             break;
         case 'verify_email':
             require_once $config['basepath'] . '/include/user_manager.inc.php';
             $user_manager = new user_managment();
             $data = $user_manager->verify_email();
             break;
         default:
             $addon_name = array();
             if (preg_match("/^addon_(.\\S*?)_.*/", $_GET['action'], $addon_name)) {
                 $file = $config['basepath'] . '/addons/' . $addon_name[1] . '/addon.inc.php';
                 if (file_exists($file)) {
                     include_once $file;
                     $function_name = $addon_name[1] . '_run_action_user_template';
                     $data = $function_name();
                 } else {
                     $data = $lang['addon_doesnt_exist'];
                 }
             } else {
                 $data = '';
             }
             break;
     }
     // End switch ($_GET['action'])
     return $data;
 }
Exemplo n.º 10
0
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('Edit contact');
if (isset($_GET['Id'])) {
    $Id = urldecode($_GET['Id']);
    require 'form_data_contact.php';
} elseif (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    require 'components/query_string_standard.php';
    require 'subclasses/contact.php';
    $dbh_contact = new contact();
    $object_name = 'dbh_contact';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        redirect("listview_contact.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button', $_SERVER['PHP_SELF']);
        $message .= $dbh_contact->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_contact->check_uniqueness_for_editing($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
Exemplo n.º 11
0
require 'path.php';
init_cobalt('Delete contact');
if (isset($_GET['Id'])) {
    $Id = urldecode($_GET['Id']);
    require_once 'form_data_contact.php';
}
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_delete']);
    require 'components/query_string_standard.php';
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_contact.php?{$query_string}");
    } elseif ($_POST['btn_delete']) {
        log_action('Pressed delete button');
        require_once 'subclasses/contact.php';
        $dbh_contact = new contact();
        $object_name = 'dbh_contact';
        require 'components/create_form_data.php';
        $dbh_contact->delete($arr_form_data);
        redirect("listview_contact.php?{$query_string}");
    }
}
require 'subclasses/contact_html.php';
$html = new contact_html();
$html->draw_header('Delete Contact', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('Id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
$html->draw_footer();
Exemplo n.º 12
0
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('View contact');
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_contact.php");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        require 'subclasses/contact.php';
        $dbh_contact = new contact();
        if ($message == "") {
            log_action('Exported table data to CSV');
            $timestamp = date('Y-m-d');
            $token = generate_token(0, 'fs');
            $csv_name = $token . $_SESSION['user'] . '_contact_' . $timestamp . '.csv';
            $filename = TMP_DIRECTORY . '/' . $csv_name;
            $csv_contents = $dbh_contact->export_to_csv();
            $csv_file = fopen($filename, "wb");
            fwrite($csv_file, $csv_contents);
            fclose($csv_file);
            chmod($filename, 0755);
            $csv_name = urlencode($csv_name);
            $message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>';
            $message_type = 'system';
        }
Exemplo n.º 13
0
<?php

//***********************************************************************
//***********************************************************************
// Test Database Interface Object
//***********************************************************************
//***********************************************************************
print_header('Test Database Interface Object');
// Create New Object
$contact = new contact();
// Dump Table Info
print_sub_header('Create Object, Show Table Info');
$contact->dump();
// Load a new record and dump it to screen
print_sub_header('Load Empty Record');
$contact->load('');
$contact->dump('data');
// Load an existing record and dump it to screen
print_sub_header('Load Existing Record');
$contact->load(1);
$contact->dump('data');
Exemplo n.º 14
0
<?php

require_once '../lib/class_support.php';
$ql = new contact();
$HoTen = isset($_POST['TieuDeCH']) ? $_POST['TieuDeCH'] : '';
$NoiDung = isset($_POST['NoiDungCH']) ? $_POST['NoiDungCH'] : '';
$HoTen = $ql->XoaDinhDang($HoTen);
$NoiDung = $ql->XoaDinhDang($NoiDung);
$NgayDang = date('Y-m-d');
if ($HoTen != '' && $NoiDung != '') {
    $ql->LuuRegister4($HoTen, $NoiDung, $NgayDang);
}
echo "Phòng khám đã nhận được ý kiến của bạn. <br />Cám ơn bạn đã góp ý để dịch vụ chúng tôi ngày càng phát triển. <br />Nếu muốn góp ý trực tiếp bạn có thể liên hệ (08) 3920 2999";
Exemplo n.º 15
0
function select()
{
    $contact = new contact();
    if (isset($_GET['page'])) {
        $pages = $_GET['page'];
    } else {
        $pages = 1;
    }
    $GLOBALS['pages'] = $pages;
    $page = new page($pages);
    $GLOBALS['page'] = $page;
    $total = $contact->countContact();
    $GLOBALS['page']->pageft($total, $GLOBALS['displaypg']);
    $item = $contact->queryAdminContact();
    global $smarty;
    $smarty->assign("item", $item);
    $smarty->assign("nextpage", $GLOBALS['page']->getPagenav());
}
Exemplo n.º 16
0
<?php

require 'components/get_listview_referrer.php';
require 'subclasses/contact.php';
$dbh_contact = new contact();
$dbh_contact->set_where("Id='" . quote_smart($Id) . "'");
if ($result = $dbh_contact->make_query()->result) {
    $data = $result->fetch_assoc();
    extract($data);
}
Exemplo n.º 17
0
<?php

/**
 * Suppression de l'adresse d'un contact
 *
 * PHP version 5
 *
 * @category Ajax
 * @package  LeQG
 * @author   Damien Senger <*****@*****.**>
 * @license  https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
 * @link     http://leqg.info
 */
if (is_numeric($_POST['fiche'])) {
    // On ouvre la fiche concernée
    $contact = new contact(md5($_POST['fiche']));
    // On modifie l'adresse enregistrée
    $contact->update('adresse_id', 0);
}
Exemplo n.º 18
0
//------------------------------------------------
// Insert Row #2
//------------------------------------------------
if ($tmp_debug) {
    qdb_list($data_source, $strsql2, false, $qdba_opts);
} else {
    qdb_list($data_source, $strsql2);
}
//------------------------------------------------
// Insert Row #3
//------------------------------------------------
if ($tmp_debug) {
    qdb_exec($data_source, $strsql3, $params, false, $qdba_opts);
} else {
    qdb_exec($data_source, $strsql3, $params);
}
//------------------------------------------------
// Insert Row #4
//------------------------------------------------
//print_array($test_vals[3]);
$contact = new contact(false);
$contact->use_bind_params();
$contact->import($test_vals[3]);
$print_only = false;
if ($print_only && $tmp_debug) {
    $contact->print_only();
    print $contact->save();
    $contact->dump('data');
} else {
    $contact->save();
}
Exemplo n.º 19
0
<?php

require_once '../lib/class_support.php';
$ql = new contact();
$DienThoai = isset($_GET['phone']) ? $_GET['phone'] : '';
$DienThoai = $ql->XoaDinhDang($DienThoai);
$NgayDang = gmdate('Y/m/d H:i:s', time() + 7 * 3600);
if ($DienThoai != '') {
    $ql->LuuSupport($DienThoai, $NgayDang);
}
echo "Số điện thoại của bạn đã được lưu! Chúng tôi sẽ liên hệ với bạn sớm nhất có thể!";
Exemplo n.º 20
0
<?php

//header('Content-Type: text/html; charset=utf-8');
require_once '../html/includes/include.php';
//$mail_format = new mail_format();
$contact = new contact();
if (array_key_exists('_wysihtml5_mode', $_POST)) {
    unset($_POST['_wysihtml5_mode']);
}
$contact_data = $contact->getSearchContact($_REQUEST);
$return = array('msg' => $msg, 'type' => $msg_type, 'data' => $contact_data);
//echo json_encode($return);
 /**
  * Saves a given contact.
  *
  * @param contact
  * @return void
  */
 public function saveContact(contact $contact)
 {
     $contact->save();
     foreach ($this->contacts as $k => $contactdb) {
         if ($contactdb->id == $contact->id) {
             $this->contacts[$k] = $contact;
             return;
         }
     }
     $this->contacts[] = $contact;
 }
 /**
  *Test Bug with mass delete and multiple pages when using select all
  * @depends testMassDeleteActionsForSelectedIds
  */
 public function testMassDeletePagesProperlyAndRemovesAllSelected()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //MassDelete for selected Record Count
     $contacts = contact::getAll();
     $this->assertEquals(7, count($contacts));
     //save Model MassDelete for entire search result
     $this->setGetArray(array('selectAll' => '1', 'Contact_page' => 1));
     $this->setPostArray(array('selectedRecordCount' => 7));
     //Run Mass Delete using progress save for page1.
     $pageSize = Yii::app()->pagination->getForCurrentUserByType('massDeleteProgressPageSize');
     $this->assertEquals(5, $pageSize);
     $this->runControllerWithExitExceptionAndGetContent('contacts/default/massDelete');
     //check for previous mass delete progress
     $contacts = contact::getAll();
     $this->assertEquals(2, count($contacts));
     $this->setGetArray(array('selectAll' => '1', 'Contact_page' => 2));
     $this->setPostArray(array('selectedRecordCount' => 7));
     //Run Mass Delete using progress save for page2.
     $pageSize = Yii::app()->pagination->getForCurrentUserByType('massDeleteProgressPageSize');
     $this->assertEquals(5, $pageSize);
     $this->runControllerWithNoExceptionsAndGetContent('contacts/default/massDeleteProgress');
     //calculating contact's count
     $contacts = contact::getAll();
     $this->assertEquals(0, count($contacts));
 }
Exemplo n.º 23
0
require_once 'helpers.php';
require_once 'account.php';
require_once 'contact.php';
require_once 'product.php';
require_once 'sql_init.php';
require_once 'salesforce_ins.php';
$ms_sql = new SQL_C();
$force = new salesforce_ins();
$ms_con = $ms_sql->get_connection();
if ($ms_con && $force->get_connection()) {
    echo "Connection established.<br />";
    $query1 = 'SELECT c.*,a.SF_ID as account_id,a.SMAN as owner_id from contacts c LEFT JOIN account a ON c.SLCODE = a.SLCODE WHERE c.SYNCH_STATUS IN (0,1)';
    $res1 = sqlsrv_query($ms_con, $query1);
    $contacts = array();
    while ($row = sqlsrv_fetch_array($res1, SQLSRV_FETCH_ASSOC)) {
        $contact = new contact();
        $contact->set_sql_fields($row);
        if (!empty($row['account_id'])) {
            $contact->set_account($row['account_id']);
        }
        if (!empty($row['owner_id'])) {
            $contact->set_owner_id($row['owner_id']);
        }
        if ($row['CONTACT_LAST_NAME']) {
            $contacts[] = $contact;
        }
    }
    echo count($contacts);
    $chunks = array_chunk($contacts, 1);
    foreach ($chunks as $chunk) {
        $contacts = $force->insert_batch('Contact', $chunk);
Exemplo n.º 24
0
<?php

$ip = router::Ip();
$contact = new contact($ip);
if (count($_POST) == 3 && !$contact->found()) {
    $_POST['ip'] = $ip;
    new contact($_POST);
}
?>

<?php 
require 'inc.nav.php';
?>

<div class="header">
	<div class="imgheadcon">
		<div class="webstar">
			<img src="/style/images/aboutus.png"></img>
		</div>
	</div>
</div>

<div class="whiterow">
	<div class="headconbody">
		<div class="row">
			<div class="description" id="opg">
				<h3>[nav_about]</h3>
				<p>[learnmore]</p>
			<div class="contentrow">
				<div class="devsimg">
					<img src="/style/images/dev-s.png" />
Exemplo n.º 25
0
 /**
  * Saves a given contact
  * @param contact
  * @return void
  */
 public function saveContact(contact $contact)
 {
     $contact->save();
 }
Exemplo n.º 26
0
require 'inc.manage.php';
?>
<div id="container" class="main">
	<div class="top dark">
		<center><h1>[title]</h1></center>
	</div>
	<div id="add" style="height: 160px; padding: 0; background: url('http://thumbs.dreamstime.com/t/seamless-background-forest-green-summer-birch-trees-bushes-38722994.jpg') repeat-x">
	</div>
	<?php 
if (isset($uri[0]) && is_numeric($uri[0])) {
    $contact = new contact(intval($uri[0]));
    if ($contact->found()) {
        $contact->delete();
        echo '<div class="green">Contact form from ', $contact->ip, ' has been removed</div>';
    }
}
?>
	<?php 
$contact = new contact(false);
while ($contact->found()) {
    ?>
	<div>
		<?php 
    echo '<a href="/manage/contact/', $contact->id, '">[Dismiss]</a> ', $contact->name, ' - from ', $contact->ip, '<br/><b>', $contact->subject, '</b><br/>', nl2br($contact->content);
    ?>
	</div>
	<?php 
}
require 'inc.footer.php';
?>
</div>
Exemplo n.º 27
0
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('Add contact');
require 'components/get_listview_referrer.php';
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    require 'components/query_string_standard.php';
    require 'subclasses/contact.php';
    $dbh_contact = new contact();
    $object_name = 'dbh_contact';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        redirect("listview_contact.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button', $_SERVER['PHP_SELF']);
        $message .= $dbh_contact->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_contact->check_uniqueness($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
Exemplo n.º 28
0
				ad_id=' . ATTR_DEF_COMPANY . " and frd_id= " . FICHE_TYPE_CONTACT . ' order by 1', 1);
    $sl_company->selected = isset($_GET['sel_company']) ? $_GET['sel_company'] : '';
    echo _('Société :') . $sl_company->input();
    ?>
    	    <input type="submit" class="button" name="submit_query" value="<?php 
    echo _('recherche');
    ?>
">
    	    <input type="hidden" name="ac" value="<?php 
    echo $_REQUEST['ac'];
    ?>
">
    	</form>
        </div>
	<?php 
    $client = new contact($cn);
    $search = isset($_GET['query']) ? $_GET['query'] : "";
    $sql = "";
    if (isset($_GET['cat'])) {
        if ($_GET['cat'] != -1) {
            $sql = sprintf(" and fd_id = %d", $_GET['cat']);
        }
    }
    if (isset($_GET['sel_company'])) {
        if ($_GET['sel_company'] != '' && $_GET['sel_company'] != -1) {
            $client->company = $_GET['sel_company'];
        }
    }
    echo '<div class="content">';
    echo $client->Summary($search, "contact", $sql);
    echo '<br>';
Exemplo n.º 29
0
 function edit($id, $data)
 {
     return contact::where($this->primaryKey, $id)->update($data);
 }
Exemplo n.º 30
0
<?php 
require "../control/view.php";
$contact = new contact();
$contact->setByOid($_GET["oid"]);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <title><?php 
echo $contact->name;
?>
 - 个人信息</title>
        <link rel="stylesheet" href="../../common/style/weui.min.css"/>
        <link rel="stylesheet" href="../../common/style/example.css"/>
        <script>
function onBridgeReady(){
WeixinJSBridge.call('hideOptionMenu');
}

if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
}
}else{
onBridgeReady();
}