Friday, July 27, 2018

response modify

Jelena Gavrilović



response.php

String.Format("<a href='/{0}'>view</a>&nbsp;<a href='/{0}'>edit</a>", item.ID),

<?php
include("connection.php");
$db = new dbObj();
$connString =  $db->getConnstring();

$params = $_REQUEST;

$action = isset($params['action']) != '' ? $params['action'] : '';
$empCls = new Employee($connString);

switch($action) {
case 'add':
$empCls->insertEmployee($params);
break;
case 'edit':
$empCls->updateEmployee($params);
break;
case 'delete':
$empCls->deleteEmployee($params);
break;
default:
$empCls->getEmployees($params);
return;
}
class Employee {
protected $conn;
protected $data = array();
function __construct($connString) {
$this->conn = $connString;
}

public function getEmployees($params) {
$this->data = $this->getRecords($params);

echo json_encode($this->data);
}
function insertEmployee($params) {
$data = array();;
// $sql = "INSERT INTO `employee` (employee_name, employee_salary, employee_age) VALUES('" . $params["name"] . "', '" . $params["salary"] . "','" . $params["age"] . "');  ";

$sql = "INSERT INTO evidencija (ime, otac, datum, napomena, prilog, status) VALUES('" . $params["ime"] . "', '" . $params["otac"] . "','" . $params["datum"] . "','" . $params["napomena"] . "','" . $params["prilog"] . "','" . $params["status"] . "');  ";


echo $result = mysqli_query($this->conn, $sql) or die("error to insert - data");

}

function getRecords() {
$rp = isset($_POST['rp']) ? $_POST['rp'] : 10;
$sortname = isset($_POST['sortname']) ? $_POST['sortname'] : 'ime';
$sortorder = isset($_POST['sortorder']) ? $_POST['sortorder'] : 'desc';
$query = isset($_POST['query']) ? $_POST['query'] : false;
$qtype = isset($_POST['qtype']) ? $_POST['qtype'] : false;

if (isset($_POST['page'])) { $page  = $_POST['page']; } else { $page=1; };  
        $start_from = ($page-1) * $rp;


$where = "";
if ($query) {$where = " WHERE $qtype LIKE '%$query%' ";
$sort = "ORDER BY $sortname $sortorder";
//$sql = "SELECT iso,name,printable_name,iso3,numcode FROM country $where $sort $limit";

$sql = "SELECT * FROM evidencija ". $where." ". $sort;
$sqlTot = $sql;

}
else
{

$sql = "SELECT * FROM evidencija order by ".$sortname." ".$sortorder." LIMIT ". $start_from .",".$rp;
$sqlTot = "SELECT * FROM evidencija";
}
$qtot = mysqli_query($this->conn, $sqlTot) or die("error to fetch tot * data");
$queryRecords = mysqli_query($this->conn, $sql) or die("error to fetch * data");

while( $row = mysqli_fetch_assoc($queryRecords) ) { 
$data[] = $row;
//echo "<pre>";print_R($data);die;

//$data[] = "<a href=./".$row.">".$row."</a>";

}
$json_data = array(
"page"            => $page,   
"total"    => intval($qtot->num_rows),
"rows"            => $data   // total data array
);

return $json_data;
}
function updateEmployee($params) {
$data = array();
//print_R($_POST);die;
// $sql = "Update `employee` set employee_name = '" . $params["edit_name"] . "', employee_salary='" . $params["edit_salary"]."', employee_age='" . $params["edit_age"] . "' WHERE id='".$_POST["edit_id"]."'";

$sql = "Update evidencija set ime = '" . $params["edit_ime"] . "', otac='" . $params["edit_otac"] . "', datum='" . $params["edit_datum"] . "', napomena='" . $params["edit_napomena"] . "', prilog='" . $params["edit_prilog"] . "', status='" . $params["edit_status"] . "' WHERE id='".$_POST["edit_id"]."'";



echo $result = mysqli_query($this->conn, $sql) or die("error to update - data");
}

function deleteEmployee($params) {
$data = array();
//print_R($_POST);die;
$sql = "delete from evidencija WHERE id='".$params["id"]."'";

echo $result = mysqli_query($this->conn, $sql) or die("error to delete - data");
}
}
?>


