Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ti.include("dbfunctions.js");
- var testlab = Titanium.UI.createLabel({
- color:'#fff',
- text:'THIS IS THE CONFIG PAGE',
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- top:10,
- left:10
- });
- var messageWin = Titanium.UI.createWindow({
- height:30,
- width:250,
- bottom:70,
- borderRadius:10,
- touchEnabled:false,
- orientationModes : [
- Titanium.UI.PORTRAIT,
- Titanium.UI.UPSIDE_PORTRAIT,
- Titanium.UI.LANDSCAPE_LEFT,
- Titanium.UI.LANDSCAPE_RIGHT
- ]
- });
- var messageView = Titanium.UI.createView({
- id:'messageview',
- height:30,
- width:250,
- borderRadius:10,
- backgroundColor:'#000',
- opacity:0.7,
- touchEnabled:false
- });
- var messageLabel = Titanium.UI.createLabel({
- id:'messagelabel',
- text:'',
- color:'#fff',
- width:250,
- height:'auto',
- font:{
- fontFamily:'Helvetica Neue',
- fontSize:13
- },
- textAlign:'center'
- });
- messageWin.add(messageView);
- messageWin.add(messageLabel);
- var db = Ti.Database.install('../database/commercialseal.sqlite','commercialseal');
- var rows = db.execute('SELECT * from configuration');
- var username = Titanium.UI.createTextField({
- value: rows.fieldByName('username'),
- backgroundColor: '#ffffff',
- borderColor: '#000',
- height: 25,
- width: 150,
- top: 100,
- left: 120,
- paddingLeft:5,
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- borderRadius: 5,
- });
- var password = Titanium.UI.createTextField({
- value: rows.fieldByName('password'),
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- backgroundColor: '#ffffff',
- borderColor: '#000',
- height: 25,
- width: 150,
- top: 130,
- left: 120,
- paddingLeft:5,
- passwordMask: true,
- borderRadius: 5,
- });
- var usrlab = Titanium.UI.createLabel({
- text: 'User Name:',
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- height: 25,
- top: 100,
- left: 20,
- });
- var psslab = Titanium.UI.createLabel({
- text: 'Password:',
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- height: 25,
- top: 130,
- left: 20,
- });
- var trklab = Titanium.UI.createLabel({
- text: 'Searches Remaining :',
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- height: 25,
- top: 160,
- left: 20,
- });
- var trkval = Titanium.UI.createLabel({
- text: rows.fieldByName('tracking'),
- font:{fontSize:12,fontFamily:'Helvetica Neue',fontWeight:'bold'},
- height: 25,
- top: 160,
- left: 160,
- });
- var updatebutton = Titanium.UI.createButton({
- title: 'Update Changes',
- height: 30,
- top: 200,
- width: 200
- });
- var reducebutton = Titanium.UI.createButton({
- title: 'Reduce Count',
- height: 30,
- top: 250,
- width: 200
- });
- Titanium.UI.currentWindow.add(updatebutton);
- Titanium.UI.currentWindow.add(reducebutton);
- Titanium.UI.currentWindow.add(usrlab);
- Titanium.UI.currentWindow.add(psslab);
- Titanium.UI.currentWindow.add(trklab);
- Titanium.UI.currentWindow.add(trkval);
- Titanium.UI.currentWindow.add(username);
- Titanium.UI.currentWindow.add(password);
- rows.close();
- updatebutton.addEventListener('click', function(e)
- {
- var db = Ti.Database.install('../database/commercialseal.sqlite','commercialseal');
- var rows = db.execute('UPDATE configuration SET username="'+username.value+'",password="'+password.value+'",tracking="'+trkval.text+'"');
- messageLabel.text = 'Settings Have Been Updated';
- messageWin.open();
- setTimeout(function()
- {
- messageWin.close({opacity:0,duration:500});
- },1000);
- db.close();
- });
- reducebutton.addEventListener('click', function(e)
- {
- reduceusecount();
- // trkval = getusecount();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement