Exemplo n.º 1
0
* 
* 
*/
include '../../../Conf/Include.php';
set_dependencies(array("ProspectController", "AdminController"));
if (!isset($_REQUEST['type'])) {
    exit;
}
$prospect = new ProspectController();
$type = $_REQUEST['type'];
switch ($type) {
    case "add_contact":
        $id = $_REQUEST['id'];
        $name = $_REQUEST['name'];
        $tel = $_REQUEST['tel'];
        $result = $prospect->SetContactPhone($id, $name, $tel);
        if ($result) {
            $contact = $prospect->Get_PhonesContact($id);
            $json = new \SivarApi\Tools\Services_JSON();
            echo $json->encode($contact);
        }
        unset($id);
        unset($name);
        unset($tel);
        break;
    case "add":
        $id = $_REQUEST['id'];
        $name = $_REQUEST['name'];
        $name2 = $_REQUEST['name2'];
        $title = $_REQUEST['title'];
        $mail = $_REQUEST['mail'];