G:
/
PleskVhosts
/
seeonsoft.com
/
hp.thefalconunited.com
/
up file
home
<?php include("config.php"); date_default_timezone_set('Asia/Muscat'); $de = date('d-m-Y H:i:s'); $brname = strtoupper($_POST['brname']); $brdesc = strtoupper($_POST['brdesc']); $resultx = $js->query('SELECT * FROM `brands` ORDER BY `id` '); $resultx->execute(); while($row = $resultx->fetch(PDO::FETCH_ASSOC)) { $br = $row['id']; } $v = $br +1; $brid = "BRAND".$v; $result = $js->prepare('SELECT * FROM `brands` WHERE brandname = :brname '); $result->execute(array(':brname' => $brname)); $cc = $result->rowCount(); if($cc != '1') { $sql = $js->prepare('INSERT INTO `brands` (`brandid`, `brandname`, `branddescr`, `addedtime`) VALUES (:brid, :brname, :brdesc, :de)'); $status = $sql->execute(array(':brid' => $brid, ':brname' => $brname, ':brdesc' => $brdesc, ':de' => $de)); $flag = '1'; } else{ $flag = '0'; } if ($flag == '1') { ?> <script type="text/javascript"> alert("Have Successfully Added the Brands <?php echo $brname?>"); window.location='brands.php' </script> <?php } else { ?> <script type="text/javascript"> alert("Already Exist"); window.location='brands.php'; </script> <?php } ?>