コード例 #1
0
ファイル: main.php プロジェクト: narareddy/sendy
function get_saved_data($val)
{
    global $mysqli;
    $q = 'SELECT ' . $val . ' FROM campaigns WHERE id = "' . mysqli_real_escape_string($mysqli, $_GET['c']) . '" AND userID = ' . get_app_info('main_userID');
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        while ($row = mysqli_fetch_array($r)) {
            $value = stripslashes($row[$val]);
            //if title
            if ($val == 'title') {
                //tags for subject
                preg_match_all('/\\[([a-zA-Z0-9!#%^&*()+=$@._-|\\/?<>~`"\'\\s]+),\\s*fallback=/i', $value, $matches_var, PREG_PATTERN_ORDER);
                preg_match_all('/,\\s*fallback=([a-zA-Z0-9!,#%^&*()+=$@._-|\\/?<>~`"\'\\s]*)\\]/i', $value, $matches_val, PREG_PATTERN_ORDER);
                preg_match_all('/(\\[[a-zA-Z0-9!#%^&*()+=$@._-|\\/?<>~`"\'\\s]+,\\s*fallback=[a-zA-Z0-9!,#%^&*()+=$@._-|\\/?<>~`"\'\\s]*\\])/i', $value, $matches_all, PREG_PATTERN_ORDER);
                $matches_var = $matches_var[1];
                $matches_val = $matches_val[1];
                $matches_all = $matches_all[1];
                for ($i = 0; $i < count($matches_var); $i++) {
                    $field = $matches_var[$i];
                    $fallback = $matches_val[$i];
                    $tag = $matches_all[$i];
                    //for each match, replace tag with fallback
                    $value = str_replace($tag, $fallback, $value);
                }
                $value = str_replace('[Email]', get_saved_data('from_email'), $value);
            }
            return $value;
        }
    }
}
コード例 #2
0
ファイル: main.php プロジェクト: 5haman/Sendy
function pagination($limit)
{
    global $p;
    $curpage = $p;
    $next_page_num = 0;
    $prev_page_num = 0;
    $total_campaigns = totals($_GET['i']);
    $total_pages = @ceil($total_campaigns / $limit);
    if ($total_campaigns > $limit) {
        if ($curpage >= 2) {
            $next_page_num = $curpage + 1;
            $prev_page_num = $curpage - 1;
        } else {
            $next_page_num = 2;
        }
        echo '<div class="btn-group" id="pagination">';
        //Prev btn
        if ($curpage >= 2) {
            if ($prev_page_num == 1) {
                echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/templates?i=' . get_app_info('app') . '\'"><span class="icon icon icon-arrow-left"></span></button>';
            } else {
                echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/templates?i=' . get_app_info('app') . '&p=' . $prev_page_num . '\'"><span class="icon icon icon-arrow-left"></span></button>';
            }
        } else {
            echo '<button class="btn disabled"><span class="icon icon icon-arrow-left"></span></button>';
        }
        //Next btn
        if ($curpage == $total_pages) {
            echo '<button class="btn disabled"><span class="icon icon icon-arrow-right"></span></button>';
        } else {
            echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/templates?i=' . get_app_info('app') . '&p=' . $next_page_num . '\'"><span class="icon icon icon-arrow-right"></span></button>';
        }
        echo '</div>';
    }
}
コード例 #3
0
function listsDisabledForUser()
{
    if (listsDisabledForBrand() && function_exists('get_app_info')) {
        if (get_app_info('is_sub_user')) {
            return 1;
        } else {
            return 0;
        }
    }
}
コード例 #4
0
ファイル: main.php プロジェクト: narareddy/sendy
function get_subscribers_count($lid)
{
    global $mysqli;
    //Check if the list has a pending CSV for importing via cron
    $server_path_array = explode('list.php', $_SERVER['SCRIPT_FILENAME']);
    $server_path = $server_path_array[0];
    if (file_exists($server_path . 'uploads/csvs') && ($handle = opendir($server_path . 'uploads/csvs'))) {
        while (false !== ($file = readdir($handle))) {
            if ($file != '.' && $file != '..' && $file != '.DS_Store' && $file != '.svn') {
                $file_array = explode('-', $file);
                if (!empty($file_array)) {
                    if (str_replace('.csv', '', $file_array[1]) == $lid) {
                        return _('Checking..') . '
					    		<script type="text/javascript">
					    			$(document).ready(function() {
					    			
					    				list_interval = setInterval(function(){get_list_count(' . $lid . ')}, 2000);
						    			
						    			function get_list_count(lid)
						    			{
						    				clearInterval(list_interval);
							    			$.post("includes/list/progress.php", { list_id: lid, user_id: ' . get_app_info('main_userID') . ' },
											  function(data) {
											      if(data)
											      {
											      	if(data.indexOf("%)") != -1)
											      		list_interval = setInterval(function(){get_list_count(' . $lid . ')}, 2000);
											      		
											      	$("#progress' . $lid . '").html(data);
											      }
											      else
											      {
											      	$("#progress' . $lid . '").html("' . _('Error retrieving count') . '");
											      }
											  }
											);
										}
										
						    		});
					    		</script>';
                    }
                }
            }
        }
        closedir($handle);
    }
    //if not, just return the subscriber count
    $q = 'SELECT COUNT(*) FROM subscribers WHERE list = ' . $lid . ' AND unsubscribed = 0 AND bounced = 0 AND complaint = 0 AND confirmed = 1';
    $r = mysqli_query($mysqli, $q);
    if ($r) {
        while ($row = mysqli_fetch_array($r)) {
            return $row['COUNT(*)'];
        }
    }
}
コード例 #5
0
ファイル: main.php プロジェクト: narareddy/sendy
function get_app_data($val)
{
    global $mysqli;
    $q = 'SELECT ' . $val . ' FROM apps WHERE id = "' . get_app_info('app') . '" AND userID = ' . get_app_info('main_userID');
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        while ($row = mysqli_fetch_array($r)) {
            return $row[$val];
        }
    }
}
コード例 #6
0
ファイル: main.php プロジェクト: narareddy/sendy
function get_paypal()
{
    global $mysqli;
    $q = 'SELECT paypal FROM login WHERE id = ' . get_app_info('main_userID');
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        while ($row = mysqli_fetch_array($r)) {
            return $row['paypal'];
        }
    }
}
コード例 #7
0
ファイル: main.php プロジェクト: 5haman/Sendy
function get_saved_data($val)
{
    global $mysqli;
    $q = 'SELECT ' . $val . ' FROM apps WHERE id = "' . mysqli_real_escape_string($mysqli, $_GET['i']) . '" AND userID = ' . get_app_info('userID');
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        while ($row = mysqli_fetch_array($r)) {
            return $row[$val];
        }
    }
}
コード例 #8
0
ファイル: main.php プロジェクト: 5haman/Sendy
function get_saved_data($val)
{
    global $mysqli;
    $q = 'SELECT ' . $val . ' FROM campaigns WHERE id = "' . mysqli_real_escape_string($mysqli, $_GET['c']) . '" AND userID = ' . get_app_info('main_userID');
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        while ($row = mysqli_fetch_array($r)) {
            $value = stripslashes($row[$val]);
            //if title
            if ($val == 'title') {
                //tags for subject
                preg_match_all('/\\[([a-zA-Z0-9!#%^&*()+=$@._\\-\\:|\\/?<>~`"\'\\s]+),\\s*fallback=/i', $value, $matches_var, PREG_PATTERN_ORDER);
                preg_match_all('/,\\s*fallback=([a-zA-Z0-9!,#%^&*()+=$@._\\-\\:|\\/?<>~`"\'\\s]*)\\]/i', $value, $matches_val, PREG_PATTERN_ORDER);
                preg_match_all('/(\\[[a-zA-Z0-9!#%^&*()+=$@._\\-\\:|\\/?<>~`"\'\\s]+,\\s*fallback=[a-zA-Z0-9!,#%^&*()+=$@._\\-\\:|\\/?<>~`"\'\\s]*\\])/i', $value, $matches_all, PREG_PATTERN_ORDER);
                $matches_var = $matches_var[1];
                $matches_val = $matches_val[1];
                $matches_all = $matches_all[1];
                for ($i = 0; $i < count($matches_var); $i++) {
                    $field = $matches_var[$i];
                    $fallback = $matches_val[$i];
                    $tag = $matches_all[$i];
                    //for each match, replace tag with fallback
                    $value = str_replace($tag, $fallback, $value);
                }
                $value = str_replace('[Email]', get_saved_data('from_email'), $value);
                //convert date
                date_default_timezone_set(get_app_info('timezone'));
                $sent = get_saved_data('sent');
                $today = $sent;
                $currentdaynumber = strftime('%d', $today);
                $currentday = strftime('%A', $today);
                $currentmonthnumber = strftime('%m', $today);
                $currentmonth = strftime('%B', $today);
                $currentyear = strftime('%Y', $today);
                $unconverted_date = array('[currentdaynumber]', '[currentday]', '[currentmonthnumber]', '[currentmonth]', '[currentyear]');
                $converted_date = array($currentdaynumber, $currentday, $currentmonthnumber, $currentmonth, $currentyear);
                $value = str_replace($unconverted_date, $converted_date, $value);
            }
            return $value;
        }
    }
}
コード例 #9
0
ファイル: index.php プロジェクト: narareddy/sendy
								      if(data)
								      {
								      	$("#' . $id . '").fadeOut();
								      }
								      else
								      {
								      	alert("' . _('Sorry, unable to delete. Please try again later!') . '");
								      }
								  }
								);
							}
							});
						    </script>
			  			</tr>';
    }
} else {
    echo '
				  	<tr>
				  		<td><a href="' . get_app_info('path') . '/new-brand" title="">' . _('Add your first brand!') . '</a></td>
				  		<td></td>
				  		<td></td>
				  	</tr>
				  	';
}
?>
		  </tbody>
		</table>
    </div>   