https://www.experts-exchange.com/questions/28498124/link-to-hyperlink-contained-in-table-row-in-a-javascript-function.html


https://onedrive.live.com/?authkey=%21AIrZFxqfvpSKaHo&cid=F8FFD0AC30BCE424&id=F8FFD0AC30BCE424%21114&parId=root&action=locate

Sunday, July 22, 2018

Faster DNS

Setup on PC

Setting up 1.1.1.1 takes two minutes and requires no technical skill or special software. Even if you’re a computer novice, pick your device below for an easy-to-follow setup guide.
  1. Click on the Start menu, then click on Control Panel.
  2. Click on Network and Internet.
  3. Click on Change Adapter Settings.
  4. Right click on the Wi-Fi network you are connected to, then click Properties.
  5. Select Internet Protocol Version 4 (or Version 6 if desired).
  6. Click Properties.
  7. Write down any existing DNS server entries for future reference.
  8. Click Use The Following DNS Server Addresses.
  9. Replace those addresses with the 1.1.1.1 DNS addresses:
    • For IPv4: 1.1.1.1 and 1.0.0.1
    • For IPv6: 2606:4700:4700::1111 and 2606:4700:4700::1001
  10. Click OK, then Close.
  11. Restart your browser.
  12. You’re all set! Your device now has faster, more private DNS servers ✌️✌️





Tuesday, July 17, 2018

Kako odrediti i izmeniti pravila pristupa sajtovima na kompjuteru - najbrzi metod


Pogledajte prethodni post i napravite fajl IZMENA.BAT, na način sličan kako sam opisao za BLOK.BAT:


rem ---------------------------------Pocetak---------------------------------------->8-----------

@echo off
takeown /f "%windir%\system32\drivers\etc\hosts" && icacls "%windir%\system32\drivers\etc\hosts" /grant administrators:F
attrib -s -h -r %windir%\system32\drivers\etc\hosts

pause
%windir%\notepad.exe %windir%\system32\drivers\etc\hosts

attrib +s +h +r %windir%\system32\drivers\etc\hosts
pause


rem -------------8<--------------------Kraj--------------------------------------------------------


Kada startujete ovaj BAT fajl kao administrator (Run As Administrator) pojaviće se sadržaj hosts fajla koji možete menjati po volji i snimiti, što nije slučaj kada ovom fajlu pristupate direktno preko My Computer-a, odnosno Explorer-a.

Kako blokirati neposlovne sajtove

1) otvorite NOTEPAD

2) iskopirajte sledeci tekst:

rem ----------------------------->8-----------------------Pocetak--------------------------------------------

@echo off
takeown /f "%windir%\system32\drivers\etc\hosts" && icacls "%windir%\system32\drivers\etc\hosts" /grant administrators:F
attrib -s -h -r %windir%\system32\drivers\etc\hosts

ECHO 127.0.0.1 facebook.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.facebook.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 twitter.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.twitter.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 instagram.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.instagram.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.vesti-online.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.b92.net>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.espreso.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 svet.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.svet.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.vesti.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 rs.n1info.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.srbijadanas.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 prva.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.prva.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 novosti.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.novosti.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 mondo.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.mondo.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.krik.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 beta.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.beta.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 hellomagazin.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.hellomagazin.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.vestinet.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.gloria.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.happytv.tv>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.smedia.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.krstarica.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.ozon.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 insajder.net>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 tracara.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 news.google.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.slobodnaevropa.org>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.republika.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.021.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.republika.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.fss.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.intermagazin.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.itvesti.info>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 scandal.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.scandal.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.informacija.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 time.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.svevesti.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.navidiku.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.polovniautomobili.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.vreme.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 okradio.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.youtube.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 starmagazin.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.danas.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.vesti-gazeta.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 vesti.mojauto.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 webtribune.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.pravda.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 politika.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.politika.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.blic.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.kurir.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 telegraf.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.telegraf.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 alo.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.alo.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 informer.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.informer.rs>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 naslovi.net>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.naslovi.net>>%WINDIR%\System32\drivers\etc\hosts


pause
%windir%\notepad.exe %windir%\system32\drivers\etc\hosts

