Moje ankete direktoriji - popravek paginacije, stevila anket
This commit is contained in:
parent
33ac1684a1
commit
fc0a41a3d8
@ -108,6 +108,15 @@ class SurveyListFolders extends SurveyList{
|
||||
if($folder_id == '0'){
|
||||
|
||||
// Prestejemo ankete, ki niso v nobenem notranjem folderju - so v rootu
|
||||
// Poiscemo vse ankete v custom folderjih
|
||||
$sql = sisplet_query("SELECT ank_id FROM srv_mysurvey_anketa WHERE usr_id='$global_user_id'");
|
||||
|
||||
// Vrnemo razliko v stevilu anket (odstejemo ankete v custom folderjih)
|
||||
$survey_count = count($this->surveys_ids);
|
||||
if(mysqli_num_rows($sql) > 0)
|
||||
$survey_count -= mysqli_num_rows($sql);
|
||||
|
||||
$this->current_folder['survey_count'] = $survey_count;
|
||||
|
||||
|
||||
// Preverimo, ce ni noben drug folder aktiviran - potem je aktiviran root
|
||||
@ -133,6 +142,9 @@ class SurveyListFolders extends SurveyList{
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$survey_count = $row['survey_count'];
|
||||
|
||||
|
||||
// Nastavimo, ce je to trenutno odprt folder
|
||||
if($row['active'] == '1')
|
||||
$this->current_folder = $row;
|
||||
@ -150,6 +162,7 @@ class SurveyListFolders extends SurveyList{
|
||||
echo '<span class="faicon folder"></span>';
|
||||
|
||||
echo $lang['srv_mySurvey_all_surveys'];
|
||||
echo '<span class="folder_item_child_count">'.$survey_count.'</span>';
|
||||
}
|
||||
else{
|
||||
echo '<li id="folder_item_'.$folder_id.'" class="folder_item '.$folder_open.' '.$folder_active.' mySurvey_draggable mySurvey_droppable" folder_id="'.$folder_id.'" onClick="mySurvey_folder_activate(\''.$folder_id.'\');">';
|
||||
@ -158,7 +171,7 @@ class SurveyListFolders extends SurveyList{
|
||||
echo '<span class="faicon folder"></span>';
|
||||
|
||||
echo $row['naslov'];
|
||||
echo '<span class="folder_item_child_count">'.$row['survey_count'].'</span>';
|
||||
echo '<span class="folder_item_child_count">'.$survey_count.'</span>';
|
||||
|
||||
// Urejanje folderja
|
||||
// Tri pikice za prikaz urejanja folderja
|
||||
@ -220,7 +233,7 @@ class SurveyListFolders extends SurveyList{
|
||||
|
||||
// Izpisemo desnostran - vsebino odprtega folderja
|
||||
private function displayRightContent(){
|
||||
|
||||
|
||||
// Naslov trenutnega folderja
|
||||
echo '<div class="folder_title">';
|
||||
$this->displayFolderTitle();
|
||||
@ -242,6 +255,16 @@ class SurveyListFolders extends SurveyList{
|
||||
|
||||
echo '</div>';
|
||||
|
||||
|
||||
# koliko imamo strani
|
||||
$this->max_pages = (int)$this->rec_per_page > 0 ? ceil($this->current_folder['survey_count'] / $this->rec_per_page) : 1;
|
||||
|
||||
# katera je trenutna stran
|
||||
if (isset($_GET['pageno']) && (int)$_GET['pageno'] > 0) {
|
||||
# izbrana stran ne more biti večja, kot pa imamo vseh strani
|
||||
$this->pageno = min((int)$_GET['pageno'], $this->max_pages);
|
||||
}
|
||||
|
||||
|
||||
// Izris seznama anket
|
||||
echo '<div class="div_sl_new folders">';
|
||||
@ -249,7 +272,7 @@ class SurveyListFolders extends SurveyList{
|
||||
echo '</div>';
|
||||
|
||||
// Paginacija - se na dnu - ni prikazana pri searchu
|
||||
if($this->isSearch != 1){
|
||||
if($this->isSearch != 1){
|
||||
echo '<div class="pagination_bottom_holder">';
|
||||
echo ' <div class="pagination bottom">';
|
||||
$this->displayPagiantion();
|
||||
@ -850,10 +873,23 @@ class SurveyListFolders extends SurveyList{
|
||||
|
||||
// Nastavimo current folder
|
||||
if($folder_id == '0'){
|
||||
|
||||
// Prestejemo ankete, ki niso v nobenem notranjem folderju - so v rootu
|
||||
// Poiscemo vse ankete v custom folderjih
|
||||
$sql = sisplet_query("SELECT ank_id FROM srv_mysurvey_anketa WHERE usr_id='$global_user_id'");
|
||||
|
||||
// Vrnemo razliko v stevilu anket (odstejemo ankete v custom folderjih)
|
||||
$survey_count = count($this->surveys_ids);
|
||||
if(mysqli_num_rows($sql) > 0)
|
||||
$survey_count -= mysqli_num_rows($sql);
|
||||
|
||||
|
||||
$this->current_folder = array(
|
||||
'id' => 0,
|
||||
'naslov' => $lang['srv_mySurvey_all_surveys']
|
||||
);
|
||||
|
||||
$this->current_folder['survey_count'] = $survey_count;
|
||||
}
|
||||
else{
|
||||
// Dobimo podatke folderja
|
||||
|
Loading…
x
Reference in New Issue
Block a user