HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/grapossconnect/center-admin/product_details.php
<?php
include_once('header.php');
$GRP_MERCHANTS_TABLE = 'grp_merchants';
$GRP_PRODUCT_SERVICES_TABLE = 'grp_product_services';
$GRP_PRODUCT_SERVICES_CATEGORY_TABLE = 'grp_product_services_category';
$GRP_PRODUCT_TYPES_TABLE = 'grp_product_types';
$GRP_SERIVCE_ORDER_DETAILS_TEMP = 'grp_service_order_details_temp';


$req = $_REQUEST['q'];
$temp_id = $_REQUEST['temp_id'];

if ($req != '') {

$getProProQuery = "select ps.ps_id, ps.name, ps.logo, ps.desc, ps.slug, ps.custom_css, c.category_name, m.merchant_name from $GRP_PRODUCT_SERVICES_TABLE as ps LEFT JOIN $GRP_PRODUCT_SERVICES_CATEGORY_TABLE as c ON c.category_id=ps.category_id LEFT JOIN $GRP_MERCHANTS_TABLE as m ON m.merchant_id=ps.merchant_id where ps.slug='$req'";
$getProDet = $wpdb->get_row($getProProQuery);

$psId = $getProDet->ps_id;

$checkTypes = $wpdb->get_results("select id, type_name from $GRP_PRODUCT_TYPES_TABLE where ps_id='$psId' and status='1'");

$getProductQuery = "select temp_id, product_name, mrp, rate, total_products, total_rate, datetime from $GRP_SERIVCE_ORDER_DETAILS_TEMP where temp_id='$temp_id'";
$getProudctList = $wpdb->get_results($getProductQuery);


?>
<div class="page-inner">
    <div class="page-title-box"></div>
    <div id="main-wrapper">
        <div class="row">
            <div class="page-title">
                <h3>Product & Services</h3>
                <div class="page-breadcrumb">
                    <ol class="breadcrumb">
                        <li><a href="home">Product & Services</a></li>
                        <li class="active"><?php echo $getProDet->name; ?></li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 col-md-12">
                <div class="panel panel-white">
                    <div class="row">
                        <div class="col-sm-7">
                            <div class="stats-info">
                                <div class="panel-heading">
                                    <h4 class="panel-title">Fill the below order form</h4>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" method="post">
                                        <table class="table">
                                            <thead>
                                                <tr>
                                                    <th>#</th>
                                                    <th>Product Name</th>
                                                    <th>MRP</th>
                                                    <th>Rate</th>
                                                    <th>Qty</th>
                                                    <th>Amount</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                              <?php
                                                $a = 1;
                                                foreach ($getProudctList as $list) {
                                               ?>  
                                                <tr>
                                                    <th scope="row"><?php echo $a; ?></th>
                                                    <td> <?php echo $list->product_name; ?></td>
                                                    <td> <?php echo $list->mrp; ?></td>
                                                    <td> <?php echo $list->rate; ?></td>
                                                    <td> <?php echo $list->total_products; ?></td>
                                                    <td> <?php echo $list->total_rate; ?></td>
                                                </tr>
                                                <?php 
                                                    $a++;
                                                } ?>
                                            </tbody>
                                        </table>
                                        <div class="form-group">
                                            <div class="col-sm-10" style="margin-top:10px;">
                                                 <a href="/agent/products?q=asiraa&temp_id=<?php echo $temp_id; ?>"><button type="button" class="btn btn-danger">Edit</button> </a>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-offset-2 col-sm-10" style="margin-top:10px;">
                                                <button type="submit" name="submitProduct" class="btn btn-success">Submit</button>
                                            </div>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-5">
                            <div class="visitors-chart">
                                <div class="panel-heading">
                                    <h4 class="panel-title"><?php echo $getProDet->name; ?></h4>
                                </div>
                                <div class="panel-body">
                                    <?php echo $getProDet->desc; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


<?php
if(isset($_REQUEST['submitProduct'])){

//for ($i=1; $i <= $_REQUEST["totalProduct"]; $i++) { 

// $temp_id = date('his'); 
// $qty = "qty";
// $datetime = date('Y-m-d H:i:s', strtotime('+5 hour +30 minutes'));
// $rate  = $_REQUEST["rate_".$i];
// $mrp = $_REQUEST["mrp_".$i];
// $product_name = $_REQUEST["product_name_".$i];
// $qty_in_carton = $_REQUEST["totalProduct_".$i];

// $carton_rate = $qty_in_carton * $rate;

// $insertBookmark = "insert into $GRP_SERIVCE_ORDER_DETAILS_TEMP set temp_id='$temp_id', product_name= '$product_name', mrp= '$mrp', rate= '$rate', total_products= '$qty_in_carton', total_rate= '$carton_rate', datetime= '$datetime'";
// $wpdb->query($insertBookmark);

?>
<script type="text/javascript">
var temp_id = '<?php echo $temp_id; ?>';
alert(temp_id);
console.log(temp_id);
location.href = '/agent/product_details?q=asiraa&temp_id='+ temp_id;
</script>
<?php
// }
} ?>
<style>
    .table {
        font-size: 13px;
    }

    .cust {
        width: 73px;
        height: 30px;
        border-radius: 4px;
    }
</style>
        </div><!-- Main Wrapper -->
        <div class="page-footer">
            <p class="no-s">bharatcbc.com</p>
        </div>
    </div><!-- Page Inner -->

<?php }
include_once('footer.php');
?>