<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

ini_set('diplay_errors', 1);
error_reporting(E_ERROR);

$formname = 'User Creation';
$maindb = 'passmain';
$trandb = 'usercomp';
$trandb2 = 'userorigin';
$printfile = "";
$file = 'user.php';
$trandbexist = 0;
$grid = '';
$keyfld = "code";
$keyfld2 = "username";
$zroot = $_SESSION["zdir"];
$zdb = $_SESSION["zdbyear_" . $dbname];
$admin = $_SESSION["admin_" . $dbname];
$username = $_SESSION["username_" . $dbname];

include("includes/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["submit"])) {
    $a = 1;
    $user = $_POST["user"];
    $password = $_POST["password"];
    $usertype = $_POST["usertype"];
    $series = $_POST["series"];
    $transadd = $_POST["transadd"];
    $transedit = $_POST["transedit"];
    $transdel = $_POST["transdel"];
    $count = $_POST["items"];

    ################## MASTERS ##################

    $supplier = $_POST["supplier"];
    $customer = $_POST["customer"];
    $originmaster = $_POST["originmaster"];
    $destination = $_POST["destination"];
    $status = $_POST["status"];
    $account = $_POST["account"];

    ################## TRANSACTIONS ##################

    $shipment = $_POST["shipment"];
    $updcontainer = $_POST["updcontainer"];
    $recp_ent = $_POST["recp_ent"];
    $updrecv = $_POST["updrecv"];
    $upddelv = $_POST["upddelv"];

    ################## REPORTS ##################

    $shiporiginrep = $_POST["shiporiginrep"];
    $deststockrep = $_POST["deststockrep"];
    $shipmentmultireg = $_POST["shipmentmultireg"];
    $recpreg = $_POST["recpreg"];
    $ledger = $_POST["ledger"];

    if (isset($_POST["user"])) {
        $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE `user`= '$user' AND code != '$qvouch'") or die(mysqli_error($conn));
        if (mysqli_num_rows($result) > 0) {
            $a = 0;
            browse("Name Already Exist");
            // header("refresh: 1; $file?code=$qvouch&mode=last");
            header("refresh: 1; $file?mode=last");
        }
    }

    if ($a == 1) {

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX($keyfld) AS maxcode FROM `$maindb` LIMIT 0,1 ") or die(mysqli_error($conn));

            if (mysqli_num_rows($gen1) > 0) {
                $vvouch = mysqli_fetch_assoc($gen1);
                $qvouch = $vvouch["maxcode"] + 1;
            } else {
                $qvouch = '1';
            }
            $mvouch = $qvouch;
        }

        #################################TRAN PART #################################

        mysqli_query($conn, "DELETE FROM `$trandb` WHERE `username`='$qvouch'") or die(mysqli_error($conn));
        mysqli_query($conn, "DELETE FROM `$trandb2` WHERE `username`='$qvouch'") or die(mysqli_error($conn));

        for ($i = 0; $i < $count; $i++) {
            $cono = $_POST["cono_$i"];
            $finyear = $_POST["finyear_$i"];
            $yearname = $_POST["yearname_$i"];
            $startdate = $_POST["startdate_$i"];
            $lastdate = $_POST["lastdate_$i"];

            if (!empty($finyear)) {
                mysqli_query($conn, "INSERT INTO `$trandb`(`username`,`cono`, `finyear`, `yearname`, `startdate`, `lastdate`) 
                                                   VALUES ('$qvouch', '$cono', '$finyear', '$yearname', '$startdate', '$lastdate')") or die(mysqli_error($conn));
            }
        }

        // FOR ORIGIN RIGHTS

        if (!empty($_POST['origin'])) {
            for ($j = 0; $j < count($_POST['origin']); $j++) {
                
                $origin = $_POST["origin"][$j];
                if (!empty($origin)) {
                    mysqli_query($conn, "INSERT INTO `$trandb2`(`username`, `origin`) 
                                                        VALUES ('$qvouch', '$origin')") or die(mysqli_error($conn));
                }
            }
        }

        ############################## MAIN  ######################################################

        if ($addflag == 1) {

            $usecode = mysqli_query($conn, "SELECT code FROM `passmain` WHERE user='$username'") or die(mysqli_error($conn));
            $getuser = mysqli_fetch_object($usecode);
            $code = $getuser->code;

            mysqli_query($conn, "INSERT INTO `$maindb`(code, `user`, `password`, `usertype`, `transadd`, `transedit`, `transdel`,
                                                        `supplier`, `customer`, `originmaster`, `destination`, `status`, 
                                                        `shipment`, `updcontainer`, `updrecv`, `upddelv`, 
                                                        `shiporiginrep`, `deststockrep`,`account`,`recp_ent`,`shipmentmultireg`,`recpreg`,`ledger`)
                                                 VALUES('$qvouch', '$user', '$password', '$usertype', '$transadd', '$transedit', '$transdel',
                                                        '$supplier', '$customer', '$originmaster', '$destination', '$status',
                                                        '$shipment', '$updcontainer', '$updrecv', '$upddelv',
                                                        '$shiporiginrep', '$deststockrep','$account','$recp_ent','$shipmentmultireg','$recpreg','$ledger')") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch;
            header("refresh: 1;$file?$keyfld=$mvouch&mode=edit");
        } else {
            $mvouch = $qvouch;

            $usecode = mysqli_query($conn, "SELECT code FROM `passmain` WHERE user = '$username'") or die(mysqli_error($conn));
            $getuser = mysqli_fetch_object($usecode);
            $code = $getuser->code;

            mysqli_query($conn, "UPDATE `$maindb` SET `user` = '$user', `password` = '$password', `usertype` = '$usertype', 
                                                      `transadd`='$transadd', `transedit`='$transedit', `transdel`='$transdel',
                                                      `supplier` = '$supplier', `customer` = '$customer', `originmaster`='$originmaster',`destination`='$destination', `status`='$status',
                                                      `shipment`='$shipment',`updcontainer`='$updcontainer', `updrecv` = '$updrecv', `upddelv` = '$upddelv',
                                                      `shiporiginrep` = '$shiporiginrep',`deststockrep`='$deststockrep',`account`='$account',
                                                      `recp_ent`='$recp_ent',`shipmentmultireg`='$shipmentmultireg',`recpreg`='$recpreg',`ledger`='$ledger' WHERE code = '$mvouch' ") or die(mysqli_error($conn));
            updmess();
            header("refresh: 1;$file?$keyfld=$mvouch&mode=edit");
        }
    }
}



if ($addflag != 1) {

    $getvouch = '';
    if ($addflag == 0) {
        $getvouch = $_GET[$keyfld];
    } else {
        $getvouch = $qvouch;
    }

    $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld = '$getvouch'") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);
}

$printdisabled = "none";

$senable = "";
$cenable = "";

/* DELETE */
if (isset($_GET["delete"])) {
    delete("$zroot", "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    delete("$zroot", "$trandb", "$keyfld2", $_GET[$keyfld], "$file?mode=last");
}
?>
<?php include("includes/linkshead.php"); ?>
<style>
    input[type=checkbox] {
        width: 20px;
        height: 20px;
    }
</style>
<script src="MyScript/user.js" type="text/javascript"></script>

<body>
    <!-- Default box -->
    <form action='' method='POST'>
        <!-- Default box -->
        <div class="">
            <div class="col-lg-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><?php echo $formname; ?></h3>

                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <label class="col-sm-3 control-label marg">User Name</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control form focusfield" name="user"
                                    placeholder="User Name" autocomplete="off"
                                    value='<? echo ($addflag != 1) ? $get['user'] : ''; ?>' required="" autofocus>
                            </div>
                        </div>

                        <div class="row">
                            <label class="col-sm-3 control-label marg">Password</label>
                            <div class="col-sm-6">
                                <input type="password" class="form-control form" name="password" id="password"
                                    autocomplete="off" placeholder="Password"
                                    value='<? echo ($addflag != 1) ? $get['password'] : ''; ?>' required="">
                            </div>
                        </div>

                        <div class="row">
                            <label class="col-sm-3 control-label marg">Confirm Pass</label>
                            <div class="col-sm-6">
                                <input type="password" name="confpass" id="confpass" class="form-control form"
                                    placeholder="Confirm Password" required=""
                                    value='<? echo ($addflag != 1) ? $get['password'] : ''; ?>'>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-6">
                                <p id="alert"></p>
                            </div>
                        </div>

                        <div class="row">
                            <label class="col-sm-3 control-label marg">User Type</label>
                            <div class="col-sm-6">

                                <select class="form-control select2 form usertype" name="usertype" id="usertype"
                                    required>
                                    <?php
                                    if ($addflag != 1) {
                                        $usertype = "";
                                        if ($get['usertype'] == 1) {
                                            $ucode = "1";
                                            $usertype = "Supervisor";
                                        }
                                        if ($get['usertype'] == 2) {
                                            $ucode = "2";
                                            $usertype = "Admin";
                                        }
                                        if ($get['usertype'] == 3) {
                                            $ucode = "3";
                                            $usertype = "Staff";
                                        }
                                        echo "<option value='$ucode'>$usertype</option>";
                                    }
                                    ?>
                                    <option value="1">Supervisor</option>
                                    <option value="2">Admin</option>
                                    <option value="3">Staff</option>
                                </select>
                            </div>
                        </div>


                        <div class="row showrights">
                            <div class="col-lg-2 col-sm-2"></div>
                            <label class="col-lg-2 col-sm-2 control-label marg text-right"
                                style="color:blueviolet">Add</label>
                            <div class="col-lg-1 col-sm-1">
                                <input type="checkbox" class="form  transadd" id="transadd" name="transadd" value="1"
                                    <?= ($get['transadd'] == "1") ? 'checked' : '' ?>>
                            </div>
                            <label class="col-lg-1 col-sm-1 control-label marg text-right"
                                style="color:blueviolet">Edit</label>
                            <div class="col-lg-1 col-sm-1">
                                <input type="checkbox" class="form  transedit" id="transedit" name="transedit" value="1"
                                    <?= ($get['transedit'] == "1") ? 'checked' : '' ?>>
                            </div>
                            <label class="col-lg-1 col-sm-1 control-label marg text-right showdel"
                                style="color:blueviolet">Delete</label>
                            <div class="col-lg-1 col-sm-1">
                                <input type="checkbox" class="form  transdel showdel" id="transdel" name="transdel"
                                    value="1" <?= ($get['transdel'] == "1") ? 'checked' : '' ?>>
                            </div>
                        </div>


                        <div class="nav-tabs-custom">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">Masters</a>
                                </li>
                                <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">Transactions</a>
                                </li>
                                <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">Reports</a></li>
                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane active" id="tab_1">
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg selectall">Select All/UnSelect
                                            All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form" id="Smasters" value="1">
                                        </div>
                                    </div>
                                    <?php
                                    $master_items = [
                                        'customer' => 'Customer',
                                        'originmaster' => 'Origin',
                                        'destination' => 'Destination',
                                        'account' => 'Account',
                                    ];
                                    echo "<div class='row'>";
                                    foreach ($master_items as $id => $label) {
                                        echo "<label class='col-sm-4 control-label marg'>$label</label>
                                        <div class='col-sm-2' style='margin-top:6px'>
                                          <input type='checkbox' class='form masters' id='$id' name='$id' value='1' " . (($get[$id] == 1) ? "checked" : "") . ">
                                        </div>";
                                    }
                                    echo "</div>";
                                    ?>
                                </div>

                                <!-- /////////// TAB 2 TRANSACTIONS -->
                                <div class="tab-pane" id="tab_2">
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg selectall">Select All/UnSelect
                                            All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form" id="Stransactions" value="1">
                                        </div>
                                    </div>
                                    <?php
                                    $transactions_items = [
                                        'shipment' => 'Shipment - Container Wise',
                                        'updcontainer' => 'Update Container / Sailing',
                                        'updrecv' => 'Container Port Arrival',
                                        'upddelv' => 'Delivery from Destination',
                                        'recp_ent' => 'Receipt Entry',
                                    ];
                                    echo "<div class='row'>";
                                    foreach ($transactions_items as $id => $label) {
                                        echo "<label class='col-sm-4 control-label marg'>$label</label>
                                        <div class='col-sm-2' style='margin-top:6px'>
                                          <input type='checkbox' class='form transactions' id='$id' name='$id' value='1' " . (($get[$id] == 1) ? "checked" : "") . ">
                                        </div>";
                                    }
                                    echo "</div>";
                                    ?>
                                </div>

                                <!-- /////////// TAB 3 REPORTS -->
                                <div class="tab-pane" id="tab_3">
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg selectall">Select All/UnSelect
                                            All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form" id="Sreports" value="1">
                                        </div>
                                    </div>
                                    <?php
                                    $reports_items = [
                                        'shiporiginrep' => 'Shipment as per Origin',
                                        'deststockrep' => 'Stock at Destination',
                                        'shipmentmultireg' => 'Multiple Shipment Register',
                                        'recpreg' => 'Receipt Register',
                                        'ledger' => 'Ledger',
                                    ];
                                    echo "<div class='row'>";
                                    foreach ($reports_items as $id => $label) {
                                        echo "<label class='col-sm-4 control-label marg'>$label</label>
                                        <div class='col-sm-2' style='margin-top:6px'>
                                          <input type='checkbox' class='form reports' id='$id' name='$id' value='1' " . (($get[$id] == 1) ? "checked" : "") . ">
                                        </div>";
                                    }
                                    echo "</div>";
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="panel-footer">
                        <?php include("includes/buttons.php"); ?>
                    </div>
                </div>
            </div>

            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 pad " id="ShowCompantRights">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Year Details</h3>
                    </div>

                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered" width="100%">
                                <thead class="mySearchTr">
                                    <tr>
                                        <th width="3%"></th>
                                        <th width="15%">Company</th>
                                        <th width="10%">Year</th>
                                        <th width="10%">Name</th>
                                        <th width="10%">From</th>
                                        <th width="10%">To</th>
                                    </tr>
                                </thead>
                                <tbody class="tbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        $gettran = mysqli_query($conn, "SELECT `cono`,`finyear`,`startdate`,`lastdate`,`yearname` FROM `usercomp` WHERE `username`='$get[code]' ORDER BY `cono`") or die(mysqli_error($conn));
                                        while ($tran = mysqli_fetch_array($gettran)) {

                                            $fetyear = mysqli_query($conn, "SELECT `finyear` FROM `compyear` WHERE `finyear`='$tran[finyear]'") or die(mysqli_error($conn));
                                            $fyear = mysqli_fetch_array($fetyear);

                                            $fetcomp = mysqli_query($conn, "SELECT `code`,`compname` FROM `company` WHERE `code`='$tran[cono]'") or die(mysqli_error($conn));
                                            $fcomp = mysqli_fetch_array($fetcomp);

                                            echo "<tr>";
                                            echo "<td><i class='fa fa-close remove' style='display:none'></i></td>";
                                            echo "<td>";
                                            echo "<select class='form-control form cono select2' name='cono_$ctr' style='width:100%'>";
                                            echo "<option value='$fcomp[code]'>$fcomp[compname]</option>";
                                            $getcomp = mysqli_query($conn, "SELECT `code`,`compname` FROM `company` order by code ") or die(mysqli_error($conn));
                                            while ($gcomp = mysqli_fetch_array($getcomp)) {
                                                echo "<option value='$gcomp[code]'>$gcomp[compname]</option>";
                                            }
                                            echo "</select>";
                                            echo "</td>";

                                            echo "<td>";
                                            echo "<select class='form-control form finyear select2' name='finyear_$ctr' style='width:100%'>";
                                            echo "<option value='$fyear[finyear]'>$fyear[finyear]</option>";
                                            $gyear = mysqli_query($conn, "SELECT `finyear` FROM `compyear`") or die(mysqli_error($conn));
                                            while ($year = mysqli_fetch_array($gyear)) {
                                                echo "<option value='$year[finyear]'>$year[finyear]</option>";
                                            }
                                            echo "</select>";
                                            echo "</td>";

                                            echo "<td><input type='text' class='form-control form yearname' name='yearname_$ctr' value='$tran[yearname]' readonly></td>";
                                            echo "<td><input type='text' class='form-control form startdate' name='startdate_$ctr' value='$tran[startdate]' readonly></td>";
                                            echo "<td><input type='text' class='form-control form lastdate' name='lastdate_$ctr' value='$tran[lastdate]' readonly></td>";
                                            echo "</tr >";
                                            $ctr++;
                                        }
                                    } else {
                                        ?>
                                        <tr>
                                            <td><i class='fa fa-close remove'></i></td>
                                            <td>
                                                <select class="form-control form cono select2" name="cono_0"
                                                    style='width:100%' required>
                                                    <option value=""></option>
                                                    <?php
                                                    $getcomp2 = mysqli_query($conn, "SELECT `code`,`compname` FROM `company` order by code ") or die(mysqli_error($conn));
                                                    while ($gcomp2 = mysqli_fetch_array($getcomp2)) {
                                                        echo "<option value='$gcomp2[code]'>$gcomp2[compname]</option>";
                                                    }
                                                    ?>
                                                </select>
                                            </td>

                                            <td>
                                                <select class="form-control form finyear select2" name="finyear_0"
                                                    style='width:100%' required>
                                                    <option value=""></option>
                                                    <?php
                                                    $gyear = mysqli_query($conn, "SELECT `finyear` FROM `compyear`") or die(mysqli_error($conn));
                                                    while ($year = mysqli_fetch_array($gyear)) {
                                                        echo "<option value='$year[finyear]'>$year[finyear]</option>";
                                                    }
                                                    ?>
                                                </select>
                                            </td>
                                            <td><input type="text" class="form-control form yearname" name="yearname_0"
                                                    value="" readonly></td>
                                            <td><input type="text" class="form-control form startdate" name="startdate_0"
                                                    value="" readonly></td>
                                            <td><input type="text" class="form-control form lastdate" name="lastdate_0"
                                                    value="" readonly></td>
                                        </tr>
                                        <?
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-lg-12 pad">
                            <button type="button" class="btn btn-primary btn-square form" id="addnew">
                                <i class="fa fa-plus" data-toggle='tooltip' title='Add Row'></i>
                            </button>
                            <input type="hidden" id="items" name="items"
                                value="<?php echo ($addflag != 1) ? $ctr : 1; ?>" />
                        </div>
                    </div>

                </div>

                <br>


                <div class="panel panel-default" style="width:70%">
                    <div class="panel-heading">
                        <h3 class="panel-title">Origin Rights</h3>
                    </div>

                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered">
                                <thead class="mySearchTr">
                                    <tr>
                                        <th width="3%"></th>
                                        <th width="15%">Origin</th>
                                    </tr>
                                </thead>
                                <tbody class="orgtbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr2 = 0;
                                        $gettran = mysqli_query($conn, "SELECT `origin` FROM `$trandb2`  WHERE `username`='$get[code]' ORDER BY `origin` ") or die(mysqli_error($conn));
                                        while ($tran = mysqli_fetch_array($gettran)) {

                                            echo "<tr>";
                                            echo "<td class='text-center'><i class='fa fa-close remove' style='display:none'></i></td>";
                                            echo "<td>";
                                            echo "<select class='form-control form origin select2' name='origin[]' style='width:100%'>";
                                            echo "<option value='$tran[origin]'>$tran[origin]</option>";
                                            $getorg = mysqli_query($conn, "SELECT `name` FROM $zdb.`origin` order by name ") or die(mysqli_error($conn));
                                            while ($gorg = mysqli_fetch_array($getorg)) {
                                                echo "<option value='$gorg[name]'>$gorg[name]</option>";
                                            }
                                            echo "</select>";
                                            echo "</td>";
                                            echo "</tr>";

                                            $ctr++;
                                        }
                                    } else {
                                        ?>
                                        <tr>
                                            <td class='text-center'><i class='fa fa-close remove'></i></td>
                                            <td>
                                                <select class="form-control form origin select2" name="origin[]" style='width:100%'>
                                                    <option value=""></option>
                                                    <?php
                                                    $getorg2 = mysqli_query($conn, "SELECT `name` FROM $zdb.`origin` order by name ") or die(mysqli_error($conn));
                                                    while ($gorg2 = mysqli_fetch_array($getorg2)) {
                                                        echo "<option value='$gorg2[name]'>$gorg2[name]</option>";
                                                    }
                                                    ?>
                                                </select>
                                            </td>
                                        </tr>

                                        <?
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-lg-12 pad">
                            <button type="button" class="btn btn-primary btn-square form" id="orgaddnew">
                                <i class="fa fa-plus" data-toggle='tooltip' title='Add Row'></i>
                            </button>
                            <input type="hidden" id="orgitems" name="orgitems"
                                value="<?php echo ($addflag != 1) ? $ctr2 : 1; ?>" />
                        </div>
                    </div>

                </div>

            </div>
        </div>
    </form>
    <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search
                        <? echo $formname; ?>
                    </h4>
                </div>
                <div class="modal-body">
                    <div class=" table-responsive">
                        <table id="example1" class="table table-striped">
                            <thead>
                                <tr class="mySearchTr">
                                    <th>code</th>
                                    <th>Name</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                if ($addflag != 1) {
                                    $srchresult = mysqli_query($conn, "SELECT * FROM `$maindb`") or die(mysqli_error($conn));
                                    while ($row = mysqli_fetch_array($srchresult)) {
                                        echo "<tr>";
                                        echo "<td align='left'>$row[code]</td>";
                                        echo "<td align='left'>$row[user]</td>";
                                        echo "<td align='left'><a href=\"$file?mode=edit&$keyfld=$row[$keyfld]\"><i class='fa fa-pencil' style='font-size:1.3em;color:#00C0EF;cursor:pointer;'></i></a></td>";
                                        echo "</tr>";
                                    }
                                }
                                ?>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>
</body>

</html>
<?php include("includes/linksfoot.php"); ?>