|
|
|
@ -17,13 +17,13 @@ define('NOTIFY_INFO1KA', 5); # Nad koliko emaili obveščamo info@1ka.si
|
|
|
|
|
set_time_limit(2400); # 30 minut
|
|
|
|
|
|
|
|
|
|
class SurveyInvitationsNew {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private $sid;
|
|
|
|
|
private $count_all = 0; # koliko prejemnikov je v bazi
|
|
|
|
|
private $surveySettings; # zakeširamo nastavitve ankete
|
|
|
|
|
private $rec_send_page_limit = 20; # Koliko zapisov imamo za paginacijo
|
|
|
|
|
|
|
|
|
|
private $newTracking = false; # Ali imamo podroben tracking za anketo
|
|
|
|
|
|
|
|
|
|
private $inv_variables = array('email','password','ime','priimek','naziv','telefon','drugo','odnos');
|
|
|
|
|
private $inv_variables_link = array('email'=>'email','geslo'=>'password','ime'=>'firstname','priimek'=>'lastname','naziv'=>'salutation','telefon'=>'phone','drugo'=>'custom','odnos'=>'relation','last_status'=>'last_status','sent'=>'sent','responded'=>'responded','unsubscribed'=>'unsubscribed');
|
|
|
|
|
private $inv_variables_excel = array('email'=>'email','geslo'=>'password','ime'=>'firstname','priimek'=>'lastname','naziv'=>'salutation','telefon'=>'phone','drugo'=>'custom','odnos'=>'relation','last_status'=>'last_status','sent'=>'sent','responded'=>'responded','unsubscribed'=>'unsubscribed'
|
|
|
|
@ -38,6 +38,7 @@ class SurveyInvitationsNew {
|
|
|
|
|
|
|
|
|
|
private $db_table = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function __construct($sid) {
|
|
|
|
|
|
|
|
|
|
$this->sid = $sid;
|
|
|
|
@ -53,16 +54,12 @@ class SurveyInvitationsNew {
|
|
|
|
|
$sql_row_all = mysqli_fetch_row($sql_query_all);
|
|
|
|
|
$this->count_all = (int)$sql_row_all[0];
|
|
|
|
|
|
|
|
|
|
# preverimo ali prikazujemo nov ali star način odvisno od nastavitve v misc
|
|
|
|
|
$sql_query = sisplet_query("SELECT count(*) FROM srv_anketa AS a WHERE id ='".$this->sid."' AND insert_time > (SELECT value FROM misc WHERE what = 'invitationTrackingStarted' LIMIT 1)");
|
|
|
|
|
list($newTracking) = mysqli_fetch_row($sql_query);
|
|
|
|
|
$this->newTracking = (int)$newTracking > 0 ? true : false;
|
|
|
|
|
|
|
|
|
|
SurveyDataSettingProfiles :: Init($this->sid);
|
|
|
|
|
|
|
|
|
|
if (isset($_SESSION['rec_on_send_page']) && (int)$_SESSION['rec_on_send_page'] > 0) {
|
|
|
|
|
$this->rec_send_page_limit = (int)$_SESSION['rec_on_send_page'];
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$this->rec_send_page_limit = REC_ON_SEND_PAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4663,102 +4660,10 @@ class SurveyInvitationsNew {
|
|
|
|
|
$_arch_id = $data[3];
|
|
|
|
|
$archType = $_POST['archType'];
|
|
|
|
|
|
|
|
|
|
# za novejše ankete prikažemo nov način
|
|
|
|
|
if ($this->newTracking) {
|
|
|
|
|
$this->showArchiveRecipients($_arch_id, $archType);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
global $lang,$site_url,$global_user_id;
|
|
|
|
|
echo '<div id="inv_view_arch_recipients">';
|
|
|
|
|
# polovimo sezname
|
|
|
|
|
$lists = array();
|
|
|
|
|
$sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
|
|
|
|
|
$sql_query = sisplet_query($sql_string);
|
|
|
|
|
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
|
|
|
|
|
$lists[$sql_row['pid']] = $sql_row['name'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lists['-1'] = $lang['srv_invitation_new_templist'];
|
|
|
|
|
$lists['0'] = $lang['srv_invitation_new_templist_author'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = explode('_',$_POST['arch_to_view']);
|
|
|
|
|
$_success = (int)$data[2];
|
|
|
|
|
$_arch_id = $data[3];
|
|
|
|
|
$sql_string = "SELECT * FROM srv_invitations_archive WHERE id = '$_arch_id'";
|
|
|
|
|
$sql_query = sisplet_query($sql_string);
|
|
|
|
|
$sql_a_row = mysqli_fetch_assoc($sql_query);
|
|
|
|
|
|
|
|
|
|
$sql_string = "SELECT email,firstname,lastname, password,salutation,phone,custom,relation,sent,responded,unsubscribed,deleted,last_status,list_id FROM srv_invitations_archive_recipients AS siar LEFT JOIN srv_invitations_recipients AS sir on siar.rec_id = sir.id WHERE arch_id = '$_arch_id' AND success = '$_success'";
|
|
|
|
|
$sql_query = sisplet_query($sql_string);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="inv_FS_content">';
|
|
|
|
|
|
|
|
|
|
echo '<table id="tbl_recipients_list">';
|
|
|
|
|
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
|
|
|
|
|
// Pri volitvah ne prikazemo nekaterih stolpcev
|
|
|
|
|
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
|
|
|
|
|
echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
|
|
|
|
|
echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
|
|
|
|
|
echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_responded'].'">'.$lang['srv_inv_recipients_responded'].'</th>';
|
|
|
|
|
echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_unsubscribed'].'">'.$lang['srv_inv_recipients_unsubscribed'].'</th>';
|
|
|
|
|
echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_password'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
|
|
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
|
|
|
|
|
// Pri volitvah ne prikazemo nekaterih stolpcev
|
|
|
|
|
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
|
|
|
|
|
echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></td>';
|
|
|
|
|
echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
|
|
|
|
|
echo '<td>'.$sql_row['firstname'].'</td>';
|
|
|
|
|
echo '<td>'.$sql_row['lastname'].'</td>';
|
|
|
|
|
echo '<td>'.$lists[$sql_row['list_id']].'</td>';
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></td>';
|
|
|
|
|
echo '<td><img src="'.$site_url.'admin/survey/icons/icons/'.((int)$sql_row['responded'] == 1 ? 'star_on.png' : 'star_off.png').'"></td>';
|
|
|
|
|
echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['unsubscribed'] == 1 ? 'opdedout_on.png' : 'opdedout_off.png').'"></td>';
|
|
|
|
|
echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
|
|
|
|
|
echo '<td>'.$sql_row['password'].'</td>';
|
|
|
|
|
echo '<td>'.$sql_row['firstname'].'</td>';
|
|
|
|
|
echo '<td>'.$sql_row['lastname'].'</td>';
|
|
|
|
|
echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
|
|
|
|
|
echo '<td>'.$lists[$sql_row['list_id']].'</td>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo '</table>';
|
|
|
|
|
|
|
|
|
|
echo '</div>'; // id="arc_content"
|
|
|
|
|
echo '<div class="inv_FS_btm">';
|
|
|
|
|
echo '<div id="navigationBottom" class="printHide">';
|
|
|
|
|
echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
|
|
|
|
|
echo '<div class="clr" />';
|
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function editArchiveComment() {
|
|
|
|
|
global $lang,$site_url;
|
|
|
|
@ -7082,8 +6987,7 @@ class SurveyInvitationsNew {
|
|
|
|
|
echo '</td>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Nov način z trackingom
|
|
|
|
|
elseif($this->newTracking == true) {
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
|
|
$userAccess = UserAccess::getInstance($global_user_id);
|
|
|
|
|
|
|
|
|
@ -7094,334 +6998,10 @@ class SurveyInvitationsNew {
|
|
|
|
|
echo '</td>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# star način brez trackinga
|
|
|
|
|
else {
|
|
|
|
|
echo '<td style="padding-right:10px;vertical-align: top;">';
|
|
|
|
|
$this->displayInvitationStatusOld();
|
|
|
|
|
echo '</td>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo '</tr></table>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function displayInvitationStatusOld() {
|
|
|
|
|
global $lang, $admin_type, $global_user_id, $site_url, $site_path;
|
|
|
|
|
|
|
|
|
|
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
|
|
|
|
|
|
|
|
|
# polovimo lurkerje
|
|
|
|
|
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
|
|
|
|
|
echo '<div class="inv_filedset_inline_div">';
|
|
|
|
|
echo '<p>';
|
|
|
|
|
if ((int)$isEmail > 0) {
|
|
|
|
|
|
|
|
|
|
# preštejemo respondente po statusu
|
|
|
|
|
$recipients_by_status = array();
|
|
|
|
|
$sql_string = "SELECT count(*) as cnt, last_status FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' GROUP BY last_status";
|
|
|
|
|
$sql_query = sisplet_query($sql_string);
|
|
|
|
|
if (mysqli_num_rows($sql_query) > 0) {
|
|
|
|
|
while($row = mysqli_fetch_assoc($sql_query)) {
|
|
|
|
|
$recipients_by_status['all'] += (int)$row['cnt'];
|
|
|
|
|
switch ((int)$row['last_status']) {
|
|
|
|
|
# 0 - E-pošta - ni poslana
|
|
|
|
|
case 0:
|
|
|
|
|
$recipients_by_status['not_send'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 1 - E-pošta - neodgovor
|
|
|
|
|
case 1:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 2 - E-pošta - napaka
|
|
|
|
|
case 2:
|
|
|
|
|
$recipients_by_status['not_send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['error'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 3 - klik na nagovor
|
|
|
|
|
case 3:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 4 - klik na anketo
|
|
|
|
|
case 4:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 5 - delno prazna
|
|
|
|
|
case 5:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 6 - končana
|
|
|
|
|
case 6:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
#$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['finished'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# null - neznan
|
|
|
|
|
default:
|
|
|
|
|
$recipients_by_status['unknown'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$all_rec_in_survey = (int)$recipients_by_status['all'];
|
|
|
|
|
|
|
|
|
|
echo '<table class="inv_dashboard_table">';
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
|
|
|
|
|
echo '<th>'.(int)$recipients_by_status['all'].'</th>';
|
|
|
|
|
echo '<th>-</th>';
|
|
|
|
|
echo '<th>100%</th>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
#popslano enotam
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
|
|
|
|
|
echo '<th>'.(int)$recipients_by_status['send'].'</th>';
|
|
|
|
|
echo '<th>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
|
|
|
|
|
echo '<th>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
|
|
#neodgovori
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
|
|
|
|
|
$unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
|
|
|
|
|
echo '<td>'.$unanswered.'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
|
|
#če se slučajno pojavijo kaki neznani statusi
|
|
|
|
|
if ((int)$recipients_by_status['unknown'] > 0) {
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
}
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
|
|
|
|
|
echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
echo '</table>';
|
|
|
|
|
echo '<br>';
|
|
|
|
|
# zloopamo še po posameznih pošiljanjih
|
|
|
|
|
$sql_string_arc = "SELECT sia.*, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' AND cnt_succsess > 0 ORDER BY sia.date_send ASC;";
|
|
|
|
|
$sql_query_arc = sisplet_query($sql_string_arc);
|
|
|
|
|
|
|
|
|
|
if (mysqli_num_rows($sql_query_arc) > 1) {
|
|
|
|
|
$cnt=0;
|
|
|
|
|
while($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
|
|
|
|
|
$cnt++;
|
|
|
|
|
# preštejemo respondente po statusu
|
|
|
|
|
$recipients_by_status = array();
|
|
|
|
|
$sql_string = "SELECT count(*) as cnt, last_status FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' AND id IN (select rec_id from srv_invitations_archive_recipients where arch_id = ".$row_arc['id']." AND success !='0') GROUP BY last_status";
|
|
|
|
|
$sql_query = sisplet_query($sql_string);
|
|
|
|
|
if (mysqli_num_rows($sql_query) > 0) {
|
|
|
|
|
while($row = mysqli_fetch_assoc($sql_query)) {
|
|
|
|
|
$recipients_by_status['all'] += (int)$row['cnt'];
|
|
|
|
|
switch ((int)$row['last_status']) {
|
|
|
|
|
# 0 - E-pošta - ni poslana
|
|
|
|
|
case 0:
|
|
|
|
|
$recipients_by_status['not_send'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 1 - E-pošta - neodgovor
|
|
|
|
|
case 1:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 2 - E-pošta - napaka
|
|
|
|
|
case 2:
|
|
|
|
|
$recipients_by_status['not_send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['error'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 3 - klik na nagovor
|
|
|
|
|
case 3:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 4 - klik na anketo
|
|
|
|
|
case 4:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 5 - delno prazna
|
|
|
|
|
case 5:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# 6 - končana
|
|
|
|
|
case 6:
|
|
|
|
|
$recipients_by_status['send'] += (int)$row['cnt'];
|
|
|
|
|
#$recipients_by_status['clicked'] += (int)$row['cnt'];
|
|
|
|
|
$recipients_by_status['finished'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
# null - neznan
|
|
|
|
|
default:
|
|
|
|
|
$recipients_by_status['unknown'] += (int)$row['cnt'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$avtor_email = iconv("iso-8859-2", "utf-8",trim ($row_arc['email']));
|
|
|
|
|
$avtor = array();
|
|
|
|
|
if (trim($row_arc['name'])) {
|
|
|
|
|
$avtor[] = trim ($row_arc['name']);
|
|
|
|
|
}
|
|
|
|
|
if (trim($row_arc['surname'])) {
|
|
|
|
|
$avtor[] = trim ($row_arc['surname']);
|
|
|
|
|
}
|
|
|
|
|
if ( count($avtor) > 0 ) {
|
|
|
|
|
$avtor_name = implode(' ',$avtor);
|
|
|
|
|
} else {
|
|
|
|
|
$avtor_name = $avtor_email;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo '<span class="pointer span_list_archive" onClick="$(this).next().next().next().toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle(); $(this).next(\'.link_archive\').toggle();">';
|
|
|
|
|
echo '<span class="inv_dashboard_sub_title as_link">';
|
|
|
|
|
echo '<span class="plus" style="color: inherit;">+ </span>';
|
|
|
|
|
echo '<span class="minus displayNone" style="color: inherit;">- </span>';
|
|
|
|
|
echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
|
|
|
|
|
echo '</span>';
|
|
|
|
|
echo '<span class="inv_dashboard_sub_detail" title="'.$avtor_email.'">'.$avtor_name.'</span>';
|
|
|
|
|
echo ', ';
|
|
|
|
|
echo '<span class="inv_dashboard_sub_detail" >'.$row_arc['ds'].'</span>';
|
|
|
|
|
echo '</span>';
|
|
|
|
|
echo '<span class="link_archive as_link displayNone" ><a href="#" onclick="inv_arch_show_details(\''.$row_arc['id'].'\'); return false;"> arhiv </a></span>';
|
|
|
|
|
echo '<br/>';
|
|
|
|
|
|
|
|
|
|
echo '<table class="inv_dashboard_table sub displayNone">';
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
|
|
|
|
|
|
|
|
|
|
echo '<th>'.(int)$all_rec_in_survey.'</th>';
|
|
|
|
|
#echo '<th>'.(int)$recipients_by_status['all'].'</th>';
|
|
|
|
|
echo '<th> </th>';
|
|
|
|
|
echo '<th>100%</th>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
#popslano enotam
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['send'].'</td>';
|
|
|
|
|
echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#neodgovori
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
|
|
|
|
|
$unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
|
|
|
|
|
echo '<td>'.$unanswered.'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
|
|
#če se slučajno pojavijo kaki neznani statusi
|
|
|
|
|
if ((int)$recipients_by_status['unknown'] > 0) {
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
}
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
|
|
|
|
|
echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
|
|
|
|
|
echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
|
|
|
|
|
echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
echo '</table>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
#Vabil še nismo pošiljali
|
|
|
|
|
echo $lang['srv_inv_dashboard_empty'].' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_inv_dashboard_add_link'].'</a>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
echo $lang['srv_inv_dashboard_not_enabled'];
|
|
|
|
|
}
|
|
|
|
|
echo '</p>';
|
|
|
|
|
echo '</div>';
|
|
|
|
|
echo '</fieldset>';
|
|
|
|
|
|
|
|
|
|
#pošiljanje po enotah
|
|
|
|
|
$cnt_by_sendings = array();
|
|
|
|
|
$all_units_count = 0;
|
|
|
|
|
# najprej koliko enotam še ni bilo poslano
|
|
|
|
|
$sel = "select count(*) FROM srv_invitations_recipients WHERE ank_id='$this->sid' AND sent = '0'";
|
|
|
|
|
$query = sisplet_query($sel);
|
|
|
|
|
list($count) = mysqli_fetch_row($query);
|
|
|
|
|
if ($count > 0) {
|
|
|
|
|
$cnt_by_sendings[0] = (int)$count;
|
|
|
|
|
}
|
|
|
|
|
$all_units_count = (int)$count;
|
|
|
|
|
$sel1 = "select count(*) as cnt, rec_id FROM srv_invitations_archive_recipients WHERE arch_id in (select id from srv_invitations_archive where ank_id = '".$this->sid."') AND success !='0' group by rec_id ORDER BY cnt ASC;";
|
|
|
|
|
$query1 = sisplet_query($sel1);
|
|
|
|
|
|
|
|
|
|
while (list($count, $rec_id) = mysqli_fetch_row($query1)) {
|
|
|
|
|
$cnt_by_sendings[(int)$count] ++;
|
|
|
|
|
$all_units_count++;
|
|
|
|
|
}
|
|
|
|
|
if (count($cnt_by_sendings) > 0) {
|
|
|
|
|
echo '<fieldset class="inv_fieldset">';
|
|
|
|
|
echo '<legend >';
|
|
|
|
|
echo '<span class="pointer legend" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
|
|
|
|
|
echo '<span class="plus red strong">+ </span>';
|
|
|
|
|
echo '<span class="minus red strong displayNone">- </span>';
|
|
|
|
|
echo $lang['srv_inv_nav_email_sending_status'];
|
|
|
|
|
echo '</span>';
|
|
|
|
|
echo Help::display('srv_inv_cnt_by_sending');
|
|
|
|
|
echo '</legend>';
|
|
|
|
|
echo '<br/>';
|
|
|
|
|
echo '<div class="inv_filedset_inline_div displayNone">';
|
|
|
|
|
echo '<table style="border-spacing: 0px;padding: 0px;margin: 0px;">';
|
|
|
|
|
echo '<colgrup>';
|
|
|
|
|
echo '<col style="min-width:150px;"/>';
|
|
|
|
|
echo '<col style="min-width:150px;"/>';
|
|
|
|
|
echo '<col style="min-width:150px;"/>';
|
|
|
|
|
echo '</colgrup>';
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_cnt'].'</th>';
|
|
|
|
|
echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_units'].'</th>';
|
|
|
|
|
echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_percentage'].'</th>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
foreach ($cnt_by_sendings AS $cnt => $units) {
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td>'.$cnt.'</td>';
|
|
|
|
|
echo '<td>'.$units.'</td>';
|
|
|
|
|
$percent = ($all_units_count > 0) ? $units / $all_units_count * 100 : 0;
|
|
|
|
|
echo '<td>'.Common::formatNumber ($percent,0,null,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
}
|
|
|
|
|
echo '<tr>';
|
|
|
|
|
echo '<td class="anl_bt_dot red">'.$lang['srv_inv_sending_overview_sum'].'</td>';
|
|
|
|
|
echo '<td class="anl_bt_dot red">'.$all_units_count.'</td>';
|
|
|
|
|
$percent = ($all_units_count > 0) ? $all_units_count / $all_units_count * 100 : 0;
|
|
|
|
|
echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
echo '</table>';
|
|
|
|
|
echo '</div>';
|
|
|
|
|
echo '</fieldset>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Prikaz statusov posiljanj
|
|
|
|
|
private function displayInvitationStatusNew() {
|
|
|
|
|
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
|
|
|
|
@ -8035,14 +7615,6 @@ class SurveyInvitationsNew {
|
|
|
|
|
$row = $this->surveySettings;
|
|
|
|
|
$_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
|
|
|
|
|
|
|
|
|
$sqlu = sisplet_query("SELECT email FROM users WHERE id='".$global_user_id."'");
|
|
|
|
|
$rowu = mysqli_fetch_array($sqlu);
|
|
|
|
|
if ($rowu['email'] == '') {
|
|
|
|
|
$sqlm = sisplet_query("SELECT * FROM misc WHERE what = 'AlertFrom'");
|
|
|
|
|
$rowm = mysqli_fetch_array($sqlm);
|
|
|
|
|
$rowu['email'] = $rowm['value'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$userAccess = UserAccess::getInstance($global_user_id);
|
|
|
|
|
|
|
|
|
|
$noEmailing = SurveySession::get('inv_noEmailing');
|
|
|
|
|