Jump to content

fsl4faisal

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by fsl4faisal

  1. if($_POST['Submit']=="Check"){ $issueid=(int)$_POST['issueid']; $returndate=mysql_real_escape_string($_POST['returndate']); list($temp)= mysql_fetch_row(mysql_query("select issueid FROM issue where issueid='$issueid'")); if($temp!=NULL){ $insert_query="insert into returning values($issueid,'$returndate')"; $result=mysql_query($insert_query,$linkID1); if($result){ list($bookid,$account,$issuedate,$duedate)= mysql_fetch_row(mysql_query("select bookid,account,issuedate,duedate FROM issue where issueid='$issueid'")); list($title,$name,$fine)= mysql_fetch_row(mysql_query("select title,name,fine FROM book,user where bookid='$bookid' AND acc='$account'")); $insert_book="update book set copies=copies+1 where bookid='$bookid'"; $result=mysql_query($update_book,$linkID1);
  2. $update_book="update book set copies=copies-1 where bookid='$bookid'"; $result=mysql_query($update_book,$linkID1); if($result) { print "<html><body background=\"header.jpg\"> <p>book successfully subtracted from database</p></body></html>"; } else { print "<html><body background=\"header.jpg\"> <p>problem occured</p></body></html>"; } }
  3. $update_book="update book set copies=copies-1 where bookid='$bookid'"; $result=mysql_query($update_book,$linkID1); if($result) { print "<html><body background=\"header.jpg\"> <p>book successfully subtracted from database</p></body></html>"; } else { print "<html><body background=\"header.jpg\"> <p>problem occured</p></body></html>"; }
  4. if($_POST['Submit']=="Check"){ $bookid=(int)$_POST['bookid']; $account=(int)$_POST['account']; $issuedate=mysql_real_escape_string($_POST['issuedate']); /*$duedate = new DateTime($issuedate); $duedate->add(new DateInterval('P15D')); echo $duedate->format('Y-m-d H:i:s') . "\n";*/ //$issuedate=date("Y-m-d",$issuedate); echo 'issuedate date is ' . $issuedate; list($year,$month,$date) = explode('-',$issuedate,3); $duedate = mktime(0,0,0,date($month),date(day)+15,date($year)); echo 'duedate date is ' . date("Y-m-d",$duedate); $duedate=date("Y-m-d",$duedate); //print $duedate; print "<br>"; //$issuedate=date("Y-m-d",$issuedate); print $issuedate; print "<br>"; print $year; print "<br>"; print $month; print "<br>"; print $date; $insert_query="insert into issue values($account,$bookid,'$issuedate','$duedate')"; $result=mysql_query($insert_query,$linkID1); if($result){ print "<html><body background=\"header.jpg\"> <p>book successfully added</p></body></html>"; } else{ print "<html><body background=\"header.jpg\"> <p>$insert_query</p>"; print "<p>there was a problem in adding</p></body></html>"; } }
  5. $insert_query="insert into issue values($account,$bookid,'$issuedate',DATE_ADD($issuedate,INTERVAL 15 DAY))";
  6. if($_POST['Submit']=="Check"){ /*$title=mysql_real_escape_string($_POST['title']); $subject=mysql_real_escape_string($_POST['subject']); $author=mysql_real_escape_string($_POST['author']);*/ $bookid=(int)$_POST['bookid']; $account=(int)$_POST['account']; $issuedate=mysql_real_escape_string($_POST['issuedate']); //Sduedate=$issuedate+15; $duedate=DATE_ADD('$issuedate'+interval 15 DAY) print $duedate; print $issuedate; $insert_query="insert into issue values($account,$bookid,'$issuedate','$duedate')"; $result=mysql_query($insert_query,$linkID1); if($result){ print "<html><body background=\"header.jpg\"> <p>book successfully added</p></body></html>"; } else{ print "<html><body background=\"header.jpg\"> <p>$insert_query</p>"; print "<p>there was a problem in adding</p></body></html>"; } }
  7. if($_POST['Submit']=="Check"){ /*$title=mysql_real_escape_string($_POST['title']); $subject=mysql_real_escape_string($_POST['subject']); $author=mysql_real_escape_string($_POST['author']);*/ $bookid=(int)$_POST['bookid']; $account=(int)$_POST['account']; $issuedate=mysql_real_escape_string($_POST['issuedate']); //Sduedate=$issuedate+15; $duedate=DATE_ADD('$issuedate'+interval 15 DAY) print $duedate; print $issuedate; $insert_query="insert into issue values($account,$bookid,'$issuedate','$duedate')"; $result=mysql_query($insert_query,$linkID1); if($result){ print "<html><body background=\"header.jpg\"> <p>book successfully added</p></body></html>"; } else{ print "<html><body background=\"header.jpg\"> <p>$insert_query</p>"; print "<p>there was a problem in adding</p></body></html>"; } }
×
×
  • 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.