</div>
<?php 
include 'includes/footer.php';
コード例 #10
0
ファイル: footer.php プロジェクト: narareddy/sendy
	        	<?php 
    if (get_app_info('version_latest') > get_app_info('version')) {
        ?>
		        <a href="http://sendy.co/get-updated?l=<?php 
        echo get_app_info('license');
        ?>
" target="_blank" style="text-decoration:none;"><span class="label label-info">new version: <?php 
        echo get_app_info('version_latest');
        ?>
 available</span></a>
		        <?php 
    }
    ?>
	        </p>
	        <?php 
} else {
    ?>
	        <p>&copy; <?php 
    echo date("Y", time());
    ?>
 <?php 
    echo get_app_info('company');
    ?>
</p>
	        <?php 
}
?>
	      </footer>
	    </div>
	</body>
</html>
コード例 #11
0
ファイル: line-unsubscribe.php プロジェクト: narareddy/sendy
<?php

include '../functions.php';
include '../login/auth.php';
/********************************/
$userID = get_app_info('main_userID');
$app = $_POST['app'];
$listID = mysqli_real_escape_string($mysqli, $_POST['list_id']);
$line = $_POST['line'];
/********************************/
//if user did not enter anything
if ($line == '') {
    //show error msg
    header("Location: " . get_app_info('path') . '/unsubscribe-from-list?i=' . $app . '&l=' . $listID . '&e=2');
    exit;
}
$line_array = explode("\r\n", $line);
for ($i = 0; $i < count($line_array); $i++) {
    $q = 'UPDATE subscribers SET unsubscribed = 1 WHERE email = "' . $line_array[$i] . '" AND list = ' . $listID . ' AND userID = ' . $userID;
    $r = mysqli_query($mysqli, $q);
    if ($r) {
    }
}
header("Location: " . get_app_info('path') . '/subscribers?i=' . $app . '&l=' . $listID);
コード例 #12
0
ファイル: logout.php プロジェクト: 5haman/Sendy
<?php

