//Fetches header template $strMetatag = $hldGlobal->fnGetMetatag(); //Fetches Metatag template $strFooter = $hldGlobal->fnGetFooter(); //Fetches footer template $strLeftMenu = $hldGlobal->fnGetLMenu(); //Fetches left menu template $hdlTpl->setVariable("metatag", $strMetatag); //Assigns Metatag $hdlTpl->setVariable("header", $strHeader); //Assigns Header $hdlTpl->setVariable("footer", $strFooter); //Assigns footer $hdlTpl->setVariable("leftmenu", $strLeftMenu); //Assigns left menu $strCourse = $hldGlobal->fnGetCource($_POST["course_id"]); $hdlTpl->setVariable("coptval", $strCourse); //Assigns option $arrQuizzes1 = $hldGlobal->fnFetchQuizzes(0, $_POST["course_id"]); $arrQuizzes = $hldGlobal->fnGetPagerArr($arrQuizzes1); if (is_array($arrQuizzes) && count($arrQuizzes) > 0) { foreach ($arrQuizzes as $key => $value) { if (is_numeric($key)) { if ($value["isactive"]) { $intstatus = 0; $hdlTpl->setVariable("status", "Active"); //Assigns status } else { $intstatus = 1; $hdlTpl->setVariable("status", "In Active"); //Assigns status
} //Creates object for global class file $hldGlobal = new clsGlobal($hdlDb); //Creates the object for sigma template. $hdlTpl =& new HTML_Template_Sigma(DIR_ADMIN_TEMPLATE, DIR_ADMIN_TEMPLATE . "/prepared"); //Loads the template from template folder $hdlTpl->loadTemplateFile("addmodule.htm", TRUE, TRUE); $strHeader = $hldGlobal->fnGetHeader(); //Fetches header template $strMetatag = $hldGlobal->fnGetMetatag(); //Fetches Metatag template $strFooter = $hldGlobal->fnGetFooter(); //Fetches footer template $strLeftMenu = $hldGlobal->fnGetLMenu(); //Fetches left menu template $strOption = $hldGlobal->fnGetCource($_POST["course_id"]); //Fetches options $hdlTpl->setVariable("metatag", $strMetatag); //Assigns Metatag $hdlTpl->setVariable("header", $strHeader); //Assigns Header $hdlTpl->setVariable("footer", $strFooter); //Assigns footer $hdlTpl->setVariable("leftmenu", $strLeftMenu); //Assigns left menu if ($_POST["submit"] == "Add Module") { $strErrormessage = ""; $intError = 1; if (trim($_POST["course_id"]) == "--") { $strErrormessage .= "Please select cources name.<br>"; $intError = 0;
if (is_dir("../presenterFiles/{$fname}") && $fname != "") { $cmd = 'mv "../presenterFiles/' . $fname . '" "../presenterFiles/' . $strPathName . '"'; @exec($cmd, $output, $return_val); } else { @mkdir("../presenterFiles/{$strPathName}", 0777); } $return = $_GET["return"]; header("Location:message.php?mess=6&return={$return}"); } } if (!$intError) { $hdlTpl->setVariable("error_message", $strErrormessage); //Assigns values } $arrModule = $hldGlobal->fnFetchModule($_GET["id"]); $strOption = $hldGlobal->fnGetCource($arrModule[0]["course_id"]); //Fetches options $hdlTpl->setVariable("option", $strOption); //Assigns option if (is_array($arrPage) && count($arrPage) > 0) { $strOpt = ""; foreach ($arrPage as $key => $value) { if ($arrModule[0]["page_name"] == $key) { $strSel = "selected='selected'"; } else { $strSel = ""; } $strOpt .= "<option value='" . $key . "' " . $strSel . ">" . $value . "</option>"; } $hdlTpl->setVariable("optpagename", $strOpt); //Assigns option