function deleteProject($path, $pathToFile) { unlink($pathToFile); clear($path); rmdir($path . 'RENDER_DATA/'); rmdir($path); return json_encode(array('code' => 0)); }
function enable($profiletext) { $fileProfileDir = "Output/Profiles/" . $profiletext . "/profile.txt"; if (file_exists($fileProfileDir)) { clear($profiletext); copy($fileProfileDir, 'Output/CurrentProfile/profile.txt'); $message = shell_exec("Scripts/snortreboot.sh 2>&1"); print_r($message); } else { // code when file not found } }
function add_top_name($thelist = "") { $filllist = array(); if (is_array($thelist)) { foreach ($thelist as $kk => $vv) { //clear(); $filllist['names'] .= $filllist['names'] ? "@||@|@" . clear($vv) : clear($vv); $filllist['ids'] .= $filllist['ids'] ? ",{$kk}" : $kk; } } return $filllist; }
function edit() { // neu co nhap pass thi lay gia tri moi, kho se lay gia tri ban dau if ($_POST['confirm_password'] != '') { $password = md5(trim($_POST['username']) . trim($_POST['confirm_password'])); } else { $password = clear($_POST['resetpass']); } $input = array('full_name' => clear($_POST['full_name']), 'email' => clear($_POST['email']), 'status' => intval($_POST['status']), 'password' => $password, 'permission' => clear($_POST['permission'])); $this->db->update_record($this->table, $input, $this->key . '=' . intval($_GET['id'])); security::redirect($this->module, 'list'); }
function log_in($log = '', $log_name = '', $log_pass = '') { //normalni prihlaseni bez parametru, s parametry je autoprihlaseni pri registraci if (!$log) { $log = clear("log"); $log_name = clear("log_name"); $log_pass = clear("log_pass"); $permanent = clear("permanent"); } $msg = $_SESSION["msg"]; if ($log) { $sql = sql_query("select id, pass\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (nick = '{$log_name}')"); $data = sql_fetch_object($sql); $db_pass = $data->pass; $id = $data->id; if (!$data->id) { $msg->set_text($l->t("bad_login"), "error"); redirect($l->l("prihlaseni")); } $log_pass = md5(md5(md5(md5(md5($log_pass))))); if ($log_pass == $db_pass) { $me = new me($data->id); $uid = $data->id; $_SESSION['me'] = $me; $_SESSION['uid'] = $uid; //ulozeni trvaleho prihlaseni if ($permanent) { $hash = time(); $a = rand(); $hash = $id . "" . $time . "" . $a; $hash = md5(md5(md5(md5(md5(md5($hash)))))); $sql = sql_query("insert into permanent_login\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(user, hash_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t('{$id}', '{$hash}')"); if ($sql) { $time = time(); $time = $time + 3600 * 24 * 60; setcookie("permanent_login", "{$id}:{$hash}", $time); } } //nastaveni ze jsem se prihlasil $sql = sql_query("update users set logged = 'yes'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (id = '" . $_SESSION['me']->uid . "')"); if ($self == "/objednavka.php") { redirect("objednavka"); } //defaultni presun zpet na stejnou stranku (aby nebyly back post data) $this_url = $_SERVER["REQUEST_URI"]; redirect($this_url); } else { $msg->set_text($l->t("bad_login"), "error"); redirect($l->l("prihlaseni")); } } }
function edit() { $image = clear($_POST['image']); if ($_FILES['file']['name']) { if ($_POST['image']) { unlink($this->pathadm . $_POST['image']); unlink($this->pathadm . 'resize/' . $_POST['image']); } $upload = new upload(); $upload->process($_FILES['file'], $this->pathadm, $this->max_width); $image = clear($upload->name); } $input = array('name' => clear($_POST['name']), 'alias' => clear($_POST['alias']), 'cha_id' => intval($_POST['cha']), 'cat_id' => intval($_POST['cat']), 'special' => intval($_POST['special']), 'description' => clear($_POST['description']), 'detail' => clear($_POST['detail']), 'image' => $image, 'cards_list' => @implode(',', $_POST['cards']), 'ordering' => (int) $ordering, 'card_slogan' => clear($_POST['card_slogan'])); $this->db->update_record($this->table, $input, $this->key . '=' . $_GET['id']); security::redirect($this->module, 'list'); }
function login() { $this->check_pin(); $db = new database(); global $sitelink; $select = "user_id,username, password, permission"; $table = "8x_user"; $where = 'status = 1 && username = \'' . clear($_POST['log_username']) . '\' && password = \'' . md5(clear($_POST['log_username'] . $_POST['log_password'])) . '\''; $row = $db->detail($table, $select, $where); if (intval($row['user_id']) > 0 && $row['username'] !== '') { $_SESSION['username'] = $row['username']; $_SESSION['user_id'] = $row['user_id']; $_SESSION['permission' . $sitelink] = $row['permission']; } header_redirect(''); }
function try_login() { //defaultni vypis problemu s prihlasenim $l = new lang("layout"); $msg = new msg(); //pokud nam google vrati code, muzeme se autentifikovat a ziksat token $code = clear("code"); if ($code) { $this->client->authenticate(); $this->token = $this->client->getAccessToken(); } /* //kdybychom chteli na nejake jine strance zase s uctem u googlu pracovat // musimve vytvorit to spojeni a pomoci se token ze session se autorizovat u googlu //ale mi tady session token nulujeme, takze uz se dal pouzit neda if ($_SESSION['token']) { $this->client->setAccessToken($_SESSION['token']); } //kdyz ho chceme ziskat $_SESSION['token'] = $this->client->getAccessToken(); */ if ($this->token) { $my_data = $this->plus->people->get('me'); $gp_id = $my_data['id']; //nyni mame udaje o uzivateli //pokusime se zjistit, zda-li j*z v databazi nekdo takovy je (gp_id) $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (gp_id = '" . $gp_id . "')"); $data = sql_fetch_object($sql); //j*z v databazi existuje if ($data->id) { $_SESSION['uid'] = $data->id; $_SESSION['me'] = new me($data->id); $_SESSION['me']->homepage_redirect(); } else { $new_login = $this->create_login($my_data); if ($new_login) { $_SESSION['uid'] = $new_login[0]; $_SESSION['me'] = new me($new_login[0]); //prvotni presun po registraci na nastaveni a doplneni udaju header("location: " . $l->l("osobni-udaje") . "?first=true"); return true; } } } $msg->set_text($l->t("bad_gplus_login"), "error"); redirect($l->l("prihlaseni")); }
function set($products) { $user = \cf\User::getLoggedIn(); if ($user) { clear(); $cartId = create(); $q = \cf\createQuery('INSERT INTO cf_products_in_cart (cart_id,product_id,amount) VALUES(:cid,:pid,:amt)'); foreach ($products as $id => $qty) { $q->setParam('cid', $cartId); $q->setParam('pid', $id); $q->setParam('amt', $qty); $q->execute(); } } else { $c = create(); $c->setParam('ready', $products); $c->set(); } return getList(); }
function save() { if ($_SESSION['member_id'] != '') { $ma_nhanvien = $_SESSION['member_id']; } else { $ma_nhanvien = 1; } $input_order = array('customer' => clear($_POST['name']), 'ma_nhanvien' => $ma_nhanvien, 'ma_website' => $_POST['maweb'], 'company' => clear($_POST['company']), 'address' => clear($_POST['address']), 'mobile' => clear($_POST['tel']), 'email' => clear($_POST['email']), 'yahoo' => clear($_POST['nick_yahoo']), 'skype' => clear($_POST['nick_skype']), 'tenmien' => clear($_POST['tenmien']), 'tenmien_sudung' => clear($_POST['tenmien_sudung']), 'hotro' => clear($_POST['hotro']), 'hosting' => clear($_POST['hosting']), 'giaodien' => clear($_POST['giaodien']), 'logo' => clear($_POST['logo']), 'banner' => clear($_POST['banner']), 'ten_cty_banner' => clear($_POST['ten_cty_banner']), 'slogan' => clear($_POST['slogan']), 'note' => clear($_POST['thongtinkhac']), 'banquyen' => $_POST['banquyen'], 'date_up' => date('Y-m-d h:m:s')); if (!$this->db->insert_record($this->table, $input_order)) { // get order_id of order $row = $this->db->detail($this->table, $this->key, '', $this->key . " DESC"); $order_id = $row[$this->key]; $input_order_detail = array('order_id' => $order_id, 'pro_price' => $_POST['gia'], 'pro_id' => $_POST['maweb'], 'chiphitamtinh' => $_POST['chiphitamtinh'], 'quantity' => '1'); if (!$this->db->insert_record($this->table_detail, $input_order_detail, 0)) { echo "success"; } else { echo "Cannot insert order detail."; } //Staff mail if ($_SESSION['member_email'] != '') { $to = $_SESSION['member_email']; $subject = 'Web Mail - New order.'; $message = ' <p>Hello <b>' . $_SESSION['member_name'] . '</b>!</p> <p>Order code<b>' . $order_id . '</b> has been sent. please visit <a href="http://url/admin" target="_blank">http://url/admin</a> for details. </p> <p> (c)2010 - @@sitename@@ - http://url </p> '; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $headers .= 'From: @@emailaddress@@' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($to, $subject, $message, $headers); } } else { echo "Cannot insert order."; } }
function makeContent($currentPage) { $PAGES_DIR = './pages/'; $PORTIONS_DIR = './htmlPortions/'; $key = makePageKey($currentPage); echo "<!DOCTYPE html>\n"; echo "<html>"; include_once $PORTIONS_DIR . 'head.html'; echo "<body>"; include_once $PORTIONS_DIR . 'banner.html'; clear(); makeNav($key, $PAGES_DIR); clear(); echo "<div id=\"page\"><div id=\"pageContent\">"; include_once $PAGES_DIR . $key . '.html'; echo "</div>"; include_once $PORTIONS_DIR . 'sidebar.html'; echo "</div>"; clear(); echo "<div id=\"footer\">Software and website by <a href=\"http://quentelery.users.sourceforge.net\">Quentin Geissmann</a><br>Website hosted by <a href='http://sourceforge.net'>sourceforge</a></div></body></html>"; }
function edit() { $image = clear($_POST['image']); $assign_banner = clear($_POST['assign_banner']); if ($_FILES['file1']['name']) { if ($_POST['image']) { unlink($this->pathadm . $_POST['image']); unlink($this->pathadm . 'resize/' . $_POST['image']); } $upload1 = new upload(); $upload1->process($_FILES['file1'], $this->pathadm, $this->max_width); $image = clear($upload1->name); } $my_top = isset($_POST['top_name']) ? $this->add_top_name($_POST['top_name']) : clear($_POST['top_type_name']); $topname = isset($my_top['names']) ? $my_top['names'] : $my_top; $toplist = isset($my_top['ids']) ? $my_top['ids'] : ""; $topname2 = isset($_POST['top_type_name2']) ? $_POST['top_type_name2'] : ""; $input = array('name' => clear($_POST['name']), 'alias' => clear($_POST['alias']), 'head_name' => clear($_POST['head_name']), 'status' => intval($_POST['status']), 'top_list' => $toplist, 'top_type_name' => $topname, 'top_type_name2' => $topname2, 'icon_on' => intval($_POST['iconchk']), 'header_text' => clear($_POST['header_text']), 'footer_text' => clear($_POST['footer_text']), 'ordering' => intval($_POST['ordering']), 'cards_list' => implode(',', $_POST['cards']), 'sapxep' => implode(',', $_POST['sapxep']), 'title' => clear($_POST['title']), 'keyword' => clear($_POST['keyword']), 'destination' => clear($_POST['destination']), 'assign_banner' => clear($_POST['assign_banner']), 'banner' => intval($_POST['banner']), 'featured' => intval($_POST['featured']), 'image' => $image, 'card_slogan' => clear($_POST['card_slogan'])); $this->db->update_record($this->table, $input, $this->key . '=' . intval($_GET['id'])); security::redirect($this->module, 'list_types'); }
function edit() { $image = clear($_POST['image']); if ($_FILES['file1']['name']) { if ($_POST['image']) { unlink($this->pathadm . $_POST['image']); unlink($this->pathadm . 'resize/' . $_POST['image']); } $upload1 = new upload(); $upload1->process($_FILES['file1'], $this->pathadm, $this->max_width); $image = clear($upload1->name); } $result = $this->db->query("SELECT tbl_id,alias FROM 8x_cards_bank WHERE tbl_id='" . (int) $_POST['assign_bank'] . "' LIMIT 1 "); $rowdata = $this->db->fetch_assoc($result); //var_dump($image); exit; if (isset($rowdata['tbl_id']) && $rowdata['tbl_id']) { $alias = isset($rowdata['alias']) ? $rowdata['alias'] : ""; $input = array('tbl_id' => $rowdata['tbl_id'], 'name' => clear($_POST['name']), 'alias' => clear($alias), 'destination' => clear($_POST['destination']), 'ordering' => intval($_POST['ordering']), 'status' => intval($_POST['status']), 'image' => $image); $this->db->update_record($this->table, $input, $this->key . '=' . intval($_GET['id'])); } security::redirect($this->module, 'list_issuers'); }
/** * Initialise l'application */ public static function init() { clear(); while (self::$continue === true) { $input = null; self::showHelp(); // L'utilisateur doit rentrer un numéro de commande while ($input === null || $input < 0 || $input >= count(self::$choices)) { $input = ask('Numéro de commande : '); } $command = self::$choices[$input]; // Le numéro est valide, on execute la commande clear(); echo 'Vous avez choisi la commande : "' . $command['text'] . '"' . PHP_EOL; self::exec($command); // Est-ce que l'utilisateur veut continuer ? $input = ask('Voulez-vous continuer ? (O/n) '); if ($input === 'n') { self::$continue = false; } clear(); } }
function clear() { global $user, $mysql, $log, $msg; if (!isset($_POST['confirm_pass'])) { $data = '<p>Bitte geben Sie zur Bestätigung ihr Passwort ein:</p> <form action=' . $_SERVER['REQUEST_URI'] . ' method=post> <input type=password name=confirm_pass /> <input type=submit value=Löschen /> </form>'; } else { if (!($user->password == sha1($_POST['confirm_pass']))) { $msg->error("Ihr Passwort ist Falsch"); //Confirmpass unset damit formular angezeigt wird. unset($_POST['confirm_pass']); $data = clear(); } else { $mysql->query("DELETE FROM " . _PREFIX_ . "log"); $log->add("Aktionschronik vollständig gelöscht"); $msg->success("Aktionschronik vollständig gelöscht."); $data = showlog(); } } return $data; }
$myxid = ""; if (is_array($modul)) { $_GET['module'] = $module = $modul['name']; if (isset($modul['xid'])) { switch ($modul['xid']) { case "issuer": case "type": case "id": case "quality": case "int": case "report": $myxid = $_GET[$modul['xid']] = ${$modul}['xid'] = (int) $modul[$modul['xid']]; break; } } } else { $module = $modul; } $matchcase = 0; $matchx = preg_match("/msie\\s([1-9]*)/i", $_SERVER['HTTP_USER_AGENT'], $oldbrow); if ($matchx && isset($oldbrow[1]) && $oldbrow[1] < 8) { $matchcase = 1; } if (intval($_GET['id']) > 0 || (int) $id > 0) { $view = 'detail'; } if ($_GET['view']) { $view = clear($_GET['view']); } include_once 'includes/class_page.php'; $page = new page();
if (!empty($show_all_ads)) { foreach ($show_all_ads as $show_ad) { echo '<a href="HW10.php?id=' . $show_ad['ad_id'] . '">' . $show_ad['ad_title'] . '</a>' . ' | ' . $show_ad['email'] . ' | <a href="HW10.php?delete=' . $show_ad['ad_id'] . '">Удалить</a><br>'; } } else { echo "Объявлений нет"; } } $city_array = option('cities', 'city'); $category_array = option('categories', 'category'); $type_array = option('types', 'type'); $smarty->assign('city_array', $city_array); $smarty->assign('category_array', $category_array); $smarty->assign('type_array', $type_array); $smarty->register_function('showAd', 'showAd'); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $_POST['user_name'] = clear($_POST['user_name']); $_POST['phone'] = clear($_POST['phone']); $_POST['ad_title'] = clear($_POST['ad_title']); $_POST['ad_description'] = clear($_POST['ad_description']); $row = $_POST; $db->query('INSERT INTO ad(?#) VALUES(?a)', array_keys($row), array_values($row)); header("Location: hw10.php"); } elseif (isset($_GET['delete'])) { $db->query("DELETE FROM ad WHERE ad_id=?d", $_GET['delete']); header("Location: HW10.php"); } elseif (isset($_GET['id'])) { $selected_ads = $db->selectRow("SELECT * FROM ad " . "LEFT JOIN cities on ad.id_city=cities.id_city " . "LEFT JOIN categories on ad.id_category=categories.id_category " . "LEFT JOIN types on ad.id_type=types.id_type " . "WHERE ad_id = ?d", $_GET['id']); $smarty->assign('selected_ads', $selected_ads); } $smarty->display('HW10.tpl');
function edit() { $input = array('name' => clear($_POST['name']), 'ordering' => intval($_POST['ordering'])); $this->db->update_record($this->table, $input, $this->key . '=' . intval($_GET['id'])); security::redirect($this->module, 'list'); }
<?php if (!defined('INCLUDED')) { die("Access Denied"); } if ($_POST['option'] == 'delete') { $menu->delete(); } include_once $menu->module . '/filter.php'; echo "<hr />"; include_once $menu->module . '/home.php'; echo "<hr />"; $option = 'delete'; $where = ''; if ($_GET['position']) { $where = '&& position =\'' . clear($_GET['position']) . '\''; } $row1 = $menu->lists('child = 0 ' . $where); $row = $menu->lists('child != 0 ' . $where); echo $temp->title_lists_form(); echo $temp->td('Menu Name', '20%'); echo $temp->td('Link', '45%'); echo $temp->td('Position', '10%'); echo $temp->td('Order', '10%', 'center'); echo $temp->td('Target', '10%', 'center'); echo $temp->dot('7'); $i = 1; $j = 1; if (!$row1) { exit; }
function edit() { $input = array('name' => clear($_POST['name']), 'link' => clear($_POST['link']), 'ordering' => intval($_POST['ordering']), 'position' => clear($_POST['position']), 'child' => intval($_POST['child']), 'alow' => intval($_POST['alow']), 'target' => clear($_POST['target'])); $this->db->update_record($this->table, $input, $this->key . '=' . intval($_GET['id'])); security::redirect($this->module, 'list'); }
error_reporting(E_ERROR && ~E_NOTICE); if ($_GET['case']) { require "../include/conf.inc.php"; require "../include/db.inc.php"; require "../include/fc.inc.php"; require "../include/const.inc.php"; $string = ''; $ids = array(); $ds = $db->GetAll("SELECT d_id_s, d_date_type_e, UNIX_TIMESTAMP(d_date_d) as data FROM wind_dates WHERE d_case_id_k=" . $_GET['case'] . " ORDER BY d_date_d DESC"); if (count($ds) > 0) { $dates = array(); foreach ($ds as $_id => $D) { $ids[] = $D['d_id_s']; $tmp = ''; $tmp .= ' Data ' . select('d_date_type_e_' . $D['d_id_s'], $_datetypes, $datetypes, $D['d_date_type_e'], 'ret=1 d=1') . ' '; $tmp .= input('d_date_d_' . $D['d_id_s'], date("d.m.Y", $D['data']), 'w=85 r=1 ret=1') . cal_image('d_date_d_' . $D['d_id_s'], 1) . ' ' . clear('d_date_d_' . $D['d_id_s'], '', 1); //if (checkPerm('case', 2)) $tmp .= "<a style='cursor:pointer;' id='edit_date' case='".$_GET['case']."' date='".$D['d_id_s']."'>zmień</a> "; //else $string .= ""; if (checkPerm('case', 4)) { $tmp .= " <a style='cursor:pointer;' id='delete_date' case='" . $_GET['case'] . "' date='" . $D['d_id_s'] . "' type='" . $D['d_date_type_e'] . "'>usuń</a> "; } else { $string .= ""; } $dates[] = $tmp; } } $string .= implode('<br>', $dates); $string .= '<script type="text/javascript">'; foreach ($ids as $_id => $ID) { $string .= print_calendar('d_date_d_' . $ID, 'd_date_d_' . $ID . '_handle'); }
public function add_mass() { $f = fopen($_FILES['file']['tmp_name'], "r"); $i = 0; $array2 = array(); while (!feof($f)) { $res = fgets($f); $array = explode(" ", $res); foreach ($array as $key => $item) { $array[$key] = clear($item); } $array2[$i]['fam'] = $array[0]; $array2[$i]['name'] = $array[1]; $array2[$i]['otch'] = $array[2]; $array2[$i]['phone'] = $array[3]; $array2[$i]['mail'] = $array[4]; $array2[$i]['date'] = $array[5]; $array2[$i]['obl'] = $array[6]; $array2[$i]['gorod'] = $array[7]; $i++; } fclose($f); echo json_encode($array2); }
} ?> <?php $sf_user->setCulture($culture); ?> <?php if ($isUserAdmin && sfConfig::get('sf_cache') == true) { sfPlop::set('sf_plop_cache', true); sfConfig::set('sf_cache', false); } ?> <?php include_partial('sfPlopCMS/slots', array('slots' => $slots, 'subSlots' => $subSlots, 'culture' => $culture, 'isUserAdmin' => $isUserAdmin, 'page' => $page, 'pageTemplate' => $pageTemplate)); echo clear(); ?> <?php if ($isUserAdmin && sfPlop::get('sf_plop_cache') == true) { sfConfig::set('sf_cache', true); } ?> <?php if (!$sf_user->isAuthenticated() && sfPlop::get('sf_plop_use_statistics') == true) { ?> <?php echo sfPlop::get('sf_plop_statistics_code'); }
if(isset($_GET["main-start"])){echo popup_main();exit;} if(isset($_GET["mysqlstatus"])){echo mysql_status();exit;} if(isset($_GET["main"])){echo mysql_main_switch();exit;} if(isset($_GET["mysqlenable"])){echo mysql_enable();exit;} if($_GET["script"]=="mysql_enabled"){echo js_mysql_enabled();exit;} if($_GET["script"]=="mysql_save_account"){echo js_mysql_save_account();exit;} if(isset($_GET["install_app"])){install_app();exit;} if(isset($_GET["InstallLogs"])){GetLogsStatus();exit;} if(isset($_GET["TestConnection-js"])){TestConnection_js();exit;} if(isset($_GET["testConnection"])){testConnection();exit;} if(isset($_GET["remove"])){remove();exit;} if(isset($_GET["uninstall_app"])){remove_perform();exit;} if(isset($_GET["remove-refresh"])){remove_refresh();exit;} if(isset($_GET["ui-samba"])){install_remove_services();exit;} if(isset($_GET["clear"])){clear();exit;} if(isset($_GET["SynSysPackages"])){SynSysPackages();exit;} if(isset($_GET["softwares-available"])){software_available();exit;} if(isset($_GET["remove-app-js"])){remove_app_js();exit;} if(isset($_POST["remove-app-perform"])){remove_app_perform();exit;} if(isset($_GET["RefreshMysqlSetup"])){RefreshMysqlSetup();exit;} if(posix_getuid()<>0){main_page();} function events_js(){ $page=CurrentPageName(); $tpl=new templates(); $title=$tpl->_ENGINE_parse_body("{events}::{{$_GET["CODE_NAME"]}}"); echo "YahooWin5(770,'$page?events-list=yes&CODE_NAME={$_GET["CODE_NAME"]}','$title');"; }
exit; } if (isset($_GET["uninstall_app"])) { remove_perform(); exit; } if (isset($_GET["remove-refresh"])) { remove_refresh(); exit; } if (isset($_GET["ui-samba"])) { install_remove_services(); exit; } if (isset($_GET["clear"])) { clear(); exit; } if (isset($_GET["SynSysPackages"])) { SynSysPackages(); exit; } if (isset($_GET["softwares-available"])) { software_available(); exit; } if (isset($_GET["remove-app-js"])) { remove_app_js(); exit; } if (isset($_POST["remove-app-perform"])) {
{ if (!get_magic_quotes_gpc()) { $message = addslashes($message); } $message = strip_tags($message); $message = htmlentities($message); return trim($message); } if ($_POST['submit']) { if (empty($_POST['postedby'])) { die('Enter a name.'); } else { if (empty($_POST['subject'])) { die('Enter a subject.'); } else { if (empty($_POST['news'])) { die('Enter an article.'); } } } $postedby = clear($_POST['postedby']); $subject = clear($_POST['subject']); $news = clear($_POST['news']); $date = mktime(); mysql_connect('localhost', 'feed', 'katie11'); mysql_select_db('news'); if (mysql_query("INSERT INTO news (id , postedby , news , subject , date) VALUES ('', '{$postedby}', '{$news}', '{$subject}', '{$date}')")) { echo 'News Entered.'; } mysql_close(); }
} $limit = '9'; $i = 1; $select = 'name,pro_id,price,description,cha_id,cat_id,status,image,alias,link_demo,special'; $where = $product->key . '> 0'; if ($_GET['status'] != '') { $where .= ' && status = ' . intval($_GET['status']); } if ($_GET['cu'] > 0) { $where .= ' && p.cha_id = ' . intval($_GET['cha']); } if ($_GET['cat'] > 0) { $where .= ' && p.cat_id = ' . intval($_GET['cat']); } if ($_GET['name']) { $where .= '&& p.name LIKE \'%' . clear($_GET['name']) . '%\''; } if ($_GET['id']) { $where = $product->key . '=' . intval($_GET['id']); } $paging = $page->paging($product->table . ' as p', $limit, $where, 1); $row = $product->lists($select, $where, '', $page->limit(), '1'); ?> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> <td width="1"><img src="images/h_trai.gif"></td> <td class="tieude"> New website template </td>
<?php require_once "inc/db.php"; require_once "inc/functions.php"; if (isset($_POST['title']) && isset($_POST['year']) && isset($_POST['format']) && isset($_POST['cast'])) { $title = clear($_POST['title']); $year = clear($_POST['year']); if (!preg_match('/(1|2)[0-9]{3}/', $year)) { $year = date("Y"); } $format = clear($_POST['format']); $cast = explode(",", clear($_POST['cast'])); foreach ($cast as $key => $value) { $trimmed = trim($value); $pieces = explode(" ", $trimmed); $surname = array_pop($pieces); $name = implode(" ", $pieces); $cast[$key] = [$name, $surname]; } addItem($db, $title, $year, $format, $cast); header("Location: index.php"); } else { header("Location: index.php"); exit; }
break; case 'informer': //текстинформера ссылки $informer_id = abs((int) $_GET['informer_id']); $text_informer = get_text_informer($informer_id); break; case 'cat': // товары $category = abs((int) $_GET['category']); //получаем из адресной строки /* параметры для сортировки */ //массив параметров сортировки //ключи - то, что передаем GET-параметром //значения - то что показ пользователю, и часть SQL запроса, который передаем в модель $order_p = array('pricea' => array('от дешевых к дорогим', 'price ASC'), 'priced' => array('от дорогих к дешевым', 'price DESC'), 'datea' => array('по дате - с первых', 'date ASC'), 'dated' => array('последние добавленные', 'date DESC'), 'namea' => array('от А до Я', 'name ASC'), 'named' => array('от Я до А', 'name DESC')); $order_get = clear($_GET['order']); //получаем возможный параметр из адресной строки if (array_key_exists($order_get, $order_p)) { $order = $order_p[$order_get][0]; $order_db = $order_p[$order_get][1]; } else { //если пользователь ввел что угодно //сортируем по умолчанию по 1му элементу массива order_p -по имени $order = $order_p['namea'][0]; $order_db = $order_p['namea'][1]; } /* параметры для сортировки */ //постраничная навигация, параметры $perpage = PERPAGE; //кол-во товаров на страницу if (isset($_GET['page'])) {
' size="50"></td></tr> </table> <input type = 'submit' value = 'Aggiorna'> </form> <?php } break; case '13': if (@$_GET['reset'] == 1) { mysql_query("UPDATE " . __PREFIX__ . "users SET theme = 'default.css'") or _err(mysql_error()); print "\n<script>alert(\"Reset Completato\"); window.location=\"admin.php\";</script>"; } print "<script>" . "\n\tif(confirm('Sei sicuro di voler procedere al reset del tema per tutti gli utenti?.') == true) {" . "\n\t\tlocation.href = 'admin.php?mode=13&reset=1'" . "\n\t}else{" . "\n\t\tlocation.href = 'admin.php'" . "\n\t}" . "\n</script>"; break; case '14': @($username = clear($_POST['username'])); if ($username) { $query = "SELECT id, level FROM " . __PREFIX__ . "users WHERE username = '******'"; $row = mysql_fetch_row(mysql_query($query)); if (!$row[0]) { _err("Errore! L'Username Specificato non esiste!"); } if ($row[0] == nick2uid($usr)) { _err("Errore! L'utente selezionato è già VIP!"); } if ($row[1] == 'vip') { $query = "UPDATE " . __PREFIX__ . "users SET level = 'user' WHERE id = '" . $row[0] . "'"; } else { $query = "UPDATE " . __PREFIX__ . "users SET level = 'vip' WHERE id = '" . $row[0] . "'"; } mysql_query($query) or _err(mysql_error());