Exemplo n.º 1
0
<?php

require_once "service/SimplePdoLeadConnectService.php";
require_once "entity/Account.php";
require_once "entity/Vendor.php";
if (array_key_exists('id', $_GET) && $_GET['id']) {
    $service = new SimplePdoLeadConnectService();
    $account = $service->loadAccount($_GET['id']);
    $vendors = $service->loadAccountVendors($_GET['id']);
}
?>


<html>
<head>
<title>Account</title>
</head>
<body>
    <h1>Account</h1>
<form method="post" action="_saveAccount.php">
    <p>
    Name:<br />
    <input type="text" name="name" <?php 
if (array_key_exists('id', $_GET) && $_GET['id']) {
    ?>
value="<?php 
    echo $account->name;
}
?>
"/>
    </p>
Exemplo n.º 2
0
    $live = "true";
    $phone = substr($_REQUEST['From'], -10);
    $name = NULL;
    $email = NULL;
    $note = NULL;
    $account = $service->loadAccountFromPhone(substr($_REQUEST['To'], -10));
} else {
    $live = "false";
    $number_sid = $_POST['number_sid'];
    $phone = $_POST['phone'];
    $name = $_POST['name'];
    $email = $_POST['email'];
    $note = $_POST['note'];
    $account = $service->loadAccountFromNumberSid($number_sid);
}
$vendors = $service->loadAccountVendors($account->id);
if (!$service->loadProspectByPhone($phone, $account->id)) {
    $p = new Prospect();
    $p->account_id = $account->id;
    $p->name = $name;
    $p->email = $email;
    $p->phone = $phone;
    $service->saveProspect($p);
}
$prospect = $service->loadProspectByPhone($phone, $account->id);
$inquiry_key = md5(microtime() . rand());
$i = new Inquiry();
$i->inquiry_key = $inquiry_key;
$i->prospect_id = $prospect->id;
$i->status = "new";
$i->note = $note;