<label for="subj_email"><?php 
    __("Email");
    ?>
:</label>
            <input class="required" name="subj_email" type="text" value="" />
         </fieldset>
      </div>

      <div class="en">
         <fieldset>
            <label for="lists"><?php 
    __("Subject belongs to the following lists");
    ?>
:</label>
            <?php 
    $lists = get_all_lists();
    while ($row = mysql_fetch_array($lists)) {
        $list_id = $row["list_id"];
        $list_name = decode($row["name"], $lang);
        ?>
               <input type="checkbox" name="lists[]" value="<?php 
        echo $list_id;
        ?>
 " /> <?php 
        echo $list_name;
        ?>
<br />
               <?php 
    }
    ?>
         </fieldset>
Example #2
0
function display_mail_form($email, $listid = 0)
{
    // display html form for uploading a new message
    global $table_width;
    $list = get_all_lists();
    $lists = sizeof($list);
    ?>
  <table cellpadding="4" cellspacing="0" border="0"
     width="<?php 
    echo $table_width;
    ?>
">
  <form enctype="multipart/form-data" action="upload.php" method="post">
  <tr>
    <td bgcolor="#cccccc">List:</td>
    <td bgcolor="#cccccc">
      <select name="list">
      <?php 
    for ($i = 0; $i < $lists; $i++) {
        echo "<option value=\"" . $list[$i][0] . "\"";
        if ($listid == $list[$i][0]) {
            echo " selected";
        }
        echo ">" . $list[$i][1] . "</option>\n";
    }
    ?>
      </select>
    </td>
  </tr>
  <tr>
    <td bgcolor="#cccccc">Subject:</td>
    <td bgcolor="#cccccc">
      <input type="text" name="subject" value="<?php 
    echo @$subject;
    ?>
"
       size="60" /></td>
  </tr>
  <tr>
    <td bgcolor="#cccccc">Text Version:</td>
    <td bgcolor="#cccccc">
       <input type="file" name="userfile[0]" size="60"/></td>
  </tr>
  <tr><td bgcolor="#cccccc">HTML Version:</td>
  <td bgcolor="#cccccc">
    <input type="file" name="userfile[1]" size="60" /></td>
  </tr>
  <tr><td bgcolor="#cccccc" colspan="2">Images: (optional)

<?php 
    $max_images = 10;
    for ($i = 0; $i < 10; $i++) {
        echo "<tr><td bgcolor=\"#cccccc\">Image " . ($i + 1) . " </td>\n          <td bgcolor=\"#cccccc\"><input type=\"file\"\n              name=\"userfile[" . ($i + 2) . "]\" size=\"60\"/></td>\n          </tr>";
    }
    ?>
  <tr><td colspan="2" bgcolor="#cccccc" align="center">
  <input type="hidden" name="max_images" value="<?php 
    echo $max_images;
    ?>
">
  <input type="hidden" name="listid" value="<?php 
    echo $listid;
    ?>
">
  <?php 
    display_form_button('upload-files');
    ?>
  </td>
  </form>
  </tr>
  </table>
<?php 
}
 " /> <?php 
        echo $questionnaire_name;
        ?>
<br />
         <?php 
    }
    ?>
      </fieldset>

      <fieldset>
         <label for="list"><?php 
    __("The study applies to the following lists");
    ?>
:</label>
         <?php 
    $result = get_all_lists();
    while ($row = mysql_fetch_array($result)) {
        $list_id = $row["list_id"];
        $list_name = stripslashes(decode($row["name"], $lang));
        ?>
            <input type="checkbox" name="list[]" value="<?php 
        echo $list_id;
        ?>
 " /> <?php 
        echo $list_name;
        ?>
<br />
         <?php 
    }
    ?>
      </fieldset>
