require '../inc/classes/Helpers.php';
// page vars
$page_title = "";
$id = $_REQUEST['id'];
// id required
if ($id == "") {
    header("Location:mainpage.php");
    exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
    header("Location:patent_list.php?cat=" . $_REQUEST['cat']);
    exit;
}
if ($_POST['commit'] == "Delete Patent") {
    $objPatent = new Patent();
    $objPatent->Delete($id);
    header("Location:patent_list.php?cat=" . $_REQUEST['cat']);
    exit;
}
$objPatent = new Patent($id);
include "includes/pagetemplate.php";
function PageContent()
{
    global $objPatent;
    global $id;
    ?>

            <div class="layout laymidwidth">

                <?php 
示例#2
0
			    <a class="slider-prev col-sm-6" href="#carousel-equipment" role="button" data-slide="prev">
			     	<img src="assets/img/arrow-toggle.png" alt="arrow">
			    </a>
			    <a class="slider-next col-sm-6" href="#carousel-equipment" role="button" data-slide="next">
			    	 <img src="assets/img/arrow-toggle.png" alt="arrow">
			    </a>
		    </div>
		</div>
		<div class="tab-2" style="<?php 
echo $tab2_style;
?>
">
			<div id="carousel-ip" class="equipment-menu-items carousel slide" data-ride="carousel">
			 	<div class="carousel-inner" role="listbox">
			 	    <?php 
$objPatent = new Patent();
$oPatent = $objPatent->GetAllPatentByCategoryId($cat_id);
$cClass = ' active';
foreach ($oPatent as $patent) {
    echo '<div class="item' . $cClass . '">' . PHP_EOL;
    echo '	<img src="/' . $objPatent->GetPath() . $patent->PatentImageUrl . '" alt="">' . PHP_EOL;
    echo '<div style="text-align: left;">' . PHP_EOL;
    echo '	<h6 class="tech-label">Title:</h6>' . PHP_EOL;
    echo '	<h2 class="tech-name">' . $patent->PatentName . '</h2>' . PHP_EOL;
    echo '	<h6 class="tech-label">Abstract:</h6>' . PHP_EOL;
    echo '	<p class="tech-description">' . $patent->PatentAbstract . '</p>' . PHP_EOL;
    echo '	<h6 class="tech-label">Probable Assignee:</h6>' . PHP_EOL;
    echo '	<p class="tech-description">' . $patent->PatentProbableAssignee . '</p>' . PHP_EOL;
    echo '	<h6 class="tech-label">Assignee(s):(std):</h6>' . PHP_EOL;
    echo '	<p class="tech-description">' . $patent->PatentAssigneesStd . '</p>' . PHP_EOL;
    echo '	<h6 class="tech-label">Assignee(s):</h6>' . PHP_EOL;
示例#3
0
function PageContent()
{
    ?>
    
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                // fix to preserve width of cells
                var fixHelper = function(e, ui) {
                    ui.children().each(function() {
                        $(this).width($(this).width());
                    });
                    return ui;
                };
                var saveIndex = function(e, ui) {
                    //alert("New position: " + ui.item.index());
                    //alert("Image Id: " + ui.item.attr("id"));
                    id = ui.item.attr("id").replace("img_", "");
                    $.ajax({
                        url: 'patent_list.php',
                        data: {
                            dragsort: 1,
                            idx: ui.item.index(),
                            id: id
                        },
                        type: 'POST',
                        dataType: 'html',
                        success: function (data) {
                            //alert("done");
                        },
                        error: function (xhr, status) {
                            alert('Sorry, there was a problem!');
                        }
                    });
                }; // end saveIndex
    
                $("#list_table tbody").sortable({
                    helper: fixHelper,
                    stop: saveIndex
                }).disableSelection();
    
            }); // end document.ready
        </script>
        <style>
            .icon-resize-vertical:hover {
                cursor:grab;
            }
        </style>        
    
            <div class="layout center-flex">

                <?php 
    $aLabels = array();
    $aLinks = array();
    $aLabels[0] = 'Home';
    $aLinks[0] = 'mainpage.php';
    $aLabels[1] = 'Category List';
    $aLinks[1] = 'category_list.php';
    $aLabels[2] = 'Patents';
    $aLinks[2] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading">Patents</p>
                    <a href="patent_admin.php?cat=<?php 
    echo $_REQUEST['cat'];
    ?>
" class="button_link"><button class="">Add New Patent</button></a>
                </div>
            </div>
    
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Patent Name</th>
                            <th>Image</th>
                            <th class="mid">Order</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objPatent = new Patent();
    $oPatent = $objPatent->GetAllPatentByCategoryId($_REQUEST['cat']);
    foreach ($oPatent as $patent) {
        echo '<tr id="img_' . $patent->Id . '">' . PHP_EOL;
        echo '<td>' . $patent->Id . '</td>' . PHP_EOL;
        echo '<td>' . $patent->PatentName . '</td>' . PHP_EOL;
        echo '<td>';
        if ($patent->PatentImageUrl != '') {
            echo '<img src="/' . $objPatent->GetPath() . $patent->PatentImageUrl . '" style="width:80px;">';
        }
        echo '</td>' . PHP_EOL;
        echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL;
        echo '<td class="mid"><a href="patent_admin.php?cat=' . $_REQUEST['cat'] . '&id=' . $patent->Id . '"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="patent_delete.php?cat=' . $_REQUEST['cat'] . '&id=' . $patent->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
        $obj = new Patent();
        $obj->CategoryId = $_REQUEST["cat"];
        $obj->PatentName = $_REQUEST["patent_name"];
        $obj->PatentAbstract = $_REQUEST["patent_abstract"];
        $obj->PatentProbableAssignee = $_REQUEST["patent_probable_assignee"];
        $obj->PatentAssigneesStd = $_REQUEST["patent_assignees_std"];
        $obj->PatentAssignees = $_REQUEST["patent_assignees"];
        $obj->create();
        $obj->handleFileUploads();
        $obj->handleDropFileUploads($aDropFields[0], 'PatentImageUrl');
        // redirect to listing list
        header("Location:patent_list.php?cat=" . $_REQUEST['cat']);
        exit;
    } else {
        // update
        $obj = new Patent($_REQUEST["id"]);
        $obj->PatentName = $_REQUEST["patent_name"];
        $obj->PatentAbstract = $_REQUEST["patent_abstract"];
        $obj->PatentProbableAssignee = $_REQUEST["patent_probable_assignee"];
        $obj->PatentAssigneesStd = $_REQUEST["patent_assignees_std"];
        $obj->PatentAssignees = $_REQUEST["patent_assignees"];
        $obj->update();
        $obj->handleFileUploads();
        $obj->handleDropFileUploads($aDropFields[0], 'PatentImageUrl');
        // redirect to listing list
        header("Location:patent_list.php?cat=" . $_REQUEST['cat']);
        exit;
    }
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing