0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: edit_stockacc_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; include( "../lib/config.php"); include_once("../model/defaults_mdl.php"); require_once "../model/defaultValues_mdl.php"; $p_id=@$_SESSION['project_id']; $u_id=@$_SESSION['user_id']; $accountdb_id=$_GET['id']; $sql="select * from stockcategory where user_id='$u_id' and category_id='$accountdb_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { //1 $accountname=$row['category_name']; }//1 if(isset($_POST['Update'])) { //2 $error_flag=0; $editaccname=@$_POST['txtaccountname']; $editaccid=@$_POST['txtaccountid']; if($editaccname=="") { $error['editaccname_null']="Please EnteraccountName"; $error_flag=1; } if($error_flag==1) { include("edit_stockacc.php"); exit(); } else { //category new //category id //category old // $result=Common::editstockcategory($editaccname,$editaccid,$accountname); echo $result; exit(); // $sql="update `stockcategory` set `category_name`='".$editaccname."' // where `category_id`='".$editaccid."'"; mysql_query($sql); if(mysql_affected_rows()>0) { $message="Updation Completed successfully.."; $url="http://".$server_ip."/CPFMS/USER/search_stockacc.php?message=$message"; echo "<script>window.location='$url'</script>"; } else { $message="Updation Failed.."; $url="http://".$server_ip."/CPFMS/USER/search_stockacc.php?message=$message"; echo "<script>window.location='$url'</script>"; } } } ?>