if ($db->HasFailedTrans()) {
        print "<script language=javascript>alert('错误:" . str_replace("'", "\\'", $db->ErrorMsg()) . "');window.history.back(-1);</script>";
        exit;
    }
    updateLastTrace($_POST[customerid]);
    $return = FormPageAction("action", "init_default");
    print_infor("修改成功", 'trip', "location='?{$return}'", "?{$return}", 1);
    exit;
}
if ($_GET['action'] == "delete_array") {
    $selectid = $_GET['selectid'];
    $selectid = explode(",", $selectid);
    for ($i = 0; $i < sizeof($selectid); $i++) {
        if ($selectid[$i] != "") {
            deleteMessage('客户联系提醒', $selectid[$i]);
            deleteCalendar('联系客户 ', $selectid[$i]);
        }
    }
}
function updateLastTrace($customerid)
{
    global $db;
    $sql = "select max(contacttime) as maxtime from crm_contact where customerid={$customerid}";
    $rs = $db->Execute($sql);
    $rs_a = $rs->GetArray();
    if ($rs_a[0]['maxtime'] != '') {
        $sql = "update customer set `lasttracetime`='" . $rs_a[0]['maxtime'] . "' where `rowid`=" . $customerid;
        $rs = $db->Execute($sql);
    }
}
addShortCutByDate("contacttime", "联系时间");
Example #2
0
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'get_calendar':
            getCalendar();
            break;
        case 'save_calendar':
            saveCalendar();
            break;
        case 'new_calendar':
            newCalendar();
            break;
        case 'add_calendar':
            addCalendar();
            break;
        case 'delete':
            deleteCalendar();
            break;
        case 'undelete':
            undeleteCalendar();
            break;
        default:
            die('no such action available');
    }
    exit;
} else {
    $obj_smarty->assign('active', 'calendars');
    $obj_smarty->display(FULLCAL_DIR . '/view/user_panel.tpl');
    exit;
}
function getCalendars()
{