Exemplo n.º 1
0
function recursiveRemoveDirectory($directory)
{
    foreach (glob("{$directory}/*") as $file) {
        if (is_dir($file)) {
            recursiveRemoveDirectory($file);
        } else {
            unlink($file);
        }
    }
    rmdir($directory);
}
Exemplo n.º 2
0
function recursiveRemoveDirectory($directory)
{
    if (strpos($directory, 'styles') !== false) {
        // safety precaution
        // alright to proceed
    } else {
        die;
    }
    foreach (glob($directory . '/*') as $file) {
        if (is_dir($file)) {
            recursiveRemoveDirectory($file);
        } else {
            unlink($file);
        }
    }
    rmdir($directory);
}
Exemplo n.º 3
0
function recursiveRemoveDirectory($path)
{
    $dir = new RecursiveDirectoryIterator($path);
    //Remove all files
    foreach (new RecursiveIteratorIterator($dir) as $file) {
        unlink($file);
    }
    //Remove all subdirectories
    foreach ($dir as $subDir) {
        //If a subdirectory can't be removed, it's because it has subdirectories, so recursiveRemoveDirectory is called again passing the subdirectory as path
        if (!@rmdir($subDir)) {
            recursiveRemoveDirectory($subDir);
        }
    }
    //Remove main directory
    rmdir($path);
}
Exemplo n.º 4
0
function recursiveRemoveDirectory($dir)
{
    $dir = str_replace('\\', '/', $dir);
    $dir = str_replace('/..', '', $dir);
    if (is_dir($dir)) {
        $ResDir = opendir($dir);
        while ($file = readdir($ResDir)) {
            if ($file != '.' and $file != '..') {
                if (is_dir("{$dir}/{$file}")) {
                    recursiveRemoveDirectory("{$dir}/{$file}");
                } elseif (file_exists("{$dir}/{$file}")) {
                    unlink("{$dir}/{$file}");
                }
            }
        }
        closedir($ResDir);
    }
    rmdir($dir);
}
Exemplo n.º 5
0
/**
 * Recursively remove directory
 *
 * @param $dir
 * @return void
 */
function recursiveRemoveDirectory($dir)
{
    $files = glob($dir . '*', GLOB_MARK);
    foreach ($files as $file) {
        if (DIRECTORY_SEPARATOR === substr($file, -1)) {
            recursiveRemoveDirectory($file);
        } else {
            unlink($file);
        }
    }
    if (is_dir($dir)) {
        rmdir($dir);
    }
}
function recursiveMoveDirectory($src, $dest)
{
    if (copyr($src, $dest)) {
        recursiveRemoveDirectory($src);
        return TRUE;
    }
    return FALSE;
}
        $profile_img = "<img src='{$check_pic}' width='100px' height= '100px' />";
    } else {
        $profile_img = "<img src='{$default_pic}' width='100px' height= '100px' />";
    }
}
global $gbizObj;
if (isset($_POST['btnDel'])) {
    $msg = "";
    global $gbizObj;
    $gbizObj->setListingId($lid);
    for ($i = 1; $i <= 8; $i++) {
        $gbizObj->delete($i);
    }
    //delete listing directory and  all its contents
    $dirPath = "biz/{$lid}";
    recursiveRemoveDirectory($dirPath);
    header("Location: view_listings.php?id={$id}");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php 
print DOMAIN_NAME . " :: " . "{$logOptions_username}";
?>
's listings</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="public/css/bootstrap.css" rel="stylesheet">
<link href="public/css/bootstrap.min.css" rel="stylesheet">
Exemplo n.º 8
0
function pierry_product360_delete_post($post_ID)
{
    $post = get_post($post_ID);
    if (pathinfo($post->guid, PATHINFO_EXTENSION) == 'tvu') {
        $zip_file = get_attached_file($post_ID);
        $to_dir = preg_replace('/\\.[^.\\s]{3,4}$/', '', $zip_file);
        recursiveRemoveDirectory($to_dir);
    }
}
Exemplo n.º 9
0
function recursiveRemoveDirectory($path)
{
    $dir = scandir($path);
    foreach ($dir as $item) {
        if ($item != '..' && $item != '.') {
            if (is_file("{$path}/{$item}")) {
                unlink("{$path}/{$item}");
            }
            if (is_dir("{$path}/{$item}")) {
                recursiveRemoveDirectory("{$path}/{$item}");
            }
        }
    }
    rmdir($path);
}
 public function removerecordfile($id, $recordname, $filename)
 {
     $query_q = 'UPDATE cms_content SET ' . $recordname . ' = "" WHERE id = "' . $id . '"';
     $query_r = mysql_query($query_q);
     $eqApp = new Apps();
     foreach (glob('resources/uploads/' . $id . '/' . $recordname . '/*') as $file) {
         if (is_dir($file)) {
             recursiveRemoveDirectory($file);
         } else {
             unlink($file);
         }
     }
     $eqApp->rrmdir('resources/uploads/' . $id . '/' . $recordname);
     exit;
 }
function filldata($syllabustmp)
{
    recursiveRemoveDirectory("tmpfilesloc");
    if ($syllabustmp == "All") {
        $str = "";
        $syllabusdata = ExecuteNonQuery("select * from section where semid=" . $_SESSION['ddlsbssem'] . " and active=1");
        $sylarr = array();
        $sbscnt = 0;
        while ($syllabusinfo = mysqli_fetch_assoc($syllabusdata)) {
            $cno = GetSingleField("select courseno from courses where cid=(select cid from course_section where csid=" . $syllabusinfo["csid"] . ")", "courseno");
            $cnot = substr($cno, 0, 1);
            if ($cnot == "C") {
                $version = GetSingleField("select version from fileinfo where active=1 and ftype='matrix'", "version");
            } else {
                $version = GetSingleField("select version from fileinfo where active=1 and ftype='gmatrix'", "version");
            }
            $cnm = GetSingleField("select coursename from courses where courseno like '" . $cno . "'", "coursename");
            $desc = GetSingleField("select description from courses where courseno like '" . $cno . "'", "description");
            $credits = GetSingleField("select credits from courses where courseno like '" . $cno . "'", "credits");
            $sem = GetSingleField("select semname from semester where active=1", "semname");
            $pid = GetSingleField("select prereqid from courses  where courseno like '" . $cno . "'", "prereqid");
            $cid = GetSingleField("select coreqid from courses  where courseno like '" . $cno . "'", "coreqid");
            $prereq = GetSingleField("select pcname from pre_req  where prereqid={$pid}", "pcname");
            $coreq = GetSingleField("select ccname from co_req  where coreqid={$cid}", "ccname");
            $sql = "select starttime,endtime,cday,roomno from facultyhours where uid=" . $syllabusinfo["uid"] . " and semid=" . $_SESSION["ddlsbssem"] . " and csid=" . $syllabusinfo["csid"];
            $web = GetSingleField('select website from section where sectionid=' . $syllabusinfo["sectionid"], 'website');
            $reqmaterials = GetSingleField('select reqmaterials from section where sectionid=' . $syllabusinfo["sectionid"], 'reqmaterials');
            $uid = $syllabusinfo["uid"];
            $dt2 = ExecuteNonQuery($sql);
            while ($inf2 = mysqli_fetch_assoc($dt2)) {
                $classloc = $inf2["roomno"];
                $cday = explode(" ", $inf2["cday"]);
                $tmp = explode(":", $inf2["starttime"]);
                $sttimehr = $tmp[0];
                $sttimemin = substr($tmp[1], 0, 2);
                $sttimeampm = substr($tmp[1], -2);
                $tmp1 = explode(":", $inf2["endtime"]);
                $entimehr = $tmp1[0];
                $entimemin = substr($tmp1[1], 0, 2);
                $entimeampm = substr($tmp1[1], -2);
            }
            $str = "<table width='100%'><tr>\r\n\t\t\t\t\t\t <td><h3><b>Gannon University</b></h3></td>\r\n\t\t\t\t\t\t<td style='text-align:right'><h3><b>Department of Computer and Information Science</b></h3></td>\r\n\t\t\t\t\t   </tr> \r\n\t\t\t\t\t   </table>\r\n\t\t\t\t\t<table style='width:100%' border='1'>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>\r\n\t\t\t\t\r\n\t\t\t\t\t   <table>";
            $data = ExecuteNonQuery('select * from users where uid=' . $uid);
            $inst = '';
            $offrno = '';
            $ph = '';
            $email = '';
            while ($info = mysqli_fetch_assoc($data)) {
                $inst = $info['salutation'] . ' ' . $info['firstname'] . $info['lastname'];
                $offrno = $info['office'];
                $ph = $info['officeno'];
                $email = $info['email'];
            }
            $str .= "<tr><td><b>Instructor:</b></td>\r\n\t\t\t\t\t\t<td>" . $inst . "</td>" . "</tr><tr>\r\n\t\t\t\t\t\t<td><b>Office:</b></td>\r\n\t\t\t\t\t\t<td>" . $offrno . "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><b>Phone:</b></td>\r\n\t\t\t\t\t\t<td>" . $ph . "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><b>Email:</b></td>\r\n\t\t\t\t\t\t<td>" . $email . "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t   </table>\r\n\t\t\t\t\t   </td>\r\n\t\t\t\t\t   <td>\r\n\t\t\t\t\t   <table>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan='2'><b>Office Hours</b></td>\r\n\t\t\t\t\t\t</tr>";
            $data1 = ExecuteNonQuery('select starttime,endtime,cday from facultyhours where uid=' . $uid . ' and semid=' . $_SESSION['ddlsbssem'] . ' and type=\'office\'');
            while ($info1 = mysqli_fetch_assoc($data1)) {
                $str .= "<tr>\r\n\t\t\t\t\t\t\t\t\t<td>" . $info1['cday'] . ':' . "</td>" . "<td>" . $info1['starttime'] . ':' . $info1['endtime'] . "</td>\r\n\t\t\t\t\t\t\t\t</tr>";
            }
            $str .= "</table></td>\r\n        \t\t\t\t\t </tr>\r\n        \t\t\t\t\t </table>\r\n        \t<table border='1'>\r\n\t        <tr>\r\n            \t<td>Course Title:</td>\r\n                <td>";
            if (isset($cnm) && $cnm != '') {
                $str .= $cnm;
            }
            $str .= "</td>" . "</tr>\r\n        \t<tr>\r\n            \t<td>Credit Hours:</td>\r\n                <td>";
            if (isset($credits) && $credits != '') {
                $str .= $credits;
            }
            $str .= ' credit(s)' . "</td>" . "\r\n             </tr>";
            $str .= "<tr>\r\n            \t<td>Semester:</td>\r\n                <td>";
            if (isset($sem) && $sem != '') {
                $str .= $sem;
            }
            $str .= "</td>\r\n            </tr>\r\n         \t<tr>\r\n            \t<td>Class Location:</td>\r\n                <td>";
            if (isset($classloc) && $classloc != '') {
                $str .= $classloc;
            }
            $str .= "</td></tr>";
            $sday = "";
            if (in_array('M', $cday)) {
                $sday .= 'M ';
            }
            if (in_array('T', $cday)) {
                $sday .= 'T ';
            }
            if (in_array('W', $cday)) {
                $sday .= 'W ';
            }
            if (in_array('Th', $cday)) {
                $sday .= 'Th ';
            }
            if (in_array('F', $cday)) {
                $sday .= 'F ';
            }
            $str .= "\r\n             <tr>\r\n            \t<td>Class Time:</td>\r\n                <td>";
            $str .= $sday . " " . $sttimehr . ':' . $sttimemin . ' ' . $sttimeampm . "\r\n               <b> to</b>" . $entimehr . ':' . $entimemin . ' ' . $entimeampm . "</option>\r\n                   \r\n                   </td>\r\n            </tr> <tr>\r\n            \t\t<td>Course Description:</td>\r\n                    \r\n            \t\t<td>";
            if (isset($desc) && $desc != '') {
                $str .= $desc;
            }
            $str .= "</td></tr>";
            $str .= "<tr>\r\n            \t\t<td>Course Learning Objectives:</td>\r\n                    \r\n                    <td>\r\n                    The student will be able to<br>";
            $cnot = substr($cno, 0, 1);
            if ($cnot == "C") {
                $cntrec = CountRecords("select cno from course_mappings where cno='" . str_replace(' ', '_', $cno) . "' and version='" . strtoupper($version) . "'");
            } else {
                $cntrec = CountRecords("select cno from gcourse_mappings where cno='" . str_replace(' ', '_', $cno) . "' and version='" . strtoupper($version) . "'");
            }
            $cnt2 = CountRecords('select * from fclo where semid=' . $_SESSION['ddlsbssem'] . ' and csid=' . $syllabusinfo["csid"] . " and uid=" . $uid);
            if ($cntrec > 0) {
                if ($cnot == "C") {
                    $data2 = ExecuteNonQuery("select mappingname from course_mappings where cno='" . str_replace(' ', '_', $cno) . "' and version='" . strtoupper($version) . "'");
                } else {
                    $data2 = ExecuteNonQuery("select mappingname from gcourse_mappings where cno='" . str_replace(' ', '_', $cno) . "' and version='" . strtoupper($version) . "'");
                }
                $cnt = 1;
                while ($info2 = mysqli_fetch_assoc($data2)) {
                    $str .= $info2['mappingname'] . '<br>';
                }
            }
            if ($cnt2 > 0) {
                $data5 = ExecuteNonQuery('select * from fclo where semid=' . $_SESSION['ddlsbssem'] . ' and uid=' . $uid . ' and csid=' . $syllabusinfo["csid"]);
                while ($info5 = mysqli_fetch_assoc($data5)) {
                    $str .= $info5['name'] . '<br>';
                }
            }
            $str .= "\t\r\n                    </td>\r\n            </tr>";
            $str .= "<tr>\r\n            \t\t<td>Co-requisites:</td>\r\n            \t\t\r\n            \t\t<td>";
            if (isset($coreq) && $coreq != '') {
                $str .= $coreq;
            }
            $str .= "</td>\r\n            </tr>\r\n           \t<tr>\r\n            \t\t<td>Prerequisites:</td>\r\n            \t\t\r\n            \t\t<td>";
            if (isset($prereq) && $prereq != '') {
                $str .= $prereq;
            }
            $str .= "</td></tr>";
            //echo $str;
            $str .= "<tr>\r\n         \t\t\t<td>Resources:</td>\r\n            \t\t<td>{$web}       </td>\r\n            </tr>\r\n\t\t\t<tr>\t<td>Required Textbooks:</td>\r\n            \t\t\r\n            \t\t<td>{$reqmaterials}\r\n          \t\t    </td>\r\n            </tr>";
            $str .= " <tr>\r\n            \t\t<td>Course Assessment Method:</td>\r\n            \t\t<td>";
            $cnt = 0;
            $sql = 'select camid,camname,camdetails from cams where csid=' . $syllabusinfo["csid"] . ' and semid=' . $_SESSION["ddlsbssem"] . " and uid=" . $uid;
            $data3 = ExecuteNonQuery($sql);
            //echo $sql;
            $cntrec1 = mysqli_num_rows($data3);
            $cnt = mysqli_num_rows($data3);
            //	echo $cnt;
            $str .= "<div>\r\n \t             \t\t<table align='left' id='camtable' style='text-align:left;' border='1' >";
            if ($cnt > 0) {
                $cnt = 1;
                while ($info3 = mysqli_fetch_assoc($data3)) {
                    $str .= "  <tr>\r\n                                        <td>" . $info3['camname'] . "</td>\r\n                                        <td width='100%'>" . $info3['camdetails'] . "\r\n                                     </td>\r\n                                  </tr>";
                }
            }
            $str .= " </table>\r\n \t\t\t\t\t\t\r\n                        </div>\r\n                    </td>\r\n            </tr>";
            $str .= " <tr>\r\n            \t\t<td>Assessment Method Mappings:</td>\r\n            \t\t\r\n            \t\t<td>";
            //		$sql="select * from course_mappings where cno='".str_replace(" ","_",$cno)."'";
            //	echo $sql;
            $cnot = substr($cno, 0, 1);
            if ($cnot == "C") {
                $cnt = CountRecords("select * from course_mappings where cno='" . str_replace(" ", "_", $cno) . "'");
            } else {
                $cnt = CountRecords("select * from gcourse_mappings where cno='" . str_replace(" ", "_", $cno) . "'");
            }
            $cnt2 = CountRecords('select * from fclo where semid=' . $_SESSION["ddlsbssem"] . ' and csid=' . $syllabusinfo["csid"] . " and uid=" . $uid);
            $myval = $cnt + $cnt2;
            //      echo $myval;
            $str .= "<table align='left' border='1' style='text-align:center'>\r\n                           \t<tr>\r\n                            \t<td rowspan='2'>ASSESSMENT METHODS</td>\r\n                                        \t<td colspan=" . $myval . " align='center'>\r\n                                            \tOBJECTIVES\r\n                          \t\t          </td>\r\n                            </tr>\r\n                            <tr>";
            for ($i = 1; $i <= $cnt + $cnt2; $i++) {
                $str .= "<td>" . $i . "</td>";
            }
            $str .= "</tr>";
            $sql = 'select camid,camname from cams where csid=' . $syllabusinfo["csid"] . ' and semid=' . $_SESSION["ddlsbssem"] . " and uid=" . $uid;
            $data = ExecuteNonQuery($sql);
            while ($info = mysqli_fetch_assoc($data)) {
                $str .= "\t\r\n                            <tr>\r\n                            \t<td>" . $info['camname'] . "</td>";
                for ($i = 1; $i <= $myval; $i++) {
                    $objnm = 'obj' . $i;
                    $t1 = GetSingleField('select ' . $objnm . ' from fcamm where camid=' . $info['camid'] . ' and csid=' . $syllabusinfo["csid"] . ' and semid=' . $_SESSION['ddlsbssem'] . " and uid=" . $uid, $objnm);
                    $str .= "<td>";
                    if ($t1 == '1') {
                        $str .= 'X';
                    } else {
                        $str .= '';
                    }
                    $str .= "</td>";
                }
                $str .= "</tr>";
            }
            $str .= "<tr>\r\n                                <td>Department-Wide Outcomes</td>";
            $cnot = substr($cno, 0, 1);
            if ($cnot == "C") {
                $data = ExecuteNonQuery('select * from matrix_' . strtolower($version) . " where cno like '" . str_replace(" ", "_", $cno) . "'");
            } else {
                $data = ExecuteNonQuery('select * from matrix_' . strtolower($version) . " where cno like '" . str_replace(" ", "_", $cno) . "'");
            }
            //						  echo mysqli_num_rows($data);
            //					  echo $sql;
            while ($info = mysqli_fetch_assoc($data)) {
                $temp = '';
                if ($info['col0'] == '1') {
                    $temp = 'CIS-1';
                }
                if ($info['col1'] == '1') {
                    if ($temp == '') {
                        $temp = 'CIS-2';
                    } else {
                        $temp .= ',' . 'CIS-2';
                    }
                }
                if ($info['col2'] == '1') {
                    if ($temp == '') {
                        $temp = 'CIS-3';
                    } else {
                        $temp .= ',' . 'CIS-3';
                    }
                }
                if ($info['col3'] == '1' || $info['col4'] == '1' || $info['col5'] == '1' || $info['col6'] == '1' || $info['col7'] == '1') {
                    if ($temp == '') {
                        $temp = 'CIS-4';
                    } else {
                        $temp .= ',' . 'CIS-4';
                    }
                }
                if ($info['col8'] == '1') {
                    if ($temp == '') {
                        $temp = 'CIS-5';
                    } else {
                        $temp .= ',' . 'CIS-5';
                    }
                }
                if ($info['col9'] == '1' || $info['col9'] == '1') {
                    if ($temp == '') {
                        $temp = 'CIS-6';
                    } else {
                        $temp .= ',' . 'CIS-6';
                    }
                }
                $str .= "<td>{$temp}</td>";
            }
            $data = ExecuteNonQuery('select * from fclo where csid=' . $syllabusinfo["csid"] . ' and semid=' . $_SESSION['ddlsbssem'] . " and uid=" . $uid);
            $i = mysqli_num_rows($data);
            while ($info = mysqli_fetch_assoc($data)) {
                $str .= "<td>" . $info['docm'] . "</td>";
            }
            $str .= "\r\n\t\t\t\t\t\t\t</tr> \r\n                           <tr>\r\n                                <td>Program-Specific Outcomes</td>";
            $cnot = substr($cno, 0, 1);
            if ($cnot == "C") {
                $data = ExecuteNonQuery('select * from matrix_' . strtolower($version) . " where cno='" . str_replace(" ", "_", $cno) . "'");
            } else {
                $data = ExecuteNonQuery('select * from gmatrix_' . strtolower($version) . " where cno='" . str_replace(" ", "_", $cno) . "'");
            }
            while ($info = mysqli_fetch_assoc($data)) {
                $temp = '';
                if ($info['col11'] == '1' || $info['col12'] == '1') {
                    if ($temp == '') {
                        $temp = 'CS-1';
                    } else {
                        $temp .= ',' . 'CS-1';
                    }
                }
                if ($info['col13'] == '1' || $info['col14'] == '1') {
                    if ($temp == '') {
                        $temp = 'CS-2';
                    } else {
                        $temp .= ',' . 'CS-2';
                    }
                }
                if ($info['col15'] == '1') {
                    if ($temp == '') {
                        $temp = 'CS-3';
                    } else {
                        $temp .= ',' . 'CS-3';
                    }
                }
                if ($info['col16'] == '1') {
                    if ($temp == '') {
                        $temp = 'CS-4';
                    } else {
                        $temp .= ',' . 'CS-4';
                    }
                }
                if ($info['col17'] == '1') {
                    if ($temp == '') {
                        $temp = 'CS-5';
                    } else {
                        $temp .= ',' . 'CS-5';
                    }
                }
                if ($info['col18'] == '1' || $info['col19'] == '1' || $info['col20'] == '1' || $info['col21'] == '1') {
                    if ($temp == '') {
                        $temp = 'IS-1';
                    } else {
                        $temp .= ',' . 'IS-1';
                    }
                }
                if ($info['col22'] == '1') {
                    if ($temp == '') {
                        $temp = 'IS-2';
                    } else {
                        $temp .= ',' . 'IS-2';
                    }
                }
                if ($info['col23'] == '1' || $info['col24'] == '1') {
                    if ($temp == '') {
                        $temp = 'IS-3';
                    } else {
                        $temp .= ',' . 'IS-3';
                    }
                }
                if ($info['col25'] == '1') {
                    if ($temp == '') {
                        $temp = 'IS-4';
                    } else {
                        $temp .= ',' . 'IS-4';
                    }
                }
                if ($info['col26'] == '1' || $info['col27'] == '1' || $info['col28'] == '1' || $info['col29'] == '1' || $info['col30'] == '1' || $info['col31'] == '1') {
                    if ($temp == '') {
                        $temp = 'SE-1';
                    } else {
                        $temp .= ',' . 'SE-1';
                    }
                }
                if ($info['col32'] == '1') {
                    if ($temp == '') {
                        $temp = 'SE-2';
                    } else {
                        $temp .= ',' . 'SE-2';
                    }
                }
                if ($info['col33'] == '1') {
                    if ($temp == '') {
                        $temp = 'SE-3';
                    } else {
                        $temp .= ',' . 'SE-3';
                    }
                }
                $str .= "<td>{$temp}</td>";
            }
            $data = ExecuteNonQuery('select * from fclo where csid=' . $syllabusinfo["csid"] . ' and semid=' . $_SESSION['ddlsbssem'] . " and uid=" . $uid);
            $i = mysqli_num_rows($data);
            while ($info = mysqli_fetch_assoc($data)) {
                $str .= "<td>" . $info['pocm'] . "</td>";
            }
            $str .= "</tr> \r\n                           </table>\r\n\t                </td>\r\n            </tr>\r\n\t\t\t  <tr>";
            $gp = GetSingleField("select gradingpolicy from section where csid=" . $syllabusinfo["csid"] . " and semid=" . $_SESSION['ddlsbssem'] . " and uid=" . $uid, "gradingpolicy");
            $str .= "      \r\n    \t   \t<td>Grading Policy:</td>\r\n           \t<td style='text-align:center'>";
            if (isset($gp) && $gp != "") {
                $str .= str_replace("<table>", "<table border='1'>", $gp);
            }
            $str .= "\r\n \t                </td>\r\n            </tr>\r\n\t\t\t <tr>\r\n           \r\n            \t<td>Course Policies:</td>\r\n            \t\r\n           \t\t<td>";
            $sql = "select coursepolicy from section where csid=" . $syllabusinfo["csid"] . " and semid=" . $_SESSION['ddlsbssem'] . " and uid=" . $uid;
            $cp = GetSingleField($sql, "coursepolicy");
            $str .= $cp;
            $str .= "</td></tr>\r\n\t\t\t\t\t<tr>\r\n        \t\t    \t<td>Attendance Policies:</td>\r\n\t\t\t\t\t\t<td>";
            $attp = GetSingleField("select attpolicy from section where csid=" . $syllabusinfo["csid"] . " and semid=" . $_SESSION['ddlsbssem'] . " and uid=" . $uid, "attpolicy");
            $str .= $attp;
            $str .= "</td></tr>\r\n\t\t\t\t\t <tr>\r\n            \r\n            \t<td>Academic Integrity:</td>\r\n            \t\r\n           \t\t<td>";
            $ai = GetSingleField("select academicintegrity from section where csid=" . $syllabusinfo["csid"] . " and  semid=" . $_SESSION['ddlsbssem'] . " and uid=" . $uid, "academicintegrity");
            $str .= $ai;
            $str .= "</td></tr>\r\n\t\t\t\t\t<tr>\r\n            \t<td>Course Calendar with Topics:</td>\r\n            \t\r\n           \t\t<td>";
            $cctopics = GetSingleField("select coursetopics from section where csid=" . $syllabusinfo["csid"] . " and  semid=" . $_SESSION['ddlsbssem'] . " and uid=" . $uid, "coursetopics");
            $csnm = GetSingleField("select sections from course_section where csid=" . $syllabusinfo["csid"], "sections");
            $fnm = GetSingleField("select firstname from users where uid=" . $uid, "firstname");
            $lnm = GetSingleField("select lastname from users where uid=" . $uid, "lastname");
            $str .= $cctopics;
            $str .= "</td>\r\n            </tr></table>";
            if (!mkdir("tmpfilesloc", 0777, true)) {
                $sylarr[$sbscnt] = "tmpfilesloc/" . $csnm . "_" . substr($fnm, 0, 1) . substr($lnm, 0, 1) . ".doc";
                $htmltodoc = new HTML_TO_DOC();
                $htmltodoc->createDoc($str, $sylarr[$sbscnt]);
                $sbscnt++;
            }
        }
        if (!mkdir("tmpzips", 0777, true)) {
            //----------------Creating zip
            $file = 'tmpzips/allcourses.zip';
            if (file_exists($file)) {
                unlink($file);
            }
            $result = create_zip($sylarr, 'tmpzips/allcourses.zip');
        }
        // We'll be outputting a PDF
        header('Content-type: application/zip');
        // It will be called downloaded.pdf
        header('Content-Disposition: attachment; filename=allcourses.zip');
        // The PDF source is in original.pdf
        readfile('tmpzips/allcourses.zip');
        //	return $str;
        //	rmdir("tmpfilesloc");
        //-----------------------------
    } else {
    }
}
Exemplo n.º 12
0
 public function save()
 {
     $eqApp = new Apps();
     $getFinfo_q = 'SELECT * FROM cms_records 
                    WHERE 
                    fieldsetid = "' . $_POST['fieldsetid'] . '" 
                    ORDER BY sortorder ASC';
     $getFinfo_r = mysql_query($getFinfo_q);
     $getFinfo_n = mysql_num_rows($getFinfo_r);
     $pnum = 1;
     $checkPosted = 0;
     //START INSERT QUERY BEGINNING WITH USUAL STARTING VALUES
     $query_q = 'UPDATE cms_content SET ';
     //WHILE LOOP FOR ADDING THE DATABASE VALUES
     while ($getFinfo = mysql_fetch_array($getFinfo_r)) {
         switch ($getFinfo['type']) {
             case "file":
                 if (isset($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["name"])) {
                     $fileInput = rand() . $_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["name"];
                     if (!file_exists('../uploads/' . $_POST['id'] . '/')) {
                         mkdir('../uploads/' . $_POST['id'] . '/', 0777);
                     }
                     if (!file_exists('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'])) {
                         mkdir('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'], 0777);
                     } else {
                         foreach (glob('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'] . '/*') as $file) {
                             if (is_dir($file)) {
                                 recursiveRemoveDirectory($file);
                             } else {
                                 unlink($file);
                             }
                         }
                     }
                     move_uploaded_file($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["tmp_name"], '../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'] . '/' . $filename . '.' . $fileext);
                     $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . $fileInput . '" ';
                     $checkPosted++;
                 }
                 break;
             case "photo":
                 if (!empty($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["name"])) {
                     if (!file_exists('../uploads/' . $_POST['id'] . '/')) {
                         mkdir('../uploads/' . $_POST['id'] . '/', 0777);
                     }
                     if (!file_exists('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'])) {
                         mkdir('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'], 0777);
                     } else {
                         foreach (glob('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'] . '/*') as $file) {
                             if (is_dir($file)) {
                                 recursiveRemoveDirectory($file);
                             } else {
                                 unlink($file);
                             }
                         }
                     }
                     $filename = pathinfo($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["name"], PATHINFO_FILENAME);
                     $fileext = strtolower(pathinfo($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["name"], PATHINFO_EXTENSION));
                     $filename = strtolower(rand() . $filename);
                     $img = new abeautifulsite\SimpleImage($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]['tmp_name']);
                     $img->fit_to_width(300)->save('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'] . '/300xauto_' . $filename . '.' . $fileext);
                     $img->save('../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'] . '/' . $filename . '.' . $fileext);
                     move_uploaded_file($_FILES[$_POST['recordset'] . '_' . $getFinfo['db_name']]["tmp_name"], '../uploads/' . $_POST['id'] . '/' . $getFinfo['db_name'] . '/' . $filename . '.' . $fileext);
                     $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . $filename . '.' . $fileext . '" ';
                     $checkPosted++;
                 }
                 break;
             case "html":
                 $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . addslashes(htmlspecialchars($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']])) . '" ';
                 $checkPosted++;
                 break;
             case "yesno":
                 $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . $_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']] . '" ';
                 $checkPosted++;
                 break;
             case "multiselect":
             case "checkboxes":
                 $vals = "";
                 $x = 0;
                 if (isset($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']])) {
                     foreach ($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']] as $key => $value) {
                         $x++;
                         $vals .= $value . ($x < count($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']]) ? "," : "");
                     }
                     $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . $vals . '" ';
                     $checkPosted++;
                 }
                 break;
             case "radio":
                 $vals = "";
                 $x = 0;
                 if (!empty($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']])) {
                     $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . htmlspecialchars($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']]) . '" ';
                     $checkPosted++;
                 }
                 break;
             case "foreignkey":
                 $fkeyOptions = $eqApp->get_field_options($getFinfo['options'], $pnum - 1);
                 if ($fkeyOptions['record_fkeytype'] == "select") {
                     $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . htmlspecialchars($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']]) . '" ';
                     $checkPosted++;
                 } elseif ($fkeyOptions['record_fkeytype'] == "multiselect") {
                     $vals = '';
                     if (isset($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']])) {
                         $d = 0;
                         foreach ($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']] as $key => $value) {
                             $d++;
                             $vals .= htmlspecialchars($value) . ($d < count($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']]) ? "," : "");
                         }
                     }
                     $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . $vals . '" ';
                     $checkPosted++;
                 }
                 break;
             case "custom_url":
                 $custom_url = ltrim(rtrim($getFinfo['custom_url'], '/'), '/');
                 $perma = explode('/', $custom_url);
                 $postedCustomUrl = "";
                 $ddnum = 0;
                 foreach ($perma as $links) {
                     $ddnum++;
                     if (isset($_POST[$links])) {
                         $postedCustomUrl .= $eqApp->permaLink($_POST[$links]) . '/';
                     }
                 }
                 $postedCustomUrl = rtrim($postedCustomUrl, '/');
                 $checkCU_q = 'SELECT * FROM cms_content 
                                     WHERE 
                                     custom_url = "' . $postedCustomUrl . '" 
                                     AND id <> "' . $_POST['id'] . '"';
                 $checkCU_r = mysql_query($checkCU_q);
                 $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . $postedCustomUrl . (mysql_num_rows($checkCU_r) > 0 ? rand() : '') . '" ';
                 $checkPosted++;
                 break;
             default:
                 //for text,textarea,colorpicker,date,select
                 $query_q .= ($pnum > 1 ? ", " : " ") . $getFinfo['db_name'] . '="' . htmlspecialchars($_POST[$_POST['recordset'] . '_' . $getFinfo['db_name']]) . '" ';
                 $checkPosted++;
                 break;
         }
         $pnum++;
     }
     $query_q .= 'WHERE id = "' . $_POST['id'] . '"';
     if ($checkPosted > 0) {
         mysql_query($query_q) or die(mysql_error());
     }
     exit;
 }
Exemplo n.º 13
0
                                    $active_template = $active_template[0]->id;
                                    $queries->update('templates', $active_template, array('enabled' => 0));
                                    // Make new template active
                                    $queries->update('templates', $template_query, array('enabled' => 1));
                                    // Finally, we need to write to cache
                                    $c->setCache('templatecache');
                                    $c->store('template', htmlspecialchars($template_name));
                                    Session::flash('scan_complete', '<div class="alert alert-success">' . $admin_language['template_enabled'] . '</div>');
                                    echo '<script data-cfasync="false">window.location.replace(\'/admin/styles/?type=templates\');</script>';
                                    die;
                                } else {
                                    if (isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['type']) && $_GET['type'] == 'templates') {
                                        // Delete template
                                        $item = $_GET['template'];
                                        require 'core/includes/remove_directories.php';
                                        recursiveRemoveDirectory('styles/templates/' . $item);
                                        // Delete from database
                                        $queries->delete('templates', array('name', '=', $item));
                                        Session::flash('templates', '<div class="alert alert-success">' . $admin_language['template_deleted'] . '</div>');
                                        echo '<script data-cfasync="false">window.location.replace(\'/admin/styles/?type=templates\');</script>';
                                        die;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
// @Email: megaphpdestroyer@gmail.com

if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') die(header('Location: /'));

define("EXEC", true);

require_once ($_SERVER['DOCUMENT_ROOT'] . '/inc/defines.php');

if (!empty($_POST['save'] != '')) {
    $ini = $_SERVER['DOCUMENT_ROOT'] . '/config.ini';
    file_put_contents($ini, $_POST['config']);
	die(json_encode(array('msg' => 'Сохранено')));
}

if (!empty($_POST['reset'] != '')) {
    $replace = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/_config.ini');
	$ini = $_SERVER['DOCUMENT_ROOT'] . '/config.ini';
    file_put_contents($ini, $replace);
	die(json_encode(array('msg' => 'Настройки сброшены')));
}

if (!empty($_POST['remove'] != '')) {
	$folder = $_SERVER['DOCUMENT_ROOT'] . '/storage';
    foreach (glob("{$folder}/*.zip") as $file) {
        if (is_dir($file)) {
            recursiveRemoveDirectory($file);
        } else unlink($file);
    }
	die(json_encode(array('msg' => 'Архивы удалены', 'files' => '0')));
}
?>
Exemplo n.º 15
0
include 'funzioni.php';
include "../mpdf60/mpdf.php";
global $_CONFIG;
$utente = check_login();
if ($utente == -1) {
    die("LOGINPROBLEM");
} else {
    $user_level = get_user_level($utente);
    if ($user_level == 0) {
        die("LOGINPROBLEM");
    }
    if ($user_level == 1) {
        die('LOGINPROBLEM');
    }
    $db = database_connect();
    if (!file_exists('./tmp/registrini')) {
        mkdir('./tmp/registrini', 0777, true);
        chmod("./tmp/registrini", 0777);
    } else {
        recursiveRemoveDirectory("./tmp/registrini");
    }
    for ($i = 1; $i <= $_CONFIG["numero_giorni"] * $_CONFIG["ore_per_giorno"]; $i++) {
        $result = $db->query("SELECT id from lezioni where ora = '{$i}'") or die($db->error);
        while ($idLez = $result->fetch_assoc()) {
            generaRegistroOra($idLez["id"], $i);
        }
    }
    Zip("./tmp/registrini/", "./tmp/registrini.zip");
    echo "SUCCESS";
}
 static function removeFolder($folder) {
     foreach (glob("{$folder}/*") as $file) {
         if (is_dir($file)) {
             recursiveRemoveDirectory($file);
         } else unlink($file);
     } rmdir($folder);
 }