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