示例#1
0
    $targetpage = "viewNotes.php";
    $selectCategoryData = $pagination->selectAll($tbl_name);
    if (isset($_REQUEST['page'])) {
        if ($_REQUEST['page'] > 1) {
            $sr = $_REQUEST['page'] * LIMIT;
            $sr = $sr - LIMIT + 1;
        } else {
            $sr = 1;
        }
    } else {
        $sr = 1;
    }
    if ($selectCategoryData) {
        foreach ($selectCategoryData as $category) {
            $seletedCategoryid = "";
            $notesCategoryDesc = $selectCategory->getNotesCategoryDataByCategoryId($category->notesCategoryId);
            $parent = $notesCategoryDesc->parentId;
            $title = $notesCategoryDesc->CategoryName;
            $category_id = $notesCategoryDesc->notesCategoryId;
            $ele = "span";
            $dropDown = $selectCategory->genrateNotesCategory($category_id, $title, $parent, $seletedCategoryid, $ele);
            ?>
                      <tr>
                        <td><?php 
            echo $sr++;
            ?>
 </td>
                        <td><?php 
            echo $dropDown;
            ?>
</td>
<?php

if (isset($_POST['addNotesCategory'])) {
    try {
        if (isset($_POST['categoryName'])) {
            $categoryInfo = new dataInfo();
            $matchNotesCategory = false;
            $notesCategoryId = "";
            $categoryData = new stdClass();
            if (isset($_POST['parentCategory'])) {
                $categoryData->parentCategory = $_POST['parentCategory'];
                $notesCategoryData = $categoryInfo->getNotesCategoryDataByCategoryId($_POST['parentCategory']);
                $getParentCategory = $notesCategoryData->parentId;
            } else {
                $categoryData->parentCategory = 0;
            }
            $categoryData->categoryName = $_POST['categoryName'];
            $categoryData->categoryDescription = $_POST['categoryDescription'];
            $categoryData->seoTitle = $_POST['seoTitle'];
            $categoryData->examDate = $_POST['examDate'];
            $categoryData->metaTag = $_POST['metaTag'];
            $categoryData->keyWord = $_POST['keyWord'];
            $categoryData->sort_order = $_POST['sort_order'];
            $categoryData->status = $_POST['status'];
            if (isset($_POST['notesCategoryId'])) {
                if ($getParentCategory == $_POST['notesCategoryId']) {
                    echo $getParentCategory . "_" . $_POST['notesCategoryId'];
                    $matchNotesCategory = true;
                }
                $categoryData->notesCategoryId = $_POST['notesCategoryId'];
                $categoryData->state = 2;