Jad Meouchy 9 lat temu
rodzic
commit
3dea609171
15 zmienionych plików z 237 dodań i 84 usunięć
  1. 0 0
      api/getData.php
  2. 5 0
      api/loadXLS.php
  3. 5 0
      api/updateCell.php
  4. 42 1
      css/general.css
  5. 32 0
      css/nav.css
  6. 0 19
      html/login.html
  7. 7 0
      html/nav.html
  8. 0 0
      html/screen/admin.html
  9. 25 0
      html/screen/login.html
  10. 78 0
      html/screen/sd.html
  11. 0 56
      html/sd.html
  12. 3 1
      index.html
  13. 35 2
      js/init.js
  14. 5 5
      js/routes.js
  15. BIN
      media/sd.gif

+ 0 - 0
api/getData.php


+ 5 - 0
api/loadXLS.php

@@ -0,0 +1,5 @@
+<?php
+
+
+
+?>

+ 5 - 0
api/updateCell.php

@@ -0,0 +1,5 @@
+<?php
+
+$id_record
+
+?>

+ 42 - 1
css/general.css

@@ -83,7 +83,7 @@ body > .screen
 {
 	display: none;
 	position: absolute;
-	top: 3.25rem;
+	top: 8rem;
 	left: 0;
 	width: 100%;
 	overflow-x: hidden;
@@ -124,4 +124,45 @@ body > .screen.active
 	background: #eee;
 	
 	z-index: 9999 !important;
+}
+
+body.screen-login #nav
+{
+	display: none;
+}
+
+
+#screen-sd table.editable
+{
+	background: #f4f4f4;
+}
+
+.table-responsive 
+{   
+    width: 100%;
+    margin-bottom: 15px;
+    overflow-x: auto;   
+    overflow-y: hidden;
+    -webkit-overflow-scrolling: touch;
+    -ms-overflow-style: -ms-autohiding-scrollbar;
+    border: 1px solid #ccc;
+}
+
+#screen-sd table.editable thead > tr > th
+{
+	font-weight: normal;
+	opacity: 0.9;
+}
+
+#screen-sd table.editable thead > tr > th.editable
+{
+	font-weight: bold;
+}
+
+
+@media (min-width: 1500px)
+{
+	.container {
+		width: 1400px;
+	}
 }

+ 32 - 0
css/nav.css

