<?php
session_start();
if (!isset($_SESSION['reusername'])) { echo 'Sorry You Dont Have permissions to View this Page!'; exit();}
require_once 'includes/database.php';
											// sAVes traker
$db=new MySQLDatabase();
$db->open_connection();
if (isset($_REQUEST['im'])){
	$imeino = htmlspecialchars($_GET['im']);
            $dd = htmlspecialchars($_GET['d']);
            $mobno = htmlspecialchars($_GET['mo']);
            $itype = htmlspecialchars($_GET['it']);
            $idate = substr($dd,6,4)."-".substr($dd,3,2)."-".substr($dd,0,2);
            $ts = date('Y-m-d h:i:s');
			$us = $_SESSION['reusername'];
			$query = "INSERT INTO devstock (itype, imeino, idate, mobno, ts, us) VALUES ('$itype', '$imeino', '$idate', '$mobno', '$ts', '$us'); ";
            $result = mysqli_query($db->connection, $query) or die(mysqli_error($db->connection) );
        }        
$db->close_connection();	
  
?>	  