<?php

// Load in standard config stuff
include "admin/config.php";
// Load in database stuff
include "{$site_root}/libs/lib_db.php";
// First say that we wish to use template system
include "{$site_root}/libs/lib_templates.php";
// Delete previously defined templates in session file
destroy_template();
insert_template("open_middle_row", "<TR>\n\t\t\t\t\t\t\t<!-- Start of middle row to hold main page content -->\n\t\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t\t<TABLE width=100% valign=top border=1 cellpadding=0 cellspacing=0>\n\t\t\t\t\t\t\t\t\t<TR>\n\t\t\t\t\t\t\t\t\t\t<TD width=25%>", 0);
insert_template("close_middle_row", "</TD>\n\t\t\t\t\t\t\t\t\t</TR>\n\t\t\t\t\t\t\t\t</TABLE>\n\t\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t\t<!-- End of middle row to hold main page content -->\n\t\t\t\t\t\t</TR>", 0);
insert_template("footer", "<TR>\n\t\t\t\t\t\t\t<!-- Start of bottom row to hold page footer -->\n\t\t\t\t\t\t\t<TD><FONT size=-2>The small print !</FONT></TD>\n\t\t\t\t\t\t\t<!-- End of bottom row to hold page footer -->\n\t\t\t\t\t\t</TR>", 0);
insert_template("separate_middle_row", "</TD>\n\t\t\t\t\t\t\t\t\t\t<TD width=*>", 0);
insert_template("page_bottom", "</TABLE>\n\t\t\t\t\t<!-- End of main table to hold entire page -->\n\t\t\t\t</TD>\n\t\t\t</TR>\n\t\t</TABLE>\n\t\t<!-- End of main table to hold entire page -->\n\t</BODY>\n</HTML>", 0);
insert_template("header", "<TR>\n\t\t\t\t\t\t\t<!-- Start of top row to hold page header -->\n\t\t\t\t\t\t\t<TD><H2>Eurologic SPIDER Metrics</H2></TD>\n\t\t\t\t\t\t\t<!-- End of top row to hold page header -->\n\t\t\t\t\t\t</TR>", 0);
insert_template("page_top", "<HTML>\n\t<HEAD>\n\t\t<TITLE>Eurologic SPIDER Metrics</TITLE>\n\t</HEAD>\n\t<BODY>\n\t\t<!-- Start of main table to hold entire page -->\n\t\t<TABLE width=95% border=1 cellpadding=0 cellspacing=0>\n\t\t\t<TR>\n\t\t\t\t<TD valign=top>\n\t\t\t\t\t<!-- Start of main table to hold entire page -->\n\t\t\t\t\t<TABLE width=100% valign=top border=1 cellpadding=0 cellspacing=0>", 0);
insert_template("whole_page", "<tpl>page_top</tpl><tpl>header</tpl><tpl>open_middle_row</tpl><tpl>nav_bar</tpl><tpl>separate_middle_row</tpl><tpl>content_area</tpl><tpl>close_middle_row</tpl><tpl>footer</tpl><tpl>page_bottom</tpl>", 0);
echo "Templates created";
        if (false !== strpos(Session::allowedSensors($login), $sensor_ip)) {
            if ($sensors == "") {
                $sensors = $sensor_ip;
            } else {
                $sensors .= "," . $sensor_ip;
            }
        }
    }
    foreach ($ACL_MAIN_MENU as $mainmenu => $menus) {
        foreach ($menus as $key => $menu) {
            if ($gacl->acl_check($mainmenu, $key, ACL_DEFAULT_USER_SECTION, $login)) {
                $perm_id = $permids[$mainmenu][$key];
                if ($perm_id > 0) {
                    $perms[$perm_id] = true;
                }
            }
        }
    }
    $template_id = insert_template($conn, $login . "_gacl", $nets, $sensors, $perms);
    if ($template_id > 0) {
        echo "Template '" . $login . "_gacl' ID{$template_id} successfully inserted into 'acl_templates'\n";
        if (update_user($conn, $login, $template_id)) {
            echo "...asigned to user {$login}\n\n";
        } else {
            echo "...not asigned to user {$login}. An error has occured\n\n";
        }
    } else {
        echo "Error creating template '" . $login . "_gacl'\n";
    }
}
$db->close();
예제 #3
0
파일: admin.php 프로젝트: snenko/chechur
                <div class="subm_col"><input type="submit" name="save_template" value="зберегти"></div>
                <div class="subm_col"><input type="submit" name="remove_template" value="видалити"></div>
            </div>
        </form>
    </div>

    <?php 
}
?>
</div>



    <?php 
if (isset($_POST['insert_template'])) {
    if (insert_template($_POST['title'], $_POST['description'], $_FILES['image_preview']['name'], $_FILES['image_swatch']['name'], $_POST['price'])) {
        $title = '';
        $description = '';
        $image_preview = '';
        $image_swatch = '';
        $price = '';
        if (!saveImage('image_preview')) {
            $error = 'зображення велике не завантажиломь';
        }
        if (!saveImage('image_swatch')) {
            $error = 'зображення мале не завантажився';
        }
    } else {
        $error = "Помилка перехоплена {$sql}. " . mysqli_error($link);
    }
}
예제 #4
0
/* //delete a list of tables
$ids = array("1onEZfLtSHdlElNP8EvAZrx-dsScJmotY1kSEk3UR", "1O3yqE1j-ryGDsfnFa7Q7aS3Mlk9HVsbYDoERZa7Y",
             "1aqzzOgYTvDBdOztZdVSZcKTsbm9fR--pe4WIcv9s", "1Knzolalnq4gJpZsQkv_Ybgk_NovBZBpEULHhi1EL");
foreach($ids as $tableID) delete_table($service, $tableID);
list_tables($service);
return;
*/
/* //update table
$taxon = array("concept_id" => 206692, "sciname" => "Gadus morhua Linnaeus, 1758");
update_fusion_table($service, $taxon, "1XqplhcfZgYPFel9FIT6T0S5WTclNPIElOH4IAAKq");
list_tables($service);
return;
*/
$table_info = create_fusion_table($service, $taxon);
$tableID = $table_info->tableId;
insert_template($tableID, $service);
//exit;
if ($permission = update_permission($client, $tableID)) {
    echo "\nAction is permitted OK\n";
    append_rows($service, $tableID, $taxon);
} else {
    echo "\nAction not permitted!\n";
}
return;
//terminate program
//=================================================================================
//=================================================================================
function prepare_data($taxon_concept_id)
{
    $txtFile = "../../eol_php_code/public/tmp/google_maps/fusion/" . $taxon_concept_id . ".txt";
    $file_array = file($txtFile);