project lisa

Upload: walter-buyela

Post on 28-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Project Lisa

    1/20

    1

    Project

    Lisa

    Html_codes.php

  • 7/25/2019 Project Lisa

    2/20

    2

    functioncreateCategoryList(){

    if(ctype_digit($_GET['category'])){

    $x=$_GET['category'];

    }else{

    $x=

    999;

    }

    echo"AllCategories";

    $i=0;

    while(1){

    if(numberToCategory($i)=="CategoryDoesNotExist"){

    break;

    }else{

    echo"";

    echonumberToCategory($i);

    echo"";

    }

    $i++;

    }

    }

    //CategoryNumbertoString

    functionnumberToCategory($n){

    switch($n){

    case0:

    $cat="Antiques";

    break;

    case1:

    $cat="Art";

    break;

    case2:

    $cat="Automotives";

    break;

    case3:

    $cat="Baby";

    break;

    case4:

    $cat="Books";

    break;

    case5:

    $cat="Business&Industrial";

    break;

    case6:

    $cat="Cameras&Photo";

    break;

    case7:

    $cat="Clothing&Accessories";

    break;

    case8:

    $cat="Collectibles";

    break;

    case9:

    $cat="Computers";

    break;

    case10:

    $cat="Crafts";

    break;

    case11:

    $cat="DVD's&Movies";

  • 7/25/2019 Project Lisa

    3/20

    3

    break;

    case12:

    $cat="Electronics";

    break;

    case13:

    $cat="Health&Beauty";

    break;

    case14:

    $cat="Home&Garden";

    break;

    case15:

    $cat="Jewelry&Watches";

    break;

    case16:

    $cat="Music";

    break;

    case17:

    $cat="PetSupplies";

    break;

    case18:

    $cat="Services";

    break;

    case19:

    $cat="Sports&Outdoors";

    break;

    case20:

    $cat="SportsMemorabilia&Cards";

    break;

    case21:

    $cat="Tools&HomeImprovement";

    break;

    case22:

    $cat="Toys&Hobbies";

    break;case23:

    $cat="VideoGames";

    break;

    case24:

    $cat="Other";

    break;

    default:

    $cat="CategoryDoesNotExist";

    }

    return$cat;

    }

    //Codeforfooter

    functionfooterCode(){

    echo'

    IfahYouTube

    IfahFacebook

    IfahGoogle+

    ';

    }

  • 7/25/2019 Project Lisa

    4/20

    4

    //Codeforaccontpagelinks

    include("functions/fun_userstats.php");

    functionaccountLinks($x){

    $my_id=$_SESSION['user_id'];

    $allPending=

    calculateAllPendingItems();

    $allReported=calculateAllReportedItems();

    $usersActive=calculateUsersActiveItems($my_id);

    $usersPending=calculateUsersPendingItems($my_id);

    $usersOffersReceived=calculateUsersOffersReceived($my_id);

    $usersOffersMade=calculateUsersOffersMade($my_id);

    $usersCompletedTrades=calculateUsersCompletedTrades($my_id);

    $usersUnreadMessages=calculateUsersUnreadMessages($my_id);

    switch($x){

    case0:$additems='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case1:$myitems='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case2:$myprofile='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case3:$shippinginfo='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case4:$offersreceived='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case5:$offersmade='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case6:$offersdeclined='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case7:$completedtrades='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case8:$inbox='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case9:$sent='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)0

    26px"

    ';

    break;

    case10:$trash='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case11:$compose='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case12:$pending='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case13:$reported='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case14:$myactive='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case15:$mypending='style="color:white;textshadow:1px1px3pxblack;

    background:url(../images/accountnav.png)026px"';break;

    case99:break;

    }

    }

    ?>

    Fun_userstats.php

  • 7/25/2019 Project Lisa

    5/20

    5

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateallreportedformoderator

    functioncalculateAllReportedItems(){

    $result=mysqli_query($mysql_connect,"SELECTitem_numberFROMitems_availableWHERE

    status='reported'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateusersactiveitems

    functioncalculateUsersActiveItems($user){

    $result=mysqli_query($mysql_connect,"SELECTitem_numberFROMitems_availableWHERE

    owner_id='$user'ANDstatus='active'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateuserspendingitems

    functioncalculateUsersPendingItems($user){

    $result=mysqli_query($mysql_connect,"SELECTitem_numberFROMitems_availableWHERE

    owner_id='$user'ANDstatus='pending'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{ return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateusersoffersreceived

    functioncalculateUsersOffersReceived($user){

    $result=mysqli_query($mysql_connect,"SELECTtrade_idFROMoffers_openWHERE

    receivers_id='$user'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateusersoffersreceived

    functioncalculateUsersOffersMade($user){

    $result=mysqli_query($mysql_connect,"SELECTtrade_idFROMoffers_openWHERE

    offerers_id='$user'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateusersoffersreceived

    functioncalculateUsersCompletedTrades($user){

  • 7/25/2019 Project Lisa

    6/20

    6

    $result=mysqli_query($mysql_connect,"SELECTitem_numberFROMitems_tradedWHERE

    owner_id='$user'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    //calculateusersoffersreceived

    functioncalculateUsersUnreadMessages($user){

    $result=mysqli_query($mysql_connect,"SELECTidFROMmessagesWHEREreceiver='$user'AND

    status='unread'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    return'';

    }else{

    return"(".mysqli_num_rows($result).")";

    }

    }

    ?>

    Activate.php

  • 7/25/2019 Project Lisa

    7/20

    7

    ?>

    Prompt.php

    Prompt

  • 7/25/2019 Project Lisa

    8/20

    8

    Additem.php

    AddanItem

    Login.php

  • 7/25/2019 Project Lisa

    9/20

    9

    if(empty($_POST['username'])){

    $error[]='Pleaseenterausername.';

    }elseif(ctype_alnum($_POST['username'])){

    $username=$_POST['username'];

    }else{

    $error[]='Usernamemustconsistoflettersandnumbersonly.';

    }

    //password

    if(empty($_POST['password'])){

    $error[]='Pleaseenterapassword.';

    }else{

    $password=mysqli_real_escape_string($mysql_connect,$_POST['password']);

    }

    if(empty($error)){

    $result=mysqli_query($mysql_connect,"SELECT*FROMusersWHEREusername='$username'AND

    password='$password'")ordie(mysql_error());

    if(mysqli_num_rows($result)==1){

    while($row=mysqli_fetch_array($result)){

    $_SESSION['user_id']=$row['user_id'];

    header('Location:account_itemsactive.php');

    }

    }else{

    $error_message='Usernameorpasswordisincorrect.

    ';

    }

    }else{

    $error_message='';

    foreach($erroras$key=>$values){

    $error_message.="$values";

    }

    $error_message.="

    ";

    }

    }

    ?>

    LogIn

    LogIn

    Username:

  • 7/25/2019 Project Lisa

    10/20

    10

    Password:

    Logout.php

    Register.php

  • 7/25/2019 Project Lisa

    11/20

    11

    if(empty($error)){

    $result=mysqli_query($mysql_connect,"SELECT*FROMusersWHEREemail='$email'ORusername='$username'

    ")ordie(mysql_error());

    //$result1=

    mysqli_query($mysql_connect,

    "SELECT

    *

    FROM

    tempusers

    WHERE

    email='$email'

    OR

    username='$username'")ordie(mysql_error());

    if(mysqli_num_rows($result)==0){

    $activation=md5(uniqid(rand(),true));

    $result2=mysqli_query($mysql_connect,"INSERTINTOtempusers

    (user_id,username,email,password,activation)VALUES('','$username','$email','$password','$activation')")ordie(mysql_error());

    if(!$result2){

    die('Couldnotinsertintodatabase:'.mysql_error());

    }else{

    $message="Toactivateyouraccount,pleaseclickonthislink:\n\n";

    $message.=

    "http://localhost:8080/lisa".'/activate.php?email='.urlencode($email)."&key=$activation";

    mail($email,'RegistrationConfirmation',$message);

    header('Location:prompt.php?x=1');

    }

    }else{

    header('Location:prompt.php?x=2');

    }

    }else{

    $error_message='';

    foreach($erroras$key=>$values){

    $error_message.="$values";

    }

    $error_message.="

    ";

    }

    }

    ?>

    Register

    Register

    Username:

    20charactersmaximum(lettersandnumbersonly)

    Email:

  • 7/25/2019 Project Lisa

    12/20

    12

    Password:

    20charactersmaximum

    Main.css

    *{

    margin:0px;

    padding:0px;

    liststyletype:none;

    }

    body{

    textalign:center;

    fontfamily:Arial;

    fontsize:12px;

    color:#303030;

    }

    header,nav,section,aside,footer{

    display:block;

    }img{

    border:none;

    }

    h2{/*Darkgraytitles*/

    fontfamily:Arial;

    fontsize:14px;

    color:#404040;

    }

    h3{/*Fortitles*/

    marginbottom:15px;

    fontsize:22px;

    color:white;

    textshadow:1px1px3px#080808;

    }

    h4{

    fontfamily:Arial;

    fontsize:14px;

    fontweight:normal;

    color:#606060;

    }

    h5{/*addressprompt*/

    textalign:center;

    fontfamily:Arial;

    fontsize:14px;

    color:#404040;

    }

    h6{/*addressinshippinginfo*/

    textalign:center;

  • 7/25/2019 Project Lisa

    13/20

    13

    fontfamily:Arial;

    fontsize:14px;

    fontweight:normal;

    color:#606060;

    }

    table{

    width:100%;

    textalign:center;

    }

    th{

    color:#888888;

    fontweight:normal;

    textdecoration:underline;

    }

    td{

    padding:3px10px;

    }

    a:link{

    color:#006699;

    textdecoration:none;

    }

    a:visited{

    color:#006699;

    textdecoration:none;

    }

    a:hover{

    color:#CC6600;

    textdecoration:underline;

    }

    a:active{

    color:#CC6600;

    textdecoration:underline;

    }

    .dates{ color:#CC6600;

    fontweight:bold;

    }

    .offers{

    color:#404040;

    fontweight:bold;

    }

    .usernames{

    color:#006699;

    fontweight:900;

    }

    .subtitles{

    color:#707070;

    }

    #wrapper{

    width:1000px;

    margin:15pxauto0px;

    textalign:left;

    }

    #main_header{

    /*spacewithlogoandtoplinks*/

    }

    #rightAlign{

    float:right;

    textalign:right;

    }

    #top_search{

    margintop:10px;

  • 7/25/2019 Project Lisa

    14/20

    14

    padding:5px0px5px10px;

    display:block;

    borderradius:7px;

    mozborderradius:7px;

    webkit

    border

    radius:

    7px;

    backgroundcolor:#006699;

    }

    #main_aside{

    width:208px;

    margintop:10px;

    marginright:10px;

    borderwidth:1px;

    float:left;

    }

    #main_section{

    margintop:10px;

    marginbottom:20px;

    float:left;

    width:780px;

    }

    #main_footer{

    paddingtop:30px;

    clear:both;

    fontsize:10px;

    }

    .searchBox{

    padding:2px;

    border:1pxsolid#b9bdc1;

    color:#505050;

    }

    .button{

    mozboxshadow:0px1px0px0px#fed897;

    webkitboxshadow:0px1px0px0px#fed897;

    boxshadow:

    0px

    1px

    0px

    0px

    #fed897;

    background:webkitgradient(linear,lefttop,leftbottom,colorstop(0.05,#f6b33d),colorstop(1,#d29105));

    background:mozlineargradient(centertop,#f6b33d5%,#d29105100%);

    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6b33d',endColorstr='#d29105');

    backgroundcolor:#f6b33d;

    mozborderradius:20px;

    webkitborderradius:20px;

    borderradius:20px;

    border:1pxsolid#eda933;

    display:inlineblock;

    color:#ffffff;

    fontfamily:arial;

    fontsize:14px;

    fontweight:bold;

    padding:2px10px;

    textdecoration:

    none;

    textshadow:1px1px5px#303030;

    }.button:hover{

    background:webkitgradient(linear,lefttop,leftbottom,colorstop(0.05,#d29105),colorstop(1,#f6b33d));

    background:mozlineargradient(centertop,#d291055%,#f6b33d100%);

    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d29105',endColorstr='#f6b33d');

    backgroundcolor:#d29105;

    }.button_active{

    position:relative;

    top:1px;

    }

  • 7/25/2019 Project Lisa

    15/20

    15

    Forms.css

    label{

    display:block;

    float:left;

    fontweight:bold;

    marginright:10px;

    textalign:right;

    width:120px;

    lineheight:25px;

    fontsize:15px;

    color:white;

    textshadow:1px1px3px#080808;

    }

    #generalform{

    padding:20px;

    background:#006699;

    overflow:auto;

    borderradius:

    7px;

    mozborderradius:7px;

    webkitborderradius:7px;

    boxshadow:5px5px15px#A0A0A0;

    mozboxshadow:5px5px15px#A0A0A0;

    webkitboxshadow:5px5px15px#A0A0A0;

    }

    .container{

    width:740px;

    }

    .error{

    color:white;

    backgroundcolor:#D00000;

    padding:4px;

    margin:10px;

    fontfamily:

    Arial;

    fontweight:bold;

    }

    .feedback{

    fontsize:15px;

    padding:5px;

    border:none;

    width:500px;

    color:white;

    fontweight:bold;

    textshadow:1px1px3px#080808;

    }

    .field{

    marginbottom:7px;

    }

    .field:hover.hint{

    position:absolute;

    display:block;

    margin:30px00650px;

    fontsize:15px;

    color:white;

    padding:7px10px;

    background:rgba(0,0,0,0.6);

    borderradius:7px;

    mozborderradius:7px;

    webkitborderradius:7px;

    }

    .hint{

  • 7/25/2019 Project Lisa

    16/20

    16

    display:none;

    }

    .input{

    fontsize:15px;

    padding:5px;

    border:1pxsolid#b9bdc1;

    width:500px;

    color:#505050;

    }

    .input:focus{

    backgroundcolor:white;

    }

    .textarea{

    fontfamily:Arial;

    height:150px;

    width:500px;

    fontsize:15px;

    padding:5px;

    border:1pxsolid#b9bdc1;

    color:#505050;

    }

    Login.css

    #left_side{

    width:490px;

    margintop:10px;

    marginright:10px;

    float:left;

    }#right_side{

    margintop:10px;

    float:left;

    width:500px;

    }

    .container{

    width:460px;

    }

    .input{

    width:360px;

    }

    .field:hover.hint{

    margin:30px00450px;

    }

    Register.css

    #left_side{

    width:490px;

    margintop:10px;

    marginright:10px;

    float:left;

    }

    #right_side{

  • 7/25/2019 Project Lisa

    17/20

    17

    margintop:10px;

    float:left;

    width:500px;

    }

    .container{

    width:460px;

    }

    .input{

    width:360px;

    }

    .field:hover.hint{

    margin:30px00450px;

    }

    Tables

    Tablestructurefortable`feedback`

    CREATETABLEIFNOTEXISTS`feedback`(

    `trade_id`int(11)NOTNULL,

    `giver`int(11)NOTNULL,

    `receiver`int(11)NOTNULL,

    `rating`int(11)NOTNULL,

    `message`varchar(300)COLLATEutf8_unicode_ciNOTNULL,

    `date_left`datetime

    NOT

    NULL

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    Tablestructurefortable`items_available`

    CREATETABLEIFNOTEXISTS`items_available`(

    `item_number`int(11)NOTNULLAUTO_INCREMENT,

    `owner_id`int(11)NOTNULL,

    `date_listed`datetimeNOTNULL,

    `date_ending`datetimeNOTNULL,

    `title`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `subtitle`varchar(60)

    COLLATE

    utf8_unicode_ci

    NOT

    NULL,

    `description`varchar(5000)COLLATEutf8_unicode_ciNOTNULL,

    `category`int(11)NOTNULL,

    `image_path1`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path2`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path3`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path4`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path5`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `item_location`varchar(10)COLLATEutf8_unicode_ciNOTNULL,

    `items_wanted`varchar(500)COLLATEutf8_unicode_ciNOTNULL,

    `status`varchar(25)COLLATEutf8_unicode_ciNOTNULL,

    PRIMARYKEY(`item_number`),

    FULLTEXTKEY`title`(`title`,`description`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ciAUTO_INCREMENT=1;

  • 7/25/2019 Project Lisa

    18/20

    18

    Table

    structure

    for

    table

    `items_traded`

    CREATETABLEIFNOTEXISTS`items_traded`(

    `item_number`int(11)NOTNULL,

    `owner_id`int(11)NOTNULL,

    `date_listed`datetimeNOTNULL,

    `date_ending`datetimeNOTNULL,

    `title`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `subtitle`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `description`varchar(5000)COLLATEutf8_unicode_ciNOTNULL,

    `category`int(11)NOTNULL,

    `image_path1`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path2`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path3`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path4`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `image_path5`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `item_location`varchar(10)COLLATEutf8_unicode_ciNOTNULL,

    `items_wanted`varchar(500)COLLATEutf8_unicode_ciNOTNULL,

    `date_traded`datetimeNOTNULL,

    PRIMARYKEY(`item_number`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    Tablestructurefortable`item_statistics`

    CREATETABLE

    IF

    NOT

    EXISTS

    `item_statistics`

    (`item_number`int(11)NOTNULL,

    `amount_offers`int(11)NOTNULL,

    PRIMARYKEY(`item_number`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    Tablestructurefortable`messages`

    CREATETABLEIFNOTEXISTS`messages`(

    `id`int(11)NOTNULLAUTO_INCREMENT,

    `receiver`int(11)NOTNULL,

    `sender`int(11)

    NOT

    NULL,

    `subject`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `body`varchar(5000)COLLATEutf8_unicode_ciNOTNULL,

    `date_sent`datetimeNOTNULL,

    `status`varchar(20)COLLATEutf8_unicode_ciNOTNULL,

    PRIMARYKEY(`id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ciAUTO_INCREMENT=1;

    Tablestructurefortable`offers_accepted`

  • 7/25/2019 Project Lisa

    19/20

    19

    CREATETABLEIFNOTEXISTS`offers_accepted`(

    `trade_id`int(11)NOTNULL,

    `offerers_id`int(11)NOTNULL,

    `offerers_item`int(11)NOTNULL,

    `receivers_id`int(11)

    NOT

    NULL,

    `receivers_item`int(11)NOTNULL,

    `date_offered`datetimeNOTNULL,

    `date_expired`datetimeNOTNULL,

    `date_accepted`datetimeNOTNULL,

    `copy_for`int(11)NOTNULL

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    Tablestructurefortable`offers_declined`

    CREATETABLEIFNOTEXISTS`offers_declined`(

    `trade_id`int(11)NOTNULL,

    `offerers_id`int(11)NOTNULL,

    `offerers_item`int(11)NOTNULL,

    `receivers_id`int(11)NOTNULL,

    `receivers_item`int(11)NOTNULL,

    `date_offered`datetimeNOTNULL,

    `date_expired`datetimeNOTNULL,

    `date_declined`datetimeNOTNULL,

    PRIMARYKEY(`trade_id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    Table

    structure

    for

    table

    `offers_open`

    CREATETABLEIFNOTEXISTS`offers_open`(

    `trade_id`int(11)NOTNULLAUTO_INCREMENT,

    `offerers_id`int(11)NOTNULL,

    `offerers_item`int(11)NOTNULL,

    `receivers_id`int(11)NOTNULL,

    `receivers_item`int(11)NOTNULL,

    `date_offered`datetimeNOTNULL,

    `date_expired`datetimeNOTNULL,

    PRIMARYKEY(`trade_id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ciAUTO_INCREMENT=1;

    Tablestructurefortable`shipping_info`

    CREATETABLEIFNOTEXISTS`shipping_info`(

    `user_id`int(11)NOTNULL,

    `full_name`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `add1`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `add2`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `city`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `state`varchar(60)COLLATEutf8_unicode_ciNOTNULL,

    `zip`varchar(20)COLLATEutf8_unicode_ciNOTNULL,

    `country`varchar(10)COLLATEutf8_unicode_ciNOTNULL,

  • 7/25/2019 Project Lisa

    20/20

    20

    PRIMARYKEY(`user_id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    Tablestructurefortable`tempusers`

    CREATETABLEIFNOTEXISTS`tempusers`(

    `user_id`int(11)NOTNULLAUTO_INCREMENT,

    `username`varchar(20)COLLATEutf8_unicode_ciNOTNULL,

    `email`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `password`varchar(40)COLLATEutf8_unicode_ciNOTNULL,

    `activation`varchar(40)COLLATEutf8_unicode_ciNOTNULL,

    PRIMARYKEY(`user_id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ciAUTO_INCREMENT=1;

    Tablestructurefortable`users`

    CREATETABLEIFNOTEXISTS`users`(

    `user_id`int(11)NOTNULLAUTO_INCREMENT,

    `username`varchar(20)COLLATEutf8_unicode_ciNOTNULL,

    `email`varchar(80)COLLATEutf8_unicode_ciNOTNULL,

    `password`varchar(40)COLLATEutf8_unicode_ciNOTNULL,

    `role`varchar(20)COLLATEutf8_unicode_ciNOTNULL,

    `credits`int(11)NOTNULL,

    PRIMARYKEY(`user_id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ciAUTO_INCREMENT=1;

    Tablestructurefortable`user_statistics`

    CREATETABLEIFNOTEXISTS`user_statistics`(

    `user_id`int(11)NOTNULL,

    `items_available`int(11)NOTNULL,

    PRIMARYKEY(`user_id`)

    )ENGINE=MyISAMDEFAULTCHARSET=utf8COLLATE=utf8_unicode_ci;

    /*!40101SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT*/;

    /*!40101SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS*/;

    /*!40101SET

    COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION

    */;