include_once 'includes/functions.php';
if (unlog_session()) {
    header('Location: ' . get_app_info('path') . '/login');
}
コード例 #13
0
ファイル: new-brand.php プロジェクト: narareddy/sendy
?>
/settings"><?php 
echo _('Settings');
?>
</a>.</div><br/>
	    
	    <div class="well">
	    	<h3><?php 
echo _('Client login details');
?>
</h3><br/>
	    	<p><strong><?php 
echo _('Login URL');
?>
</strong>: <?php 
echo get_app_info('path');
?>
</p>
		    <p><strong><?php 
echo _('Login email');
?>
</strong>: <span id="login-email"><?php 
echo _('Not set yet');
?>
 (<?php 
echo _('uses');
?>
 <em><?php 
echo _('From email');
?>
</em>)</span></p>
コード例 #14
0
ファイル: report.php プロジェクト: narareddy/sendy
</a>
    </div>
  </div>
<script type="text/javascript">
	$(".subscriber-info").click(function(){
		s_id = $(this).data("id");
		$("#subscriber-text").html("<?php 
echo _('Fetching');
?>
..");
		
		$.post("<?php 
echo get_app_info('path');
?>
/includes/subscribers/subscriber-info.php", { id: s_id, app:<?php 
echo get_app_info('app');
?>
 },
		  function(data) {
		      if(data)
		      {
		      	$("#subscriber-text").html(data);
		      }
		      else
		      {
		      	$("#subscriber-text").html("<?php 
echo _('Oops, there was an error getting the subscriber\'s info. Please try again later.');
?>
");
		      }
		  }
コード例 #15
0
?>
"></i> All templates</a></li>
        <li <?php 
if (currentPage() == 'templates.php' && $_GET['do'] == "create") {
    echo 'class="active"';
}
?>
><a href="<?php 
echo get_app_info('path') . '/templates.php?i=' . $_GET['i'] . '&do=create';
?>
"><i class="icon-edit  <?php 
if (currentPage() == 'templates.php' && $_GET['do'] == "create") {
    echo 'icon-white';
}
?>
"></i> Create template</a></li>
        <li <?php 
if (currentPage() == 'templates.php' && $_GET['do'] == "campaign") {
    echo 'class="active"';
}
?>
><a href="<?php 
echo get_app_info('path') . '/templates.php?i=' . $_GET['i'] . '&do=campaign';
?>
"><i class="icon-edit  <?php 
if (currentPage() == 'templates.php' && $_GET['do'] == "campaign") {
    echo 'icon-white';
}
?>
"></i> New template campaign</a></li>
</ul>
コード例 #16
0
ファイル: delete.php プロジェクト: 5haman/Sendy
<?php

include '../functions.php';
include '../login/auth.php';
$subscriber_id = mysqli_real_escape_string($mysqli, $_POST['subscriber_id']);
$q = 'DELETE FROM subscribers WHERE id = ' . $subscriber_id . ' AND userID = ' . get_app_info('main_userID');
$r = mysqli_query($mysqli, $q);
if ($r) {
    echo true;
}
コード例 #17
0
ファイル: save-campaign.php プロジェクト: 5haman/Sendy
    }
} else {
    //Check if 'From email's bounces/complaints 'Notifications' are set previously
    $q = 'SELECT bounce_setup, complaint_setup FROM campaigns WHERE from_email = "' . $from_email . '" AND bounce_setup=1 AND complaint_setup=1';
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        $bounce_setup = 1;
        $complaint_setup = 1;
    }
    //Insert into campaigns
    $q = 'INSERT INTO campaigns (userID, app, from_name, from_email, reply_to, title, label, plain_text, html_text, query_string, wysiwyg, bounce_setup, complaint_setup) VALUES (' . get_app_info('main_userID') . ', ' . get_app_info('app') . ', "' . $from_name . '", "' . $from_email . '", "' . $reply_to . '", "' . $subject . '", "' . $campaign_title . '", "' . $plain . '", "' . addslashes($html) . '", "' . $query_string . '", ' . $wysiwyg . ', ' . $bounce_setup . ', ' . $complaint_setup . ')';
    $r = mysqli_query($mysqli, $q);
    if ($r) {
        //get the campaign id from the new insert
        $campaign_id = mysqli_insert_id($mysqli);
        //Upload attachment(s)
        if ($file[0] != '') {
            if (!file_exists("../../uploads/attachments/{$campaign_id}")) {
                mkdir("../../uploads/attachments/{$campaign_id}", 0777);
            }
            for ($i = 0; $i < count($file); $i++) {
                move_uploaded_file($file[$i], "../../uploads/attachments/{$campaign_id}/" . $filename[$i]);
            }
        }
        if ($w_clicked) {
            header('Location: ' . get_app_info('path') . '/edit?i=' . get_app_info('app') . '&c=' . $campaign_id);
        } else {
            header('Location: ' . get_app_info('path') . '/send-to?i=' . get_app_info('app') . '&c=' . $campaign_id);
        }
    }
}
コード例 #18
0
ファイル: sidebar.php プロジェクト: 5haman/Sendy
}
?>
"></i> <?php 
echo _('View all lists');
?>
</a></li>
    </ul>
    <ul class="nav nav-list">
        <li class="nav-header"><?php 
