Brisanje uploada datotek v vpogledu in urejanju podatkov
This commit is contained in:
parent
3029789eb8
commit
e9e30fdbfa
@ -227,6 +227,9 @@ class SurveyPostProcess {
|
|||||||
} elseif ($_GET['a'] == 'edit_data_question_save') {
|
} elseif ($_GET['a'] == 'edit_data_question_save') {
|
||||||
$this->ajax_edit_data_question_save(0);
|
$this->ajax_edit_data_question_save(0);
|
||||||
|
|
||||||
|
} elseif ($_GET['a'] == 'edit_data_question_upload_delete') {
|
||||||
|
$this->ajax_edit_data_question_upload_delete();
|
||||||
|
|
||||||
} elseif ($_GET['a'] == 'get_inline_edit') {
|
} elseif ($_GET['a'] == 'get_inline_edit') {
|
||||||
$this->ajax_get_inline_edit();
|
$this->ajax_get_inline_edit();
|
||||||
|
|
||||||
@ -255,11 +258,8 @@ class SurveyPostProcess {
|
|||||||
$this->ajax_coding_merge();
|
$this->ajax_coding_merge();
|
||||||
|
|
||||||
} elseif ($_GET['a'] == 'coding_filter') {
|
} elseif ($_GET['a'] == 'coding_filter') {
|
||||||
$this->ajax_coding_filter();
|
$this->ajax_coding_filter();
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -547,6 +547,25 @@ class SurveyPostProcess {
|
|||||||
/*if ($refresh == 1)
|
/*if ($refresh == 1)
|
||||||
header("Location: index.php?anketa=".$this->anketa."&a=data&m=edit");*/
|
header("Location: index.php?anketa=".$this->anketa."&a=data&m=edit");*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pobrisemo upload datoteke v urejanju podatkov
|
||||||
|
function ajax_edit_data_question_upload_delete () {
|
||||||
|
Common::updateEditStamp();
|
||||||
|
|
||||||
|
$spr_id = $_POST['spr_id'];
|
||||||
|
$usr_id = $_POST['usr_id'];
|
||||||
|
$code = $_POST['code'];
|
||||||
|
|
||||||
|
$s = sisplet_query("DELETE FROM srv_data_upload WHERE ank_id='".$this->anketa."' AND usr_id='".$usr_id."' AND code='".$code."'");
|
||||||
|
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
|
||||||
|
|
||||||
|
$s2 = sisplet_query("DELETE FROM srv_data_text".$this->db_table." WHERE spr_id='".$spr_id."' AND usr_id='".$usr_id."'");
|
||||||
|
if (!$s2) echo mysqli_error($GLOBALS['connect_db']);
|
||||||
|
|
||||||
|
$this->ajax_edit_data_question();
|
||||||
|
|
||||||
|
self::forceRefreshData($this->anketa);
|
||||||
|
}
|
||||||
|
|
||||||
function ajax_get_inline_edit () {
|
function ajax_get_inline_edit () {
|
||||||
|
|
||||||
|
@ -5468,3 +5468,10 @@ function consultingPopupClose(){
|
|||||||
$('#popup_note').fadeOut('slow').html('');
|
$('#popup_note').fadeOut('slow').html('');
|
||||||
$('#fade').fadeOut('slow');
|
$('#fade').fadeOut('slow');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Brisanje datoteke iz podatkov
|
||||||
|
function removeUploadFromData(usr_id, spr_id, code){
|
||||||
|
|
||||||
|
$("#fullscreen").load('ajax.php?t=postprocess&a=edit_data_question_upload_delete', {anketa: srv_meta_anketa_id, usr_id: usr_id, spr_id: spr_id, code: code});
|
||||||
|
}
|
||||||
|
@ -774,15 +774,55 @@ class TextController extends Controller
|
|||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Smo v admin podatkih in uplodamo datoteko ali fotografijo
|
||||||
|
elseif( ($row['upload'] == 1 || $row['upload'] == 2) && ($_GET['t'] == 'postprocess' || $_GET['m'] == 'quick_edit') ){
|
||||||
|
|
||||||
|
$sqlUpload = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id='".get('usr_id')."' AND code='".$row2['text']."'");
|
||||||
|
|
||||||
|
// Ze imamo datoteko - moznost brisanja v adminu
|
||||||
|
if(mysqli_num_rows($sqlUpload) > 0){
|
||||||
|
|
||||||
|
$rowUpload = mysqli_fetch_array($sqlUpload);
|
||||||
|
$file = $rowUpload[0];
|
||||||
|
|
||||||
|
global $site_url;
|
||||||
|
echo '<div style="font-size:14px;"><a href="'.$site_url.'/main/survey/download.php?anketa='.get('anketa').'&code='.$row2['text'].'">'.$file.'</a></div>';
|
||||||
|
|
||||||
|
// Remove file button
|
||||||
|
if($_GET['quick_view'] != '1'){
|
||||||
|
echo '<div class="buttonwrapper floatLeft">
|
||||||
|
<a
|
||||||
|
class="ovalbutton ovalbutton_orange btn_savesettings"
|
||||||
|
href="#"
|
||||||
|
style="margin: 10px 0 0 0;"
|
||||||
|
id="remove_file_'.$spremenljivka.'_vrednost_'.$i.'"
|
||||||
|
onClick="removeUploadFromData(\''.get('usr_id').'\', \''.$spremenljivka.'\', \''.$row2['text'].'\')"
|
||||||
|
>';
|
||||||
|
echo self::$lang['srv_alert_upload_remove'];
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Uploadamo datoteko preko admina - TODO
|
||||||
|
else{
|
||||||
|
|
||||||
|
echo '<input name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '"
|
||||||
|
type="file"
|
||||||
|
id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '"
|
||||||
|
class="pointer"
|
||||||
|
>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Upload
|
// Upload
|
||||||
elseif ($row['upload'] == 1) {
|
elseif ($row['upload'] == 1) {
|
||||||
|
|
||||||
echo '<input name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '"
|
echo '<input name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '"
|
||||||
type="file"
|
type="file"
|
||||||
id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '"
|
id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '"
|
||||||
' . (!$missing ? '' : ' disabled') . '
|
' . (!$missing ? '' : ' disabled') . '
|
||||||
class="pointer"
|
class="pointer"
|
||||||
onChange="checkUpload(this, \''.$spremenljivka.'_vrednost_'.$i.'\');"
|
onChange="checkUpload(this, \''.$spremenljivka.'_vrednost_'.$i.'\');"
|
||||||
>';
|
>';
|
||||||
|
|
||||||
// Remove file button
|
// Remove file button
|
||||||
echo '<div class="remove_file pointer"
|
echo '<div class="remove_file pointer"
|
||||||
@ -794,8 +834,9 @@ class TextController extends Controller
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fotografiranje
|
// Fotografiranje
|
||||||
elseif ($row['upload'] == 2) {
|
elseif ($row['upload'] == 2) {
|
||||||
|
|
||||||
$inpname = 'vrednost_' . $spremenljivka . '_kos_' . $row1['id'];
|
$inpname = 'vrednost_' . $spremenljivka . '_kos_' . $row1['id'];
|
||||||
$inpid = 'spremenljivka_' . $spremenljivka . '_vrednost_' . $i;
|
$inpid = 'spremenljivka_' . $spremenljivka . '_vrednost_' . $i;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user