Example #4
0
function display_lists($binding)
{
    $lists = get_all_lists($binding);
    if ($lists) {
        echo "<lists count=\"" . count($lists) . "\">\n";
        foreach ($lists as $list) {
            echo "<list id=\"" . $list->id . "\" name=\"" . $list->name . "\" label=\"" . $list->label . "\" " . "activeCount=\"" . $list->activeCount . "\"/>\n";
        }
        echo "</lists>\n";
    }
}
            break;
    }
}
// The following actions may only be performed by an admin user
if (check_admin_user()) {
    switch ($action) {
        case 'create-mail':
            display_mail_form(get_email());
            break;
        case 'create-list':
            display_list_form(get_email());
            break;
        case 'store-list':
            if (store_list($_SESSION['admin_user'], $_POST)) {
                echo "<p style=\"padding-bottom: 50px\">New list added.</p>";
                display_items('All Lists', get_all_lists(), 'information', 'show-archive', '');
            } else {
                echo "<p style=\"padding-bottom: 50px\">List could not be\n                 stored. Please try again.</p>";
            }
            break;
        case 'send':
            send($_GET['id'], $_SESSION['admin_user']);
            break;
        case 'view-mail':
            display_items('Unsent Mail', get_unsent_mail(get_email()), 'preview-html', 'preview-text', 'send');
            break;
    }
}
/**********************************************************************
* Section 4: display footer
*********************************************************************/
function display_mail_form($email, $listid = 0)
{
    // display html form for uploading a new message
    global $table_width;
    $list = get_all_lists();
    $lists = sizeof($list);
    ?>
  <table cellpadding = 4 cellspacing = 0 border = 0 width = <?php 
    echo $table_width;
    ?>
>
  <form enctype='multipart/form-data' action='upload.php' method='post'>
  <tr>
    <td bgcolor = "#cccccc">
      List:
    </td>
    <td bgcolor = "#cccccc"> 
      <select name = list>
      <?php 
    for ($i = 0; $i < $lists; $i++) {
        echo '<option value = ' . $list[$i][0];
        if ($listid == $list[$i][0]) {
            echo ' selected';
        }
        echo '>' . $list[$i][1] . "</option>\n";
    }
    ?>
      </select>
    </td>
  </tr>
  <tr>
    <td bgcolor = "#cccccc">
      Subject:
    </td>
    <td bgcolor = "#cccccc">
      <input type = text name = subject value = "<?php 
    echo $subject;
    ?>
" 
       size = 60 ></td>
  </tr>
  <tr><td bgcolor = "#cccccc">
    Text Version:  
  </td><td bgcolor = "#cccccc">
    <input type=file name='userfile[0]' size = 60>
  </td></tr>
  <tr><td bgcolor = "#cccccc">
    HTML Version:  
  </td><td bgcolor = "#cccccc">
    <input type=file name='userfile[1]' size = 60>
  </td></tr>
  <tr><td bgcolor = "#cccccc" colspan =2>Images: (optional)
  
<?php 
    $max_images = 10;
    for ($i = 0; $i < 10; $i++) {
        echo "<tr><td bgcolor = '#cccccc'>Image " . ($i + 1) . ' </td>';
        echo "<td bgcolor = '#cccccc'>";
        echo "<input type=file name='userfile[" . ($i + 2) . "]' size = 60></td></tr>";
    }
    ?>
   
  <tr><td colspan = 2 bgcolor = '#cccccc' align = center>
  <input type = hidden name = max_images  value = <?php 
    echo $max_images;
    ?>
>
  <input type = hidden name = listid  value = <?php 
    echo $listid;
    ?>
>
  <?php 
    display_form_button('upload-files');
    ?>
  </td>
  </form>
  </tr>
  </table>
<?php 
}
Example #7
0
function print_message_select_form($bapi, $session_id, $msg_id = null, $list_ids = null, $seg_ids = null, $year = null, $month = null, $day = null, $from_addr = null, $from_name = null, $reply_addr = null)
{
    // Use the API to retrieve messages, lists, and segments for client.
    if (!$bapi) {
        return false;
    }
    // The next 3 API calls will fail on the Agency account itself.  $bapi must reference a subaccount.
    $messages = get_all_messages($bapi);
    $lists = get_all_lists($bapi);
    $segments = get_all_segments($bapi);
    ?>
<h2><?php 
    echo HEADER_REQUEST;
    ?>
 - Message Selection</h2>

<form method="post" action="<?php 
    echo REQUEST_SCRIPT;
    ?>
">
<input type="hidden" name="fm_stage" value="select"/>
<input type="hidden" name="fm_sessionid" value="<?php 
    echo $session_id;
    ?>
"/>
<p>
<label class="required">Please select the message to be approved:</label>
</p>

<?php 
    if (count($messages) > 0) {
        ?>
<select name="fm_msgid">
<option value="">Please select a message...</option>
<?php 
        foreach ($messages as $msg) {
            $sel_flag = $msg->id == $msg_id ? "selected" : "";
            echo "<option value=\"{$msg->id}\" {$sel_flag}>{$msg->name}</option>\n";
        }
        ?>
</select>
<?php 
    } else {
        echo "<div class=\"warning\">There are no messages to select.</div>";
    }
    ?>

<p>
<label class="required">Please select the list(s) and/or segment(s) to be targeted:</label>
</p>

<div id="list_seg_2_cols">
<?php 
    echo "<div id=\"list_select\">\n<p><u>Lists</u></p>\n";
    if (count($lists) > 0) {
        foreach ($lists as $list) {
            $chk_flag = $list_ids && in_array($list->id, $list_ids) ? "checked" : "";
            echo "<input type=\"checkbox\" name=\"fm_listids[]\" value=\"{$list->id}\" {$chk_flag}/>{$list->name} &nbsp;[{$list->activeCount}]<br/>\n";
        }
    } else {
        echo "<div class=\"warning\">There are no lists to select.</div>\n";
    }
    echo "\n</div>\n<div id=\"segment_select\">\n<p><u>Segments</u></p>\n";
    if (count($segments) > 0) {
        foreach ($segments as $segment) {
            $chk_flag = $seg_ids && in_array($segment->id, $seg_ids) ? "checked" : "";
            echo "<input type=\"checkbox\" name=\"fm_segids[]\" value=\"{$segment->id}\" {$chk_flag}/>{$segment->name}<br/>\n";
        }
    } else {
        echo "<div class=\"warning\">There are no segments to select.</div>\n";
    }
    ?>
</div>

<div style="clear: both"></div>


<p>
Please enter the date on which the message should be sent:
</p>

<?php 
    display_date_selector($year, $month, $day);
    ?>

<p>
Please enter message header information:
</p>

<p>
<label class="required">From Address:</label>
<input type="text" name="fm_fromaddr" value="<?php 
    echo $from_addr;
    ?>
"/>
&nbsp;&nbsp;
<label class="required">From Full Name:</label>
<input type="text" name="fm_fromname" value="<?php 
    echo $from_name;
    ?>
"/>
&nbsp;&nbsp;
<label class="optional">Reply Address:</label>
<input type="text" name="fm_replyaddr" value="<?php 
    echo $reply_addr;
    ?>
"/>
</p>

<p>
<input type="submit" value="Submit"/>
&nbsp;&nbsp;
<input type="button" value="Cancel" onclick="window.location='<?php 
    echo REQUEST_SCRIPT;
    ?>
'"/>
</p>
</form>

<?php 
    return true;
}