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'); $brand = $_POST['brand']; $vtype = strtoupper($_POST['vtype']); $brdesc = strtoupper($_POST['brdesc']); $resultx = $js->query('SELECT * FROM `vehicle_types` ORDER BY `id` '); $resultx->execute(); while($row = $resultx->fetch(PDO::FETCH_ASSOC)) { $br = $row['id']; } $v = $br + 1; $tid = "VTYPE".$v; $result = $js->prepare('SELECT * FROM `vehicle_types` WHERE brands = :brand AND typename = :vtype '); $result->execute(array(':brand' => $brand, ':vtype' => $vtype)); $cc = $result->rowCount(); if($cc != '1') { $sql = $js->prepare('INSERT INTO `vehicle_types` (`vtypeid`, `brands`, `typename`, `typedescr`, `addedtime`) VALUES (:tid, :brand, :vtype, :brdesc, :de)'); $status = $sql->execute(array(':tid' => $tid, ':brand' => $brand, ':vtype' => $vtype, ':brdesc' => $brdesc, ':de' => $de)); $flag = '1'; } else{ $flag = '0'; } if ($flag == '1') { ?> <script type="text/javascript"> alert("Have Successfully Added the Vehicle Type <?php echo $vtype?>"); window.location='vehicle-types.php' </script> <?php } else { ?> <script type="text/javascript"> alert("Already Exist"); window.location='vehicle-types.php'; </script> <?php } ?>