attrib +s +h +r %windir%\system32\drivers\etc\hosts
pause


rem -----------------------------8<-----------------------Kraj--------------------------------------------


3) Snimite fajl kao "BLOK.BAT", navodnici su obavezni !

Kliknite desnim tasterom na taj dobijeni fajl i odaberite "Run As Administrator".

4) Sada Vaši zaposleni neće gubiti previše vremena na gledanju nebitnih sadržaja tokom posla.

5) Naravno, podrazumeva se da ovaj BLOK.BAT fajl startujete na svim kompjuterima u Vašoj firmi, kod svih zaposlenih.

Podrazumeva se i da Vi imate administratorska prava - administratorski nalog na svakom kompjuteru, a oni ga nemaju.

6) Srećno !





Ukoliko i Vi imate da reklamirate neki svoj proizvod ili slične sadržaje, blogove, knjige i sajtove slobodno me kontaktirajte.



Monday, July 16, 2018

kako-blokirati-facebook

My solution:

@echo off
takeown /f "%windir%\system32\drivers\etc\hosts" && icacls "%windir%\system32\drivers\etc\hosts" /grant administrators:F
attrib -s -h -r %windir%\system32\drivers\etc\hosts
ECHO 127.0.0.1 facebook.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.facebook.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 twitter.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.twitter.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 instagram.com>>%WINDIR%\System32\drivers\etc\hosts
ECHO 127.0.0.1 www.instagram.com>>%WINDIR%\System32\drivers\etc\hosts
attrib +s +h +r %windir%\system32\drivers\etc\hosts
pause
%windir%\notepad.exe %windir%\system32\drivers\etc\hosts








Sources:


https://www.vesic.org/blog/kako-blokirati-facebook-i-jos-ponesto-kontrola-pristupa-webu/


@echo off
takeown /f "%windir%\system32\drivers\etc\hosts" && icacls "%windir%\system32\drivers\etc\hosts" /grant administrators:F
attrib -s -h -r %windir%\system32\drivers\etc\hosts
%windir%\notepad.exe %windir%\system32\drivers\etc\hosts

*

127.0.0.1 facebook.com
127.0.0.1 www.facebook.com

127.0.0.1 twitter.com
127.0.0.1 www.twitter.com

127.0.0.1 instagram.com
127.0.0.1 www.instagram.com


More info...


http://www.eureka-centar.hr/upisi/on-line-testiranje/engleski-jezik/3/



My ideas:

@echo off
takeown /f "%windir%\system32\drivers\etc\hosts" && icacls "%windir%\system32\drivers\etc\hosts" /grant administrators:F
attrib -s -h -r %windir%\system32\drivers\etc\hosts
%windir%\notepad.exe %windir%\system32\drivers\etc\hosts

127.0.0.1 facebook.com

127.0.0.1 www.facebook.com



127.0.0.1 twitter.com

127.0.0.1 www.twitter.com



127.0.0.1 instagram.com

127.0.0.1 www.instagram.com


@echo off
attrib -r -a -s -h C:\WINDOWS\System32\Drivers\etc\hosts 1>nul 
C:\WINDOWS\System32\Drivers\etc\hosts >> echo 200.100.10.20    www.bogus.com
C:\WINDOWS\System32\Drivers\etc\hosts >> echo 200.100.10.22    www.fake.com



@echo off

SET NEWLINE=^& echo.

ECHO %NEWLINE%^ >>%WINDIR%\System32\drivers\etc\hosts

FIND /C /I "heracles.fila" %WINDIR%\system32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 heracles.fila>>%WINDIR%\System32\drivers\etc\hosts

FIND /C /I "www.heracles.fila" %WINDIR%\system32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 www.heracles.fila>>%WINDIR%\System32\drivers\etc\hosts

FIND /C /I "api.heracles.fila" %WINDIR%\system32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 api.heracles.fila>>%WINDIR%\System32\drivers\etc\hosts

FIND /C /I "bracket.heracles.fila" %WINDIR%\system32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 bracket.heracles.fila>>%WINDIR%\System32\drivers\etc\hosts

FIND /C /I "onvenue.heracles.fila" %WINDIR%\system32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 bracket.heracles.onvenue>>%WINDIR%\System32\drivers\etc\hosts