Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,28 @@ const UserSchema = new Schema({
mobile: {
type: String,
},
age:{
type:Number
},
height:{
type:Number
},
weight:{
type:Number
},
email: {
type: String,

},
designation: {
userType: {
type: String,

},
hospital: {
type: String
},
bloodGroup:{
type: String
}
// type: Date,
// required: true
Expand Down
3 changes: 0 additions & 3 deletions modules/app.module.js

This file was deleted.

4 changes: 4 additions & 0 deletions public/app.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Created by Sk on 6/29/2017.
*/
angular.module('PharmacyApp', []);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ angular.module('PharmacyApp').controller('UserController',['$scope','UserService
* GETTERS
* */

$scope.query = {}
$scope.queryBy = '$'
$scope.orderProp="name";
//1. Get Users
function getusers() {
UserService.get().then(users => {
Expand All @@ -30,6 +33,11 @@ angular.module('PharmacyApp').controller('UserController',['$scope','UserService
});
};

$scope.searchUser = function() {
user = {};
getusers();
};

$scope.deleteUser = function(id) {
UserService.delete(id).then(() => {
getusers();
Expand Down
79 changes: 11 additions & 68 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular JS</title>
<base href="/app/">
<link rel="stylesheet" href="modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="modules/bootstrap/dist/css/bootstrap-theme.css">
<script src="modules/jquery/dist/jquery.min.js"></script>
<script src="modules/bootstrap/dist/js/bootstrap.js"></script>
<script src="modules/angular/angular.js"></script>
<script src="modules/angular-route/angular-route.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="../modules/app.module.js"></script>
<script src="../controllers/user.controller.js"></script>
<script src="../services/user.service.js"></script>
<script src="../routes/main.route.js"></script>
</head>
<body ng-app="PharmacyApp">

<div class="container" ng-controller="UserController">
<h2 class="header">Welcome</h2>
<div>
<div class="row">
<div class="col-md-1 col-md-offset-11">
<button class="btn btn-success pull-right" data-toggle="collapse" data-target="#userForm"
aria-controls="userForm">Create User
</button>
</div>
</div>

<div class="row collapse" id="userForm" aria-expanded="false">
<br/>

<div class="col-md-2">
<input type="text" class="form-control" placeholder="First name" ng-model="user.firstName">
</div>
<div class="col-md-2">
<input type="text" class="form-control" placeholder="Last name" ng-model="user.lastName">
</div>
<html>

<head>
<link rel="stylesheet" href="style.css">

<!--<div class="col-md-2">-->
<!--<button class="btn btn-primary pull-right" ng-click="addUser(user)">Add</button>-->
<!--</div>-->
<div class="col-md-2">
<button type="submit" class="btn btn-primary pull-right" ng-click="addUser(user)">Add</button>
</div>
<br/>
</div>
</head>

<body>
<div ng-view ng-app="PharmacyApp">

<div class="row">
<table class="table">
<thead>
<tr>
<th>First name</th>
<th>Last name</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in users">
<td>{{user.firstName}}</td>
<td>{{user.lastName}} </td>
<td><input ng-model="user.lastNames" placeholder="lastname"/></td>
<td><button class="btn btn-danger" ng-click="editUser(user,user._id)">Edit</button></td>
<td><button class="btn btn-danger" ng-click="deleteUser(user._id)">Delete</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>


<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
<script src="http://code.angularjs.org/1.2.1/angular-route.min.js"></script>
<script src="route.config.js"></script>
</body>

</html>
53 changes: 27 additions & 26 deletions public/prescription.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title></title>
<title>HexSpeak | Prescription</title>

<!-- Angular js -->
<script src="modules/angular/angular.js"></script>
<script src="modules/angular-route/angular-route.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-animate.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-route.js" integrity="sha256-lw0u1cTM3AYG0sY5cKefhETFxDjo/T5GTAppqOwgGPY=" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="../modules/app.module.js"></script>
<script src="../controllers/prescription.controller.js"></script>
<script src="../services/prescription.service.js"></script>
<script src="../routes/main.route.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/2.5.0/ui-bootstrap-tpls.min.js"></script>
<script src="app.module.js"></script>
<script src="controllers/prescription.controller.js"></script>
<script src="controllers/user.controller.js"></script>
<script src="services/prescription.service.js"></script>
<script src="services/user.service.js"></script>


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
Expand Down Expand Up @@ -295,32 +299,24 @@ <h5>Create a New User<small> . Fill The Form Below</small></h5>
</div>
</div>

<div class="hr-line-dashed"></div>

<div class="form-group"><label class="col-sm-2 control-label">Blood Group</label>

<div class="col-sm-3"><select class="form-control m-b" name="bloodGroup">
<div class="col-sm-3"><select ng-model="prescription.bloodGroup" class="form-control m-b" name="bloodGroup">
<option>Select</option>
<option>B+</option>
<option>B-</option>
<option>A+</option>
<option>A-</option>
<option>AB+</option>
<option>AB-</option>
<option>O+</option>
<option>O-</option>
<option ng-selected="prescription.bloodGroup=='B+'">B+</option>
<option ng-selected="prescription.bloodGroup=='B-'">B-</option>
<option ng-selected="prescription.bloodGroup=='A+'">A+</option>
<option ng-selected="prescription.bloodGroup=='A-'">A-</option>
<option ng-selected="prescription.bloodGroup=='AB+'">AB+</option>
<option ng-selected="prescription.bloodGroup=='AB-'">AB-</option>
<option ng-selected="prescription.bloodGroup=='O+'">O+</option>
<option ng-selected="prescription.bloodGroup=='O-'">O-</option>
</select>

</div>
</div>
<div class="hr-line-dashed"></div>

<div class="form-group" >
<div class="col-md-5">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span><input type="text" class="form-control" value="03/04/2017">
</div>
</div>
</div>

<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">Mobile</label>
Expand Down Expand Up @@ -379,7 +375,7 @@ <h5>Create a New User<small> . Fill The Form Below</small></h5>
<td>{{prescription.bloodGroup}} </td>
<td>{{prescription.contactNo}} </td>
<!--<td><input ng-model="user.lastNames" placeholder="lastname"/></td>-->
<td><button class="btn btn-danger" ng-click="editPrescription(prescription,prescription._id)">Edit</button></td>
<!--<td><button class="btn btn-danger" ng-click="editPrescription(prescription,prescription._id)">Edit</button></td>-->
<td><button class="btn btn-danger" ng-click="deletePrescription(prescription._id)">Delete</button></td>
</tr>
</tbody>
Expand All @@ -394,6 +390,11 @@ <h5>Create a New User<small> . Fill The Form Below</small></h5>
</div>
</div>
</div>
<!--Reg Patients Section-->

<div class="row">

</div>
</div>
</div>
</div>
Expand Down
21 changes: 21 additions & 0 deletions public/route.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// var app = angular.module('PharmacyApp', ['ngRoute']);
//
// app.config(function ($routeProvider, $locationProvider, $httpProvider) {
// $routeProvider
// .when('/prescription', {
// templateUrl: 'prescription.html',
// controller: 'PrescriptionController'
// })
// .when('/user', {
// templateUrl: 'views/home.html',
// })
// .otherwise({
// templateUrl: 'test.html',
// controller: 'testController'
// });
// $locationProvider.html5Mode(true);
// });
// app.controller("testController", function ($scope) {
// $scope.msg = "ng-view is working fine";
// });
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading