Ejemplo n.º 1
0
function PageContent()
{
    global $objSound;
    ?>
    
        <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: 'soundtest_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] = 'Sound';
    $aLinks[2] = 'sound_list.php&cat=' . $_REQUEST['cat'];
    $aLabels[3] = 'Sound Test List';
    $aList[3] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading">Sound Tests</p>
                    <a href="soundtest_admin.php?cat=<?php 
    echo $_REQUEST['cat'];
    ?>
&sound=<?php 
    echo $objSound->Id;
    ?>
" class="button_link"><button class="">Add New Sound Test</button></a>
                </div>
            </div>
    
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Image 1</th>
                            <th>Image 2</th>
                            <th>Image 3</th>
                            <th class="mid">Order</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objSoundTest = new SoundTest();
    $oSoundTest = $objSoundTest->getAllSoundTestBySoundId($objSound->Id);
    foreach ($oSoundTest as $soundtest) {
        echo '<tr id="img_' . $soundtest->Id . '">' . PHP_EOL;
        echo '<td>' . $soundtest->Id . '</td>' . PHP_EOL;
        echo '<td><img src="/' . $objSoundTest->GetPath() . $soundtest->ImageUrl1 . '" style="max-width: 200px;" /></td>' . PHP_EOL;
        echo '<td><img src="/' . $objSoundTest->GetPath() . $soundtest->ImageUrl2 . '" style="max-width: 200px;" /></td>' . PHP_EOL;
        echo '<td><img src="/' . $objSoundTest->GetPath() . $soundtest->ImageUrl3 . '" style="max-width: 200px;" /></td>' . PHP_EOL;
        echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL;
        echo '<td class="mid"><a href="soundtest_admin.php?cat=' . $_REQUEST['cat'] . '&sound=' . $_REQUEST['sound'] . '&id=' . $soundtest->Id . '"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="soundtest_delete.php?cat=' . $_REQUEST['cat'] . '&sound=' . $_REQUEST['sound'] . '&id=' . $soundtest->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
Ejemplo n.º 2
0
		   		 </div>
				<p class="tech-description"><?php 
echo $oSound[0]->OverviewText;
?>
</p>
			</div>
			<?php 
$iCnt = 0;
foreach ($oSoundTest as $soundtest) {
    $iCnt++;
    echo '<div class="test-' . $iCnt . '">' . PHP_EOL;
    echo '    <p class="tech-description">' . $soundtest->SoundTestDescription . '</p>' . PHP_EOL;
    echo '    <div class="pods">' . PHP_EOL;
    echo '    	<div class="pod" id="audio_test1">' . PHP_EOL;
    echo '    		<img class="pod-x" src="assets/img/modalx.png" alt="x">' . PHP_EOL;
    echo '    		<img src="/' . $objSoundTest->GetPath() . $soundtest->ImageUrl1 . '" alt="65db">' . PHP_EOL;
    echo '          <audio id="audio_testfile1"><source src="/' . $objSoundTest->GetPath() . $soundtest->SoundUrl1 . '" type="audio/wav"></audio>' . PHP_EOL;
    echo '    		<h4>' . $soundtest->Text1 . '</h4>' . PHP_EOL;
    echo '    	</div>' . PHP_EOL;
    echo '    	<div class="pod" id="audio_test2">' . PHP_EOL;
    echo '    		<img class="pod-x" src="assets/img/modalx.png" alt="x">' . PHP_EOL;
    echo '    		<img src="/' . $objSoundTest->GetPath() . $soundtest->ImageUrl2 . '" alt="55db">' . PHP_EOL;
    echo '    		<h4>' . $soundtest->Text2 . '</h4>' . PHP_EOL;
    echo '          <audio id="audio_testfile2"><source src="/' . $objSoundTest->GetPath() . $soundtest->SoundUrl2 . '" type="audio/wav"></audio>' . PHP_EOL;
    echo '    	</div>' . PHP_EOL;
    echo '    	<div class="pod" id="audio_test3">' . PHP_EOL;
    echo '    		<img class="pod-x" src="assets/img/modalx.png" alt="x">' . PHP_EOL;
    echo '    		<img src="/' . $objSoundTest->GetPath() . $soundtest->ImageUrl3 . '" alt="35db">' . PHP_EOL;
    echo '    		<h4>' . $soundtest->Text3 . '</h4>' . PHP_EOL;
    echo '          <audio id="audio_testfile3"><source src="/' . $objSoundTest->GetPath() . $soundtest->SoundUrl3 . '" type="audio/wav"></audio>' . PHP_EOL;
    echo '    	</div>' . PHP_EOL;
Ejemplo n.º 3
0
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing
        $objSoundTest = new SoundTest($id);
        $sound_id = $objSoundTest->SoundId;
        $sound_test_description = $objSoundTest->SoundTestDescription;
        $sound_url1 = $objSoundTest->SoundUrl1;
        $sound_url2 = $objSoundTest->SoundUrl2;
        $sound_url3 = $objSoundTest->SoundUrl3;
        $image_url1 = $objSoundTest->ImageUrl1;
        $image_url2 = $objSoundTest->ImageUrl2;
        $image_url3 = $objSoundTest->ImageUrl3;
        $text1 = $objSoundTest->Text1;
        $text2 = $objSoundTest->Text2;
        $text3 = $objSoundTest->Text3;
        $path = $objSoundTest->GetPath();
    } else {
        if ($_REQUEST['mode'] == 'a') {
            $sound_id = $_REQUEST["sound"];
        }
    }
}
include "includes/pagetemplate.php";
function PageContent()
{
    global $id;
    global $sound_id;
    global $sound_test_description;
    global $sound_url1;
    global $sound_url2;
    global $sound_url3;