Exemplo n.º 1
0
function commit_sauvegarde($type_sauvegarde, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    header("Pragma: no-cache");
    header("Content-Type: text/x-delimtext; name=\"php_conges_" . $type_sauvegarde . ".sql\"");
    header("Content-disposition: attachment; filename=php_conges_" . $type_sauvegarde . ".sql");
    //
    // Build the sql script file...
    //
    $maintenant = date("d-m-Y H:i:s");
    echo "#\n";
    echo "# PHP_CONGES\n";
    echo "#\n# DATE : {$maintenant}\n";
    echo "#\n";
    //recup de la liste des tables
    $sql1 = "SHOW TABLES";
    $ReqLog = SQL::query($sql1);
    while ($resultat = $ReqLog->fetch_array()) {
        $table = $resultat[0];
        echo "#\n#\n# TABLE: {$table} \n#\n";
        if ($type_sauvegarde == "all" || $type_sauvegarde == "structure") {
            echo "# Struture : \n#\n";
            echo get_table_structure($table);
        }
        if ($type_sauvegarde == "all" || $type_sauvegarde == "data") {
            echo "# Data : \n#\n";
            echo get_table_data($table);
        }
    }
}
         $tpl->assign('sql_error', $db->ErrorMsg());
     }
 case 'N':
 default:
     if (empty($_REQUEST['submit'])) {
         SmartyValidate::connect($tpl);
         SmartyValidate::register_form('conf_user_permissions', true);
         SmartyValidate::register_criteria('isValueUnique', 'validate_unique', 'conf_user_permissions');
         SmartyValidate::register_criteria('isNotEqual', 'validate_not_equal', 'conf_user_permissions');
         SmartyValidate::register_criteria('isNotSubCat', 'validate_not_sub_category', 'conf_user_permissions');
         SmartyValidate::register_validator('v_CATEGORY_ID', 'CATEGORY_ID:0', 'isNotEqual', true, false, null, 'conf_user_permissions');
         SmartyValidate::register_validator('v_CATEGORY_ID_U', "CATEGORY_ID:user_permission:0:USER_ID", 'isValueUnique', false, false, null, 'conf_user_permissions');
         SmartyValidate::register_validator('v_CATEGORY_ID_S', "CATEGORY_ID", 'isNotSubCat', false, false, null, 'conf_user_permissions');
     } else {
         SmartyValidate::connect($tpl);
         $data = get_table_data('user_permission');
         $data['USER_ID'] = $u;
         if (SmartyValidate::is_valid($data, 'conf_user_permissions')) {
             // Check if category is parent to existing categories.
             $child_categories = find_child_categories();
             if ($child_categories > 0) {
                 $tpl->assign('CHILD_CATEGORIES', $child_categories);
                 $tpl->assign('WARN', true);
                 $category = $db->GetOne("SELECT `TITLE` FROM `{$tables['category']['name']}` WHERE `ID` = " . $db->qstr($data['CATEGORY_ID']));
                 $tpl->assign('CATEGORY', $category);
             } else {
                 $id = $db->GenID($tables['user_permission']['name'] . '_SEQ');
                 $data['ID'] = $id;
                 if (db_replace('user_permission', $data, 'ID') > 0) {
                     $tpl->assign('posted', 'Permission granted.');
                 } else {
Exemplo n.º 3
0
<div id="content" class="span10">
	<!-- content starts -->
	<?php 
$get_pages = get_table_data('brochure', null);
//echo "<pre>";print_r($get_pages);
?>

	<div>
		<ul class="breadcrumb">
			<li>
				<a href="#">Home</a> <span class="divider">/</span>
			</li>
			<li>
				<a href="#">brochure</a>
			</li>
			<li>
				
			</li>
		</ul>
	</div>
	<?php 
if ($_GET['msg'] == 'delete') {
    ?>
					<div class="alert alert-success">brochure has been Deleted</div>
				<?php 
}
?>

				<?php 
if ($_GET['msg'] == 'success') {
    ?>
 $tmpl = $db->GetRow("SELECT `SUBJECT`, `BODY` FROM `{$tables['email_tpl']['name']}` WHERE `ID` = " . $db->qstr($_REQUEST['EMAIL_TPL_ID']));
 $mail = get_emailer();
 $mail->Body = replace_email_vars($tmpl['BODY'], $email_data);
 $mail->Subject = replace_email_vars($tmpl['SUBJECT'], $email_data);
 $mail->AddAddress($email_data['EMAIL'], $email_data['NAME']);
 if (!DEMO) {
     $sent = $mail->Send();
 } else {
     $sent = true;
 }
 if ($sent) {
     $id = $db->GenID($tables['email']['name'] . '_SEQ');
     $data['ID'] = $id;
     if ($db->Replace($tables['email']['name'], $data, 'ID', true) > 0) {
         // Save to Links table
         $link_data = get_table_data('link');
         $link_data['RECPR_REQUIRED'] = REQUIRE_RECIPROCAL;
         $link_data['STATUS'] = 2;
         $link_data['OWNER_NAME'] = $data['NAME'];
         $link_data['OWNER_EMAIL'] = $data['EMAIL'];
         $link_data['DATE_ADDED'] = gmdate('Y-m-d H:i:s');
         $link_data['DATE_MODIFIED'] = gmdate('Y-m-d H:i:s');
         if (ENABLE_PAGERANK) {
             require_once 'include/pagerank.php';
             $link_data['PAGERANK'] = get_page_rank($link_data['URL']);
         }
         $link_data['ID'] = $link_id;
         if ($db->Replace($tables['link']['name'], $link_data, 'ID', true) > 0) {
             $category = $db->GetOne("SELECT `TITLE` FROM `{$tables['category']['name']}` WHERE `STATUS` = '2' AND `ID` = " . $db->qstr($full_data['CATEGORY_ID']));
             $full_data['CATEGORY'] = $category;
             $tpl->assign('posted', true);
Exemplo n.º 5
0
<div id="content" class="span10">
	<!-- content starts -->
	<?php 
$get_pages = get_table_data('sr_gallery', null);
//echo "<pre>";print_r($get_pages);
?>

	<div>
		<ul class="breadcrumb">
			<li>
				<a href="#">Home</a> <span class="divider">/</span>
			</li>
			<li>
				<a href="#">Gallary</a>
			</li>
			<li>
				
			</li>
		</ul>
	</div>
	<?php 
if ($_GET['msg'] == 'delete') {
    ?>
					<div class="alert alert-success">Gallary has been Deleted</div>
				<?php 
}
?>

				<?php 
if ($_GET['msg'] == 'success') {
    ?>
Exemplo n.º 6
0
     case 'delete_entry':
         $myReturn = delete_entry($_POST);
         break;
     case 'book_entry':
         $myReturn = book_entry($_POST);
         break;
     case 'get_entry':
         $myReturn = get_entry($_POST);
         if (isset($myReturn['minutes_locked']) && $myReturn['minutes_locked'] > 31) {
             $data = array('user_id' => $myReturn['fields']['lock'], 'id' => $myReturn['fields']['id']);
             release_lock($data);
             $myReturn = get_entry($_POST);
         }
         break;
     case 'get_table_data':
         $myReturn = get_table_data($_POST['access_level'] * 1);
         break;
     case 'get_groups':
         $myReturn['groups'] = get_groups($_POST['nuid']);
         break;
     case 'release_lock':
         $myReturn = release_lock($_POST);
         break;
     case 'delete_revisions':
         $myReturn = delete_revisions($_POST);
         break;
     default:
         $myReturn['error'] = 'Not prepared to handle action "' . $_POST['action'] . '"';
         break;
 }
 // end switch
Exemplo n.º 7
0
    $page = mysqli_fetch_array($page1);
    include "addpage.php";
}
/**gallary**/
if ($_GET['data'] == 'gallary') {
    include "gallary.php";
}
if ($_GET['data'] == 'addgallary') {
    include "addgallary.php";
}
/* Home Page */
if ($_GET['data'] == 'homepage') {
    $page = get_table_data(DB_PREFIX . 'homepage', null);
    include "homepage.php";
}
if ($_GET['data'] == 'contactpage') {
    $page = get_table_data(DB_PREFIX . 'contact', null);
    include "contactpage.php";
}
if ($_GET['data'] == 'settings') {
    $global1 = mysqli_query($db_connect, "select * from cns_globalsettings");
    $global = mysqli_fetch_array($global1);
    include "settings.php";
}
?>
	</div>
	<?php 
include "include/footer.php";
?>
</div>
Exemplo n.º 8
0
    SmartyValidate::register_validator('v_RECPR_ONLINE', 'RECPR_URL', 'isURLOnline', $recpr_required ? false : true, false, null, 'submit_link');
    SmartyValidate::register_validator('v_RECPR_LINK', 'RECPR_URL', 'isRecprOnline', $recpr_required ? false : true, false, null, 'submit_link');
    SmartyValidate::register_validator('v_RECPR_DOMAIN', 'RECPR_URL', 'isRecprDomain', $recpr_required ? false : true, false, null, 'submit_link');
    SmartyValidate::register_validator('v_OWNER_NAME', 'OWNER_NAME', 'notEmpty', false, false, 'trim', 'submit_link');
    SmartyValidate::register_validator('v_OWNER_EMAIL', 'OWNER_EMAIL', 'isEmail', false, false, 'trim', 'submit_link');
    if (count($price) > 0) {
        SmartyValidate::register_validator('v_LINK_TYPE', 'LINK_TYPE', 'notEmpty', false, false, 'trim', 'submit_link');
    }
    // Deeplink URL Validation
    for ($dl = 1; $dl <= 5; $dl++) {
        SmartyValidate::register_validator('v_DEEPLINK_URL' . $dl, 'URL' . $dl, 'isURL', true, false, 'trim', 'submit_link');
    }
} else {
    SmartyValidate::connect($tpl);
    SmartyValidate::set_form('submit_link');
    $data = get_table_data('link', true);
    $data['STATUS'] = 1;
    $data['IPADDRESS'] = get_client_ip();
    $data['VALID'] = 1;
    $data['LINK_TYPE'] = $link_type;
    $data['RECPR_REQUIRED'] = $recpr_required;
    if ($recpr_required) {
        $data['RECPR_VALID'] = 1;
        $data['RECPR_LAST_CHECKED'] = gmdate('Y-m-d H:i:s');
    }
    $data['LAST_CHECKED'] = gmdate('Y-m-d H:i:s');
    $data['DATE_ADDED'] = gmdate('Y-m-d H:i:s');
    $data['DATE_MODIFIED'] = gmdate('Y-m-d H:i:s');
    if (strlen(trim($data['URL'])) > 0 && !preg_match('#^http[s]?:\\/\\/#i', $data['URL'])) {
        $data['URL'] = "http://" . $data['URL'];
    }
 case 'N':
 default:
     if ($id) {
         $where = "WHERE `ID` != " . $db->qstr($id);
     }
     if (empty($_POST['submit'])) {
         SmartyValidate::disconnect();
         SmartyValidate::connect($tpl, true);
         SmartyValidate::register_criteria('isEmailAndAddLinkValid', 'validate_email_and_add_link');
         SmartyValidate::register_validator('v_VALIDATE_EMAIL_TYPE', 'TPL_TYPE', 'isEmailAndAddLinkValid', false, false, 'trim');
         SmartyValidate::register_validator('v_TITLE', 'TITLE', 'notEmpty', false, false, 'trim');
         SmartyValidate::register_validator('v_SUBJECT', 'SUBJECT', 'notEmpty', false, false, 'trim');
         SmartyValidate::register_validator('v_BODY', 'BODY', 'notEmpty', false, false, 'trim');
     } else {
         SmartyValidate::connect($tpl);
         $data = get_table_data('email_tpl');
         if (SmartyValidate::is_valid($data)) {
             if (empty($id)) {
                 $id = $db->GenID($tables['email_tpl']['name'] . '_SEQ');
             }
             $data['ID'] = $id;
             if ($db->Replace($tables['email_tpl']['name'], $data, 'ID', true) > 0) {
                 $tpl->assign('posted', true);
                 if (isset($_SESSION['return'])) {
                     @header('Location: ' . $_SESSION['return']);
                     @exit;
                 }
             } else {
                 $tpl->assign('sql_error', $db->ErrorMsg());
             }
         }
Exemplo n.º 10
0
function show_spam()
{
    print get_table_data('SELECT * FROM ' . db_tablename('spamlog'));
}
Exemplo n.º 11
0
    if (isset($data['user_id']) && $data['user_id'] !== '') {
        $qry = "INSERT INTO `{$user_meta}` (user_id,meta_key,meta_value) VALUES ('" . $data['user_id'] . "','last_accessed', CURRENT_TIMESTAMP) " . "ON DUPLICATE KEY UPDATE meta_value=CURRENT_TIMESTAMP;";
        $myResults = $mySQLi->add_row($qry);
        $out['results'] = $myResults;
        if ($mySQLi->error != '') {
            $out['error'] = $mySQLi->error_num . ': ' . $mySQLi->error;
        }
        return $out;
    }
}
//***	Primary control.  Calls the function that matches the requested ACTION ***//
if (isset($_POST['action']) && $_POST['action'] != '') {
    $myAction = $_POST['action'];
    switch ($myAction) {
        case 'get_table_data':
            $myReturn['table_data'] = get_table_data($_POST['user_access']);
            break;
        case 'get_groups':
            $myReturn['groups'] = get_groups($_POST['nuid']);
            break;
        case 'update_user':
            unset($_POST['action']);
            $myReturn = update_user($_POST);
            break;
        case 'add_user':
            unset($_POST['action']);
            $myReturn = add_user($_POST);
            break;
        case 'delete_user':
            $myReturn = delete_user($_POST['id']);
            break;
Exemplo n.º 12
0
             SmartyValidate::register_validator('v_TITLE_URL', 'TITLE_URL:!^[\\w_-]+$!', 'isRegExp', false, false, 'trim', 'dir_categs_edit');
             SmartyValidate::register_validator('v_TITLE_URL_U', 'TITLE_URL:category:' . $id . ':PARENT_ID', 'isValueUnique', false, false, null, 'dir_categs_edit');
         }
     } else {
         SmartyValidate::register_criteria('isNotEqual', 'validate_not_equal', 'dir_categs_edit');
         SmartyValidate::register_criteria('isNotEqualVariable', 'validate_not_equal_var', 'dir_categs_edit');
         SmartyValidate::register_criteria('isSymbolicUnique', 'validate_symbolic_unique', 'dir_categs_edit');
         SmartyValidate::register_criteria('isParentValid', 'validate_symbolic_parent', 'dir_categs_edit');
         SmartyValidate::register_validator('v_SYMBOLIC_ID', 'SYMBOLIC_ID:0', 'isNotEqual', true, false, null, 'dir_categs_edit');
         SmartyValidate::register_validator('v_SYMBOLIC_ID_E', 'SYMBOLIC_ID:PARENT_ID', 'isNotEqualVariable', true, false, null, 'dir_categs_edit');
         SmartyValidate::register_validator('v_SYMBOLIC_ID_U', 'SYMBOLIC_ID', 'isSymbolicUnique', false, false, null, 'dir_categs_edit');
         SmartyValidate::register_validator('v_SYMBOLIC_ID_P', 'SYMBOLIC_ID', 'isParentValid', false, false, null, 'dir_categs_edit');
     }
 } else {
     SmartyValidate::connect($tpl);
     $data = get_table_data('category');
     $data['SYMBOLIC'] = isset($_REQUEST['s']) && $_REQUEST['s'] == 1 ? 1 : 0;
     if (strlen(trim($data['TITLE_URL'])) == 0) {
         $data['TITLE_URL'] = preg_replace('`[^\\w_-]`', '_', $data['TITLE']);
     }
     if (SmartyValidate::is_valid($data, 'dir_categs_edit')) {
         if ($action == 'N') {
             $data['DATE_ADDED'] = gmdate('Y-m-d H:i:s');
         }
         if (empty($id)) {
             $id = $db->GenID($tables['category']['name'] . '_SEQ');
         }
         $data['ID'] = $id;
         if ($db->Replace($tables['category']['name'], $data, 'ID', true) > 0) {
             // Refresh editor permissions
             if (!$_SESSION['is_admin']) {
Exemplo n.º 13
0
function create_admin($admin_details)
{
    global $tpl, $db, $tables;
    $db = ADONewConnection(DB_DRIVER);
    if (!$db->Connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)) {
        return false;
    }
    $db->SetFetchMode(ADODB_FETCH_ASSOC);
    $sql = "SELECT * FROM `{$tables['user']['name']}` WHERE `LOGIN` = " . $db->qstr($admin_details['admin_user']) . " LIMIT 1";
    $result = $db->GetRow($sql);
    $max_user_id = $db->GetOne("SELECT MAX(`ID`) FROM `{$tables['user']['name']}`");
    $max_user_id = empty($max_user_id) ? 1 : $max_user_id + 1;
    $data = !empty($result) && is_array($result) ? $result : get_table_data('user');
    $data['LOGIN'] = $admin_details['admin_user'];
    $data['NAME'] = $admin_details['admin_name'];
    $data['PASSWORD'] = encrypt_password($admin_details['admin_password']);
    $data['EMAIL'] = $admin_details['admin_email'];
    $data['ADMIN'] = 1;
    $data['SUBMIT_NOTIF'] = $data['SUBMIT_NOTIF'] == 0 ? 0 : 1;
    $data['PAYMENT_NOTIF'] = $data['PAYMENT_NOTIF'] == 0 ? 0 : 1;
    if (empty($result) || !is_array($result)) {
        $mode = "INSERT";
        $where = false;
        $data['ID'] = $db->GenID($tables['user']['name'] . '_SEQ', $max_user_id);
    } else {
        $mode = "UPDATE";
        $where = " `ID` = " . $db->qstr($data['ID']);
        /* Create a new sequence to cater for upgrading installation */
        $db->CreateSequence($tables['user']['name'] . '_SEQ', $max_user_id);
    }
    if (!$db->AutoExecute($tables['user']['name'], $data, $mode, $where)) {
        $tpl->assign('form_error', 'SQL_ERROR_ADMIN');
        $tpl->assign('sql_error', $db->ErrorMsg());
        return false;
    }
    return 1;
}
Exemplo n.º 14
0
     #	0.0.4
     //}
     //else
     //{
     //	#	update the totals anyways, it may be needed when the language changes
     //	#
     //	calc_query_limits('table_editor_adm', $parms[2], $TABLE);
     //	$_SESSION['table_editor_adm'.'_paginate']['thispage'] = 0;
     //}
     //echo '<p class="todo">$limits='.$limits.'</p>';
     //echo '<p class="todo">$filters='.$filters.'</p>';
     //echo ' $TABLE_ADM_PARAM<br>';var_dump($TABLE_ADM_PARAM);echo '<hr>';
     if ($TABLE_ADM_PARAM) {
         $rows = get_table_data('*all', $parms[0], $limits, $filters, $TABLE_ADM_PARAM);
     } else {
         $rows = get_table_data('*all', $parms[0], $limits, $filters, $filters_relations);
     }
     if (function_exists('get_table_data_list')) {
         echo get_table_data_list($rows, 'table_editor_adm', $parms[4]);
     } else {
         echo '<p style="color:red;">Missing function <b>get_table_data_list</b></p>';
         //var_dump($rows);
         echo '<hr>';
     }
     //echo $splitter_block
     //	.$js;
     exit;
     break;
     #
     #---------------------------
 #
Exemplo n.º 15
0
<div id="content" class="span10">
	<!-- content starts -->
	<?php 
$get_pages = get_table_data('gallary', null);
//echo "<pre>";print_r($get_pages);
?>

	<div>
		<ul class="breadcrumb">
			<li>
				<a href="#">Home</a> <span class="divider">/</span>
			</li>
			<li>
				<a href="#">Gallary</a>
			</li>
			<li>
				
			</li>
		</ul>
	</div>
	<?php 
if ($_GET['msg'] == 'delete') {
    ?>
					<div class="alert alert-success">Gallary has been Deleted</div>
				<?php 
}
?>

				<?php 
if ($_GET['msg'] == 'success') {
    ?>
Exemplo n.º 16
0
<div id="content" class="span10">
	<!-- content starts -->
	<?php 
$pages = get_table_data('services', null);
//echo "<pre>";print_r($pages);
?>
	<div>
		<ul class="breadcrumb">
			<li>
				<a href="#">Home</a> <span class="divider">/</span>
			</li>
			<li>
				<a href="#">Services</a>
			</li>
			<li>
				
			</li>
		</ul>
	</div>
	<?php 
if ($_GET['msg'] == 'delete') {
    ?>
					<div class="alert alert-success">Services has been Deleted</div>
				<?php 
}
?>
				<?php 
if ($_GET['msg'] == 'update') {
    ?>
					<div class="alert alert-success">Services has update successfully</div>
				<?php 
Exemplo n.º 17
0
}
if ($_GET['data'] == 'editproject') {
    $pages = mysqli_query($db_connect, "select * from on_projects where id ='{$_GET['page']}'");
    $page = mysqli_fetch_array($pages);
    include "addproject.php";
}
if ($_GET['data'] == 'addproject') {
    include "addproject.php";
}
if ($_GET['data'] == 'pages') {
    $pages = get_table_data('pages', null);
    include "pages.php";
}
if ($_GET['data'] == 'editpage') {
    $pages = get_table_data('pages', array('page_id !' => $_GET['page']));
    $page = get_table_data('pages', array('page_id' => $_GET['page']));
    include "addpage.php";
}
if ($_GET['data'] == 'addpage') {
    include "addpage.php";
}
if ($_GET['data'] == 'addimage') {
    include "page_images.php";
}
if ($_GET['data'] == 'gallary') {
    include "gallary.php";
}
if ($_GET['data'] == 'addgallary') {
    include "addgallary.php";
}
if ($_GET['data'] == 'brochure') {
Exemplo n.º 18
0
<?php

require 'admin/coreclass.php';
include 'autoresponder/responder.php';
$db = new database();
$x = new online_tracker();
$x->tracker();
$gerger = new gerger_timer();
$gerger->start();
$gerger->setprecision(4);
$articleID = $_REQUEST['segment'];
$where = " WHERE autoNumber = '{$articleID}'";
$rs = get_table_data('news_segments', $where);
$data = mysql_fetch_assoc($rs);
/*
$sql = " select * from article_versions av ";
$sql .= " where av.articleID =" . intval( $articleID );
if (!($result = $db->query( $sql ))) {
		die('Error:'. $db->error());
}
$view_article = array();
while ( $view_article[] = $db->fetcharray() );
$dateline = $view_article[0]->dateline;
// get the dateline of the headline news..
$day = $view_article[0]->published_day;
$month = $view_article[0]->published_month;
$year = $view_article[0]->published_year;
$articleID = $view_article[0]->articleID;
*/
/**
* Get the other news on this category
Exemplo n.º 19
0
							     
							<div class="control-group">
							  <label class="control-label" for="textarea2">Gallery</label>
							  <div class="controls">
								<input class="input-file uniform_on" id="fileInput" type="file" required name="banners[]" multiple>
							  </div>
							</div>
							
							<div class="control-group">
							  <label class="control-label" for="textarea2">Type</label>
							  <div class="controls">
								<select name="type">
									<option value=""> select gallery type</option>
									<option value="certificates">certificates</option>
									<?php 
$serv = get_table_data('services', null);
for ($i = 0; $i < count($serv); $i++) {
    ?>
									<option value="<?php 
    echo $serv[$i]['name'];
    ?>
"><?php 
    echo $serv[$i]['name'];
    ?>
</option>
									<?php 
}
?>
								</select>
							  </div>
							</div>
Exemplo n.º 20
0
    header("location:../index.php?data=projects&msg=delete");
}
if (isset($_POST['page_id']) && $_POST['page_id'] == '') {
    $pr_id = array_shift($_POST);
    $pr_img = array_shift($_POST);
    $_POST['name'] = htmlspecialchars(str_replace("'", "", $_POST['name']));
    $_POST['created_date'] = date("Y-m-d H:i:s");
    $_POST['updated_date'] = date("Y-m-d H:i:s");
    if ($_FILES['image']['name']) {
        $image_file = rand() . $_FILES['image']['name'];
        $image_path = '../../images/' . $image_file;
        $temp = $_FILES['image']['tmp_name'];
        copy($temp, $image_path);
        $_POST['image'] = $image_file;
    }
    $pages = get_table_data('services', array('showon_homepage' => 1));
    if (count($pages) < 3) {
        $_POST['showon_homepage'] = 1;
    }
    $_POST['description'] = htmlspecialchars(str_replace("'", "", $_POST['description']));
    //print_r($_POST); exit;
    db_insert('services', $_POST);
    header('location:../index.php?data=projects&msg=success');
} else {
    $product_id = array_shift($_POST);
    $images = array_shift($_POST);
    $_POST['name'] = str_replace("'", "", $_POST['name']);
    if ($_FILES['image']['name']) {
        $image_file = rand() . $_FILES['image']['name'];
        $image_path = '../../images/' . $image_file;
        $temp = $_FILES['image']['tmp_name'];
Exemplo n.º 21
0
     if ($action == 'N') {
         $data = array();
     }
     SmartyValidate::connect($tpl);
     SmartyValidate::register_form('conf_users_edit', true);
     SmartyValidate::register_criteria('isValueUnique', 'validate_unique', 'conf_users_edit');
     SmartyValidate::register_validator('v_LOGIN', 'LOGIN:4:25', 'isLength', false, false, 'trim', 'conf_users_edit');
     SmartyValidate::register_validator('v_LOGIN_U', 'LOGIN:user:'******'isValueUnique', false, false, false, 'conf_users_edit');
     SmartyValidate::register_validator('v_NAME', 'NAME:4:25', 'isLength', false, false, 'trim', 'conf_users_edit');
     SmartyValidate::register_validator('v_PASSWORD', 'PASSWORD:4:25', 'isLength', true, false, 'trim', 'conf_users_edit');
     SmartyValidate::register_validator('v_PASSWORDC', 'PASSWORD:PASSWORDC', 'isEqual', true, false, 'trim', 'conf_users_edit');
     SmartyValidate::register_validator('v_EMAIL', 'EMAIL', 'isEmail', false, false, 'trim', 'conf_users_edit');
     SmartyValidate::register_validator('v_EMAIL_U', 'EMAIL:user:'******'isValueUnique', false, false, 'trim', 'conf_users_edit');
 } else {
     SmartyValidate::connect($tpl);
     $data = get_table_data('user');
     if (!isset($data['SUBMIT_NOTIF'])) {
         $data['SUBMIT_NOTIF'] = 0;
     }
     if (!isset($data['PAYMENT_NOTIF'])) {
         $data['PAYMENT_NOTIF'] = 0;
     }
     $data['PASSWORDC'] = $_REQUEST['PASSWORDC'];
     if (SmartyValidate::is_valid($data, 'conf_users_edit')) {
         unset($data['PASSWORDC']);
         if (empty($id)) {
             $id = $db->GenID($tables['user']['name'] . '_SEQ');
         }
         $data['ID'] = $id;
         if ($action == 'E') {
             if (empty($data['PASSWORD'])) {
Exemplo n.º 22
0
    include "projects.php";
}
if ($_GET['data'] == 'editproject') {
    $pages = get_table_data('services', array('id' => $_GET['page']));
    $page = $pages[0];
    include "addproject.php";
}
if ($_GET['data'] == 'addproject') {
    include "addproject.php";
}
if ($_GET['data'] == 'about') {
    $page = get_table_data('about');
    include "addpage.php";
}
if ($_GET['data'] == 'contact') {
    $page = get_table_data('contact');
    include "addcontact.php";
}
if ($_GET['data'] == 'gallary') {
    include "gallary.php";
}
if ($_GET['data'] == 'addgallary') {
    include "addgallary.php";
}
if ($_GET['data'] == 'addimages') {
    include "addimages.php";
}
?>
	</div>
	<?php 
include "include/footer.php";
Exemplo n.º 23
0
for ($i = 0; $i < $n; $i++) {
    // Count the active banners
    foreach ($links as $field => $values) {
        if ($field == 'clientID') {
            if (checkhttptext($links[$i]->website)) {
                $url = splithttptext($links[$i]->website);
                $sponsoredlinks .= '<li><a href="' . $links[$i]->website . '">' . $url[1] . '</a></li>';
            } else {
                $sponsoredlinks .= '<li><a href="http://' . $links[$i]->website . '">' . $links[$i]->website . '</a></li>';
            }
        }
    }
}
###################################################
# get station segments here
$rs = get_table_data('news_segments');
while ($data = mysql_fetch_assoc($rs)) {
    $segments .= '<li><a href="segments.php?segmentID=' . $data['autoNumber'] . '">' . $data['segmentTitle'] . '</li>';
}
/*
 * Generate random quote
 */
$quote = new quote_of_the_day();
$result = $quote->generate_random_quote();
$quote_author = $result[0]->quote_author;
$quote_message = $result[0]->quote_message;
/**
 * Get the poll of the day
 */
//get the current date
$date = date('Y-m-d');
Exemplo n.º 24
0
<div id="content" class="span10">
<?php 
$page = get_table_data('scanner_video', array('video_id' => 1));
?>
			<!-- content starts -->
		<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">Home</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">Video Page Settings</a>
					</li>
				</ul>
			</div>
			
			<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-edit"></i> Video Page Settings</h2>
						<div class="box-icon">
							
						</div>
					</div>
					<div class="box-content">
						<form class="form-horizontal" method="post" action="dbfiles/videotable.php"  enctype="multipart/form-data">
						  <fieldset>
							<input type="hidden" value="<?php 
echo $page[0]['video_id'];
?>
" name="video_id">
Exemplo n.º 25
0
<?php

include "../include/config.php";
include "../include/functions.php";
if ($_GET['table']) {
    deleterow($_GET['table'], array('page_id' => $_GET['page_id']));
    header("location:../index.php?data=pages&msg=delete");
}
if (isset($_POST['page_id']) && $_POST['page_id'] == '') {
    $pr_id = array_shift($_POST);
    $_POST['page_url'] = strtolower(htmlspecialchars(str_replace(" ", "-", str_replace("'", "", $_POST['page_title']))));
    $_POST['page_title'] = htmlspecialchars(str_replace("'", "", $_POST['page_title']));
    $url_exists = get_table_data('pages', array('page_url' => $_POST['page_url']));
    if (count($url_exists) > 0) {
        $_POST['page_url'] = rand() . strtolower(htmlspecialchars(str_replace(" ", "-", str_replace("'", "", $_POST['page_title']))));
    }
    $_POST['created_date'] = date("Y-m-d H:i:s");
    $_POST['updated_date'] = date("Y-m-d H:i:s");
    $_POST['page_description'] = htmlspecialchars(str_replace("'", "", $_POST['page_description']));
    //	echo "<pre>";print_r($_POST);
    db_insert('pages', $_POST);
    header('location:../index.php?data=pages&msg=success');
} else {
    $product_id = array_shift($_POST);
    $_POST['page_url'] = strtolower(htmlspecialchars(str_replace(" ", "-", str_replace("'", "", $_POST['page_title']))));
    $_POST['page_title'] = str_replace("'", "", $_POST['page_title']);
    $_POST['page_description'] = htmlspecialchars(str_replace("'", "", $_POST['page_description']));
    db_update('pages', $_POST, array('page_id' => $product_id));
    header('location:../index.php?data=pages&msg=updated');
}
Exemplo n.º 26
0
function calc_query_limits($thisPage, $paginate, $TABLE, $items_per_page = '')
{
    #	0.0.4
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #
    #	recalculate the query limits to paginate
    #
    #	get the total number of records in the table and calculate the total number of pages
    #
    global $filters, $TABLE_ADM_PARAM, $filters_relations;
    #	0.0.6
    if ($items_per_page == '') {
        $items_per_page = ITEMS_PER_PAGE;
    }
    #	0.0.4
    //echo '<p class="todo">tot_pages='.$_SESSION[EDIT_TABLE_NAME.'_paginate']['tot_pages'].'</p>';
    if ($TABLE_ADM_PARAM) {
        $rows = get_table_data('*info', '', $TABLE, $filters, $TABLE_ADM_PARAM);
    } else {
        //$rows = get_table_data('*info', '', $TABLE, $filters);					#	0.0.6
        $rows = get_table_data('*info', '', $TABLE, $filters, $filters_relations);
        #	0.0.6
    }
    //$tot_pages = (int)($rows / ITEMS_PER_PAGE + 0.999);	#	0.0.4
    $tot_pages = (int) ($rows / $items_per_page + 0.999);
    #	0.0.4
    //echo '<p class="todo">$rows='.$rows.'</p>';
    //echo '<p class="todo">$items_per_page='.$items_per_page.'</p>';
    //echo '<p class="todo">$tot_pages='.$tot_pages.'</p>';
    #
    #	manage pagination
    #
    $act_page = $_SESSION[EDIT_TABLE_NAME . '_paginate']['thispage'];
    //echo '<p class="todo">IN $act_page='.$act_page.'</p>';
    //$limits 	= '0,'.ITEMS_PER_PAGE;	#	0.0.4
    $limits = '0,' . $items_per_page;
    #	0.0.4
    if ($paginate == 'next' && $act_page < $tot_pages - 1) {
        $act_page++;
        //$limits = ($act_page * ITEMS_PER_PAGE).','.ITEMS_PER_PAGE;	#	0.0.4
        $limits = $act_page * $items_per_page . ',' . $items_per_page;
        #	0.0.4
    } elseif ($paginate == 'prev' && $act_page > 0) {
        $act_page--;
        //$limits = ($act_page * ITEMS_PER_PAGE).','.ITEMS_PER_PAGE;	#	0.0.4
        $limits = $act_page * $items_per_page . ',' . $items_per_page;
        #	0.0.4
    } elseif (is_numeric($paginate)) {
        $act_page = $paginate;
        //$limits = ($act_page * ITEMS_PER_PAGE).','.ITEMS_PER_PAGE;	#	0.0.4
        $limits = $act_page * $items_per_page . ',' . $items_per_page;
        #	0.0.4
    }
    $_SESSION[EDIT_TABLE_NAME . '_paginate']['thispage'] = $act_page;
    $_SESSION[EDIT_TABLE_NAME . '_paginate']['tot_pages'] = $tot_pages;
    //echo '<p class="todo">OUT $act_page='.$act_page.'</p>';
    //echo '<p class="todo">$thisPage='.$thisPage.'</p>';
    //echo '<p class="todo">items_per_page='.ITEMS_PER_PAGE.'</p>';
    //echo '<p class="todo">thispage='.$_SESSION[EDIT_TABLE_NAME.'_paginate']['thispage'].'</p>';
    //echo '<p class="todo">tot_pages='.$_SESSION[EDIT_TABLE_NAME.'_paginate']['tot_pages'].'</p>';
    //echo '<p class="todo">$limits='.$limits.'</p>';
    return $limits;
}
Exemplo n.º 27
0
<div id="content" class="span10">
	<!-- content starts -->
	<?php 
$get_pages = get_table_data('sr_service_images', array('service_id' => $_GET['page']));
$pagess = get_table_data('sr_services', array('id' => $_GET['page']));
//echo "<pre>";print_r($pagess[0]['name']);
?>

	<div>
		<ul class="breadcrumb">
			<li>
				<a href="#">Home</a> <span class="divider">/</span>
			</li>
			<li>
				<a href="#"><?php 
echo $pagess[0]['name'];
?>
 Service images</a>
			</li>
			<li>
				
			</li>
		</ul>
	</div>
	<?php 
if ($_GET['msg'] == 'delete') {
    ?>
					<div class="alert alert-success">Gallary has been Deleted</div>
				<?php 
}
?>
Exemplo n.º 28
0
}
#=========================================
#
#	if the user has not enough privileges, redirect to the main site page
#
#=========================================
//check_access($USER_ID,$USER_PW,EDIT_TABLE_MIN_PRIV);
#=========================================
#
#	get the required record
#
#=========================================
if ($_REC_MODE == '*add') {
    $row_data = array();
} else {
    $row_data = get_table_data($RRN, $_SESSION['table_editor']['lang']);
    if (!is_array($row_data)) {
        ?>
<div class="warningBox">

			Record ID "<?php 
        echo $RRN;
        ?>
" not found in table "<?php 
        echo $TABLE;
        ?>
"

		</div><?php 
        return;
    }