diff --git a/admin/survey/BranchingAjax.php b/admin/survey/BranchingAjax.php index 755fadb79..37b32f6a9 100644 --- a/admin/survey/BranchingAjax.php +++ b/admin/survey/BranchingAjax.php @@ -1418,12 +1418,6 @@ class BranchingAjax { echo $row['id']; } - function ajax_get_new_if () { - $sql = sisplet_query("SELECT * FROM misc WHERE what='new_if_$this->anketa'"); - $row = mysqli_fetch_array($sql); - echo $row['value']; - } - function ajax_if_collapsed () { Common::updateEditStamp(); @@ -2924,11 +2918,6 @@ class BranchingAjax { if (!$sql) echo mysqli_error($GLOBALS['connect_db']); $if_id = mysqli_insert_id($GLOBALS['connect_db']); - $sqlm = sisplet_query("SELECT * FROM misc WHERE what='new_if_$this->anketa'"); - if (mysqli_num_rows($sqlm) > 0) - sisplet_query("UPDATE misc SET value='$if_id' WHERE what='new_if_$this->anketa'"); - else - sisplet_query("INSERT INTO misc (what, value) VALUES ('new_if_$this->anketa', '$if_id')"); if ($this->spremenljivka > 0 || ($if > 0 && $endif == 1)) { $sql = sisplet_query("SELECT * FROM srv_branching WHERE element_spr = '$this->spremenljivka' AND element_if='$if'"); diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php index 34a56cb08..f0a1db196 100644 --- a/admin/survey/SurveyAdminAjax.php +++ b/admin/survey/SurveyAdminAjax.php @@ -584,12 +584,6 @@ class SurveyAdminAjax { if (!$sql) echo mysqli_error($GLOBALS['connect_db']); } - if (isset ($_POST['SurveyExport'])) { - $val = $_POST['SurveyExport']; - $sql = sisplet_query("UPDATE misc SET value='$val' WHERE what = 'SurveyExport'"); - if (!$sql) - echo mysqli_error($GLOBALS['connect_db']); - } if (isset ($_POST['SurveyForum'])) { $val = $_POST['SurveyForum']; $sql = sisplet_query("UPDATE misc SET value='$val' WHERE what = 'SurveyForum'"); diff --git a/admin/survey/SurveyAdminSettings.php b/admin/survey/SurveyAdminSettings.php index 9177d09ed..006783ac1 100644 --- a/admin/survey/SurveyAdminSettings.php +++ b/admin/survey/SurveyAdminSettings.php @@ -4846,8 +4846,6 @@ class SurveyAdminSettings { list ($SurveyDostop) = mysqli_fetch_row($result); $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyCookie'"); list ($SurveyCookie) = mysqli_fetch_row($result); - $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyExport'"); - list ($SurveyExport) = mysqli_fetch_row($result); $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyForum'"); list ($SurveyForum) = mysqli_fetch_row($result); @@ -4872,34 +4870,21 @@ class SurveyAdminSettings {
- '; - ?> - -
- '; - ?> - '; echo ''; $sqlf = sisplet_query("SELECT id, naslov FROM forum WHERE parent = '0'"); while ($rowf = mysqli_fetch_array($sqlf)) { echo ''; - } - ?> - - + } + echo '';*/ - '; + + echo '
'; echo '' . $lang['srv_edithelp'] . ''; diff --git a/admin/survey/classes/class.Common.php b/admin/survey/classes/class.Common.php index 93c7f2f2c..b72c42579 100644 --- a/admin/survey/classes/class.Common.php +++ b/admin/survey/classes/class.Common.php @@ -706,28 +706,16 @@ class Common { * @return Ambigous */ function getFromEmail() { - global $global_user_id, $site_domain; - $MailFrom = 'info@1ka.si'; + global $global_user_id, $site_domain, $email_server_settings; - # nastavimo pošiljatelja - # za SAFE.SI naredimo hardcoded da se pošilja kao iz SAFE.SI - if (strpos($site_domain, "safe.si") === false) - { - #nismo iz SAFE.SI - $r = sisplet_query("SELECT value FROM misc WHERE what='AlertFrom'"); - list ($MailFrom) = mysqli_fetch_row($r); - } - else - { - # smo na SAFE.SI - $MailFrom = 'info@safe.si'; - } + if(isset($email_server_settings['SMTPFrom'])) + $MailFrom = $email_server_settings['SMTPFrom']; # Če je slučanjo napaka nastavimo info@1ka.si - if ($MailFrom == null || trim($MailFrom) == '' || !$this->validEmail($MailFrom)) - { + if ($MailFrom == null || trim($MailFrom) == '' || !$this->validEmail($MailFrom)){ $MailFrom = 'info@1ka.si'; } + return $MailFrom; } diff --git a/admin/survey/classes/class.SurveyExport.php b/admin/survey/classes/class.SurveyExport.php index b0166a610..7494191d2 100644 --- a/admin/survey/classes/class.SurveyExport.php +++ b/admin/survey/classes/class.SurveyExport.php @@ -111,14 +111,6 @@ class SurveyExport # za profil časov SurveyTimeProfiles :: Init($this->sid, $global_user_id); - - $result = sisplet_query ("SELECT value FROM misc WHERE what='SurveyExport'"); - list ($SurveyExport) = mysqli_fetch_row ($result); - $adminTypes = array(0=>$lang['forum_admin'],1=>$lang['forum_manager'],2=>$lang['forum_clan'],3=>$lang['forum_registered'] ); - - if ($SurveyExport<$admin_type) { - die ($lang['srv_export_no_access'].$adminTypes[$admin_type]); - } # manjkajoče vrednosti $this->SMV = new SurveyMissingValues($this->sid); diff --git a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php index a5268170e..403a07dc1 100644 --- a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php +++ b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php @@ -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; @@ -52,17 +53,13 @@ class SurveyInvitationsNew { $sql_query_all = sisplet_query("SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'"); $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,101 +4660,9 @@ 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 '
'; - # 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 '
'; + $this->showArchiveRecipients($_arch_id, $archType); - echo ''; - - echo ''; - - // Pri volitvah ne prikazemo nekaterih stolpcev - if(SurveyInfo::getInstance()->checkSurveyModule('voting')){ - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - else{ - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - - echo ''; - - while ($sql_row = mysqli_fetch_assoc($sql_query)) { - echo ''; - - // Pri volitvah ne prikazemo nekaterih stolpcev - if(SurveyInfo::getInstance()->checkSurveyModule('voting')){ - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - else{ - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - - - echo ''; - } - - echo '
'.$lang['srv_inv_recipients_sent'].''.$lang['srv_inv_recipients_email'].''.$lang['srv_inv_recipients_firstname'].''.$lang['srv_inv_recipients_lastname'].''.$lang['srv_inv_recipients_list_id'].''.$lang['srv_inv_recipients_sent'].''.$lang['srv_inv_recipients_responded'].''.$lang['srv_inv_recipients_unsubscribed'].''.$lang['srv_inv_recipients_email'].''.$lang['srv_inv_recipients_password'].''.$lang['srv_inv_recipients_firstname'].''.$lang['srv_inv_recipients_lastname'].''.$lang['srv_inv_recipients_last_status'].''.$lang['srv_inv_recipients_list_id'].'
'.$sql_row['email'].''.$sql_row['firstname'].''.$sql_row['lastname'].''.$lists[$sql_row['list_id']].''.$sql_row['email'].''.$sql_row['password'].''.$sql_row['firstname'].''.$sql_row['lastname'].''.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.''.$lists[$sql_row['list_id']].'
'; - - echo '
'; // id="arc_content" - echo '
'; - echo ''; + return; } function editArchiveComment() { @@ -7082,8 +6987,7 @@ class SurveyInvitationsNew { echo ''; } } - // Nov način z trackingom - elseif($this->newTracking == true) { + else{ $userAccess = UserAccess::getInstance($global_user_id); @@ -7094,334 +6998,10 @@ class SurveyInvitationsNew { echo ''; } } - # star način brez trackinga - else { - echo ''; - $this->displayInvitationStatusOld(); - echo ''; - } echo ''; } - function displayInvitationStatusOld() { - global $lang, $admin_type, $global_user_id, $site_url, $site_path; - - $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email'); - - # polovimo lurkerje - echo '
'.$lang['srv_inv_nav_email_status'].''; - echo '
'; - echo '

'; - 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 ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - #popslano enotam - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - #neodgovori - echo ''; - echo ''; - $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']); - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - #če se slučajno pojavijo kaki neznani statusi - if ((int)$recipients_by_status['unknown'] > 0) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
'.$lang['srv_inv_dashboard_tbl_all'].''.(int)$recipients_by_status['all'].'-100%
'.$lang['srv_inv_dashboard_tbl_send'].''.(int)$recipients_by_status['send'].''.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').''.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_unanswered'].''.$unanswered.''.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_clicked'].''.(int)$recipients_by_status['clicked'].''.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_unknown'].''.(int)$recipients_by_status['unknown'].''.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_finished'].''.(int)$recipients_by_status['finished'].''.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'
'; - echo '
'; - # 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 ''; - echo ''; - echo '+ '; - echo '- '; - echo $cnt.$lang['srv_inv_dashboard_list_cnt_title']; - echo ''; - echo ''.$avtor_name.''; - echo ', '; - echo ''.$row_arc['ds'].''; - echo ''; - echo ' arhiv '; - echo '
'; - - echo ''; - echo ''; - echo ''; - - echo ''; - #echo ''; - echo ''; - echo ''; - echo ''; - #popslano enotam - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - - #neodgovori - echo ''; - echo ''; - $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']); - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - #če se slučajno pojavijo kaki neznani statusi - if ((int)$recipients_by_status['unknown'] > 0) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
'.$lang['srv_inv_dashboard_tbl_all'].''.(int)$all_rec_in_survey.''.(int)$recipients_by_status['all'].' 100%
'.$lang['srv_inv_dashboard_tbl_send'].''.(int)$recipients_by_status['send'].''.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').''.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$all_rec_in_survey : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_unanswered'].''.$unanswered.''.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$all_rec_in_survey : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_clicked'].''.(int)$recipients_by_status['clicked'].''.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$all_rec_in_survey : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_unknown'].''.(int)$recipients_by_status['unknown'].''.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$all_rec_in_survey : 0),0,'%').'
'.$lang['srv_inv_dashboard_tbl_finished'].''.(int)$recipients_by_status['finished'].''.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').''.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$all_rec_in_survey : 0),0,'%').'
'; - } - - } - - } - } else { - #Vabil še nismo pošiljali - echo $lang['srv_inv_dashboard_empty'].' '.$lang['srv_inv_dashboard_add_link'].''; - } - - } else { - echo $lang['srv_inv_dashboard_not_enabled']; - } - echo '

