Jump to content

shebbycs

Members
  • Posts

    174
  • Joined

  • Last visited

Everything posted by shebbycs

  1. I had SQL Query like this and I am using oracle 10g and then I click the expressions to do that if or case loop so I want to know how the expression syntax work or at least example of the expressions In this image I want to know example of expression can be do inside it
  2. but how to call first and last in sql developer if first and last is invalid identifier
  3. SELECT HIREDATE FROM EMP WHERE ROWNUM<=1 ORDER BY HIREDATE; ? is it like this?
  4. ok let said I had called the min hiredate for the first hired how can i call that person only ? because if i did like min hiredate and min ename it will not give the first hired date person
  5. I had try for the date i using for max and min but when to call together with name I did not manage to make it because it will showing many name since i used the group by that part I stuck
  6. I had data like this empno ename job mgr hiredate sal comm deptno 7369 SMITH CLERK 7902 1980-12-17 800 NULL 20 7499 ALLEN SALESMAN 7698 1981-02-20 1600 300 30 7521 WARD SALESMAN 7698 1981-02-22 1250 500 30 7566 JONES MANAGER 7839 1981-04-02 2975 NULL 20 1) Display the name and hire date of the employee who was hired first without using subquery 2) Display the name and hire date of the employee who was hired last without using subquery
  7. Thanks a lot barand
  8. There are 3 questions which are : 1. Group functions work across many rows to produce one result per group (My answer : Yes) 2. Group functions include Null in calculations (My answer : Yes and No) 3. There WHERE clause restricts rows prior to inclusion in a group calculations. (My answer : Yes) But each of these questions need to give a example for every statement Hope you can help me please Thank you
  9. If u see in Microsoft Excel table when we write each field its automatically when to next line without entering the "Enter" key, is it possible to do in HTML and how to do that any example please
  10. //countercashadminlocation2.php <?php session_start(); ini_set('session.bug_compat_warn', 0); ini_set('session.bug_compat_42', 0); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; if (isset($_POST["submit"])) { $place = $_POST['tempat']; $_SESSION['tempat']=$place; $b= $_SESSION['tempat']; $sql1 = mysql_query("SELECT *,DATE_FORMAT(Form_Date, '%d/%m/%Y %H:%i %p') AS Form_Date FROM counter_cash WHERE Branch_Codename='$place' ORDER BY Form_Date") or die(mysql_error()); $sql2 = mysql_query("SELECT ID FROM counter_cash WHERE Check_By ='' AND Branch_Codename='$place' ") or die(mysql_error()); echo "<body bgcolor='#F5D16A'>"; echo "<center><img src ='OK.gif'></center><br>"; echo "<center><h2>COUNTER CASH CHECKING REPORT</h2>"; echo "<table><tr><td><h3>LOCATION</h3></td><td><h3>:</h3></td><td><h3>".$place."</h3></td></tr></table></center>"; echo "<center><table border = '1'>"; echo "<tr><th rowspan='2'>ID</th><th rowspan='2'>DATE & TIME</th><th rowspan='2'>CASHIER NAME</th><th colspan='3'>COUNTER CASH</th><th colspan='3'>PETTY CASH</th><th rowspan='2'>SIGN</th><th rowspan='2'>HANDOVER TO (NAME)</th><th rowspan='2'>SIGN</th><th rowspan='2'>CHECK BY</th><th rowspan='2'>CHECK SYMBOL</th></tr>"; echo "<tr><th>AMOUNT</th><th>SHORTAGE</th><th>EXCESS</th><th>AMOUNT</th><th>SHORTAGE</th><th>REMARK</th></tr>"; while($report = mysql_fetch_array($sql1)) { echo "<tr align='center'><td>".$report['ID']."</td>"; echo "<td>".$report['Form_Date']."</td> "; echo "<td>".$report['Cashier_Name']."</td> "; echo "<td>RM ".$report['Counter_Amount']."</td> "; echo "<td>RM ".$report['Counter_Shortage']."</td> "; echo "<td>RM ".$report['Counter_Excess']."</td> "; echo "<td>RM ".$report['Petty_Amount']."</td> "; echo "<td>RM ".$report['Petty_Shortage']."</td> "; echo "<td>".$report['Petty_Remark']."</td> "; echo "<td>".$report['Cashier_Sign']."</td> "; echo "<td>".$report['Handover_Name']."</td> "; echo "<td>".$report['Handover_Sign']."</td> "; echo "<td>".$report['Check_By']."</td> "; echo "<td>"; echo "<input type='button' name='check[]' value=".$report['ID'].">"; echo "</td>"; } echo"</tr></table></center><br>"; /* echo"<center><form name='editcheckby' method='post' action='countercashadmineditcheckby2.php'>"; echo "<table><tr><td><b>CHOOSE ID TO CHECK BY</b></td></tr><tr><td><center><select name = 'cuba'>"; while($checkby = mysql_fetch_array($sql2)) { echo "<option value ='".$checkby['ID']."'>".$checkby['ID']."</option>"; } echo "</select></center></td></tr>"; echo "<tr><td><center><input type='submit' name='submit' value='Check'></center></td></tr></table></form>"; */ echo "<center><h3><a href='adminselect.php'>BACK</a> <a href='logout.php'>LOG OUT</a></h3></center>"; } else { ?> <!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> <script type="text/javascript"> function a() { var x = document.select.branchcodename.value; if(x=="") { alert("Please choose branch location"); return false; } } </script> </head> <body bgcolor="#F5D16A"> <center> <img src="OK.gif" /> <table border="0" align="center"> <form name="select" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="return a()"> <tr><td><center><h1>CHOOSE COUNTER CASH CHECKING REPORT LOCATION</h1></center></td></tr> <tr><td><center>Branch Codename:<select name="tempat"> <option value="OK01">OK</option> <option value="TK02">TK</option> </select></center></td></tr> <tr><td><center><input type="submit" name="submit" value="Submit"></center></td></tr> </form> </table> </center> </body> </html> <?php } // $sql3 = mysql_query("UPDATE counter_cash SET Check_By ='$a' WHERE Check_By ='' "); // $sql4 = mysql_query("UPDATE counter_cash2 SET Check_By ='$a' WHERE Check_By ='' "); ?> My screenshot is It is possible when i click check symbol it update the check by name? how it update to check by name when clicking button on check symbol? The check by name I took after the login Session and the update query in countercashadmineditcheckby2.php <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; $b=$_SESSION['tempat']; if (isset($_POST["Check"])) { $b=$_SESSION['tempat']; $checkby=$_POST['cuba']; $sql1 = mysql_query("UPDATE counter_cash SET Check_By = '$a'") or die(mysql_error()); $_SESSION['is_logged_in'] = 1; if($_SESSION['is_logged_in'] == 1) { header("Location: countercashadminviewedit2.php"); } } ?> I confusing how to send data from countercashadminlocation to countercashadmineditcheckby2.php because as I know if using dropdown it will send base on select name but about button I was confused, hope someobody can help me
  11. I had made modification where that tick or check mark I added one field named "Check_By_Mark" where collation is utf8_unicode_ci //countercashadminlocation.php <?php session_start(); ini_set('session.bug_compat_warn', 0); ini_set('session.bug_compat_42', 0); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; if (isset($_POST["submit"])) { $place = $_POST['tempat']; $_SESSION['tempat']=$place; $b= $_SESSION['tempat']; $sql1 = mysql_query("SELECT *,DATE_FORMAT(Form_Date, '%d/%m/%Y %H:%i %p') AS Form_Date FROM counter_cash WHERE Branch_Codename='$place' ORDER BY Form_Date") or die(mysql_error()); $sql2 = mysql_query("SELECT ID FROM counter_cash WHERE Check_By ='' AND Branch_Codename='$place' ") or die(mysql_error()); echo "<body bgcolor='#F5D16A'>"; echo "<center><img src ='OK.gif'></center><br>"; echo "<center><h2>COUNTER CASH CHECKING REPORT</h2>"; echo "<table><tr><td><h3>LOCATION</h3></td><td><h3>:</h3></td><td><h3>".$place."</h3></td></tr></table></center>"; echo "<center><table border = '1'>"; echo "<tr><th rowspan='2'>ID</th><th rowspan='2'>DATE & TIME</th><th rowspan='2'>CASHIER NAME</th><th colspan='3'>COUNTER CASH</th><th colspan='3'>PETTY CASH</th><th rowspan='2'>SIGN</th><th rowspan='2'>HANDOVER TO (NAME)</th><th rowspan='2'>SIGN</th><th rowspan='2'>CHECK BY </th></tr>"; echo "<tr><th>AMOUNT</th><th>SHORTAGE</th><th>EXCESS</th><th>AMOUNT</th><th>SHORTAGE</th><th>REMARK</th></tr>"; while($report = mysql_fetch_array($sql1)) { echo "<tr align='center'><td>".$report['ID']."</td>"; echo "<td>".$report['Form_Date']."</td> "; echo "<td>".$report['Cashier_Name']."</td> "; echo "<td>RM ".$report['Counter_Amount']."</td> "; echo "<td>RM ".$report['Counter_Shortage']."</td> "; echo "<td>RM ".$report['Counter_Excess']."</td> "; echo "<td>RM ".$report['Petty_Amount']."</td> "; echo "<td>RM ".$report['Petty_Shortage']."</td> "; echo "<td>".$report['Petty_Remark']."</td> "; echo "<td>".$report['Cashier_Sign']."</td> "; echo "<td>".$report['Handover_Name']."</td> "; echo "<td>".$report['Handover_Sign']."</td> "; echo "<td>".$report['Check_By_Mark']."</td> "; } echo"</table></center><br>"; echo"<center><form name='editcheckby' method='post' action='countercashadmineditcheckby.php'>"; echo "<table><tr><td><b>CHOOSE ID TO CHECK BY</b></td></tr><tr><td><center><select name = 'cuba'>"; while($checkby = mysql_fetch_array($sql2)) { echo "<option value ='".$checkby['ID']."'>".$checkby['ID']."</option>"; } echo "</select></center></td></tr>"; echo "<tr><td><center><input type='submit' name='submit' value='Check'></center></td></tr></table></form>"; echo "<center><h3><a href='adminselect.php'>BACK</a> <a href='logout.php'>LOG OUT</a></h3></center>"; } else { ?> <!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> <script type="text/javascript"> function a() { var x = document.select.branchcodename.value; if(x=="") { alert("Please choose branch location"); return false; } } </script> </head> <body bgcolor="#F5D16A"> <center> <img src="OK.gif" /> <table border="0" align="center"> <form name="select" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="return a()"> <tr><td><center><h1>CHOOSE COUNTER CASH CHECKING REPORT LOCATION</h1></center></td></tr> <tr><td><center>Branch Codename:<select name="tempat"> <option value="OK01">OK</option> <option value="TK02">TK</option> </select></center></td></tr> <tr><td><center><input type="submit" name="submit" value="Submit"></center></td></tr> </form> </table> </center> </body> </html> <?php } // $sql3 = mysql_query("UPDATE counter_cash SET Check_By ='$a' WHERE Check_By ='' "); // $sql4 = mysql_query("UPDATE counter_cash2 SET Check_By ='$a' WHERE Check_By ='' "); ?> //countercashadmineditcheckby.php <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; $b=$_SESSION['tempat']; if (isset($_POST["submit"])) { $b=$_SESSION['tempat']; $checkby=$_POST['cuba']; $sql1 = mysql_query("UPDATE counter_cash SET Check_By = '$a',Check_By_Mark='✓' WHERE ID = '$checkby'") or die(mysql_error()); $_SESSION['is_logged_in'] = 1; if($_SESSION['is_logged_in'] == 1) { header("Location: countercashadminviewedit.php"); } } ?> //countercashadminviewedit.php <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; $b=$_SESSION['tempat']; $sql1 = mysql_query("SELECT *,DATE_FORMAT(Form_Date, '%d/%m/%Y %l:%i %p') AS Form_Date FROM counter_cash WHERE Branch_Codename='$b' ORDER BY Form_Date") or die(mysql_error()); $sql2 = mysql_query("SELECT ID FROM counter_cash WHERE Check_By ='' AND Branch_Codename='$b'") or die(mysql_error()); ?> <!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> </head> <body bgcolor='#F5D16A'> <center><img src ='OK.gif'></center><br> <center><h2>COUNTER CASH CHECKING REPORT</h2><table><tr><td><h3>LOCATION</h3></td><td><h3>:</h3></td><td><h3><?php echo $b; ?></h3></td></tr></table></center> <center><table border = '1'> <tr><th rowspan='2'>ID</th><th rowspan='2'>DATE & TIME</th><th rowspan='2'>CASHIER NAME</th><th colspan='3'>COUNTER CASH</th><th colspan='3'>PETTY CASH</th><th rowspan='2'>SIGN</th><th rowspan='2'>HANDOVER TO (NAME)</th><th rowspan='2'>SIGN</th><th rowspan='2'>CHECK BY</th></tr><tr><th>AMOUNT</th><th>SHORTAGE</th><th>EXCESS</th><th>AMOUNT</th><th>SHORTAGE</th><th>REMARK</th></tr> <?php while($report = mysql_fetch_array($sql1)) { ?> <tr align='center'><td><?php echo $report['ID'];?></td><td><?php echo $report['Form_Date'];?></td><td><?php echo $report['Cashier_Name'];?></td><td>RM <?php echo $report['Counter_Amount'];?></td><td>RM <?php echo $report['Counter_Shortage'];?></td><td>RM <?php echo $report['Counter_Excess'];?></td><td>RM <?php echo $report['Petty_Amount'];?></td><td>RM <?php echo $report['Petty_Shortage'];?></td><td><?php echo $report['Petty_Remark'];?></td><td><?php echo $report['Cashier_Sign'];?></td><td><?php echo $report['Handover_Name'];?></td><td><?php echo $report['Handover_Sign'];?></td><td><?php echo $report['Check_By_Mark'];?></td></tr><?php } ?> </table></center><br /><center> <form name='editcheckby' method='post' action='countercashadmineditcheckby.php'><table><tr><td><b>CHOOSE ID TO CHECK BY</b></td></tr><tr><td><center><select name = 'cuba'> <?php while($checkby = mysql_fetch_array($sql2)) { ?> <option value = <?php echo $checkby['ID'];?>><?php echo $checkby['ID'];?></option> <?php } ?> </select></center></td></tr> <tr><td><center><input type='submit' name='submit' value='Check'></center></td></tr></table></form> <center><h3><a href='adminselect.php'>BACK</a> <a href='logout.php'>LOG OUT</a></h3></center> </body> </html> So when I am inserting into phpmyadmin I got this symbol in my phpmyadmin I got that ace symbol and when i want to retrieve it and put in table I got that double?symbol hope anybody can solve
  12. May I know any example to insert data using input type=text and the data was input is ✓ How to insert it and how to retrieve it
  13. Problem solved I found the error and correct it
  14. yeah I saw but all was text where mine is text in textarea ok i post another picture If you see in field let said now I want to input one data which is line number 13 that show Time = 10.00 am Task = Morning Briefing Operation = 1) Sales Performance Review Staff A = RM 5,000.00 Staff B = RM 3700.00 Staff C = RM 4,200.00 2) Staff Performance Review a) Service Performance Review b) Attendance Performance Review and all this data is inserted in one line where the operation input data I label as text area My data can be shown same like this picture above using that nl2br function but only if the person who input data in text area using "Enter" keystroke to move new line but as we know when we write in textarea after it reached lts limit column it will automatically move to the next line but still if using nl2br function, the data were not in linebreak same according to the first one i mention About word wrap how it will be balance the word if first line for example was 25 but second form the first line was 30
  15. how to do that ? but if I know if wordwrap its set the limit how many character in one line right?
  16. //countercashadminlocation.php <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; if (isset($_POST["submit"])) { $place = $_POST['tempat']; $_SESSION['tempat']=$place; $b= $_SESSION['tempat']; $sql1 = mysql_query("SELECT *,DATE_FORMAT(Form_Date, '%d/%m/%Y %H:%i %p') AS Form_Date FROM counter_cash WHERE Branch_Codename='$place' ORDER BY Form_Date") or die(mysql_error()); $sql2 = mysql_query("SELECT * FROM counter_cash WHERE Branch_Codename='$place'") or die(mysql_error()); echo "<body bgcolor='#F5D16A'>"; echo "<center><img src ='OK.gif'></center><br>"; echo "<center><h2>COUNTER CASH CHECKING REPORT</h2>"; echo "<table><tr><td><h3>LOCATION</h3></td><td><h3>:</h3></td><td><h3>".$place."</h3></td></tr></table></center>"; echo "<center><table border = '1'>"; echo "<tr><th rowspan='2'>ID</th><th rowspan='2'>DATE & TIME</th><th rowspan='2'>CASHIER NAME</th><th colspan='3'>COUNTER CASH</th><th colspan='3'>PETTY CASH</th><th rowspan='2'>SIGN</th><th rowspan='2'>HANDOVER TO (NAME)</th><th rowspan='2'>SIGN</th><th rowspan='2'>CHECK BY </th></tr>"; echo "<tr><th>AMOUNT</th><th>SHORTAGE</th><th>EXCESS</th><th>AMOUNT</th><th>SHORTAGE</th><th>REMARK</th></tr>"; while($report = mysql_fetch_array($sql1)) { echo "<tr align='center'><td>".$report['ID']."</td>"; echo "<td>".$report['Form_Date']."</td> "; echo "<td>".$report['Cashier_Name']."</td> "; echo "<td>RM ".$report['Counter_Amount']."</td> "; echo "<td>RM ".$report['Counter_Shortage']."</td> "; echo "<td>RM ".$report['Counter_Excess']."</td> "; echo "<td>RM ".$report['Petty_Amount']."</td> "; echo "<td>RM ".$report['Petty_Shortage']."</td> "; echo "<td>".$report['Petty_Remark']."</td> "; echo "<td>".$report['Cashier_Sign']."</td> "; echo "<td>".$report['Handover_Name']."</td> "; echo "<td>".$report['Handover_Sign']."</td> "; echo "<td>".$report['Check_By']."</td> "; } echo"</table></center><br>"; echo"<center><form name='editcheckby' method='post' action='countercashadmineditcheckby.php'>"; echo "<table><tr><td><b>CHOOSE ID TO CHECK BY</b></td></tr><tr><td><center><select name = 'cuba'>"; while($checkby = mysql_fetch_array($sql2)) { echo "<option value ='".$checkby['ID']."'>".$checkby['ID']."</option>"; } echo "</select></center></td></tr>"; echo "<tr><td><center><input type='submit' name='submit' value='Check'></center></td></tr></table></form>"; echo "<center><h3><a href='adminselect.php'>BACK</a> <a href='logout.php'>LOG OUT</a></h3></center>"; } else { ?> <!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> <script type="text/javascript"> function a() { var x = document.select.branchcodename.value; if(x=="") { alert("Please choose branch location"); return false; } } </script> </head> <body bgcolor="#F5D16A"> <center> <img src="OK.gif" /> <table border="0" align="center"> <form name="select" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="return a()"> <tr><td><center><h1>CHOOSE COUNTER CASH CHECKING REPORT LOCATION</h1></center></td></tr> <tr><td><center>Branch Codename:<select name="tempat"> <option value="OK01">OK</option> <option value="TK02">TK</option> </select></center></td></tr> <tr><td><center><input type="submit" name="submit" value="Submit"></center></td></tr> </form> </table> </center> </body> </html> <?php } // $sql3 = mysql_query("UPDATE counter_cash SET Check_By ='$a' WHERE Check_By ='' "); // $sql4 = mysql_query("UPDATE counter_cash2 SET Check_By ='$a' WHERE Check_By ='' "); ?> //countercashadmineditcheckby.php <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; $b=$_SESSION['tempat']; if (isset($_POST["submit"])) { $b=$_SESSION['tempat']; $checkby=$_POST['cuba']; $sql1 = mysql_query("UPDATE counter_cash SET Check_By = '$a' WHERE ID = '$checkby'") or die(mysql_error()); $_SESSION['is_logged_in'] = 1; if($_SESSION['is_logged_in'] == 1) { header("Location: countercashadminviewedit.php"); } } ?> //countercashadminviewedit.php <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:login.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("kime") or die(mysql_error()); $a=$_SESSION['branchcodename']; $b=$_SESSION['tempat']; $sql1 = mysql_query("SELECT *,DATE_FORMAT(Form_Date, '%d/%m/%Y %l:%i %p') AS Form_Date FROM counter_cash WHERE Branch_Codename='$b' ORDER BY Form_Date") or die(mysql_error()); $sql2 = mysql_query("SELECT * FROM counter_cash WHERE Branch_Codename='$b'") or die(mysql_error()); ?> <!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> </head> <body bgcolor='#F5D16A'> <center><img src ='OK.gif'></center><br> <center><h2>COUNTER CASH CHECKING REPORT</h2><table><tr><td><h3>LOCATION</h3></td><td><h3>:</h3></td><td><h3><?php echo $b; ?></h3></td></tr></table></center> <center><table border = '1'> <tr><th rowspan='2'>ID</th><th rowspan='2'>DATE & TIME</th><th rowspan='2'>CASHIER NAME</th><th colspan='3'>COUNTER CASH</th><th colspan='3'>PETTY CASH</th><th rowspan='2'>SIGN</th><th rowspan='2'>HANDOVER TO (NAME)</th><th rowspan='2'>SIGN</th><th rowspan='2'>CHECK BY</th></tr><tr><th>AMOUNT</th><th>SHORTAGE</th><th>EXCESS</th><th>AMOUNT</th><th>SHORTAGE</th><th>REMARK</th></tr><?php while($report = mysql_fetch_array($sql1)) { ?><tr align='center'><td><?php echo $report['ID'];?></td><td><?php echo $report['Form_Date'];?></td><td><?php echo $report['Cashier_Name'];?></td><td>RM <?php echo $report['Counter_Amount'];?></td><td>RM <?php echo $report['Counter_Shortage'];?></td><td>RM <?php echo $report['Counter_Excess'];?></td><td>RM <?php echo $report['Petty_Amount'];?></td><td><?php echo $report['Petty_Shortage'];?></td><td><?php echo $report['Petty_Remark'];?></td><td><?php echo $report['Cashier_Sign'];?></td><td><?php echo $report['Handover_Name'];?></td><td><?php echo $report['Handover_Sign'];?></td><td><?php echo $report['Check_By'];?></td></tr><?php } ?> </table></center><br /><center><form name='editcheckby' method='post' action='countercashadmineditcheckby.php'><table><tr><td><b>CHOOSE ID TO CHECK BY</b></td></tr><tr><td><center><select name = 'cuba'><?php while($checkby = mysql_fetch_array($sql2)) { ?><option value = <?php echo $checkby['ID'];?>><?php echo $checkby['ID'];?></option><?php } ?></select></center></td></tr> <tr><td><center><input type='submit' name='submit' value='Check'></center></td></tr></table></form> <center><h3><a href='adminselect.php'>BACK</a> <a href='logout.php'>LOG OUT</a></h3></center> </body> </html> This 3 pages is just to make the "Check_By" field contained data but my problem was once I updated "Check_By" field according to the ID, I want the dropdownlist to contain ID where the Check By was not filled with data because now it still listing all the ID and not listing ID where check_by still not being filled That ID dropdownlist code was countercashadminlocation.php echo "<table><tr><td><b>CHOOSE ID TO CHECK BY</b></td></tr><tr><td><center><select name = 'cuba'>"; while($checkby = mysql_fetch_array($sql2)) { echo "<option value ='".$checkby['ID']."'>".$checkby['ID']."</option>"; } echo "</select></center></td></tr>"; echo "<tr><td><center><input type='submit' name='submit' value='Check'></center></td></tr></table></form>"; Any suggestion or solution
  17. Sorry my english will be bad but I try first Based on this picture, look on the first line of s when come to the second line of s, I never put the "Enter" keystroke and that leads to the second photo where all s in one line can textarea be coded when its reached limit of column it can line break for second line without pressing "Enter" keystroke?
  18. But I created sample program //linebreaks.php <!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> </head> <body> <form action="linebreaks2.php" method="post"> <textarea name="ye" cols="40" rows="10" ></textarea> <input type="submit" name="submit" value="press"> </form> </body> </html> //linebreaks2.php <?php if(isset($_POST['submit'])) { $a = nl2br($_POST['ye']); echo $a; } ?> linebreaks.php and linebreaks2.php screenshot after i input The word was not in line break
  19. In operation or action & results using textarea For example if person insert or input data and when the data reached finish line it will automatically line break and save to database My problem was when calling from database, the data will output long text instead of user input which has linebreak Any solution please where the user input data via textarea it will automatically recognized line break
  20. while($report = mysql_fetch_array($searchall)) { echo "<tr align='center'><td>".$report['Task_Date']."</td>"; echo "<td>".$report['Branch_Codename']."</td>"; echo "<td>".$report['Task_Name']."</td>"; echo "<td>".$report['Task_Task']."</td>"; echo "<td>".str_replace("\r","<br>",$report['Task_Operation'])."</td>"; echo "<td>".nl2br($report['Task_Action'])."</td>"; echo "<td>".$report['Check_By']."</td></tr>"; } This works perfect when using textarea in task operation and task action but the main problem was when we input data in textarea and we enter to line break then only it will convert using that str replace or nl2br but what I want when user input data in textarea, it will automatically line break without user 'Enter' input
  21. same also not working for me
  22. In the picture below show the result taking from taskreportview.php If u can see on the Operation field when I insert the long data, the data move forward My main question is how to make the data jump to below for example aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa to aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa //TaskReportview.php <?php mysql_connect("localhost","root") or die ("could not connect to the mysql"); mysql_select_db("kime") or die ("no database"); $a=$_SESSION['branchcodename']; $b=$_SESSION['ID']; $sql2 = mysql_query("SELECT *,DATE_FORMAT(Task_Date, '%d/%m/%Y %l:%i %p') AS Task_Date FROM task_report WHERE ID='$b' ORDER BY Task_Date") or die(mysql_error()); echo "<body bgcolor='#F5D16A'>"; echo "<center><img src ='OK.gif'></center><br>"; echo "<center><h2>OPERATION REPORT</h2>"; echo "<table><tr><td><h3>LOCATION</h3></td><td><h3>:</h3></td><td><h3>".$a."</h3></td></tr></table></center>"; echo "<center><table border = '1'>"; echo "<tr><th>DATE & TIME</th><th>STAFF NAME</th><th>TASK</th><th>OPERATION</th><th>ACTION & RESULTS</th></tr>"; while($report = mysql_fetch_array($sql2)) { echo "<tr align='center'><td>".$report['Task_Date']."</td>"; echo "<td>".$report['Task_Name']."</td>"; echo "<td>".$report['Task_Task']."</td>"; echo "<td>".$report['Task_Operation']."</td> "; echo "<td>".$report['Task_Action']."</td> "; } echo"</table><h2><a href='taskreportform.php'>Add Task Form</a><br></h2><h2><a href='logout.php'>Logout</a></h2></center>"; ?>
  23. Thanks a lot guru I will let u know if I succeed doing that date and time anyhow again thanks a lot and also jessica who also previously helping me a lot
  24. sorry again I thinks this post should be solved because the criteria every date and time must be inserted so the problem is solved
×
×
  • 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.