Ext.onReady(function(){
var loggedUser=0;
var sessionid='';
var username = new Ext.form.TextField({
id: 'username',
name: 'username',
fieldLabel: 'Ονομα χρήστη',
maxLength: 100,
frame:true,
width: 100
});
var password = new Ext.form.TextField({
id: 'password',
name: 'password',
fieldLabel: 'Κωδικός',
maxLength: 100,
frame:true,
width: 100,
inputType: 'password'
});
var submitButton = new Ext.Button({
text: 'Login',
type: 'submit',
iconCls: 'icon-login',
handler: function(){
// alert(a);
if( (username.isValid()) && (password.isValid()) ) {
logForm1.getForm().submit({
waitMsg: 'Πιστοποίηση στοιχείων χρήστη...',
success: function(form,action){
// var obj = Ext.util.JSON.decode(action.response.responseText);
// Ext.MessageBox.alert('Success','Your mail has been sent.');
// Ext.MessageBox.alert('Επιτυχης αποστολή','Τα στοιχεία σας εχουν αποσταλλει με επιτυχία.');
var obj1 = Ext.util.JSON.decode(action.response.responseText);
// Ext.Msg.alert('Error',' '+obj1.sessionid );
sessionid=obj1.sessionid;
// alert(sessionid);
loggedUser=1;
// loginWindow.hide();
// alert(sessionid);
window.location = '/docmanusers.php?sid='+sessionid;
},
failure:function(form, action){
var obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert('Σφάλμα',' '+obj.var1 );
}
});
}
else
{
Ext.MessageBox.show({
title:'Προειδοποίηση',
msg: 'Παρακαλούμε συμπληρώστε σωστά το όνομα χρήστη και τον κωδικό πρόσβασης.',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.WARNING
});
return;
}
} });
var logForm1 = new Ext.form.FormPanel({
labelWidth: 100,
//title:'Users login',
frame: false,
border:false,
method: 'POST',
url: 'docmanlogin.php',
bodyStyle:'padding:3px 3px 3px 3px;',
// width: 716,
autoWidth: true,
// autoHeight:true,
items: [
{
layout : 'column',
border:false,
frame:true,
items:[
/* {
border:false,
frame:false,
layout:'form',
labelWidth:50,
width:70,
// columnWidth: 0.33, //,
items:[{html:'
Users Login:
'}]
}, */
{
border:false,
frame:false,
layout:'form',
labelWidth:90,
width:200,
// columnWidth: 0.33, //,
items:[username]
}
,
{
border:false,
frame:false,
layout:'form',
labelWidth:50,
width:160,
// columnWidth: 0.33, //,
items:[password]
}
,
{
border:false,
frame:false,
layout:'form',
labelWidth:50,
width:100,
// columnWidth: 0.33, //,
items:[submitButton]
}
]
}
],
renderTo:'loginpanel'
});
var sdatefroms = new Ext.form.DateField(
{
name: 'sdatefroms',
fieldLabel: 'Απο',
id: 'sdatefrom1',
format: 'd/m/Y'
}
);
var sdatetos = new Ext.form.DateField(
{
name: 'sdatetos',
fieldLabel: 'Εως',
id: 'sdateto1',
format: 'd/m/Y'
}
);
if (odate1!='')
sdatefroms.setValue(odate1);
if (odate2!='')
sdatetos.setValue(odate2);
sdatefroms.on('select',function(){
document.getElementById('searchdatefrom').value=sdatefroms.getValue().dateFormat("Y-m-d");
document.getElementById('searchdatefrom1').value=sdatefroms.getValue().dateFormat("d/m/Y");
});
sdatetos.on('select',function(){
document.getElementById('searchdateto').value=sdatetos.getValue().dateFormat("Y-m-d");
document.getElementById('searchdateto1').value=sdatetos.getValue().dateFormat("d/m/Y");
});
var datepanel1 = new Ext.form.FormPanel({
labelWidth: 100,
frame: false,
border:false,
bodyStyle:'padding:3px 3px 3px 3px;background-color: #fffddf',
width: 380,
items: [
{
layout : 'column',
border:false,
frame:false,
bodyStyle:'padding:0px 0px 0px 0px;background-color: #fffddf',
items:[
{
border:false,
bodyStyle:'padding:0px 0px 0px 0px;background-color: #fffddf',
frame:false,
layout:'form',
labelWidth:30,
items:[
sdatefroms ]
}
,
{
border:false,
bodyStyle:'padding:0px 0px 0px 10px;background-color: #fffddf',
frame:false,
layout:'form',
labelWidth:30,
items:[sdatetos]
}
]
}
],renderTo:'sdatefrom'
});
function hidediv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('mainpage').style.visibility = 'hidden';
} else {
if (document.layers) { // Netscape 4
document.mainpage.visibility = 'hidden';
} else { // IE 4
document.all.mainpage.style.visibility = 'hidden';
}
}
}
function showdiv() {
if (document.getElementById) { // DOM3=IE5, NS6
document.getElementById('mainpage').style.visibility = 'visible';
} else {
if (document.layers) { // Netscape4
document.mainpage.visibility = 'visible';
} else { // IE4
document.all.mainpage.style.visibility = 'visible';
}
}
}
});