monmon vor 5 Jahren
Ursprung
Commit
275039eb3d
7 geänderte Dateien mit 39 neuen und 5 gelöschten Zeilen
  1. 4 3
      api/v1/Users/addUser.php
  2. BIN
      db/f.db
  3. 12 0
      header.php
  4. 4 0
      home.php
  5. 1 1
      index.php
  6. 17 0
      ini/logs/log.txt
  7. 1 1
      pid

+ 4 - 3
api/v1/Users/addUser.php

@@ -1,7 +1,7 @@
 <?php 
   require "connectionDb.php";
 
-  if (isset($_POST['edit']) && $_POST['role']!='super' && $_POST['username']!='super' && $_POST['email']!='super' ) {
+  if (isset($_POST['add']) && $_POST['role']!='super' && $_POST['username']!='super' && $_POST['email']!='super' ) {
     
 
      $role = $_POST['role'];
@@ -9,11 +9,12 @@
      $username = $_POST['username'];
      $email = $_POST['email'];
      $password = $_POST['password'];
+     $passcode = generate_password();
      $pumplist = $_POST['pumplist'];
      $pumpliststr = implode(",", $pumplist);
 
      
-     $sql ="INSERT INTO user SET created_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),updated_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'), name='$username', email='$email', password='$password',role='$role',pump_list='$pumpliststr' WHERE id='$id'";
+     $sql ="INSERT INTO user SET created_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),updated_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'), name='$username', email='$email', password='$password',role='$role',pump_list='$pumpliststr',pass_code='$passcode' WHERE id='$id'";
 
     $db->exec($sql);
 
@@ -121,7 +122,7 @@ input[type=checkbox]:checked:after {
  
   <div class="form-group">
       <div class="col-sm-offset-2 col-sm-10"> 
-    <input type="submit" name="edit" value="Submit" class="btn btn-success">
+    <input type="submit" name="add" value="Submit" class="btn btn-success">
     <input type="button" value="Cancel" class="btn btn-danger" onclick="document.getElementById('editVForm').style.display = 'none';">
     </div>
   </div>

BIN
db/f.db


+ 12 - 0
header.php

@@ -12,6 +12,18 @@ function decimalAndNumberFormat3($number){
   $i = number_format(round($number,3));
   return $i;
 }
+
+function generate_password($length = 6){
+$chars =  '0123456789';
+
+$str = '';
+$max = strlen($chars) - 1;
+
+for ($i=0; $i < $length; $i++)
+  $str .= $chars[random_int(0, $max)];
+
+return $str;
+}
 ?>
 <!DOCTYPE html>
 <html lang="en" >

+ 4 - 0
home.php

@@ -1,3 +1,7 @@
 <?php 
+<<<<<<< HEAD
 	echo "<CENTER><h1>WELCOME TO ADMIN PAGE</h1></CENTER>";
+=======
+	echo '<CENTER>WELCOME TO ADMIN PAGE</CENTER>';
+>>>>>>> a05cdaf0169bcc43dd534dbc668c788c3e73a1cd
  ?>

+ 1 - 1
index.php

@@ -14,7 +14,7 @@
 	function changePages(fileLocation) {
 		// alert(fileLocation);
 		document.getElementById('loadFrame').src = fileLocation;
-	}
+	} 	
 	
 var selector='.sidebar-menu li';
 	$(selector).on('click', function(){

+ 17 - 0
ini/logs/log.txt

@@ -2684,3 +2684,20 @@ Fps after connect: [{1 2  86  [] false } {2 2  82  [] false } {3 2  82  [] false
 products: map[1:{1 Diesel 000000} 2:{2 P Diesel 000000} 3:{3 92 RON 000000} 4:{4 95 RON 000000} 5:{5 MS 000000} 6:{6 97 RON 000000}]
 tanks: map[1:{1 1 1} 2:{2 2 2} 3:{3 3 3} 4:{4 4 4} 5:{5 5 5} 7:{7 6 7}]
 Fps after connect: [{1 2  86  [] false } {2 2  82  [] false } {3 2  82  [] false } {4 2  82  [] false } {5 2  82  [] false } {6 2  82  [] false } {7 2  86  [] false } {8 2  82  [] false }]
+---------------------------------------------------
+Forward Station System (FSS) - v0.1.19
+===============
+Ini File Directory ini/
+Data Directory : ./db/
+dbmigration:true
+dblogmode:false
+Static File Location : ./static/
+Static POS Location : ./static-pos/
+Pos Binary Location : ./PosBinary/
+Log Level : ERROR
+DOMS IP Address : 192.168.1.100
+Printer : usb:/dev/usb/lp1
+Forward Station System (FSS) Server started endpoints at : 9999
+products: map[1:{1 Diesel 000000} 2:{2 P Diesel 000000} 3:{3 92 RON 000000} 4:{4 95 RON 000000} 5:{5 MS 000000} 6:{6 97 RON 000000}]
+tanks: map[1:{1 1 1} 2:{2 2 2} 3:{3 3 3} 4:{4 4 4} 5:{5 5 5} 7:{7 6 7}]
+Fps after connect: [{1 1  4  [] false } {2 1  0  [] false } {3 1  0  [] false } {4 1  0  [] false } {5 1  0  [] false } {6 1  0  [] false } {7 1  4  [] false } {8 1  0  [] false }]

+ 1 - 1
pid

@@ -1 +1 @@
-4234
+8047