'; - echo '
'; - echo '
'; - - #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 '
'; - echo ''; - echo ''; - echo '+ '; - echo '- '; - echo $lang['srv_inv_nav_email_sending_status']; - echo ''; - echo Help::display('srv_inv_cnt_by_sending'); - echo ''; - echo '
'; - echo '
'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - foreach ($cnt_by_sendings AS $cnt => $units) { - echo ''; - echo ''; - echo ''; - $percent = ($all_units_count > 0) ? $units / $all_units_count * 100 : 0; - echo ''; - echo ''; - } - echo ''; - echo ''; - echo ''; - $percent = ($all_units_count > 0) ? $all_units_count / $all_units_count * 100 : 0; - echo ''; - echo ''; - echo '
'.$lang['srv_inv_sending_overview_cnt'].''.$lang['srv_inv_sending_overview_units'].''.$lang['srv_inv_sending_overview_percentage'].'
'.$cnt.''.$units.''.Common::formatNumber ($percent,0,null,'%').'
'.$lang['srv_inv_sending_overview_sum'].''.$all_units_count.''.Common::formatNumber ($percent,0,null,'%').'
'; - echo '
'; - echo '
'; - } - } - // 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'); diff --git a/frontend/api/class.ApiLogin.php b/frontend/api/class.ApiLogin.php index e9b1a4ddc..3dfe301ce 100644 --- a/frontend/api/class.ApiLogin.php +++ b/frontend/api/class.ApiLogin.php @@ -1635,10 +1635,10 @@ class ApiLogin } } - $result = sisplet_query("SELECT value FROM misc WHERE what='ByeEmail'"); - list ($ByeEmail) = mysqli_fetch_row($result); - $result = sisplet_query("SELECT value FROM misc WHERE what='ByeEmailSubject'"); - list ($ByeEmailSubject) = mysqli_fetch_row($result); + + $ByeEmail = '

