Hi @rproffitt
Thanks for the reply can you please help to rectify this code, I am new in PHP i followed the standard syntax referred on php documentation.
Kind Regards,
Naveed.
Hi @rproffitt
Thanks for the reply can you please help to rectify this code, I am new in PHP i followed the standard syntax referred on php documentation.
Kind Regards,
Naveed.
Hi All,
I havefollowing code and getting error "Parse error: syntax error, unexpected 'elseif' (T_ELSEIF) in C:\xampp\htdocs\SMR\index.php on line 13". Wehen i remove elseif and keep only if it just checks the first condition and ignor the second. When i put back elseif i get error. Please to fix this issue.
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if(isset($_POST['login']))
{
$adminuser=$_POST['username'];
$password=md5($_POST['password']);
$userlvl=$_POST['userlvl'];
$query=mysqli_query($con,"select ID from tbladmin where UserName='$adminuser' && Password='$password' && userlvl='$userlvl' ");
$ret=mysqli_fetch_array($query);
elseif($ret>0 || userlvl==1){
$_SESSION['cvmsaid']=$ret['ID'];
header('location:dashboard.php');
}
elseif($ret>0 || userlvl==2){
$_SESSION['cvmsaid']=$ret['ID'];
header('location:dashboard-supp.php');
}
else{
$msg="Invalid Details.";
}
}
?>
So i did the colning but didn't work, now what i did is i made parttion image using Ghost utlity before i proceed furthure want to ask one question if i will install fresh os and then restore the image taken earlier by Ghost utlity to restore the old OS will it work or no?
Kind Regards,
Naveed.
Thanks rproffitt,
For quick response i will try my best using clone tools if it works.
Thanks for your time and help.
I will post back if there is any development on this.
Kind Regards,
Naveed.
If possible please advise some tools or guidlines so that i can give it a try.
Hi there,
Yes you are absolutly right i do agree with you i have valid backups of the dabase and application but definelty that requires reinstallation to resotre them that's what i am trying if i can recover the OS, Please help on this.
Kind Regards,
Naveed.
Hi Good Evening All,
Hope all are fine during this current situation.
Currently i am facinf some issue after sudden power shut the HP Z840 Workstation is not loading the operating system i tried following:
1. Tried to repair the OS but in the repair screen no OS to select.
2. Varified the hard disc is there in the Bios setup.
3. Rmeoved the hard disc and put it into the same model workstation i can see hte partition are there it shows system partition and rest 2 parttions as well and i copied the
data already but vendor is asking to reinstall the application which will cost a lot of expenese.
I am trying my luck if some how i can recover the OS.
Any help will be highly appriciated.
Kind Regards,
Naveed.
I found the issue.
Thanks.
Dear All,
Good Morning!
I am facing this issue i tried a lot but not able to find the issue with this function when i call this function i get error
Argument not specified for parameter 'LVL' of 'Public Function UL(LVL As String) As String'
The code is listed below, if someone can help me on this i will be greatful.
Public Function UL(ByVal LVL As String) As String
Dim con As OracleConnection = New OracleConnection(My.Settings.ConnectionString)
Dim com As OracleCommand = Nothing
Dim userLevel As String = True
Try
con.Open()
com = New OracleCommand("SELECT LVL FROM Users WHERE Username = '" & Username & "'", con)
userLevel = com.ExecuteScalar
con.Close()
Catch Exp As OperationAbortedException
If con.State = ConnectionState.Open Then
con.Close()
userLevel = "Failed to retrieve permission level"
End If
End Try
Return userLevel
End Function
Thanks in Advance.
Have a good day.
con.ConnectionString = ConnectionString
Try
dsOle.Clear()
dtOle.Clear()
cmdOle = con.CreateCommand
da.SelectCommand = cmdOle
Dim eaddress As String
cmdOle = New OracleCommand("SELECT EMAIL_ADDRESS FROM USERS WHERE USERNAME = '" & ComboBox2.Text & "'", con)
da.SelectCommand = cmdOle
da.Fill(dsOle, "USERS")
eaddress = (dsOle.Tables(0).Rows(0).Item(0))
Dim mail As New MailMessage()
Dim SmtpServer As New SmtpClient("smtp.office365.com")
mail.From = New MailAddress("XXX.XXXX@gmail.COM")
mail.[To].Add(eaddress)
mail.Subject = "Complaint Details"
Dim qry As String
Dim dsbody As New DataSet
qry = "select comp_type,LOCATION,COMPLAINT_DETAIL,REMARKS from complaint"
cmdOle1 = New OracleCommand(qry, con)
dsbody.Clear()
da1 = New OracleDataAdapter(cmdOle1)
da1.Fill(dsbody, "Complaint")
Dim dts As New DataTable
Dim dv As New DataView(dsbody.Tables(0))
dts = dv.ToTable()
mail.Body = " <html><head><title>Complaint details</title></head><table border=1><tr bgcolor=#6699FF ><th <th bgcolor=#6699FF>Complaint Location><th bgcolor=#6699FF>Complaint Type<th bgcolor=#6699FF><th bgcolor=#6699FF>Complaint Remarks</th></tr></html>"
mail.IsBodyHtml = True
SmtpServer.Port = 587
SmtpServer.Credentials = New Net.NetworkCredential("xxx@dmail.com", "PWD")
SmtpServer.EnableSsl = True
SmtpServer.Send(mail)
MessageBox.Show("The Complaint Sent to Respective department")
Catch ex As Exception
MsgBox(ex.ToString)
Finally
con.Close()
End Try
I figure out a way how to select specific email for the assigned complaint handler and able to send email also but data is not coming only headings actually i need to send the currently inserted record as notification to the user.
Could you please help me out to adjust this code.
Thanks in advance.
Hi, Good Evening to everyone!
I am preparing one application facing some challenges, the scenrio is to send email when a user enter a complaint in the system to the assigned user the assigned user have email address already in the system the email notification should go to assigned user alongwith Complaint ID and complaint detail. then if after 30 minutes no one updates the status the system should send another notification to next level after 1 hour if still status not updated the system should send email notification to final level. could you please help me with code sample if possible. i am able to send notification using below code but unable to figure out how to send complaint details.
Sub email_send() On Error Resume Next Dim mail As New MailMessage() Dim SmtpServer As New SmtpClient SmtpServer.Credentials = New Net.NetworkCredential("abc@gmail.com", "mypassword") SmtpServer.Port = 587 SmtpServer.Host = "smtp.gmail.com" SmtpServer.EnableSsl = True SmtpServer.EnableSsl = True mail.To.Add("abc@gmail.com") mail.From = New MailAddress("abc@gmail.com") mail.Subject = "Subject" mail.Body = "Body" SmtpServer.Send(mail) End Sub Thanks in Advance for youe great help always
actualy the time i am fetching from the csv file its in a raw format once i add
dt = dt = dt.AddSeconds(DataGridView1.Rows(i).Cells(4).Value)
i am getting error on this line "Conversion from string "dateTimeOrigination" to type 'Double' is not valid."
Sorry i didn't get you if you can modify this code and explain a ittle bit it will be great.
I tried this before but it's bringing same result for all my cell in that coloumn
Private Sub calculation()
Dim dt As Date
dt = New DateTime(1970, 1, 1, 0, 0, 0, 0)
Dim i As Integer
For Each row As DataGridViewRow In DataGridView1.Rows
If Not row.IsNewRow Then
DataGridView1.Rows(i).Cells(4).Value = dt
i += 1
End If
Next
End Sub
Please help on this i need to put the formula as i submitted in my first post.
Many Thanks.
Dear All,
I am trying to read a CSV file into VB.NET datagridview which is fine i did already but one of datagridview coloumn is date and time i want to convert it to human readable format and want to read the correct format in date and time column in all rows like if i have 100 records it should correct or convert all 100 records date and time into correct format in that column and the column number is 4.
Any sample code example will be much appriciated.
I did conversion in excel by using the below formula it works fine and shows correct format,
=(B2/86400)+25569) which brings me correct format.
Please help on this.
Many Thanks in advance.
I found out the problem and fixed it i just the retval variable is equal to nothing it worked perfectly.
Anyway thanks for the help.
Yes i tried it is showing nothing, means null but then if it's nulll it's suppose to take value 4999 and then add one to make it 5000 but its adding 1 in 0 then next record 1+1=2 and so on.
Dear Friends,
Good Day,
I am facing an issue in one of the functions the code is given below if someone can help on this actually this function is supposed to check the work ordewr number if it's nulll then it is suppose to take default value as 4999 and add one everytime, but the function is not taking the default value its is starting from 1 and then next record +1 means 2 like this but it supposed to be like 4999+1 means 5000 next record 5000+1 means 5001 like this. Any help in this regard will be highly appriciated. i am using VB.NET with Oracle Database.
Private Function Auto_no() As Integer
Dim con As New OracleConnection(ConnectionString)
Dim com As OracleCommand = Nothing
Dim retVal As Object
Try
con.Open()
com = New OracleCommand("SELECT MAX(WO_NO) FROM WO GROUP BY WO_NO ORDER BY WO_NO DESC", con)
retVal = com.ExecuteScalar()
If Not IsDBNull(retVal) Then
retVal += 1
Else
retVal = 4999
End If
con.Close()
Catch ex As OracleException
If con.State = ConnectionState.Open Then
con.Close()
End If
retVal = 4999
End Try
Return retVal
End Function
Sorry i was ill, some quries as still pending.
How to cahnge column name in MSFlexgrid?
How to delete a Selected Row?
Suppose i have a text box and i enter then click on search button to show Record in MSFlexGrid?
How to udpade a selected record?
How to clear the Contents of Flex Grid, i mean when i click on save button it should clear the Grid.
Here is the image file
First of all thanks Jx_Man fantastic code example
Now let me ask some questions
i want to write column name as Employee ID insetad Emp_id
Please view the attached image file thanks.
Dear All,
Please give me sample code which should for add edit delete data from db using flex grid.
Thanks in advance.
it is very basic thing that your phone should connect to your pc in any way , you can use bluetooth , or some cable for this.
Thanks for reply
Which cable is it telephone cable in modem??
Can i do this through network card???
Can you provide me some sample example.
Hi All,
I want to ask you a question.
Can you tell me how can i record a call from my phone to my PC?
What method should i adopt?
Should my telephone is is connected to my PC through a wire?
Dear All,
I have one PDC and one ADC my ADC(Additional Domain Controller Has been crashed) now i want to make new ADC but i receive error please view the attached image for error detail please advice me how to complete this task
Here is my code which displays all the table from a Table space in Oracle
With ListView1
.View = View.Details : .CheckBoxes = True : .FullRowSelect = True
End With
con.ConnectionString = ConnectionString
Try
dsOle.Clear()
dtOle.Clear()
cmdOle = con.CreateCommand
cmdOle.CommandText = "SELECT * FROM TAB"
da.SelectCommand = cmdOle
da.Fill(dsOle, "TAB")
Dim i As Integer = 0
Dim j As Integer = 0
For i = 0 To dsOle.Tables(0).Columns.Count - 1
Me.ListView1.Columns.Add(dsOle.Tables(0).Columns(i).ColumnName.ToString())
Next
For i = 0 To dsOle.Tables(0).Rows.Count - 1
For j = 0 To dsOle.Tables(0).Columns.Count - 1
itemcoll(j) = dsOle.Tables(0).Rows(i)(j).ToString()
Next
Dim lvi As New ListViewItem(itemcoll)
Me.ListView1.Items.Add(lvi)
Me.ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)
Next
Catch ex As Exception
If ConnectionState.Open Then
con.Close()
End If
MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "NO DATA FOUND !!")
End Try
It works fine now i am using "ListView1_ItemCheck" event when this event fires it should list table column names.
But the problem is this when i load the form it shows all the Tables
1. when i click on check box it didn't list all the columns
2. When i click on a checkbox against WO it should list all the columns of Wo table and when i click on checkbox against KEY_MAKING_REC it should display the columns of KEY_MAKING_REC table
How to achieve this please guide me.
Private Sub ListView1_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
If e.NewValue = CheckState.Checked Then
With ListView1
.View = View.Details : .CheckBoxes = True : .FullRowSelect = True …
Hi all,
Can anybody tell me how can i give option to user to design there own reports????
i.e They should be able to define
1. Report Title
2. Reports Fields(When they click on Work Order button they should be able to view Work Order Table column and they should be able to select columns then a report should be composed.
Then all the Column should be in the form datagrid.
Is it possible.
I have resolved my problem by using this method
Private Sub DataGridView1_CurrentCellDirtyStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.CurrentCellDirtyStateChanged
If DataGridView1.CurrentCell.ColumnIndex = 15 Then
DataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
End Sub
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
'if sender is the checkbox column
If e.ColumnIndex = 15 Then
Dim frm As New frm_wo_byid_rep(txtwono.Text)
frm.Show()
End If
End Sub
I am auto generating data grid and I am using check box in Data grid View,
Now i am invoking check box state changed event but it produces the following error
Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Here the code
Private Sub PRNT_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles PRNT.CheckedChanged
Some Stuff.
End Sub
When i changes this line
Private PRNT As New DataGridViewCheckBoxColumn
To this
Private Withevents PRNT As New DataGridViewCheckBoxColumn
Then error changes
Event 'CheckedChanged' cannot be found.
What could be the problem.
I have resolved the problem.
What do you mean wipe in and wipe out? Slide Left to Right or something else?
PS
Thats a very distinguished avatar you have. You almost look like royalty.:)
Yes left and right like one slowly moves left and one right.
Change the column type from text to memo.
How can we apply wipe in and wipe out animation on VB.NET form.
Dear All,
for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do set fdate=%%a%%b%%c
for /f "tokens=1,2,3,4,5 delims=: " %%a in ('time /t') do set ftime=%%a%%b%%c%%d%%e
exp userid=HR/HR@dummy file=C:\BACKUP\backup%fdate%%ftime%.dmp log=C:\BACKUP\backup%fdate%%ftime%.log
This scripts works fine but my requirement is when this script run it should make a folder its name should be current hour. i.e
if time is 5 o clock the the name of folder should be 5 and when hour is 6 then the name of the folder should be 6.
Any idea how to achieve this.
Dear All,
Here is my code i am generating data grid manually on run time i want to assign a default value to REC ST column, i have tried but it didn't assign default value please view the last line of this peace of code.
Dim clmprno As New DataGridViewTextBoxColumn
clmprno.HeaderText = "PR NO"
clmprno.DataPropertyName = "PR_NO"
DataGridView1.Columns.Add(clmprno)
Dim clmItemName As New DataGridViewTextBoxColumn
clmItemName.HeaderText = "ITEM NAME"
clmItemName.DataPropertyName = "ITEM"
DataGridView1.Columns.Add(clmItemName)
Dim clmqty As New DataGridViewTextBoxColumn
clmqty.HeaderText = "QUANTITY"
clmqty.DataPropertyName = "QTY"
DataGridView1.Columns.Add(clmqty)
Dim clmprr As New DataGridViewTextBoxColumn
clmprr.HeaderText = "PUR REASON"
clmprr.DataPropertyName = "PUR_REASON"
DataGridView1.Columns.Add(clmprr)
Dim clmPDate As New CalendarColumn
clmPDate.HeaderText = "PR Date"
clmPDate.DataPropertyName = "PR_DATE"
DataGridView1.Columns.Add(clmPDate)
Dim clmst As New DataGridViewComboBoxColumn
clmst.HeaderText = "STATUS"
clmst.DataPropertyName = "STATUS"
DataGridView1.Columns.Add(clmst)
clmst.MaxDropDownItems = 10
clmst.Items.Add("IT")
clmst.Items.Add("IT MANAGER")
clmst.Items.Add("AITM")
clmst.Items.Add("PM")
clmst.Items.Add("SDF")
Dim clmrst As New DataGridViewTextBoxColumn
clmrst.HeaderText = "REC ST"
clmrst.DataPropertyName = "REC_ST"
DataGridView1.Columns.Add(clmrst)
BindData()
DataGridView1.DataSource = bindingsource1
Label3.Text = Now
Timer1.Enabled = True
Timer1.Interval = 500
DataGridView1.CurrentRow.Cells(4).Value = Now.ToString("MM/dd/yyyy")
DataGridView1.CurrentRow.Cells(6).Value = "NEW"
When i tried this code
Dim clmrst As New DataGridViewTextBoxColumn
clmrst.HeaderText = "REC ST"
clmrst.DataPropertyName = "REC_ST"
clmrst.DefaultCellStyle.NullValue = "New"
clmrst.DefaultCellStyle.DataSourceNullValue = "New"
DataGridView1.Columns.Add(clmrst)
It shows default value but when i try to save it didn't saved in the db here is my save code
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
Try
For r = 0 To DataGridView1.RowCount - 2 ' Why RowCount-2?
For Each cell As DataGridViewCell In DataGridView1.Rows(r).Cells
If cell.FormattedValue Is Nothing OrElse cell.FormattedValue.ToString = String.Empty …
Dear All,
I want to print a crystal report on which the contents are displayed on first page(which i already have don) and the Instruction always should displayed on second page how can i do this????
Please help me
Please Mark the thread as reolved
I think You should use Textbox name instead column name in your insert statement in values section you are entering your column name you should use textbox name follow this example
sqlInsert = "INSERT INTO tracker(TrioleNo,TrioleOpenDate,Description,Qty,Price) VALUES ('" & Me.Textbox1.Text & "','" & Me.Textbox2.Text & "','" & Me.Textbox3.Text & "','" & Me.Textbox4.Text & "','" & Me.Textbox5.Text & "')"
I hope this would help you.
No body has any idea about this issue.
Hello all,
Actually what i am doing is, i am trying to copy the records from my WO table and trying to change the scheduled_date like
if i have already entered a work oder and scheduled it on 26-SEO-2011 when the next month comes it should give me message do you want to crate work oders when i press yes it should copy the those records which has current date and change it month e.g in our example 26-SEP-2011 to 26-OCT-2011 and save it but i am unable to perform this task and similer procedure will be for other saved records when their scheduled date come it should copy it and change the month and save
This piece of code is on form load event
Private Sub QueryWorkorder()
Dim con As New OleDbConnection("Provider=MSDAORA.1;Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=196.111.116.205)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=Dummy)));" _
+ "User Id=PCHR;Password=PCHR;")
Dim com As OleDbCommand = Nothing
Dim adapter As OleDbDataAdapter
Dim dt As New DataTable("WO")
Try
Dim checkDate As DateTime = DateTime.Now.AddMonths(-1)
con.Open()
com = New OleDbCommand("SELECT COUNT(*) FROM WO WHERE SCHEDULED_DATE = '" & checkDate.ToString("dd-MM-yyyy") & "'", con)
If CInt(com.ExecuteScalar()) > 0 Then
con.Close()
If MessageBox.Show("Do you wish to generate workorder based on todays date?", "Workorder generation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
com = New OleDbCommand("SELECT * FROM WO WHERE SCHEDULED_DATE = '" & checkDate.ToString("dd-MM-yyyy") & "'", con)
adapter = New OleDbDataAdapter(com)
adapter.Fill(dt)
con.Close()
Dim frm As frmworkodr = New frmworkodr(dt)
frm.Show()
End If
End If
con.Close()
Catch ex …
no body has any idea???
So you must post your question in C# forum they would be able to answer you quickly
Which language are you using???
and which database are you using???
Dear all,
I have problem i have table name "WO" in oracle db i want
"Whenever I start my program, I want it it look at all the works orders, and if any works order has a date that is exactly one month before today's date, then I want the program to display a message and create copies of those works orders with a schedule date of today's date and save it".
how to achieve this please provide me code
Thanks in advance.
Here is the structure of my database
DISCRIPTION VARCHAR2(200)
REQ_DATE DATE
WO_T VARCHAR2(30)
TASK_PER VARCHAR2(50)
ORIGINATOR VARCHAR2(70)
REQ_DEPT VARCHAR2(70)
EXTENSION NUMBER(10)
CRAFT VARCHAR2(50)
TASK_ASSG_TO VARCHAR2(70)
SCHEDULED_DATE DATE
SCHEDULED_FINISH_DATE DATE
COMPLETION_DATE DATE
ESTIMATED_HRS NUMBER(10)
REQ_TYPE VARCHAR2(50)
PRIORITY NUMBER(2)
ITEM_CODE NUMBER(30)
LOCATION VARCHAR2(70)
SUB_LOC VARCHAR2(70)
ADDED_DATE DATE
QTY NUMBER(30)
DONE_BY VARCHAR2(70)
EMP_ID NUMBER(20)
COMP_DU VARCHAR2(20)
COMMENTS VARCHAR2(2000)
PREP_BY VARCHAR2(50)
WO_USER VARCHAR2(30)
WO_NO NUMBER(25)
ITEM_NAME VARCHAR2(100)
Please also view the attached project file by following the given link
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Try
'MsgBox("Open")
cn = New OleDbConnection("Provider=microsoft.jet.oledb.4.0;Data Source=E:\Project-Hemtech\HemDatabase1.mdb;")
cn.Open()
com = New OleDbCommand("select partname,partdesc,partnum,partqty from partno WHERE type = '" & combobox1.Text & "'", cn)
cmd.ExecuteNonQuery()
MsgBox("Your Account Created Successfully ")
Me.PartnoTableAdapter.Fill(Me.HemDatabase1DataSet1.partno)
Catch myException As Exception
MsgBox("No Record Inserted" + myException.ToString())
Finally
'MsgBox("Closing Connection")
cn.Close()
End Try
End Sub
Just replace this code with the previous code
Ok then just change this line you would have the result.
com = New OleDbCommand("select partname,partdesc,partnum,partqty from partno WHERE type = '" & combobox1.Text & "'", cn)
First of all you must create a textbox on your form then enter type in text box and change this line of code
com = New OleDbCommand("select partname,partdesc,partnum,partqty from partno WHERE type = '" & textbox1.Text & "'", cn)
Hope this would help you.
it was very simple here is the solution
CrystalReportViewer1.ReportSource = Nothing
When i pass the parameter and run the report it works fine as i close the form it closes the form is there any way so that i should be able to close the crystal report viewer and pass the parameter again and should be able to view report again.
Thanks in advance.
where is you combobox in this coding???