echo _('Reports');
?>
</li>
        <li <?php 
if (currentPage() == 'report.php' || currentPage() == 'reports.php') {
    echo 'class="active"';
}
?>
><a href="<?php 
echo get_app_info('path') . '/reports?i=' . $app;
?>
"><i class="icon-zoom-in  <?php 
if (currentPage() == 'report.php' || currentPage() == 'reports.php') {
    echo 'icon-white';
}
?>
"></i> <?php 
echo _('See reports');
?>
</a></li>
    </ul>
</div>
コード例 #19
0
ファイル: duplicate.php プロジェクト: narareddy/sendy
//------------------------------------------------------//
//                      FUNCTIONS                       //
//------------------------------------------------------//
//get brand's data
$q = 'SELECT from_name, from_email, reply_to FROM apps WHERE id = ' . $app_id;
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
    while ($row = mysqli_fetch_array($r)) {
        $from_name = $row['from_name'];
        $from_email = $row['from_email'];
        $reply_to = $row['reply_to'];
    }
}
//get campaign's data
$q2 = 'SELECT title, plain_text, html_text FROM campaigns WHERE id = ' . $campaign_id;
$r2 = mysqli_query($mysqli, $q2);
if ($r2) {
    while ($row = mysqli_fetch_array($r2)) {
        $title = stripslashes($row['title']);
        $plain_text = stripslashes($row['plain_text']);
        $html_text = stripslashes($row['html_text']);
    }
}
//Insert into database
$q3 = 'INSERT INTO campaigns (userID, app, from_name, from_email, reply_to, title, plain_text, html_text) VALUES (' . get_app_info('main_userID') . ', ' . $app_id . ', "' . $from_name . '", "' . $from_email . '", "' . $reply_to . '", "' . addslashes($title) . '", "' . addslashes($plain_text) . '", "' . addslashes($html_text) . '")';
$r3 = mysqli_query($mysqli, $q3);
if ($r3) {
    header("Location: " . get_app_info('path') . "/app?i=" . $app_id);
} else {
    echo 'Error duplicating.';
}
コード例 #20
0
ファイル: delete.php プロジェクト: 5haman/Sendy
$list_id = mysqli_real_escape_string($mysqli, $_POST['list_id']);
//delete autoresopnder emails
$q = 'SELECT id FROM ares WHERE list = ' . $list_id;
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
    while ($row = mysqli_fetch_array($r)) {
        $ares_id = $row['id'];
        $q2 = 'DELETE FROM ares_emails WHERE ares_id = ' . $ares_id;
        mysqli_query($mysqli, $q2);
    }
}
//delete autoresponder
$q = 'DELETE FROM ares WHERE list = ' . $list_id;
mysqli_query($mysqli, $q);
//delete list and its subscribers
$q = 'DELETE FROM lists WHERE id = ' . $list_id . ' AND userID = ' . get_app_info('main_userID');
$r = mysqli_query($mysqli, $q);
if ($r) {
    $q2 = 'DELETE FROM subscribers WHERE list = ' . $list_id;
    $r2 = mysqli_query($mysqli, $q2);
    if ($r2) {
        //delete CSV file (in case it was uploaded and waiting for import by cron)
        $server_path_array = explode('delete.php', $_SERVER['SCRIPT_FILENAME']);
        $server_path = str_replace('includes/list/', '', $server_path_array[0]) . 'uploads/csvs/';
        $filename = $server_path . get_app_info('main_userID') . '-' . $list_id . '.csv';
        if (file_exists($filename)) {
            unlink($filename);
        }
        echo true;
    }
}
コード例 #21
0
ファイル: test-send.php プロジェクト: narareddy/sendy
 if (get_app_info('s3_key') != '' && get_app_info('s3_secret') != '') {
     $mail->IsAmazonSES();
     $mail->AddAmazonSESKey(get_app_info('s3_key'), get_app_info('s3_secret'));
 } else {
     if ($smtp_host != '' && $smtp_port != '' && $smtp_username != '' && $smtp_password != '') {
         $mail->IsSMTP();
         $mail->SMTPDebug = 0;
         $mail->SMTPAuth = true;
         $mail->SMTPSecure = $smtp_ssl;
         $mail->Host = $smtp_host;
         $mail->Port = $smtp_port;
         $mail->Username = $smtp_username;
         $mail->Password = $smtp_password;
     }
 }
 $mail->Timezone = get_app_info('timezone');
 $mail->CharSet = "UTF-8";
 $mail->From = $from_email;
 $mail->FromName = $from_name;
 $mail->Subject = $title2;
 $mail->AltBody = $plain_text2;
 $mail->MsgHTML($html_text2);
 $mail->AddAddress($test_email_array[$i], '');
 $mail->AddReplyTo($reply_to, $from_name);
 if (file_exists('../../uploads/attachments/' . $campaign_id)) {
     foreach (glob('../../uploads/attachments/' . $campaign_id . '/*') as $attachment) {
         if (file_exists($attachment)) {
             $mail->AddAttachment($attachment);
         }
     }
 }
