Exemple #1
0
<?php 
include_once 'dbMySql.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $fname = $_POST['first_name'];
    $lname = $_POST['last_name'];
    $city = $_POST['city_name'];
    //$res=$con->insert($fname,$lname,$city);
    $fh = fopen('uploads/awards/awards.csv', 'r');
    if ($fh) {
        //$awards = array_map("str_getcsv", file("../awards.csv",FILE_SKIP_EMPTY_LINES));
        $res = $con->insert_awards($fh);
        if ($res) {
            ?>
  <script>
  alert('Record inserted...');
        window.location='index.php'
        </script>
  <?php 
        } else {
            ?>
  <script>
  /*alert('error inserting record...');
        window.location='index.php'*/
        </script>
  <?php 
        }
    } else {
        echo 'can not openn input file';
<?php

include_once 'dbMySql.php';
$con = new DB_con();
$formatos = array('.jpg', '.png', '.gif', '.ico');
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $nombre = $_FILES['archivo']['name'];
    $nombreTmp = $_FILES['archivo']['tmp_name'];
    $exte = substr($nombre, strrpos($nombre, '.'));
    if (in_array($exte, $formatos)) {
        if (move_uploaded_file($nombreTmp, "imagenes/{$nombre}")) {
            //echo '<script> alert(" Exito al ingresar su imagen"); </script>';
            //echo "<script> window.location='index.php'; </script>";
        }
    } else {
        echo '<script> alert(" Error al ingresar la imagen"); </script>';
        echo "<script> window.location='usuarios.php'; </script>";
    }
    $fname = $_POST['first_name'];
    $lname = $_POST['last_name'];
    $email = $_POST['email'];
    $lugar = $_POST['lugar'];
    $coordenada_x = $_POST['coordenada_x'];
    $coordenada_y = $_POST['coordenada_y'];
    $imagen = $nombre;
    $res = $con->insert($fname, $lname, $email, $lugar, $coordenada_x, $coordenada_y, $imagen);
    if ($res) {
        ?>
		<script>
		alert('Usuario registrado con exito...');
<?php

include_once 'dbMySql.php';
$con = new DB_con();
$table = "car";
$table1 = "CUSTOMER";
$table2 = "RENTALS";
$res = $con->select($table);
$res1 = $con->select($table1);
$res2 = $con->select($table2);
?>




<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" href="style.css" type="text/css" />


    <script type="text/javascript">
        function edit_id(id)
        {
            if(confirm('Sure to change the prices ?'))
            {
                window.location='edit_data.php?edit_id='+id
            }
        }
    </script>
<?php

include_once 'dbMySql.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $VehicleID = $_POST['VehicleID'];
    $Model = $_POST['Model'];
    $YEAR = $_POST['YEAR'];
    $LOCATION = $_POST['LOCATION'];
    $Availability_type = $_POST['Availability_type'];
    $DailyRate = $_POST['DailyRate'];
    $WeeklyRate = $_POST['WeeklyRate'];
    $Cflag = $_POST['Cflag'];
    $Mflag = $_POST['Mflag'];
    $Vflag = $_POST['Vflag'];
    $Tflag = $_POST['Tflag'];
    $Lflag = $_POST['Lflag'];
    $Sflag = $_POST['Sflag'];
    $OwnerID = $_POST['OwnerID'];
    $res = $con->insert($VehicleID, $Model, $YEAR, $LOCATION, $Availability_type, $DailyRate, $WeeklyRate, $Cflag, $Mflag, $Vflag, $Tflag, $Lflag, $Sflag, $OwnerID);
    if ($res) {
        ?>
        <script>
            alert('Car has been successfully added...');
            window.location='index.php'
        </script>
        <?php 
    } else {
        ?>
        <script>
<?php

include_once 'dbMySql.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $VehicleID = $_POST['VehicleID'];
    $CustID = $_POST['CustID'];
    $StartDate = $_POST['StartDate'];
    $ReturnDate = $_POST['ReturnDate'];
    $AmountDue = $_POST['AmountDue'];
    $Rental_Schedule = $_POST['Rental_Schedule'];
    $Rental_Status = $_POST['Rental_Status'];
    $TotalNo_Weeks = $_POST['TotalNo_Weeks'];
    $TotalNo_Day = $_POST['TotalNo_Day'];
    $res2 = $con->insert_res($VehicleID, $CustID, $StartDate, $ReturnDate, $AmountDue, $Rental_Schedule, $Rental_Status, $TotalNo_Weeks, $TotalNo_Day);
    if ($res2) {
        ?>
        <script>
            alert('Rental Information Noted...');
            window.location='index.php'
        </script>
        <?php 
    } else {
        ?>
        <script>
            alert('Error in Rental Details..vehicle number of car is wrong/ Or Newly added customer no is wrong/ Amount Due is 0');
            window.location='index.php'
        </script>
        <?php 
    }
Exemple #6
0
<?php

include_once 'dbconn.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $fname = $_POST['first_name'];
    $lname = $_POST['last_name'];
    $city = $_POST['city_name'];
    $res = $con->insert($fname, $lname, $city);
    if ($res) {
        ?>
  <script>
  alert('Record inserted...');
        window.location='index.php'
        </script>
  <?php 
    } else {
        ?>
  <script>
  alert('error inserting record...');
        window.location='index.php'
        </script>
  <?php 
    }
}
// data insert code ends here.
?>


<!--





<?php 
include_once 'dbMySql.php';
$con = new DB_con();
$formatos = array('.jpg', '.png', '.gif', '.ico');
// data insert code starts here.
if (isset($_POST['modificar'])) {
    $id = $_POST['id'];
    $nombre = $_POST['nombre'];
    $apellido = $_POST['apellido'];
    $email = $_POST['email'];
    $lugar = $_POST['lugar'];
    $coordenada_x = $_POST['coordenada_x'];
    $coordenada_y = $_POST['coordenada_y'];
    $img = $_POST['imagen'];
}
if (isset($_POST['modificar_datos'])) {
    $nombre = $_FILES['archivo']['name'];
    $nombreTmp = $_FILES['archivo']['tmp_name'];
    $exte = substr($nombre, strrpos($nombre, '.'));
    if (in_array($exte, $formatos)) {
        if (move_uploaded_file($nombreTmp, "imagenes/{$nombre}")) {
            //echo '<script> alert(" Exito al ingresar su imagen"); </script>';
            //echo "<script> window.location='index.php'; </script>";
        }
    } else {
<?php

include_once 'dbMySql.php';
$con = new DB_con();
$table = "car";
// data insert code starts here.
if (isset($_GET['edit_id'])) {
    $sql = mysql_query("SELECT * FROM car WHERE VehicleID=" . $_GET['edit_id']);
    $result = mysql_fetch_array($sql);
}
// data update code starts here.
if (isset($_POST['btn-update'])) {
    $DailyRate = $_POST['DailyRate'];
    $WeeklyRate = $_POST['WeeklyRate'];
    $id = $_GET['edit_id'];
    $res = $con->update($table, $id, $DailyRate, $WeeklyRate);
    if ($res) {
        ?>
        <script>
            alert('Updated..Go back and check');
            window.location='index.php'
        </script>
        <?php 
    } else {
        ?>
        <script>
            alert('Error updating record...');
            window.location='index.php'
        </script>
        <?php 
    }
<?php

include_once 'dbMySql.php';
$con = new DB_con();
//$table_rent = "RENTALS";
//$table_car="CAR";
// data insert code starts here.
/*
if(isset($_GET['return_id']))
{
    $sql=mysql_query("SELECT * FROM RENTALS WHERE CustID=".$_GET['return_id']);
    $result=mysql_fetch_array($sql);
}*/
// data update code starts here.
if (isset($_POST['btn-update'])) {
    $CustID = $_POST['CustID'];
}
// data insert code ends here.
?>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Return </title>
    <link rel="stylesheet" href="style4.css" type="text/css" />
</head>
<body>
<center>

    <div id="header">
        <div id="content">
Exemple #10
0
<?php

include_once 'dbMySql.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $fname = $_POST['fname'];
    $sname = $_POST['sname'];
    $gender = "M";
    $email = $_POST['email'];
    $icu_code = $_POST['icu_code'];
    $icu_rating = $_POST['icu_rating'];
    $fide_rating = $_POST['fide_rating'];
    $blitz_rating = $_POST['blitz_rating'];
    $federation = $_POST['federation'];
    $res = $con->insert($email, $fname, $sname, $gender, $icu_code, $icu_rating, $fide_rating, $blitz_rating, $federation);
    if ($res) {
        ?>
		<script>
		alert('Registration Record inserted...');
        window.location='reg_list.php'
        </script>
		<?php 
    } else {
        ?>
		<script>
		alert('error inserting registration record...');
        window.location='reg_add.php'
        </script>
		<?php 
    }
<?php

include_once 'dbMySql.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $Fname = $_POST['Fname'];
    $Lname = $_POST['Lname'];
    $Address = $_POST['Address'];
    $Phone = $_POST['Phone'];
    $res1 = $con->insert_cust($Fname, $Lname, $Address, $Phone);
    if ($res1) {
        ?>
        <script>
            alert('Customer is successfully added...');
            window.location='index.php'
        </script>
        <?php 
    } else {
        ?>
        <script>
            alert('error adding customer...');
            window.location='index.php'
        </script>
        <?php 
    }
}
// data insert code ends here.
?>
<html>
<head>
<?php

include_once 'dbMySql.php';
$con = new DB_con();
// data insert code starts here.
if (isset($_POST['btn-save'])) {
    $StartDate = $_POST['StartDate'];
    $ReturnDate = $_POST['ReturnDate'];
}
// data insert code ends here.
?>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Car Rent</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>

    <div id="header">
        <div id="content">
            <label>Search When You Need Car</label>
        </div>
    </div>

    <div id="body">
        <div id="content">
            <form method="post">
                <table align="center">
<?php

session_start();
//set sent and error variables to false.
$sent = false;
$hasError = false;
$errorArray = array();
// Report all errors
//error_reporting(E_ALL);
/*Include the database connection script 
 * Create an instance
 */
include_once 'DB_con.php';
$con = new DB_con();
/*
 * Sanitize before inerting data
 * */
// data insert code starts here.
if (isset($_POST['signup'])) {
    /*
     * Sanitize and assign php variable name with values from the form
     */
    $name = trim(htmlspecialchars($_POST['name']));
    $email = trim($_POST['email']);
    $country = trim(htmlspecialchars($_POST['country']));
    /*
    Concatinate day, month and year into one variable ($dob) 
    Convert into date
    */
    $date = $_POST['dob_day'] . '-' . $_POST['dob_month'] . '-' . $_POST['dob_year'];
    $d = strtotime($date);
    <?php 
include_once 'dbMySql.php';
$con = new DB_con();
$table = "users";
$res = $con->select($table);
if (isset($_POST['eliminar'])) {
    $id = $_POST['id'];
    $res = $con->delete($id);
    if ($res) {
        ?>
     <script>
        alert('Exito al eliminar');
        window.location='usuarios.php'
    </script>
    <?php 
    } else {
        ?>
        <script>
            alert('Error al eliminar');
            window.location='usuarios.php'
        </script>
        <?php 
    }
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Data</title>
  <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
Exemple #15
0
<?php

// Controller 1 !!
require __DIR__ . '/dbMySql.php';
$con = new DB_con();
require __DIR__ . '/view.php';
if (!empty($_POST['fname']) and !empty($_POST['lname']) and !empty($_POST['keywords']) and !empty($_FILES['rezume']['tmp_name'])) {
    if (isset($_POST['submit'])) {
        $fname = $_POST['fname'];
        $lname = $_POST['lname'];
        $keywords = $_POST['keywords'];
        $rezume = $_FILES['rezume']['name'];
        $con->insert($fname, $lname, $keywords, $rezume);
        // __Cunstruct function@ avtomat kmiana MYSQL in
        $target_file = __DIR__ . '/uploads/' . basename($_FILES['rezume']['name']);
        $uploadOk = 0;
        // false
        $fileType = pathinfo($target_file, PATHINFO_EXTENSION);
        if ($fileType == "txt" or $fileType == "pdf" or $fileType == "doc" or $fileType == "docx") {
            $uploadOk = 1;
        } else {
            echo 'Your File format it must be TXT or PDF or DOC.';
        }
        if ($uploadOk == 1 and is_uploaded_file($_FILES["rezume"]["tmp_name"])) {
            move_uploaded_file($_FILES['rezume']['tmp_name'], $target_file);
        } else {
            echo 'Sorry, there was an error uploading your file.';
        }
    }
} else {
    $error = 'Please, set all fields !!';
<?php

include_once 'dbMySql.php';
$con = new DB_con();
$res = $con->select();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PHP Data Update and Delete Using OOP - By Cleartuts</title>
    <link rel="stylesheet" href="style4.css" type="text/css" />
    <script type="text/javascript">

        function edit_id(id)
        {
            if(confirm('Sure to edit this record ?'))
            {
                window.location='edit_data.php?edit_id='+id
            }
        }
    </script>
</head>
<body>
<center>
    <div id="header">
        <div id="content">
            <label>PHP Data Update and Delete Using OOP - By Cleartuts</label>
        </div>
    </div>
    <div id="body">
        <div id="content">
<?php

// Controller 2 !!
echo '<a href="index.php">Main Menu</a><br><br>';
require __DIR__ . '/dbMySql.php';
$con = new DB_con();
if (isset($_GET['search'])) {
    $fname = $_GET['fname'];
    $lname = $_GET['lname'];
    $keywords = $_GET['keywords'];
    $res = $con->search($fname, $lname, $keywords);
    //var_dump($res);
    $ret = [];
    while (false != ($row = mysqli_fetch_row($res))) {
        $ret[] = $row;
    }
}
$folder = 'uploads/';
include __DIR__ . '/search.php';
//var_dump($ret);