Spoštovani,

Uspešno ste se odjavili iz spletnega mesta www.1ka.si.

Veseli nas, da ste preizkusili orodje 1ka.

SFPAGENAME ekipa

'; + $ByeEmailSubject = 'Uspešna odjava'; + $result = sisplet_query("SELECT name FROM users WHERE email='$email'"); list ($ime) = mysqli_fetch_row($result); diff --git a/function/ProfileClass.php b/function/ProfileClass.php index 1c00562d2..34f2614d6 100644 --- a/function/ProfileClass.php +++ b/function/ProfileClass.php @@ -151,16 +151,9 @@ class Profile { $this->ZePrijavljen = true; - // Preveri ce moramo po registraciji vrec na kak URL - $rt = sisplet_query ("SELECT value FROM misc WHERE what='AfterReg'"); - $rxx = mysqli_fetch_row ($rt); - - if (strlen ($rxx[0]) > 3){ - $rxx[0] = str_replace ($originating_domain, $keep_domain, $rxx[0]); - header ('location: ' .$rxx[0] .'?&l=1'); - } - else - header ('location: /index.php'); + // Moramo po registraciji vrec na kak URL + $rxx = str_replace ($originating_domain, $keep_domain, '/admin/survey/'); + header ('location: '.$rxx.'?&l=1'); } else header ('location: /index.php'); @@ -223,16 +216,9 @@ class Profile { $this->ZePrijavljen = true; - // Preveri ce moramo po registraciji vrec na kak URL - $rt = sisplet_query ("SELECT value FROM misc WHERE what='AfterReg'"); - $rxx = mysqli_fetch_row ($rt); - - if (strlen ($rxx[0]) > 3){ - $rxx[0] = str_replace ($originating_domain, $keep_domain, $rxx[0]); - header ('location: ' .$rxx[0] .'?&l=1'); - } - else - header ('location: /index.php'); + // Moramo po registraciji vrec na kak URL + $rxx = str_replace ($originating_domain, $keep_domain, '/admin/survey/'); + header ('location: '.$rxx.'?&l=1'); } function GoogleLogin () { @@ -392,17 +378,17 @@ class Profile { sisplet_query ("UPDATE users SET last_login=NOW() WHERE id='" .$r[3] ."'"); - // določi še, od kje se je prijavil + // določi še, od kje se je prijavil - $hostname=""; - $headers = apache_request_headers(); - if (array_key_exists('X-Forwarded-For', $headers)){ - $hostname=$headers['X-Forwarded-For']; - } else { - $hostname=$_SERVER["REMOTE_ADDR"]; - } + $hostname=""; + $headers = apache_request_headers(); + if (array_key_exists('X-Forwarded-For', $headers)){ + $hostname=$headers['X-Forwarded-For']; + } else { + $hostname=$_SERVER["REMOTE_ADDR"]; + } - sisplet_query ("INSERT INTO user_login_tracker (uid, IP, kdaj) VALUES ('" .$r[3] ."', '" .$hostname ."', NOW())"); + sisplet_query ("INSERT INTO user_login_tracker (uid, IP, kdaj) VALUES ('" .$r[3] ."', '" .$hostname ."', NOW())"); setcookie ("uid", base64_encode($this->email), time()+$LifeTime, '/', $cookie_domain); @@ -419,22 +405,9 @@ class Profile { header ('location: ' .$site_url .str_replace (base64_decode($_POST['l']), $site_url, "")); } - - // Preveri ce moramo po registraciji vrec na kak URL - $rt = sisplet_query ("SELECT value FROM misc WHERE what='AfterReg'"); - $rxx = mysqli_fetch_row ($rt); - - if (strlen ($rxx[0]) > 3) { - $rxx[0] = str_replace ($originating_domain, $keep_domain, $rxx[0]); - header ('location: ' .$rxx[0] .'?&l=1'); - } - else { - - if (!isset ($_GET['l'])) - header('Location: ' .$site_url .'?l=1'); - else - header('Location: ' .base64_decode($_GET['l']) .'?&l=1'); - } + // Moramo po registraciji vrec na kak URL + $rxx = str_replace ($originating_domain, $keep_domain, '/admin/survey/'); + header ('location: '.$rxx.'?&l=1'); } else{ // Password prompt