コード例 #22
0
ファイル: export-csv.php プロジェクト: 5haman/Sendy
<?php

include '../functions.php';
include '../login/auth.php';
/********************************/
$table = 'subscribers';
// table to export
$userID = get_app_info('main_userID');
$ares_id = mysqli_real_escape_string($mysqli, $_GET['c']);
$action = $_GET['a'];
$additional_query = '';
/********************************/
if ($action == 'clicks') {
    //file name
    $filename = 'clicked.csv';
    $additional_query = 'AND unsubscribed = 0 AND bounced = 0 AND complaint = 0';
    //get
    $clicks_join = '';
    $clicks_array = array();
    $clicks_unique = 0;
    $q = 'SELECT * FROM links WHERE ares_emails_id = ' . $ares_id;
    $r = mysqli_query($mysqli, $q);
    if ($r && mysqli_num_rows($r) > 0) {
        while ($row = mysqli_fetch_array($r)) {
            $id = stripslashes($row['id']);
            $clicks = stripslashes($row['clicks']);
            if ($clicks != '') {
                $clicks_join .= $clicks . ',';
            }
        }
    }
コード例 #23
0
ファイル: settings.php プロジェクト: narareddy/sendy
">
	        <input type="hidden" name="redirect" id="redirect" value="<?php 
echo get_app_info('path') . '/settings';
?>
">
	        
	        <button type="submit" class="btn btn-inverse"><i class="icon-ok icon-white"></i> <?php 
echo _('Save');
?>
</button>
	    </form>
    </div>   
    
    <!-- Check if sub user -->
	<?php 
if (!get_app_info('is_sub_user')) {
    ?>
	 
    <div class="span5">
	    <h2><?php 
    echo _('Your license key');
    ?>
</h2><br/>
	    <div>
		    <p><?php 
    echo _('You\'ll need this license key to');
    ?>
 <a href="http://sendy.co/get-updated" target="_blank" style="text-decoration:underline"><?php 
    echo _('download the latest version of Sendy on our website');
    ?>
</a>.</p>
コード例 #24
0
ファイル: connect.php プロジェクト: beijizhou/xinjiang001
 function callback()
 {
     global $cfg_webpath;
     $app = isset($_GET['app']) ? $_GET['app'] : '';
     if (in_array($app, array('renren', 'weibo', 'qq'))) {
         $_SESSION['app'][$app] = get_app_info($app);
     }
     go($cfg_webpath . '/member.php?a=login&method=callback&app=' . $app);
 }
コード例 #25
0
ファイル: delete.php プロジェクト: 5haman/Sendy
<?php

include '../functions.php';
include '../login/auth.php';
$campaign_id = mysqli_real_escape_string($mysqli, $_POST['campaign_id']);
$q = 'DELETE FROM campaigns WHERE id = ' . $campaign_id . ' AND userID = ' . get_app_info('main_userID');
$r = mysqli_query($mysqli, $q);
if ($r) {
    $q2 = 'DELETE FROM links WHERE campaign_id = ' . $campaign_id;
    $r2 = mysqli_query($mysqli, $q2);
    if ($r2) {
        if (file_exists('../../uploads/attachments/' . $campaign_id)) {
            $files = glob('../../uploads/attachments/' . $campaign_id . '/*');
            // get all file names
            foreach ($files as $file) {
                unlink($file);
            }
            rmdir('../../uploads/attachments/' . $campaign_id);
        }
        echo true;
    }
}
コード例 #26
0
ファイル: list.php プロジェクト: ariestiyansyah/nggadu
								$("#list' . $id . '-encrypted").show();
								$(this).hide();
							});
							$("#list' . $id . '-encrypted").mouseout(function(){
								$(this).hide();
								$("#list' . $id . '").show();
							});
							</script>
					    </tr>
						
			  			';
    }
} else {
    echo '
				  		<tr>
				  			<td>' . _('No list yet.') . ' <a href="' . get_app_info('path') . '/new-list?i=' . get_app_info('app') . '" title="">' . _('Add one') . '</a>!</td>
				  			<td></td>
				  			<td></td>
				  			<td></td>
				  			<td></td>
				  			<td></td>
				  			<td></td>
				  		</tr>
				  	';
}
?>
		    
		  </tbody>
		</table>		
    </div>   
