Jump to content

heshan

Members
  • Posts

    170
  • Joined

  • Last visited

Everything posted by heshan

  1. Thanks George... Highly appreciate if u could able to provide coding as well.......
  2. HI all, I have a small problem regarding my php project. There is a page called open_account.php. It contains all customer data such as NIC, full_name, date of birth, gender etc. When a user fills all the fields in that form it redirects to another page called new_account.php. There are various account types in the bank. (Ex: A,B,C) I want to do something like this. When a user selects account B it has to show an error message saying " A male person cannot open a B account". Because it only allows women to open B account. At the same time when a particular user selects an account say A, a message should be appeared as "Account number 1 has been successfully created" I want your suggestions regarding how can i do these thing? I have attached all the php files Database structure customer(account_number,nic, full_name, name_with_initials, phone_number, address, gender, date_of_birth) [attachment deleted by admin]
  3. Hi, Thank you all for your replies. I will try it by using echo statement.
  4. Hi, I want something this to be done. When a user tries to logged into the site by entering wrong password, the error message like " Invalid username or password" should be displayed in the same page. I tried following coding. But it shows the error message in a different page. $connect=mysql_connect('localhost','root',''); mysql_select_db('bank',$connect); $username= $_POST['username']; $password= $_POST['password']; $result = mysql_query ('select * from users where username = "' . $_POST['username'] . '" and password = "' . $_POST['password'] . '"'); while($row=mysql_fetch_row($result)){ $user_type=$row[4]; } session_start(); session_register("user_type"); $_SESSION["user_type"]=$user_type; if($user_type=='T'){ header('Location:teller_page.php'); }else if($user_type=='AO'){ header('Location:accofficer_page.php'); }else if($user_type=='AS'){ header('Location:accsup_page.php'); }else if($user_type=='LS'){ header('Location:loansup_page.php'); }else if($user_type=='CS'){ header('Location:cashsup_page.php'); }else{ header('Location:try_again.php'); }
  5. Hi, I have a problem. i want to show the current date and time in my tables of the database. I want to show it because i want to show it on my report generated in php. By the way i do not have a "date" field in my form. Can anyone help me out? Thanks, Heshan.
  6. Thank you for both of you guys..
  7. Hi, i found this coding from a web site. Can anyone what is the meaning of this code when selecting data. $sql =("SELECT `customer_id`, `nic`, `full_name`, `name_with_initials`, `address`, `contact_number`, `gender` FROM `customer` WHERE `nic`='%s'", mysql_real_escape_string($_POST['nic']) ); $result=mysql_query($sql) or die( mysql_error() ); Specially that part where `nic`='%s'" and real_escape_string(). Thanks,
  8. They are different types of accounts. Therefore if i include them in a same table it would not see the differentiation. This project is related to the bank. Bank does provide account numbers based on account types.
  9. HI, I have 4 account type tables savings_investment(ID,account_type,full_name,balance,interest,customer_id) shakthi(ID,account_type,full_name,balance,interest,customer_id) surathal(ID,account_type,full_name,balance,interest,customer_id) abhimani_plus(ID,account_type,full_name,balance,interest,customer_id) ID is the primary key for every table.The ID is different from one table to another. That is why i created 4 tables rather than one table. I want to write the coding to check account balances. That is if user types the Account ID(ID) and clicks on search button the relevant details regarding that account should be shown in a table. That is account_type,full_name, balance, interest and customer_id. Can anyone give me the relevant coding... Thanks, Heshan
  10. sorry, i have no idea... if u can help me i will be more appreciate.
  11. It depends from account to account. That i do not need. I just want to delete records when he clicks on "close account" button.
  12. Hi guys, This is very important. The supervisor of my system wants to close accounts which contain zero balances for long time periods. There is a separate page contains ID and Account Number.This is included in a form and a "close account" button is there. When he clicks on that button the relevant record should be deleted from all tables which include that ID. The table structure looks like this. There are 4 account types which contain same fields. savings_investment(ID,account_type,full_name_balance,interest,customer_id) I want full coding of this scenario. Thanks, Heshan
  13. Hi, i have a transaction table which includes following fields. tran_ID,account_number,account_type,transaction_type,amount,Date I want to know how these data can be retrieved and display in another table. The table is filled with several records. Thanks, Heshan
  14. Hi, My transaction table looks like this.It includes following fields. tran_ID,account_type,account_number,transaction_type,amount,Date The records regarding each transaction is stored in this table. I want to know how i retrieve the data from this table into another form or table.The coding is what i want... My actual purpose would be to allow cash supervisor to update records. But first it needs to retrieve data. Then only he can check things and update if necessary. Thanks, Heshan.
  15. Now it is OK. Thanks everyone who help me out..... 8)
  16. @jcbones, it is worked.... 8) Thanks a lot. Thanks everyone for helping me regarding this matter.
  17. An error message occurred...... Notice: Undefined index: nic in C:\wamp\www\php files\modify_form.php on line 40 Notice: Undefined index: full_name in C:\wamp\www\php files\modify_form.php on line 41 Notice: Undefined index: name_with_initials in C:\wamp\www\php files\modify_form.php on line 42 Notice: Undefined index: address in C:\wamp\www\php files\modify_form.php on line 43 Notice: Undefined index: contact_number in C:\wamp\www\php files\modify_form.php on line 44 Notice: Undefined index: gender in C:\wamp\www\php files\modify_form.php on line 45
  18. @ andyjcurtis, that coding seems to be not working. i try both... @Shp0ngl3, this is my approve_account.php page <?php $connect=mysql_connect("localhost","root",""); mysql_select_db("bank",$connect) or die ("could not select database"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- #apDiv4 { position:absolute; width:772px; height:495px; z-index:3; left: 206px; top: 300px; } #form1 { font-size: 18px; font-weight: bold; } body,td,th { font-size: 18px; } --> </style> </head> <body> <div id="apDiv4"> <form action="" method="post" name="form1" id="form1"> <fieldset> <legend class="cap"> Customer Details</legend> <table width="85%" height="350" border="0" align="center" cellpadding="5" cellspacing="0"> <?php //initilize variables $var_nic = ''; $var_full_name = ''; $var_name_with_initials = ''; $var_address = ''; $var_contact_number = ''; $var_gender = ''; if(isset($_POST['customer_id'])) { $customer_id=(int)$_POST['customer_id']; $query = "select * from customer where customer_id=$customer_id LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result) < 1) { echo 'The record could not be found.'; }else { $row=mysql_fetch_array($result); // replace blank variables with variables from the database $var_nic = $row['nic']; $var_full_name = $row['full_name']; $var_name_with_initials = $row['name_with_initials']; $var_address = $row['address']; $var_contact_number = $row['contact_number']; $var_gender = $row['gender']; } } ?> <tr> <td> </td> <td class="title02"> </td> <td> </td> <td> </td> </tr> <tr height="30"> <td width="2%" height="35"> </td> <td width="46%" class="title02" align="left">National ID</td> <td width="50%" class="attribute1" align="left"><input type="text" name="nic" size="30" class="attribute1" value="<?php echo $var_nic; ?>"></td> <td width="2%"> </td> </tr> <tr height="30"> <td height="33"> </td> <td width="46%" class="title02" align="left">Full Name</td> <td width="50%" class="attribute1" align="left"><input type="text" name="full_name" size="30" class="attribute1" value="<?php echo $var_full_name; ?>"></td> <td width="2%"> </td> </tr> <tr height="30"> <td height="34"> </td> <td class="title02" align="left">Name With Initials</td> <td width="50%" class="attribute1" align="left"><input type="text" name="name_with_initials" size="30" class="attribute1" value="<?php echo $var_name_with_initials; ?>"></td> </tr> <tr height="30"> <td width="2%"> </td> <td width="46%" class="title02" align="left">Address</td> <td width="50%" class="attribute1" align="left"><label> <textarea name="address" id="textarea" cols="45" rows="5"><?php echo $var_address; ?></textarea> </label></td> <td width="2%"> </td> </tr> <tr height="30"> <td width="2%"> </td> <td width="46%" class="title02" align="left">Contact Number</td> <td width="50%" class="attribute1" align="left"><input type="text" name="contact_number" size="30" class="attribute1" value="<?php echo $var_contact_number; ?>"></td> <td width="2%"> </td> </tr> <tr height="30"> <td width="2%"> </td> <td width="46%" class="title02" align="left">Sex</td> <td width="50%" class="attribute1" align="left"><p> <select name="gender" id="jumpMenu" > <option selected="selected"><?php echo $var_gender; ?></option> <option>Male</option> <option>Female</option> </select> <td width="50%" class="attribute1" align="left"> </td> <br /> </p></td> <td width="2%"> </td> </tr> </table> <p align="center"> </p> <p align="center"> <label> </label> <label> <input name="button" type="submit" id="button" value="Approve Account" /> <label><a href="modify_form.php"> <input name="button2" type="submit" id="button2" value="Modify Account" /> </a></label> <label> <a href="accsup_help.php"> <input name="button" type="submit" id="button" value="Help" /> </a></label> </td> </p> </fieldset> <td width="5%"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="center"> </td> <td> </td> </tr> <tr> <td> </td> <td><font color="red" size="1" ></font></td> <td> </td> </tr> </table> </form> </div> <img src="../images/mahapitiya 1.jpg" width="1024" height="139" /> </body> </html>
  19. Hi guys, The supervisor of my system wants to modify my customer details if something incorrect inserted into the database. The process of the system is looked like this. The user enters customer data and and it stores in the customer table. customer(customer_id, nic, full_name, name_with_initials, address, contact_number, gender) Then when supervisor logged in he wants to approve or modify the details based on my the accuracy of data. When he types the customer ID and clicks on search button ( customer page) the relevant record details have been displayed. That part is worked properly.(approve_account.php) Then in that same page there is a button called "Modify Account" which is linked to modify_form.php But it does not work. This is that page.Can anyone correct myself... The error message is saying undefined nic, full_name etc...... <?php $connect=mysql_connect("localhost","root",""); mysql_select_db("bank",$connect) or die ("could not select database"); $nic =$_POST['nic']; $full_name =$_POST['full_name']; $name_with_initials =$_POST['name_with_initials']; $address =$_POST['address']; $contact_number =$_POST['contact_number']; $gender =$_POST['gender']; if(isset($_POST['customer_id'])) { $customer_id=(int)$_POST['customer_id']; $result = mysql_query("UPDATE * from customer SET nic = '$nic', full_name = '$full_name', name_with_initials = '$name_with_initials', address = '$address', contact_number = '$contact_number', gender = '$gender'") ; if($result){ echo "Your information has been successfully added to the database."; }else{ echo "Failed"; } } ?> Thanks, Heshan
  20. @ litebearer, you are right. i want something that to be done. I need to approve customers one by one. But this coding i made not worked.Can anyone help me out...... <?php $connect=mysql_connect("localhost","root",""); mysql_select_db("bank",$connect) or die ("could not select database"); if(isset($_POST['customer_id'])){ $customer_id=$_POST['customer_id']; $query = "SELECT * from customer WHERE approved='0'"; mysql_query($query) or die(mysql_error()); $query = "UPDATE * from customer WHERE customer_id='$customer_id'"; $result = mysql_query($query) or die(mysql_error()); if ($result) { echo "Customer details have been successfully approved"; } } ?>
  21. @Shp0ngl3, i made a query according to you. This is how it looks like. I want a message to be appeared as " Details have been successfully approved" How could i do that? <?php $connect=mysql_connect("localhost","root",""); mysql_select_db("bank",$connect) or die ("could not select database"); $query = "select* from customer where approved='0'"; mysql_query($query) or die(mysql_error()); $query = "UPDATE customer SET approved='1' WHERE approved='0'"; mysql_query($query) or die(mysql_error()); ?> @brown 2005, It is better to apply another field and state whether the account is approved or not. But i am confusing about that. Can you give me an example coding?
  22. Hi guys, I want something to be clarified. The supervisor of my system is responsible for approving accounts. When he logged into the system he should be able to view the customer records based on customer ID. That is when he types the relevant customer ID and clicks on search button the relevant record is displayed in a form. That part is OK. Thereafter he should approve the account by clicking on "Approve Account" button. I want to know how can he make sure relevant customer_id is approved or not. customer table includes fields of, customer_id, nic, full_name, name_with_initials, address, contact_number, gender. I want to whether i have add an extra field to my customer table saying "approves status" or whatever. Can anyone give me a suggestion?? Thanks, Heshan
  23. Hi guys, I want to generate reports and i want to use some fields of one table and other fields of another table. How can i use that? Ex. customer(customer_id, full_name,name_with_initials, address, contact_number,gender) transaction_table(tran_ID, account_number,account_type,transaction_type, amount, Date) If i want to use only customer_id, tran_ID, full_name and amount how can i use them to generate reports. I want them to be taken as fields of one table and use it.. Thanks, Heshan
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.