@@ -0,0 +1,32 @@
+#nav
+{
+	position: absolute;
+	top: 0;
+	width: 100%;
+	
+	/*background-color: #000;*/
+	/*box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
+	height: 8rem;
+	box-sizing: border-box;
+	z-index: 1;
+	color: white;
+	
+	padding: 0.5em 0;
+	
+	overflow: hidden;
+}
+
+#nav > .container
+{
+	height: 100%;
+}
+
+#nav .logo
+{
+	height: 100%;
+}
+
+#nav .logo > img
+{
+	height: 100%;
+}

+ 0 - 19
html/login.html

@@ -1,19 +0,0 @@
-<div id="screen-login" class="screen">
-	<div class="container">
-
-	<form class="form-signin">
-	<h2 class="form-signin-heading">Special Dispatch</h2>
-	<label for="inputEmail" class="sr-only">Email address</label>
-	<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
-	<label for="inputPassword" class="sr-only">Password</label>
-	<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
-	<div class="checkbox">
-	  <label>
-		<input type="checkbox" value="remember-me"> Remember me
-	  </label>
-	</div>
-	<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
-	</form>
-
-	</div>
-</div>

+ 7 - 0
html/nav.html

@@ -0,0 +1,7 @@
+<nav id="nav">
+	<div class="container">
+		<a href="#/" class="logo">
+			<img src="media/sd.gif"/>
+		</a>
+	</div>
+</nav>

+ 0 - 0
html/admin.html → html/screen/admin.html


+ 25 - 0
html/screen/login.html

@@ -0,0 +1,25 @@
+<div id="screen-login" class="screen">
+	<div class="container">
+		<form class="form-signin">
+		
+			<center><img src="media/sd.gif"/></center>
+			<br/>
+			
+			
+			<label for="email" class="sr-only">Email address</label>
+			<input type="email" id="email" class="form-control" placeholder="Email address" required autofocus>
+			<label for="password" class="sr-only">Password</label>
+			<input type="password" id="password" class="form-control" placeholder="Password" required>
+			
+			<!--
+			<div class="checkbox">
+			  <label>
+				<input type="checkbox" value="remember-me"> Remember me
+			  </label>
+			  
+			</div>
+			-->
+			<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
+		</form>
+	</div>
+</div>

+ 78 - 0
html/screen/sd.html

@@ -0,0 +1,78 @@
+<div id="screen-sd" class="screen">
+	<div class="container">
+		<br/>
+		<ul class="nav nav-tabs">
+			<li class="active"><a data-toggle="tab" href="#table1">Dynamics</a></li>
+			<li><a data-toggle="tab" href="#table2">Tilly's</a></li>
+			<li><a data-toggle="tab" href="#table3">Sephoria</a></li>
+		</ul>
+
+		<div class="tab-content">
+			<div id="table1" class="tab-pane fade in active">
+				<div class="hero-unit">
+				<!--
+					<h1>Worksheet</h1>
+					<h4>live edit</h4>
+					-->
+					<br/>
+				
+					<div class="table-responsive">
+						<table class="table table-striped editable" style="cursor: pointer;">
+							<thead>
+								<tr>
+									<th>Division</th>
+									<th>Consignee</th>
+									<th>Called&nbsp;In</th>
+									<th>Dispatch&nbsp;#</th>
+									<th>Shipper</th>
+									<th>Ready</th>
+									<th>Address&nbsp;1</th>
+									<th>Address&nbsp;2</th>
+									<th>City</th>
+									<th>ST</th>
+									<th>Zip</th>
+									<th>Phone</th>
+									
+									<th>Ready&nbsp;Time</th>
+									<th>Close&nbsp;Time</th>
+									<th class="editable">Pickup&nbsp;Time</th>
+									<th class="editable">Depart&nbsp;Time</th>
+									<th class="editable">BOL&nbsp;Delivered</th>
+									
+									<th>Dispatch&nbsp;Refere</th>
+									
+									<th>Ctns</th>
+									<th>Weight</th>
+									<th>Cube</th>
+								</tr>
+							</thead>
+						
+							<tbody>
+							</tbody>
+						
+							<tfoot></tfoot>
+						</table>
+					</div>
+
+					<input style="position: absolute; display: none;">
+					
+					<!--
+					<div style="text-align: right">
+						<button type="submit" class="btn btn-primary">Save</button>
+					</div>
+					-->
+				</div>
+			</div>
+			
+			<div id="table2" class="tab-pane fade">
+				<h3>Menu 1</h3>
+				<p>Some content in menu 1.</p>
+			</div>
+			
+			<div id="table3" class="tab-pane fade">
+				<h3>Menu 2</h3>
+				<p>Some content in menu 2.</p>
+			</div>
+		</div>
+	</div>
+</div>

+ 0 - 56
html/sd.html

@@ -1,56 +0,0 @@
-<div id="screen-sd" class="screen">
-	<div class="container">
-		<br/>
-		<ul class="nav nav-tabs">
-			<li class="active"><a data-toggle="tab" href="#home">Company 1</a></li>
-			<li><a data-toggle="tab" href="#menu1">Dynamics</a></li>
-			<li><a data-toggle="tab" href="#menu2">Tilly's</a></li>
-			<li><a data-toggle="tab" href="#menu2">Sephoria</a></li>
-		</ul>
-
-		<div class="tab-content">
-			<div id="home" class="tab-pane fade in active">
-				<div class="hero-unit">
-					<h1>Worksheet</h1>
-					<h4>live edit</h4>
-					
-					<hr>
-					
-					<div class="alert alert-error hide">
-						That would cost too much
-					</div>
-				
-					<table id="mainTable" class="table table-striped" style="cursor: pointer;">
-						<thead><tr><th>Name</th><th>Cost</th><th>Profit</th><th>Fun</th></tr></thead>
-					
-						<tbody>
-							<tr><td tabindex="1">Car</td><td tabindex="1">100</td><td tabindex="1">200</td><td tabindex="1">0</td></tr>
-							<tr><td tabindex="1">Bike</td><td tabindex="1">330</td><td tabindex="1">240</td><td tabindex="1">1</td></tr>
-							<tr><td tabindex="1">Plane</td><td tabindex="1">430</td><td tabindex="1">540</td><td tabindex="1">3</td></tr>
-							<tr><td tabindex="1">Yacht</td><td tabindex="1">100</td><td tabindex="1">200</td><td tabindex="1">0</td></tr>
-							<tr><td tabindex="1">Segway</td><td tabindex="1">330</td><td tabindex="1">240</td><td tabindex="1">1</td></tr>
-						</tbody>
-					
-						<tfoot><tr><th><strong>TOTAL</strong></th><th>1290</th><th>1420</th><th>5</th></tr></tfoot>
-					</table>
-
-					<input style="position: absolute; display: none;">
-					
-					<div style="text-align: right">
-						<button type="submit" class="btn btn-primary">Save</button>
-					</div>
-				</div>
-			</div>
-			
-			<div id="menu1" class="tab-pane fade">
-				<h3>Menu 1</h3>
-				<p>Some content in menu 1.</p>
-			</div>
-			
-			<div id="menu2" class="tab-pane fade">
-				<h3>Menu 2</h3>
-				<p>Some content in menu 2.</p>
-			</div>
-		</div>
-	</div>
-</div>

+ 3 - 1
index.html

@@ -14,6 +14,7 @@
 	
 	<link rel="stylesheet" type="text/css" href="css/loading.css"/>
 	<link rel="stylesheet" type="text/css" href="css/login.css"/>
+	<link rel="stylesheet" type="text/css" href="css/nav.css"/>
 	<link rel="stylesheet" type="text/css" href="css/general.css"/>
 	<link rel="stylesheet" type="text/css" href="css/sd.css"/>
 
@@ -36,6 +37,7 @@
 <script src="js/vendor/jquery-2.2.4.js"></script>
 <script src="js/vendor/bootstrap.js"></script>
 <script src="js/vendor/routie.custom.js"></script>
+<script src="js/vendor/mindmup-editabletable.js"></script>
 
 <script src="js/authorization.js"></script>
 <script src="js/helper.js"></script>
@@ -48,7 +50,7 @@
 $(function()
 {
 	loadHTML('html/', [
-			'login', 'sd'])
+			'nav', 'screen-login', 'screen-sd', 'screen-admin'])
 			.done(window.loadApp);
 });
 </script>

+ 35 - 2
js/init.js

@@ -7,9 +7,42 @@ var router = window['router'];
 
 function loadApp()
 {
+	initializeRoutes();
+	router.reload();
+
 	//login and logout
-	//$('form.login').submit(login);
+	$('form.form-signin').submit(login);
 	//$('#logout').click(logout);
 	
-	showPage('login');
+	
+	$('table.editable').editableTableWidget();
+	
+	$('table.editable td').on('change', function(evt, newValue)
+	{
+		// do something with the new cell value 
+/*		if (....) { 
+			return false; // reject change
+		}
+*/
+	});
+	
+	loadData();
+}
+
+function login(e)
+{
+	e.preventDefault();
+	
+	router('/sd');
+	
+	return false;
+}
+
+function loadData()
+{
+	
+}
+
+function addCompany(company)
+{
 }

+ 5 - 5
js/routes.js

@@ -3,10 +3,10 @@
 
 function initializeRoutes()
 {
-	router('/home',			routes.home);
-	router('/sd',	routes.sd);
+	router('/login',		routes.login);
+	router('/sd',			routes.sd);
 	
-	router('*',				routes.home);
+	router('*',				routes.login);
 }
 
 
@@ -15,9 +15,9 @@ function initializeRoutes()
 
 var routes =
 {
-	home: function()
+	login: function()
 	{
-		showPage('home');
+		showPage('login');
 	},
 	
 	sd: function()

BIN
media/sd.gif