</div>
コード例 #27
0
ファイル: edit.php プロジェクト: 5haman/Sendy
        }
        //Upload logo
        $file = $_FILES['logo']['tmp_name'];
        $file_name = $_FILES['logo']['name'];
        if ($file_name != '') {
            $extension_explode = explode('.', $file_name);
            $extension = $extension_explode[count($extension_explode) - 1];
            $time = time();
            chmod("../../uploads", 0777);
            //Check filetype
            $allowed = array("jpeg", "jpg", "gif", "png");
            if (in_array($extension, $allowed)) {
                //Upload file
                if (!move_uploaded_file($file, '../../uploads/logos/' . $id . '.' . $extension)) {
                    //Could not upload brand logo image to '/logos/' folder.
                    //Please make sure permissions in /uploads/ folder is set to 777.
                    //Then remove the /logos/ folder in the /uploads/ folder and try again.
                    header("Location: " . get_app_info('path') . '/edit-brand?i=' . $id . '&e=3');
                } else {
                    //Update brand_logo_filename in database
                    mysqli_query($mysqli, 'UPDATE apps SET brand_logo_filename = "' . $id . '.' . $extension . '" WHERE id = ' . $id);
                }
            } else {
                //Please upload only these image formats: jpeg, jpg, gif and png.
                header("Location: " . get_app_info('path') . '/edit-brand?i=' . $id . '&e=2');
                exit;
            }
        }
        header("Location: " . get_app_info('path'));
    }
}
コード例 #28
0
ファイル: edit.php プロジェクト: narareddy/sendy
$subscribed_url = mysqli_real_escape_string($mysqli, $_POST['subscribed_url']);
$confirm_url = mysqli_real_escape_string($mysqli, $_POST['confirm_url']);
$thankyou = isset($_POST['thankyou_email']) ? mysqli_real_escape_string($mysqli, $_POST['thankyou_email']) : '';
$thankyou_subject = addslashes(mysqli_real_escape_string($mysqli, $_POST['thankyou_subject']));
$thankyou_message = addslashes($_POST['thankyou_message']);
if ($thankyou != '') {
    $thankyou = 1;
} else {
    $thankyou = 0;
}
//unsubscribe settings
$unsubscribe_all_list = mysqli_real_escape_string($mysqli, $_POST['unsubscribe_all_list']);
$unsubscribed_url = mysqli_real_escape_string($mysqli, $_POST['unsubscribed_url']);
$goodbye = isset($_POST['goodbye_email']) ? mysqli_real_escape_string($mysqli, $_POST['goodbye_email']) : '';
$goodbye_subject = addslashes(mysqli_real_escape_string($mysqli, $_POST['goodbye_subject']));
$goodbye_message = addslashes($_POST['goodbye_message']);
$confirmation_subject = addslashes(mysqli_real_escape_string($mysqli, $_POST['confirmation_subject']));
$confirmation_email = addslashes($_POST['confirmation_email']);
if ($goodbye != '') {
    $goodbye = 1;
} else {
    $goodbye = 0;
}
//------------------------------------------------------//
//                      FUNCTIONS                       //
//------------------------------------------------------//
$q = 'UPDATE lists SET name = "' . $list_name . '", opt_in = ' . $opt_in . ', subscribed_url = "' . $subscribed_url . '", confirm_url = "' . $confirm_url . '", thankyou = ' . $thankyou . ', thankyou_subject = "' . $thankyou_subject . '", thankyou_message = "' . $thankyou_message . '", unsubscribe_all_list = ' . $unsubscribe_all_list . ', unsubscribed_url = "' . $unsubscribed_url . '", goodbye = ' . $goodbye . ', goodbye_subject = "' . $goodbye_subject . '", goodbye_message = "' . $goodbye_message . '", confirmation_subject = "' . $confirmation_subject . '", confirmation_email = "' . $confirmation_email . '" WHERE id = ' . $list_id;
$r = mysqli_query($mysqli, $q);
if ($r) {
    header("Location: " . get_app_info('path') . "/list?i=" . $app);
}
コード例 #29
0
ファイル: autoresponders-list.php プロジェクト: 5haman/Sendy
			                			<td><a href="' . get_app_info('path') . '/autoresponders-emails?i=' . get_app_info('app') . '&a=' . $ares_id . '">' . $ares_name . '</a></td>
			                			<td>' . $ares_type_name . '</td>
			                			<td>' . $recipients . '</td>
			                			<td><a href="javascript:void(0)" title="" id="delete-' . $ares_id . '" data-id="' . $ares_id . '"><i class="icon-trash"></i></a></td>
			                			<script type="text/javascript">
						            	$("#delete-' . $ares_id . '").click(function(e){
						            		e.preventDefault(); 
											c = confirm("' . _('All associated autoresponder emails will be permanently deleted.') . ' ' . _('Confirm delete') . ' \'' . $ares_name . '\'?");
											if(c)
											{
								            	$.post("' . get_app_info('path') . '/includes/ares/delete-ares.php", { id: $(this).data("id") },
							            		  function(data) {
							            		      if(data)
							            		      {
							            		      	$("#ares-' . $ares_id . '").fadeOut(function(){
							            		      		window.location = "' . get_app_info('path') . '/autoresponders-list?i=' . get_app_info('app') . '&l=' . $lid . '";
							            		      	});
							            		      }
							            		      else
							            		      {
							            		      	alert("' . _('Sorry, unable to delete. Please try again later!') . '");
							            		      }
							            		  }
							            		);
							            	}
						            	});
							            </script>
		                			</tr>
		                			';
    }
} else {
コード例 #30
0
ファイル: app.php プロジェクト: narareddy/sendy
echo _('Choose a brand you\'d like to duplicate this campaign on');
?>
:</label><br/>
		            <div class="controls">
		              <select id="on-brand" name="on-brand">
		              	<?php 
echo '<option value="' . get_app_info('app') . '" id="brand-' . get_app_info('app') . '">' . get_app_data('app_name') . '</option>';
$q = 'SELECT id, app_name FROM apps WHERE userID = ' . get_app_info('main_userID');
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
    while ($row = mysqli_fetch_array($r)) {
        $app_id = $row['id'];
        $app_name = $row['app_name'];
        //sub users can only duplicate a campaign in their own brand
        if (get_app_info('is_sub_user') != true) {
            if ($app_id != get_app_info('app')) {
                echo '<option value="' . $app_id . '" id="brand-' . $app_id . '">' . $app_name . '</option>';
            }
        }
    }
}
?>
		              </select>
		              <input type="hidden" name="campaign_id" id="campaign_id" value=""></input>
		            </div>
		          </div>
		          </form>
		    </div>
		    <div class="modal-footer">
		      <a href="#" class="btn btn" data-dismiss="modal"><?php 
echo _('Cancel');