예제 #1
0
function crm_get_campaigns_combo_list()
{
    $campaigns = crm_get_campaigns();
    if (!$campaigns) {
        return array();
    }
    $result = array();
    foreach ($campaigns as $camp) {
        $result[$camp["id"]] = $camp["title"];
    }
    return $result;
}
예제 #2
0
if ($create) {
    $title = get_parameter("title");
    $description = get_parameter("description");
    $start_date = get_parameter("start_date");
    $end_date = get_parameter("end_date");
    $expenses = get_parameter("expenses");
    //$campaign =
    $values = array("title" => $title, "start_date" => $start_date, "end_date" => $end_date, "description" => $description, "expenses" => $expenses);
    $id = process_sql_insert("tcampaign", $values);
    if ($id) {
        echo "<h3 class='suc'>" . __("Campaign created sucessfully") . "</h3>";
    } else {
        echo "<h3 class='error'>" . __("There was a problem creating campaign") . "</h3>";
    }
}
$campaigns = crm_get_campaigns();
if (!$campaigns) {
    echo "<h3 class='error'>" . __("There aren't campaigns") . "</h3>";
} else {
    $table->width = '98%';
    $table->class = 'databox';
    $table->colspan = array();
    $table->data = array();
    $table->class = "listing";
    $table->data = array();
    $table->style = array();
    $table->colspan = array();
    $table->head[0] = __('ID');
    $table->head[1] = __('Name');
    $table->head[2] = __('Start date');
    $table->head[3] = __('End date');