Jad Meouchy %!s(int64=9) %!d(string=hai) anos
pai
achega
8929799df5
Modificáronse 4 ficheiros con 7 adicións e 11 borrados
  1. 2 0
      api/auth-validate.php
  2. 1 3
      api/getCompanies.php
  3. 1 1
      api/getCompanyData.php
  4. 3 7
      api/updateCell.php

+ 2 - 0
api/auth-validate.php

@@ -1,5 +1,7 @@
 <?php
 
+require('db.inc.php');
+
 @session_start();
 
 if(!$_SESSION['id_user'])

+ 1 - 3
api/getCompanies.php

@@ -1,6 +1,4 @@
-<?php
-
-include 'db.inc.php';
+<?php require('auth-validate.php');
 
 //get all companies
 

+ 1 - 1
api/getCompanyData.php

@@ -1,4 +1,4 @@
-<?php
+<?php require('auth-validate.php');
 
 include 'db.inc.php';
 

+ 3 - 7
api/updateCell.php

@@ -1,8 +1,6 @@
-<?php
+<?php require('auth-validate.php');
 
-require('auth-validate.php');
-
-$id_user = 
+$id_user = $_SESSION['id_user'];
 
 $id_file_row = isset($_REQUEST['id_file_row']) ? $_REQUEST['id_file_row'] : null;
 $key = isset($_REQUEST['key']) ? $_REQUEST['key'] : null;
@@ -11,9 +9,7 @@ $value = isset($_REQUEST['value']) ? $_REQUEST['value'] : null;
 
 $stmt_file = $dbh->prepare(
 	"INSERT INTO file_row_update (id_file_row, key, value, id_user)
-	VALUES()
-	id_company, name, description
-	FROM company");
+	VALUES(:id_file_row, :key, :value, :id_user)";
 							
 $stmt_file->execute();