Server IP : 80.241.246.6 / Your IP : 216.73.216.188 Web Server : Apache/2.4.25 (Debian) System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64 User : www-data ( 33) PHP Version : 7.0.33-0+deb9u12 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/kharagauli_new/Citizens_feedback/admin/pages/ |
Upload File : |
<div class="page-container" id="page-container"> <!-- BEGIN MAIN CONTENT --> <div class="main_content"> <!-- BEGIN WRAPPER --> <div class="content-wrapper" style="padding-top: 80px; padding-bottom: 80px"> <?php if($_SESSION['E_'.$Action]==1) if($Action=='program_clases'){ // ==================== Options RequestTimeInterval $ClassID=0; $ClassName=''; if(isset($_GET['editClassID'])) $ClassID=(int)$_GET['editClassID']; if(isset($_GET['DelProjClass'])){ $PCID=(int)$_GET['DelProjClass']; mysqli_query($baza,'delete from cf_ProgramClasses where ID='.$PCID); mysqli_query($baza,'delete from cf_Programs where ClassID='.$PCID); mysqli_query($baza,'delete from cf_Answers where ClassID='.$PCID); } if(isset($_POST['ClassName'])){ $ClassName=$_POST['ClassName']; $ClassID=(int)$_POST['ClassID']; if($ClassID==0){ $sql='select * from cf_ProgramClasses where Name="'.$ClassName.'"'; $ptk=mysqli_query($baza,$sql); if(mysqli_num_rows($ptk)>0) { info('ასეთი კლასი უკვე არსებობს'); }else{ $sql='insert into cf_ProgramClasses (Name) values ("'.$ClassName.'")'; $ptk=mysqli_query($baza,$sql); } }else{ // ClassID>0 $sql='update cf_ProgramClasses set Name="'.$ClassName.'" where ID='.$ClassID; $ptk=mysqli_query($baza,$sql); } if(!$ptk) die(mysqli_error($ptk)); } ?> <div class=""> <table border="1" cellspacing="0" cellpadding="5" class="normal PCTable" align="center" style="border-collapse:collapse; margin-top:20px"> <thead><tr><td colspan="2">კლასის დასახელება</td><td colspan="10"></td></thead> <tbody class="sortable"> <?php $ptk=mysqli_query($baza,'select * from cf_ProgramClasses order by Pos'); while($row=mysqli_fetch_array($ptk,1)){ if($ClassID==$row['ID']) $ClassName=$row['Name']; ?> <tr num="<?=$row['ID']?>" <?=$row['ID']==$ClassID?'class="selected"':''?>> <td class="handle"></td> <td><?=$row['Name']?></td> <td><span class="delete"></span></td> <td><span class="activeIcon <?=$row['Active']?'active':''?>"></span></td> </tr> <?php } ?> </tbody> </table> <script> $('.sortable').sortable({ handle:'.handle', stop:function(){ var tbody=$(this).closest('tbody'); var lines=$(tbody).children('tr'); var ss=[]; $.each(lines,function(i,e){ var num=$(e).attr('num'); ss.push(num); }) console.log(ss); $.ajax({ url:'interactive.php', type:'post', dataType:'json', data:{f:'setClassesSort',ss:ss} }) .done(function(data){ console.log('DONE ',data); }) .fail(function(data){ console.log('FAIL ',data); }) console.log('Stop'); } }) $('span.activeIcon').on('click',function(){ $(this).toggleClass('active'); var num=$(this).closest('tr').attr('num'); var active=0; if($(this).hasClass('active')) active=1; $.post({ url:'interactive.php', type:'post', dataType:'json', data:{f:'setClassesActive',num:num, active:active} }) }) $('span.delete').on('click',function(){ var num=$(this).closest('tr').attr('num'); confirmMessage('პროგრამის კლასის და მასში შემავალი ყველა პროექტის და მათი სტატისტიკის წაშლა?','?Action=<?=$Action?>&DelProjClass='+num); }) </script> <?php ?> <form method="post"><input type="hidden" name="ClassID" value="<?=$ClassID?>"> <table border="1" cellspacing="0" cellpadding="5" class="normal" align="center" style="border-collapse:collapse; margin-top:20px"> <thead><tr><td><?=$ClassID>0?'კლასის რედაქტირება':'ახალი კლასი'?></td></thead> <tr><td><input type="text" name="ClassName" value="<?=$ClassName?>"></td></tr> <tr><td align="center" colspan="10"><input type="submit"></td> </form> </div> <?php } ?> </div> </div> </div>