function get_unsent_mail($email)
{
    if (!check_admin_user($email)) {
        return false;
    }
    $list = array();
    $query = "select mailid, subject, listid from mail \r\n            where status = 'STORED' or status = 'TESTED' order by modified";
    if (db_connect()) {
        $result = mysql_query($query);
        if (!$result) {
            echo '<p>Unable to get list from database.';
            return false;
        }
        $num = mysql_numrows($result);
        for ($i = 0; $i < $num; $i++) {
            array_push($list, array(mysql_result($result, $i, 0), mysql_result($result, $i, 1), get_list_name(mysql_result($result, $i, 2)), mysql_result($result, $i, 2)));
        }
    }
    return $list;
}
     $subj_gender = $data[2];
     $subj_bdate = $data[3];
     $subj_email = $data[4];
     $subj_status = $data[5];
     if (!subject_exists($subj_email)) {
         $query = "INSERT INTO subjects (`first_name`, `last_name`, `gender`, `birth_date`, `email`, `status`)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ('" . $subj_first_name . "', '" . $subj_last_name . "', '" . $subj_gender . "', '" . $subj_bdate . "', '" . $subj_email . "', '" . $subj_status . "') ";
         $result = mysql_query($query, $dbconnect);
         confirm_query($result);
         $subj_id = mysql_insert_id();
         $subject_count++;
         if (isset($list_id)) {
             // add the imported subject to the edited list
             $query_rel = "INSERT INTO rel_subj_list (`list_id`, `subj_id`) VALUES ('" . $list_id . "', '" . $subj_id . "')";
             $result_rel = mysql_query($query_rel, $dbconnect);
             if (mysql_affected_rows() == 1) {
                 $list_name = get_list_name($list_id, $lang);
                 echo "Subject has been added to list {$list_name}.";
             }
         }
     } else {
         continue;
     }
 }
 fclose($handle);
 unlink($storage_path);
 if (isset($list_id)) {
     $mesaj[] = $subject_count . " subjects were added to this list";
     $_SESSION["mesaj"] = $mesaj;
     redirect("view_list.php?list_id=" . $list_id);
 } else {
     $mesaj[] = $subject_count . " subjects were added";
function get_unsent_mail($user)
{
    if (!check_admin_user($user)) {
        return false;
    }
    $list = array();
    $query = "select mailid, subject, listid from mail \n            where status = 'STORED' or status = 'TESTED' order by modified";
    if ($conn = db_connect()) {
        $result = $conn->query($query);
        if (!$result) {
            echo '<p>Unable to get list from database.</p>';
            return false;
        }
        $num = $result->num_rows;
        for ($i = 0; $i < $num; $i++) {
            $row = $result->fetch_array();
            array_push($list, array($row[0], $row[1], get_list_name($row[2]), $row[2]));
        }
    }
    return $list;
}
        }
        if (!check_logged_in()) {
            display_login_form($action);
        }
        break;
    case 'log-in':
    case '':
        if (!check_logged_in()) {
            display_login_form($action);
        }
        break;
    case 'show-all-lists':
        display_items('All Lists', get_all_lists(), 'information', 'show-archive', '');
        break;
    case 'show-archive':
        display_items('Archive For ' . get_list_name($_GET['id']), get_archive($_GET['id']), 'view-html', 'view-text', '');
        break;
    case 'information':
        display_information($_GET['id']);
        break;
    default:
        if (!check_logged_in()) {
            display_login_form($action);
        }
        break;
}
//all other actions require user to be logged in
if (check_logged_in()) {
    switch ($action) {
        case 'account-settings':
            display_account_form(get_email(), get_real_name(get_email()), get_mimetype(get_email()));
示例#5
0
        }
        if ($complaint == 1) {
            $unsubscribed = '<span class="label label-inverse">' . _('Marked as spam') . '</span>';
        }
        if ($confirmed == 0) {
            $unsubscribed = '<span class="label">' . _('Unconfirmed') . '</span>';
        }
        if ($name == '') {
            $name = '[' . _('No name') . ']';
        }
        echo '
			  			
			  			<tr id="' . $id . '">
			  			  <td><a href="#subscriber-info" data-id="' . $id . '" data-toggle="modal" class="subscriber-info">' . $name . '</a></td>
					      <td><a href="#subscriber-info" data-id="' . $id . '" data-toggle="modal" class="subscriber-info">' . $email . '</a></td>
					      <td><a href="' . get_app_info('path') . '/subscribers?i=' . get_app_info('app') . '&l=' . $list . '">' . get_list_name($list) . '</a></td>
					      <td>' . $timestamp . '</td>
					      <td id="unsubscribe-label-' . $id . '">' . $unsubscribed . '</td>
					      <td>
					    ';
        if ($row['unsubscribed'] == 0) {
            $action_icon = '
								<a href="javascript:void(0)" title="' . _('Unsubscribe') . ' ' . $email . '" data-action' . $id . '="unsubscribe" id="unsubscribe-btn-' . $id . '">
									<i class="icon icon-ban-circle"></i>
								</a>
								';
        } else {
            if ($row['unsubscribed'] == 1) {
                $action_icon = '
								<a href="javascript:void(0)" title="' . _('Resubscribe') . ' ' . $email . '" data-action' . $id . '="resubscribe" id="unsubscribe-btn-' . $id . '">
									<i class="icon icon-ok"></i>