Beruflich Dokumente
Kultur Dokumente
http://getbootstrap.com/components/
--------------------------------------------------------------------------
AngularJS is constantly updating the state of both the form and the input fields.
They are all properties of the input field, and are either true or false.
They are all properties of the form, and are either true or false.
<p>Username:<br>
<input type="text" name="user" ng-model="user" required>
<span style="color:red" ng-show="myForm.user.$dirty && myForm.user.$invalid">
<span ng-show="myForm.user.$error.required">Username is required.</span>
</span>
</p>
<p>Email:<br>
<input type="email" name="email" ng-model="email" required>
<span style="color:red" ng-show="myForm.email.$dirty && myForm.email.$invalid">
<span ng-show="myForm.email.$error.required">Email is required.</span>
<span ng-show="myForm.email.$error.email">Invalid email address.</span>
</span>
</p>
<p>
<input type="submit"
ng-disabled="myForm.user.$dirty && myForm.user.$invalid ||
myForm.email.$dirty && myForm.email.$invalid">
</p>
</form>
<script>
var app = angular.module('myApp', []);
app.controller('validateCtrl', function($scope) {
$scope.user = 'John Doe';
$scope.email = 'john.doe@gmail.com';
});
</script>
------------------------------------------------
<input type="number"
ng-model="string"
[name="string"]
[min="string"]
[max="string"]
[ng-min="string"]
[ng-max="string"]
[step="string"]
[ng-step="string"]
[required="string"]
[ng-required="string"]
[ng-minlength="number"]
[ng-maxlength="number"]
[pattern="string"]
[ng-pattern="string"]
[ng-change="string"]>
--------------------------------------------------
deleteUser = $window.confirm('Are you sure you want to delete the record?');
if(deleteUser){
$http.post("http://localhost:8080/mssqlwater/includes/api/connection_delete.php",
{id: id})
.then(function(){
$scope.message = "Successfully Deleted";
$scope.messageStatus = "alert alert-danger";
$scope.msgBox = true;
$timeout(function(){
$scope.msgBox = false;
}, 1000);
$scope.selectData();
});
-----------------------------------------------------------------------------------
----------
var app = angular.module("mySettings", ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider.
when("/cubic", {
templateUrl: "pages/cubic.htm",
controller: "myCubicSettingsController"
}).
when("/typecon", {
templateUrl: "pages/typecon.htm",
controller: "myConnectionSettingsController"
}).
when("/download", {
templateUrl: "pages/download.htm",
controller: "myDownloadSettingsController"
}).
when("/upload", {
templateUrl: "pages/upload.htm",
controller: "myUploadSettingsController"
});
console.log('here');
});
$http.get('http://localhost:8080/mssqlwater/includes/api/connection_list_row.php').
then(function(response){
$scope.connections = response.data;
});
//selectData();
$scope.insertData = function(){
ans = $window.confirm('Are you sure you want to add this
record?');
if (ans){
$http.post("http://localhost:8080/mssqlwater/includes/api/connection_add.php",
{type: $scope.type, minrate: $scope.minrate, mincubic: $scope.mincubic, percubic:
$scope.percubic, tax: $scope.tax, status: $scope.status})
.then(function(){
$scope.message = "Successfully Submited!";
$scope.msgBox = true;
$scope.type = "";
$scope.minrate = "";
$scope.mincubic = "";
$scope.percubic = "";
$scope.tax = "0.0";
$scope.status = "Active";
$timeout(function(){
$scope.msgBox = false;
}, 1000);
$scope.selectData();
});
}
}
$scope.selectData = function(){
$http.get('http://localhost:8080/mssqlwater/includes/api/connection_list_row.php').
then(function(response){
$scope.connections = response.data;
});
//alert('hello');
}
$scope.btnInsert = true;
$scope.updateData = function(mem_id){
$scope.btnUpdate = false;
$scope.btnInsert = true;
$http.post("http://localhost:8080/mssqlwater/includes/api/connection_edit.php",
{id: $scope.id, type: $scope.type, minrate: $scope.minrate, mincubic:
$scope.mincubic, percubic: $scope.percubic, tax: $scope.tax, status:
$scope.status})
.then(function(response){
$scope.type = "";
$scope.minrate = "";
$scope.mincubic = "";
$scope.percubic = "";
$scope.tax = "0.0";
$scope.status = "Active";
$scope.id = "";
$scope.message = "Successfully Updated";
$scope.messageStatus = "alert alert-success";
$scope.msgBox = true;
$timeout(function(){
$scope.msgBox = false;
}, 1000);
$scope.selectData();
});
}
$scope.updateBtn = function(objcon){
$scope.btnInsert = false;
$scope.btnUpdate = true;
$scope.id = objcon.id;
$scope.type = objcon.type;
$scope.minrate = parseInt(objcon.minrate);
$scope.mincubic = parseInt(objcon.mincubic);
$scope.percubic = parseInt(objcon.percubic);
$scope.tax = parseInt(objcon.tax);
$scope.status = objcon.status;
$scope.deleteData = function(id){
deleteUser = $window.confirm('Are you sure you want to delete the
record?');
if(deleteUser){
$http.post("http://localhost:8080/mssqlwater/includes/api/connection_delete.php",
{id: id})
.then(function(){
$scope.message = "Successfully Deleted";
$scope.messageStatus = "alert alert-danger";
$scope.msgBox = true;
$timeout(function(){
$scope.msgBox = false;
}, 1000);
$scope.selectData();
});
}
}
});
});
-------------------------------------------------------------------------
$scope.basket = [];
$scope.basket = [
{'id': '1','name': 'T-Shirt', 'quantity': 2, 'cost': 1.10,
'subtotal': 2.20},
{'id': '2','name': 'Jeans', 'quantity': 2, 'cost': 1.99,
'subtotal': 2.20},
{'id': '3','name': 'Jacket', 'quantity': 1, 'cost': 3.22,
'subtotal': 3.22}
];
angular.forEach($scope.basket, function(item) {
$scope.addItem(item);
});
-------------------------------------------------------
--------------------------------------------------------
search in json
$scope.findSetting = function(_id){
var found = $scope.settings.filter(function(setting){ return
setting.id === _id });
return JSON.stringify(found);
};
-------------------------------------------------------
$today = date('Y-m-d');
$stop_date = new DateTime($today);
$stop_date->modify('+1 day');
------------------------------------------------------------------
---------------------------------------------------------------
//create billing record
$billing = new Billing();
$billing->consumerid = $data->id;
$billing->date = date("Y-m-d");
$billing->qtydelivered = 0;
$billing->amount = $data->total;
$billing->discount = 0.0;
$billing->total = $billing->amount - $billing->discount;
$billing->status = "pending";
$billing->processedby = "";
$billing->type = "new";
$billing->remarks = "";
$billing->readingno = $readingid;
$insertid = $billing->create();
$billingitem->create();
}
---------------------------------------------------------------
http://angular-ui.github.io/bootstrap/versioned-docs/0.12.0/
--------------------------------------------------------
function length(obj) {
return Object.keys(obj).length;
}
v7fz76
------------------------------------------------------------------
angular for Each
var values = [{ "Name" : "Thomas", "Password" : "thomasTheKing" },
{ "Name" : "Linda", "Password" : "lindatheQueen" }];
angular.forEach(values, function(value, key){
console.log(key + ': ' + value);
});
// it will log two iteration like this
// 0: [object Object]
// 1: [object Object]
-----------------------------------------------------------------------------
--
angular NgTables
http://techqa.info/programming/tag/ngtable?after=41678086
-----------------------------------------------------------------------------
--
Date input in angular
<label class="col-sm-2 control-label" for="textinput">Bill To</label>
<div class="col-sm-4">
<input type="Date" class="form-control" ng-model="billto.value"
required/>
</div>
--------------------------------------------------------------------
Format date yyyy-mm-dd
-----------------------------------------------------------------------
Secco Inventory
SELECT itemid, sum(qty) as credit, sum(dqty) as debit, (sum(qty) - sum(dqty))
as volume FROM `inventory` group by userid, itemid
1) PO from customer
- warehouseid = destination to customer
- centerid = source