function test_GetSingleField()
 {
     $_SESSION["a_userid"] = 10;
     $dept = GetSingleField("select deptid from users where uid=" . $_SESSION["a_userid"], "deptid");
     $this->assertIsA($dept, 'string');
 }
                                <tr>
                                    <th>Subject Section</th>
                                    <th>Subject Name</th>
                                    <th>Pre-Req</th>
                                    <th>Co-Reqs</th>
                                    <th>Credits</th>
                                </tr>
                                <?php 
    $sql = "SELECT cs.sections,c.coursename,c.credits,c.prereqid,c.coreqid FROM section s,course_section cs,courses c where s.csid=cs.csid and cs.cid=c.cid and s.uid=" . $_POST["ddlfaculty"] . " and s.semid=" . $_POST["ddlsem"];
    $data3 = ExecuteNonQuery($sql);
    while ($info3 = mysqli_fetch_assoc($data3)) {
        if ($info3["prereqid"] != "0") {
            $prereq = GetSingleField("select pcname from pre_req where prereqid=" . $info3["prereqid"], "pcname");
        }
        if ($info3["coreqid"] != "0") {
            $coreq = GetSingleField("select ccname from co_req where coreqid=" . $info3["coreqid"], "ccname");
        }
        ?>
                                    <tr>
                                        <td><?php 
        echo $info3["sections"];
        ?>
</td>
                                        <td><?php 
        echo $info3["coursename"];
        ?>
</td>
                                        <td><?php 
        echo $prereq;
        ?>
</td>
Пример #3
0
    $ext = substr($str, $i + 1, $l);
    return $ext;
}
if (isset($_POST['Submit'])) {
    $errors = array();
    $required_fields = array('imgnm');
    $errors = array_merge($errors, check_required_fields($required_fields, $_POST));
    if (empty($errors)) {
        if (empty($_POST["ddcatid"])) {
            $message = "Please select category";
        } else {
            $inm = $_POST["imgnm"];
            $visible = $_POST["cbvisible"];
            $dispord = $_POST["dispord"];
            $catid = $_POST["ddcatid"];
            $existord = GetSingleField("select disporder from images where imageid=" . $_GET["id"], "disporder");
            //	echo $dispord." " . $existord;
            if (!file_exists($_FILES['photoimage']['tmp_name']) || !is_uploaded_file($_FILES['photoimage']['tmp_name'])) {
                //file not inside
                if ($exitstord != $dispord) {
                    $i = 0;
                    if ($visible == "on") {
                        $i = 1;
                    }
                    $qry = "update images set disporder=" . $existord . " where disporder=" . $dispord;
                    ///	echo $qry."  ";
                    ExecuteNonQuery($qry);
                    $c_date = date("Y-m-d");
                    $qry = "update images set imagename='" . $inm . "',visible=b'" . $i . "',imgcatid=" . $catid . ",modifyip='" . getip() . "',modifydate='" . $c_date . "',disporder=" . $dispord . " where imageid=" . $_GET["id"];
                    //		echo $qry."  ";
                    $cntrec = ExecuteNonQuery($qry);
Пример #4
0
if (!empty($message)) {
    echo "<p class=message>" . $message . "</p>";
} else {
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}
?>
                <?php 
if (!empty($errors)) {
    display_errors1($errors);
}
?>
            </td>
            </tr>
                   <?php 
$dept = GetSingleField("select deptid from users where uid=" . $_SESSION["a_userid"], "deptid");
$deptname = GetSingleField("select deptname from dept where deptid=" . $dept, "deptname");
?>
                <tr>
                	<td>Department</td>
					<td>:</td>
                    <td style="font-weight:bold;"><?php 
echo $deptname;
?>
</td>
                </tr>
         
                <tr>
                	<td>Active</td>
					<td>:</td>
                    <td><input type="checkbox" name="cbxactive" checked>
                    </td>
        if (in_array("F", $cday)) {
            if ($tp == 'lec') {
                $csnm = GetSingleField("select sections from course_section where csid=" . $info["csid"], "sections");
                echo $csnm . "<br>";
            } else {
                echo "Office Hours<br>";
            }
            echo $info["starttime"] . " to " . $info["endtime"];
        }
        ?>
                                    </td>
                                    <td align="center">
                                        <?php 
        if (in_array("S", $cday)) {
            if ($tp == 'lec') {
                $csnm = GetSingleField("select sections from course_section where csid=" . $info["csid"], "sections");
                echo $csnm . "<br>";
            } else {
                echo "Office Hours<br>";
            }
            echo $info["starttime"] . " to " . $info["endtime"];
        }
        ?>
                                    </td>
                                </tr>
                                    <?php 
    }
} else {
    for ($i = 0; $i < 4; $i++) {
        echo "<tr>";
        echo "<td>&nbsp;</td>";
?>
                <?php 
if ($_GET["flag"] == 2) {
    ?>
                <div id="diverror">
                    <img src="images/cross.png" width="25px" height="25px"><?php 
    echo $_GET["msg"];
    ?>
 
                </div>
                <?php 
}
?>
	<div id="viewsubjects">
    		<?php 
$per = GetSingleField('select permission from users where userid=$_POST["permission"]', "permission");
?>
			<form method="post" action="viewsubjects.php">			
			<table border="1">
			<tr>
            <td align="center" style="padding-top:20px;border:none;">
          <b>Select Semester:</b>
            
             <select name="ddlsem">
        	<option value="">Select</option>
           <option value="Summer 2015">Summer 2015</option>
           <option value="Summer 2015">Fall 2015</option>
           <option value="Summer 2015">Spring 2016</option>
           <option value="Summer 2015">Summer 2016</option>
           <option value="Summer 2015">Fall 2016</option>
           
                                $query = "update outcomes_result set obj1=b'" . $res1 . "',obj2=b'" . $res2 . "',obj3=b'" . $res3;
                                $query = $query . "',obj4=b'" . $res4 . "',obj5=b'" . $res5 . "' where ocmresid=" . $ocmresid1;
                                $cnt = ExecuteNonQuery($query);
                            }
                        }
                    }
                    //						$query=substr($query, 0, -1);
                    //			echo $query;
                    if ($cnt > 0) {
                        redirect_to("retrivesurvey.php?msg=Survey updated successfully?flag=1");
                    } else {
                        redirect_to("retrivesurvey.php?msg=Error in updating survey?flag=2");
                    }
                }
            } else {
                $name = GetSingleField("select subname from subject where subid=" . $subid, "subname");
                show_alert("Please enter objective of '" . $name . "\\'");
            }
        } else {
            show_alert("Subject selection same on both side");
        }
    } else {
        show_alert("please select subject from both list");
    }
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Course Assesment Survey</title>
            if (strpos($cnm, " ")) {
                $cnm = str_replace(" ", "_", $cnm);
            }
            $cnm = $cnm . "_" . $_POST["cbx_nu"];
            $cntrec = CountRecords("select sections from course_section where sections='" . $cnm . "'");
            if ($cntrec == 0) {
                $sql = "insert into course_section(sections,active,cid)values('" . $cnm . "',1," . $_POST["ddlcourse"] . ")";
                //			echo $sql;
                ExecuteNonQuery($sql);
            } else {
                $sql = "update course_section set active=1 where sections='" . $cnm . "'";
                //		echo $sql;
                ExecuteNonQuery($sql);
            }
        } else {
            $cnm = GetSingleField("select courseno from courses where cid=" . $_POST["ddlcourse"], "courseno");
            if (strpos($cnm, " ")) {
                $cnm = str_replace(" ", "_", $cnm);
            }
            $cnm = $cnm . "_NU";
            $cntrec = CountRecords("select sections from course_section where sections='" . $cnm . "'");
            if ($cntrec > 0) {
                $sql = "update course_section set active=0 where sections='" . $cnm . "'";
                ExecuteNonQuery($sql);
                $cbx_nu = "";
            }
        }
    }
}
if (!isset($_SESSION["rdbdeg"])) {
    redirect_to("index.php");
Пример #9
0
ob_start();
ini_set('display_errors', 'off');
include_once "includes/connect.php";
require_once "includes/functions.php";
require_once "includes/session.php";
include "includes/DataAccess.php";
include_once "includes/form_functions.php";
include "../fckeditor/fckeditor.php";
if (!logged_in()) {
    redirect_to("index.php");
}
$cnt = CountRecords("select * from insidepage where pagename='" . $_GET["page"] . "'");
if ($cnt == 1) {
    $pnm = GetSingleField("select pageietitle from insidepage where pagename='" . $_GET["page"] . "'", "pageietitle");
    $desc = GetSingleField("select pagedesc from insidepage where pagename='" . $_GET["page"] . "'", "pagedesc");
}
if (isset($_POST["Submit"])) {
    $errors = array();
    $required_fields = array('pagetitle');
    $errors = array_merge($errors, check_required_fields($required_fields, $_POST));
    if (empty($errors)) {
        if ($cnt == 1) {
            $c_date = date("Y-m-d");
            $qry = "update insidepage set pageietitle='" . $_POST["pagetitle"] . "',pagedesc='" . $_POST["editor1"] . "'";
            $qry = $qry . ",modifyip='" . getip() . "',modifydate='" . $c_date . "' where pagename='" . $_GET["page"] . "'";
            //	echo $qry;
            $cntrec = ExecuteNonQuery($qry);
            if ($cntrec == 1) {
                redirect_to("welcome.php?msg=page content updated successfully.&flag=1");
            } else {
    redirect_to("index.php");
}
if (isset($_POST["Submit"])) {
    $i = 0;
    if (isset($_POST["cbxactive"])) {
        ExecuteNonQuery("update semester set active=0");
        $i = 1;
    }
    $crec = CountRecords("select * from semester");
    $currsord = GetSingleField("select sortorder from semester where semid=" . $_GET["id"], "sortorder");
    if ($currsord == $_POST["ddlso"]) {
        $updateold = "update semester set active=" . $i . " where semid=" . $_GET["id"];
        ExecuteNonQuery($updateold);
        //						echo $updateold."<br>";
    } else {
        $stmpid = GetSingleField("select semid from semester where sortorder=" . $_POST["ddlso"], "semid");
        $sql = "update semester set sortorder=" . $currsord . " where semid=" . $stmpid;
        ExecuteNonQuery($sql);
        //	echo $sql."<br>";
        $sql = "update semester set sortorder=" . $_POST["ddlso"] . ",active={$i} where semid=" . $_GET["id"];
        ExecuteNonQuery($sql);
        //				echo $sql;
    }
    redirect_to("viewsemesters.php");
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Edit Semester</title>
         }
     }
     $query = substr($query, 0, -1);
     $cnt = ExecuteNonQuery($query);
     echo $query;
     if ($cnt > 0) {
         redirect_to("editcoursesurvey.php?msg=Survey inserted successfully&flag=1");
     } else {
         redirect_to("editcoursesurvey.php?msg=Error in inserting survey&flag=2");
     }
 } else {
     $data = ExecuteNonQuery('select * from outcomes_main') or die(mysql_error());
     while ($info = mysql_fetch_assoc($data)) {
         $data1 = ExecuteNonQuery('select * from outcomes_detail where ocmmainid=' . $info["ocmmainid"]) or die(mysql_error());
         while ($info1 = mysql_fetch_assoc($data1)) {
             $ocmresid = GetSingleField("select * from outcomes_result where subid=" . $subid . " and ocmdetailid=" . $info1["ocmdetailid"], "ocmresid");
             $myarr = array();
             $temp = "mycb" . $info1["ocmdetailid"];
             for ($i = 0; $i < 5; $i++) {
                 $myarr[$i] = $_POST[$temp][$i];
             }
             //						echo "<table><tr>";
             $res1 = empty($myarr[0]) ? "0" : "1";
             //					echo "<td style=width:20px;text-align:right;>".$res1."</td>";
             $res2 = empty($myarr[1]) ? "0" : "1";
             //				echo "<td style=width:20px;text-align:right;>".$res2."</td>";
             $res3 = empty($myarr[2]) ? "0" : "1";
             //			echo "<td style=width:20px;text-align:right;>".$res3."</td>";
             $res4 = empty($myarr[3]) ? "0" : "1";
             //		echo "<td style=width:20px;text-align:right;>".$res4."</td>";
             $res5 = empty($myarr[4]) ? "0" : "1";
Пример #12
0
         }
     } else {
         if ($_POST["ddlprereq"] != "") {
             $pid = $_POST["ddlprereq"];
         } else {
             $pid = "0";
         }
     }
     if (isset($_POST["txtncoreq"]) && $_POST["txtncoreq"] != "") {
         $ccnt = CountRecords("select * from co_req where ccname like '" . $_POST["txtncoreq"] . "'");
         if ($ccnt > 0) {
             $pid = GetSingleField("select coreqid from co_req where ccname like '" . $_POST["txtncoreq"] . "'", "coreqid");
         } else {
             $sql = "insert into co_req(ccname)values('" . $_POST["txtncoreq"] . "')";
             ExecuteNonQuery($sql);
             $cid = GetSingleField("select max(coreqid) as newid from co_req", "newid");
         }
     } else {
         if ($_POST["ddlcoreq"] != "") {
             $cid = $_POST["ddlcoreq"];
         } else {
             $cid = "0";
         }
     }
     $str = "update courses set courseno='" . $_POST["txtcid"] . "',special='" . $_POST["spCourse"] . "',coursename='" . $_POST["txtcnm"] . "',description='" . $_POST["tadesc"] . "'";
     $str .= ",prereqid=" . $pid . ",coreqid=" . $cid . ",credits=" . $_POST["txtcredits"] . ",active={$i} where cid=" . $_GET["id"];
     ExecuteNonQuery($str);
     //	echo $str;
     redirect_to("viewcourses.php");
 } else {
     if (count($errors) == 1) {
    $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'];
    $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'], "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'], "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'], "coursetopics");
    $str .= $cctopics;
    $str .= "</td>\r\n            </tr></table>";
    $sylarr[$cnt] = "tmpfileloc/" . $syllabusinfo["sectionid"] . ".doc";
    $htmltodoc = new HTML_TO_DOC();
    $htmltodoc->createDoc($str, $sylarr[$cnt]);
    $cnt++;
    echo $str;
}
//----------------Creating zip
/*			$result = create_zip($sylarr,'tmpfileloc/test.zip');
					// We'll be outputting a PDF
					header('Content-type: application/zip');
					// It will be called downloaded.pdf
					header('Content-Disposition: attachment; filename=test.zip');
					// The PDF source is in original.pdf
    $obj3 = $_POST["objective3"];
    $obj4 = $_POST["objective4"];
    $obj5 = $_POST["objective5"];
    $cnt = CountRecords("select * from objectives where subid=" . $_GET["subid"]);
    if ($cnt == 0) {
        $query = "insert into objectives(subid,obj1,obj2,obj3,obj4,obj5)values(";
        $query .= $_GET["subid"] . ",'" . $obj1 . "','" . $obj2 . "','" . $obj3 . "','" . $obj4 . "','" . $obj5 . "')";
        $cnt1 = ExecuteNonQuery($query);
        echo $query;
        if ($cnt1 == 1) {
            redirect_to("viewsubjects.php?msg=Record inserted successfully.&flag=1");
        } else {
            redirect_to("viewsubjects.php?msg=Error in inserting record..Please try later.&flag=2");
        }
    } else {
        $getid = GetSingleField("select objid from objectives where subid=" . $_GET["subid"], "objid");
        $query = "update objectives set obj1='" . $obj1 . "',obj2='" . $obj2 . "',obj3='" . $obj3 . "',obj4='" . $obj4 . "',";
        $query .= "obj5='" . $obj5 . "' where objid=" . $getid;
        $cnt1 = ExecuteNonQuery($query);
        //	echo $query;
        if ($cnt1 == 1) {
            redirect_to("viewsubjects.php?msg=Record updated successfully.&flag=1");
        } else {
            redirect_to("viewsubjects.php?msg=Error in updating record..Please try later.&flag=2");
        }
    }
}
?>

<!doctype html>
<html>
    if ($_GET["flag"] == "0") {
        $cnt = CountRecords("select filename from fileinfo where ftype='matrix'");
    } else {
        redirect_to("index.php");
    }
}
if ($_GET["flag"] == "1") {
    if ($cnt != 0) {
        $currentver = GetSingleField("select version from fileinfo where ftype='gmatrix' and active=1", "version");
    } else {
        $currentver = "No Active Version";
    }
} else {
    if ($_GET["flag"] == "0") {
        if ($cnt != 0) {
            $currentver = GetSingleField("select version from fileinfo where ftype='matrix' active=1", "version");
        } else {
            $currentver = "No Active version";
        }
    } else {
        redirect_to("index.php");
    }
}
$ver = $cnt + 1;
$ver = "V" . $ver;
?>
            <td><input type="checkbox" name="chkver" <?php 
if ($cnt == 0) {
    echo "checked disabled";
}
?>
			<?php 
if (!empty($errors)) {
    display_errors1($errors);
}
?>


            </td>
            </tr>
               
                <tr>
                	<td  width="60px">Select Faculty</td>
					<td  width="10px">:</td>
                    <td>
        <?php 
$dept = GetSingleField("select deptid from users where uid=" . $_SESSION["a_userid"], "deptid");
$data = ExecuteNonQuery('select uid,firstname,lastname from users where deptid=' . $dept);
?>
           <select name="ddlfac" onChange="document.form1.submit();">
          <?php 
while ($info = mysqli_fetch_assoc($data)) {
    ?>
				<option value="<?php 
    echo $info["uid"];
    ?>
" <?php 
    if ($_POST["ddlfac"] == $info["uid"]) {
        echo "selected";
    }
    ?>
><?php 
     $cntrec = CountRecords("select * from co_req where ccname='" . trim($info1["corequisite"]) . "'");
     if ($cntrec == 0) {
         $str = "insert into co_req(ccname)values('" . trim($info1["corequisite"]) . "')";
         $cnt = ExecuteNonQuery($str);
         if ($cnt == 1) {
             $coid = mysqli_insert_id();
         }
     } else {
         $sql = "select coreqid from co_req where ccname='" . trim($info1["corequisite"]) . "'";
         //	echo $sql."<br>";
         $coid = GetSingleField($sql, "coreqid");
     }
 }
 $cnt = CountRecords("select * from courses where courseno='" . $info1["courseid"] . "'");
 if ($cnt > 0) {
     $cid = GetSingleField("select cid from courses where courseno='" . $info1["courseid"] . "'", "cid");
     //		$tmparray[$i][0]=$info1["courseid"];
     //	$tmparray[$i][1]=$info1["coursename"];
     //	$i++;
     $str = "update courses set courseno='" . $info1["courseid"] . "',coursename='" . $info1["coursename"] . "',description='" . str_replace("'", "\\'", $info1["coursedesc"]) . "',prereqid={$preid},coreqid={$coid},credits=" . $info1["credits"] . ",set active=1, set deptid=1 where cid=" . $cid;
     //echo $str."<br>";
     ExecuteNonQuery($str);
     $str1 = "update catelog_temp set approve=1 where id=" . $info1["id"];
     //	echo $str1."<br>";
     ExecuteNonQuery($str1);
 } else {
     $str = "insert into courses(courseno,coursename,description,prereqid,coreqid,credits,active,deptid)values('";
     $str .= $info1["courseid"] . "','" . $info1["coursename"] . "','" . str_replace("'", "\\'", $info1["coursedesc"]) . "',{$preid},{$coid}," . $info1["credits"] . ",1,1)";
     //	echo $str."<br>";
     ExecuteNonQuery($str);
     $str1 = "update catelog_temp set approve=1 where id=" . $info1["id"];
Пример #18
0
                <div id="diverror">
                    <img src="images/cross.png" width="25px" height="25px"><?php 
    echo $_GET["msg"];
    ?>
                </div>
                <?php 
}
?>

                  <div id="addbannerdiv">
                  <br><br>
                </div>
           	<div id="contentdetail">
              <?php 
$snm = GetSingleField("select semname from semester where active=1", "semname");
$year = GetSingleField("select year from semester where active=1", "year");
?>
					    Current Semester: <b><?php 
echo $snm . " " . $year;
?>
				</div>
              
        	
      </div>
    </div>
</div>
<div id="footer">
	<div id="footernav">
	<?php 
include "footer.html";
?>
    ?>
				
                <tr>
               		<td ><?php 
    echo "<b>" . $fnm . " " . $lnm . "</b>";
    ?>
</td>
               <?php 
    $data1 = ExecuteNonQuery('select * FROM section where semid=' . $_SESSION["statusincsem"] . " and uid=" . $info["uid"] . " and active=1");
    while ($info1 = mysqli_fetch_assoc($data1)) {
        $section = GetSingleField("select sections from course_section where csid=" . $info1["csid"], "sections");
        $cntrecords = CountRecords("select * from fcamm where csid=" . $info1["csid"] . " and semid=" . $_SESSION["statusincsem"] . " and uid=" . $info["uid"]);
        if ($cntrecords > 0) {
            $sql = "SELECT SUM(obj1) + SUM(obj2) + SUM(obj3)+ SUM(obj4)+ SUM(obj5)+ SUM(obj6)+ SUM(obj7)+ SUM(obj8)+ SUM(obj9)+ SUM(obj10) as 'Total'\r\nFROM fcamm where csid=" . $info1["csid"] . " and semid=" . $_SESSION["statusincsem"] . " and uid=" . $info["uid"];
            //echo $sql;
            $sfld = GetSingleField($sql, "Total");
            if ($sfld != 0) {
                $cntrecords = 1;
            } else {
                $cntrecords = 0;
            }
        } else {
            $cntrecords = 0;
        }
        ?>
               <tr>
                   <td>&nbsp;</td>
            	    <td><?php 
        echo $section;
        ?>
</td>
                                        // Replace the <textarea id="editor1"> with a CKEditor
                                        // instance, using default configuration.
                                        CKEDITOR.config.toolbar_MA = [['Source', '-', 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo', 'RemoveFormat', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Table', 'HorizontalRule', 'SpecialChar'], '/', ['Format', 'Templates', 'Bold', 'Italic', 'Underline', '-', 'Superscript', '-', ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent']];
                                        CKEDITOR.replace('taai',
                                                {toolbar: 'MA'}
                                        );
                                    </script>
                                </td>
                            </tr>
                            <tr>
                                <td>Course Calendar with Topics</td>
                                <td>:</td>
                                <td>
<?php 
if (isset($_POST["ddlcnm"])) {
    $cctopics = GetSingleField("select coursetopics from section where csid=" . $_POST["ddlcnm"] . " and uid=" . $_SESSION["userid"] . " and semid=" . $_SESSION["ddlsem3"], "coursetopics");
}
?>
                                    <textarea name="tacc" id="tacc" rows="10" cols="50">
                                    <?php 
if (isset($cctopics) && $cctopics != "") {
    echo $cctopics;
}
?>
    
                                    </textarea>
                                    <script>
                                        // Replace the <textarea id="editor1"> with a CKEditor
                                        // instance, using default configuration.
                                        CKEDITOR.config.toolbar_MA = [['Source', '-', 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo', 'RemoveFormat', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Table', 'HorizontalRule', 'SpecialChar'], '/', ['Format', 'Templates', 'Bold', 'Italic', 'Underline', '-', 'Superscript', '-', ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent']];
                                        CKEDITOR.replace('tacc',
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 {
    }
}
 </td>
                                    <td><?php 
    echo $info["email"];
    ?>
 </td>
                                    <td><?php 
    echo $info["office"];
    ?>
 </td>
                                    <td><?php 
    echo $info["officeno"];
    ?>
 </td>
                                    <td>
                                        <?php 
    $semid = GetSingleField("select semid from semester where active=1", "semid");
    $data1 = ExecuteNonQuery("select cday,starttime,endtime from facultyhours where uid=" . $info["uid"] . " and semid=" . $semid . " and type='office'");
    while ($info1 = mysqli_fetch_assoc($data1)) {
        echo $info1["cday"] . " " . $info1["starttime"] . ":" . $info1["endtime"] . "<br>";
    }
    ?>
                                    </td>
                                </tr>
                            <?php 
}
?>
                        </table>
                    </form>
                </div>
            </div>
            <div id="footer">
Пример #23
0
?>

<?php 
if (isset($_POST["submit"])) {
    $errors = array();
    $required_fields = array('username', 'password');
    $errors = array_merge($errors, check_required_fields($required_fields, $_POST));
    if (empty($errors)) {
        $unm = $_POST["username"];
        $pwd = $_POST["password"];
        $cnt = CountRecords("select * from users where username='******' and password='******' and permission=1");
        //	echo ".............".$usrid."asdas ".$permission;
        if ($cnt > 0) {
            $usrid = GetSingleField("select uid from users where username='******' and password='******'", "uid");
            $permission = GetSingleField("select permission from users where username='******' and password='******'", "permission");
            $activefld = GetSingleField("select active from users where username='******' and password='******'", "active");
            if ($activefld == "1") {
                $_SESSION["a_username"] = $unm;
                $_SESSION["a_userid"] = $usrid;
                $_SESSION["a_usrpermission"] = $permission;
                redirect_to('welcome.php');
            } else {
                $message = "You are not active user..Please contact administrator";
            }
        } else {
            $message = "Username or password is incorrect...";
        }
    } else {
        if (count($errors) == 1) {
            $message = "There was 1 error in the form.";
        } else {
    $tmp = strpos($matrixfields[0][$i], ")");
    $tmp1 = substr($matrixfields[0][$i], 0, $tmp + 1);
    $strqry .= "('" . $matrixfields[0][$i] . "','" . str_replace(")", "\\)", $tmp1) . "','{$ver}'),";
}
$strqry = substr($strqry, 0, strlen($strqry) - 1);
//echo $strqry."<br><br>";
ExecuteNonQuery($strqry);
//--------------------------------------------------------UPLOAD SUB OUTCOMES---------------------------------------------------------------------
$strqry = "insert into sub_outcomes(docmid,socmname,version)values";
//	echo "<tr><th>Course Outcomes</th></tr>";
for ($i = 2; $i < $cols - 1; $i++) {
    //	echo "<tr>";
    //	echo "<td>".$matrixfields[$i][1]."</td>";
    //		echo "</tr>";
    //		echo $matrixfields[0][$i];
    $id = GetSingleField("select docmid from dept_outcomes where docname='" . $matrixfields[0][$i] . "'", "docmid");
    $strqry .= "(" . $id . ",'" . str_replace(")", "\\)", $matrixfields[1][$i]) . "','{$ver}'),";
}
$strqry = substr($strqry, 0, strlen($strqry) - 1);
//	echo $strqry."<br><br>";
ExecuteNonQuery($strqry);
//-----------------------------------------------------UPLOAD MAPPINGS------------------------------------------------------------------------------
$flag = 0;
$tnm = "matrix_{$ver}";
$strqry = "create table {$tnm}(";
$strcols = "";
for ($i = 0; $i < $cols - 3; $i++) {
    $strcols .= "col{$i} int,";
}
$strqry = $strqry . $strcols . "requiredcol text,cno text,objno int,version text)";
//	echo $strqry."<br><br>";
 $cday = $matrixfields[$i][14];
 $rno = $matrixfields[$i][15] . $matrixfields[$i][16];
 $sid = $_SESSION["ddlcssem"];
 $tmp1 = explode(" ", $matrixfields[$i][5]);
 if (count($tmp1) != 3) {
     $namelist[$nmcnt] = $matrixfields[$i][0];
     $nmcnt++;
     continue;
 }
 //				print_r($tmp1);
 $sql = "select * from users where salutation like '" . $tmp1[0] . "' and firstname like '" . $tmp1[1] . "%' and lastname like '" . $tmp1[2] . "'";
 //echo $sql."<br>";
 $cnt2 = CountRecords($sql);
 if ($cnt2 != 0) {
     $sql = "select uid from users where salutation like '" . $tmp1[0] . "' and firstname like '" . $tmp1[1] . "%' and lastname like '" . $tmp1[2] . "'";
     $uid = GetSingleField($sql, "uid");
     $cntrec3 = CountRecords("select * from facultyhours where semid=" . $sid . " and uid=" . $uid . " and csid=" . $csid);
     if ($cntrec3 == 0) {
         $sql = "insert into facultyhours(csid,starttime,endtime,type,cday,roomno,uid,semid)values(";
         $sql .= "{$csid},'{$sttime}','{$entime}','{$type}','{$cday}','{$rno}',{$uid},{$sid})";
         ExecuteNonQuery($sql);
         //	echo $sql;
         $sql = "select camname from cams where csid={$csid} and uid={$uid} and semid={$sid}";
         $cnt = CountRecords($sql);
         if ($cnt == 0) {
             $sql1 = "insert into cams(camname,camdetails,csid,uid,semid)values('Assignments:','Students will periodically be assigned homework assignments related to software design principles, patterns and architecture, Due dates will be announced in class.',{$csid},{$uid},{$sid}),\r\n\t\t\t\t\t\t\t('Examinations/Quizzes:','Students will periodically take in-class examinations covering knowledge and application of software design principles,design patterns,architecture and related topics from the assigned readings,course notes,and homework.',{$csid},{$uid},{$sid}),\r\n\t\t\t\t\t\t\t('Project:','The project shall be staffed by individual student who will indentify design patterns/architecture present in open source software. Recommendation for areas of improvement using design patterns with rationale and implementation can be parts of the project.',{$csid},{$uid},{$sid})";
             ExecuteNonQuery($sql1);
             //	echo $sql1;
         }
     } else {
         $sql = "update facultyhours set starttime='" . $sttime . "',endtime='" . $entime . "',type='" . $type . "',cday='" . $cday . "',roomno='" . $rno . "' where csid=" . $csid . " and uid=" . $uid . " and semid=" . $sid;
Пример #26
0
        ?>
" value="<?php 
        echo $info["pocm"];
        ?>
"></td>
                                                    <?php 
    }
}
?>
                                        </tr> 
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <?php 
$gp = GetSingleField("select gradingpolicy from section where csid=" . $_SESSION["mapcsid"] . " and uid=" . $_SESSION["userid"] . " and semid=" . $_SESSION["ddlsem3"], "gradingpolicy");
?>
                                <td>Grading Policy</td>
                                <td>:</td>
                                <td>
                                    <textarea name="tagp" id="tagp" rows="10" cols="50">
                                        <?php 
if (isset($gp) && $gp != "") {
    echo $gp;
} else {
    ?>
                        	<table>
                            <tr>
                            <td style="vertical-align:top;">
                                <table border="1">
                                    <tr>
Пример #27
0
        $cid = GetSingleField("select coreqid from courses where cid=(select cid from course_section where csid=" . $info2["csid"] . ")", "coreqid");
        $cdesc = GetSingleField("select description from courses where cid=(select cid from course_section where csid=" . $info2["csid"] . ")", "description");
        $prnm = GetSingleField("select pcname from pre_req where prereqid=" . $pid, "pcname");
        $crnm = GetSingleField("select ccname from co_req where coreqid=" . $cid, "ccname");
        $credits = GetSingleField("select credits from courses where cid=(select cid from course_section where csid=" . $info2["csid"] . ")", "credits");
        $csnm = GetSingleField("select sections from course_section where csid=" . $info2["csid"], "sections");
        $cnm = $info2["name"];
        $reqm = $info2["reqmaterials"];
        $sal = GetSingleField("select salutation from users where uid=" . $info2["uid"], "salutation");
        $fnm = GetSingleField("select firstname from users where uid=" . $info2["uid"], "firstname");
        $lnm = GetSingleField("select lastname from users where uid=" . $info2["uid"], "lastname");
        $email = GetSingleField("select email from users where uid=" . $info2["uid"], "email");
        $rno = GetSingleField("select roomno from facultyhours where csid=" . $info2["csid"], "roomno");
        $cday = GetSingleField("select cday from facultyhours where csid=" . $info2["csid"], "cday");
        $sttime = GetSingleField("select starttime from facultyhours where csid=" . $info2["csid"], "starttime");
        $entime = GetSingleField("select endtime from facultyhours where csid=" . $info2["csid"], "endtime");
        $web = $info2["website"];
        $gp = $info2["gradingpolicy"];
        $cp = $info2["coursepolicy"];
        $ap = $info2["attpolicy"];
        $ai = $info2["academicintegrity"];
        $ct = $info2["coursetopics"];
    }
    ?>
     	<h2 class="wow fadeIn">Select Course</h2>  
		<div id="courseinfo">
        <div class="content-row wow fadeIn">   
			<div class="content-column">
				Course Name
			</div>
			<div class="content-column">