コード例 #1
0
ファイル: CreateEvent.php プロジェクト: kisorbiswal/Creamy
    // do we have a title?
    // if not, we do need at least some customer data...
    if (!isset($_POST["customerid"])) {
        $validated = 0;
    } else {
        if (!isset($_POST["customer_type"])) {
            $validated = 0;
        }
    }
}
if ($validated == 1) {
    $db = new \creamy\DbHandler();
    // check if this is a new customer type of event.
    if (isset($_POST["customerid"]) && isset($_POST["customer_type"])) {
        $customerid = $_POST["customerid"];
        $customertype = $_POST["customer_type"];
        $result = $db->createContactEventForCustomer($user->getUserId(), $customerid, $customertype, true, null, null, null);
    } else {
        // normal event
        $title = $_POST["title"];
        $color = isset($_POST["color"]) ? $_POST["color"] : CRM_UI_COLOR_DEFAULT_HEX;
        error_log("Creando evento con color {$color}");
        $result = $db->createEvent($user->getUserId(), $title, $color, true, null, null, null);
    }
    // return result
    ob_clean();
    print "{$result}";
} else {
    ob_clean();
    print "0";
}
コード例 #2
0
ファイル: events.php プロジェクト: kisorbiswal/Creamy
    header("location: ./install.php");
}
// initialize session and DDBB handler
require_once './php/Session.php';
include_once './php/UIHandler.php';
require_once './php/LanguageHandler.php';
require_once './php/DbHandler.php';
$ui = \creamy\UIHandler::getInstance();
$lh = \creamy\LanguageHandler::getInstance();
$user = \creamy\CreamyUser::currentUser();
$db = new \creamy\DbHandler();
// create new event with client id?
if (isset($_GET["customerid"]) && isset($_GET["customer_type"])) {
    $customerid = $_GET["customerid"];
    $customertype = $_GET["customer_type"];
    $db->createContactEventForCustomer($user->getUserId(), $customerid, $customertype);
}
?>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Creamy</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />
	    <!-- fullCalendar 2.2.5-->
	    <link href="css/fullcalendar/fullcalendar.min.css" rel="stylesheet" type="text/css" />
	    <link href="css/fullcalendar/fullcalendar.print.css" rel="stylesheet" type="text/css" media='print' />
        <!-- Creamy style -->
        <link href="css/creamycrm.css" rel="stylesheet" type="text/css" />
        <?php