public function ready_to_pickup_order_view($orderID = '') { $this->session->set_userdata(array('log_MODULE' => 'ready_to_pickup_order_view', 'log_MID' => '')); $this->data['title'] = 'Ready To Be Pickup Orders View'; $orderID = id_decrypt($orderID); $result = $this->order_pickup_lib->pickup_order_view($orderID, 3); $this->data['result'] = $result; $this->data['orderID'] = $orderID; if ($_POST) { $this->custom_log->write_log('custom_log', 'Post data is ' . print_r($_POST, true)); $result['trackingNbr'] = $this->input->post('track_number'); $rules = add_tracking_number_rules(); $this->form_validation->set_rules($rules); $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->form_validation->run()) { if ($this->order_m->save_tracking_number($orderID, $result['trackingNbr'])) { $this->session->set_flashdata('success', $this->lang->line('success_save_track_no')); $this->custom_log->write_log('custom_log', $this->lang->line('success_save_track_no')); } else { $this->session->set_flashdata('error', $this->lang->line('error_save_track_no')); $this->custom_log->write_log('custom_log', $this->lang->line('error_save_track_no')); } redirect(base_url() . $this->session->userdata('userType') . '/ready_to_pickup/ready_to_pickup_order_view/' . id_encrypt($orderID)); } } $this->data['result'] = $result; $this->data['orderID'] = $orderID; $this->adminCustomView('shipping_management/pickup_orders_management/ready_to_shipped_order_view', $this->data); }
public function in_black_list($customerId, $status) { $customerId = id_decrypt($customerId); if ($customerId) { $this->customer_lib->customer_in_black_list($customerId, $status); } else { $this->session->set_flashdata('error', $this->lang->line('error_invalie_id')); } redirect(base_url() . $this->session->userdata('userType') . '/customer_management/user_detail/' . id_encrypt($customerId)); }
public function unblock_block($customerId, $status) { $customerId = id_decrypt($customerId); if ($customerId) { $this->customer_lib->customer_unblock_block($customerId, $status); } else { $this->session->set_flashdata('error', $this->lang->line('error_invalie_id')); } redirect(base_url() . 'admin/pointeforce_management/user_detail/' . id_encrypt($customerId)); }
public function makeMainImage($productImageId = '', $product_id = '') { $this->session->set_userdata(array('log_MODULE' => 'make_main_image', 'log_MID' => '')); if (empty($productImageId)) { $this->session->set_flashdata('error', $this->lang->line('error_product_image_id_not')); redirect(base_url() . 'cse/product_management'); } $productImageId = id_decrypt($productImageId); $product_id = id_decrypt($product_id); $this->custom_log->write_log('custom_log', 'product image id is ' . $productImageId); $this->product_lib->make_main_image($productImageId, $product_id); redirect(base_url() . 'cse/product_management/addEditProductImage/' . id_encrypt($product_id)); }
public function unblock_block($employeeId, $status) { $employeeId = id_decrypt($employeeId); if (!empty($employeeId)) { $return = $this->profile_lib->block_unblock($employeeId, $status); if ($return) { if (!$status) { $this->session->set_flashdata('success', $this->lang->line('success_block_user')); } else { $this->session->set_flashdata('success', $this->lang->line('success_unblock_user')); } } else { $this->session->set_flashdata('error', $this->lang->line('error_not_update')); } } else { $this->session->set_flashdata('error', $this->lang->line('error_invalie_id')); } redirect(base_url() . 'admin/cse_management/user_detail/' . id_encrypt($employeeId)); }
public function unblock_block($employeeId, $status) { $this->session->set_userdata(array('log_MODULE' => 'unblock_block', 'log_MID' => '')); $employeeId = id_decrypt($employeeId); if (!empty($employeeId)) { $return = $this->user_lib->block_unblock($employeeId, $status); if ($return) { if (!$status) { $this->session->set_flashdata('success', $this->lang->line('success_block_user')); } else { $this->session->set_flashdata('success', $this->lang->line('success_unblock_user')); } } else { $this->session->set_flashdata('error', $this->lang->line('error_not_update')); } } else { $this->session->set_flashdata('error', $this->lang->line('error_invalie_id')); } redirect(base_url() . 'superadmin/user_management/user_detail/' . id_encrypt($employeeId)); }
public function addEditCategory($parentCategoryId = 0, $categoryId = 0) { $organizationId = $this->session->userdata('organizationId'); $categoryId = id_decrypt($categoryId); $parentCategoryId = id_decrypt($parentCategoryId); $category_detail = $this->organization_category_m->category_detail($categoryId, $organizationId); //print_r($category_detail); if (!empty($category_detail)) { $categoryCode = $category_detail->categoryCode; $categoryDescription = $category_detail->categoryDescription; $image = $category_detail->imageName; } else { $categoryCode = ''; $categoryDescription = ''; $image = ''; } if (isset($_POST) && !empty($_POST)) { $organization_id = $this->session->userdata('organizationId'); $categoryCode = $this->input->post('categoryCode'); $categoryDescription = $this->input->post('categoryDescription'); $parentCategoryId = $parentCategoryId; $image = $this->input->post('categoryimage'); $lastModifiedBy = $this->session->userdata('userId'); if (!empty($category_detail)) { $rs = $this->organization_category_m->update_category($organization_id, $categoryId, $categoryCode, $categoryDescription, $image, $lastModifiedBy, $parentCategoryId); } else { $rs = $this->organization_category_m->add_category($organization_id, $categoryCode, $categoryDescription, $image, $lastModifiedBy, $parentCategoryId); } redirect(base_url() . 'retailer/category_Mgmt/category_listing/' . id_encrypt($parentCategoryId)); } $this->data['categoryCode'] = $categoryCode; $this->data['categoryDescription'] = $categoryDescription; $this->data['imageName'] = $image; $this->data['parentCatId'] = $parentCategoryId; $this->data['imagePath'] = base_url() . 'uploads/category/'; $this->data['imageUploadPath'] = base_url() . 'retailer/category_Mgmt/upload_category_image'; $this->data['catId'] = $categoryId; $this->data['parentCatId'] = $parentCategoryId; $this->data['categoryName'] = $categoryCode; $this->retailerCustomView('pointepay/category_Mgmt/addEditcategory', $this->data); }
public function product_add_by_cse() { $stateId = $this->input->post('stateId'); $cseReqDay = $this->input->post('cseReqDay'); $jsonArray = array('total' => 0, 'result' => array()); if ($cseReqDay == 2) { $lastSunday = date('Y-m-d', strtotime('last Sunday')); $next7days = date('Y-m-d', strtotime('last Sunday +7 days')); $where = "DATE_FORMAT(product.createDt,'%Y-%m-%d') >= '" . $lastSunday . "' AND DATE_FORMAT(product.createDt,'%Y-%m-%d') < '" . $next7days . "'"; if ($stateId) { $where .= " AND address.state = " . $stateId; } } elseif ($cseReqDay == 1) { $where = "DATE_FORMAT(product.createDt,'%Y-%m-%d') = '" . date('Y-m-d', strtotime('-1 days')) . "'"; if ($stateId) { $where .= " AND address.state = " . $stateId; } } else { $where = "DATE_FORMAT(product.createDt,'%Y-%m-%d') = '" . date('Y-m-d') . "'"; if ($stateId) { $where .= " AND address.state = " . $stateId; } } $total = 0; $result = $this->cse_m->total_products_request_by_according_day($where); if (!empty($result)) { $i = 0; foreach ($result as $row) { $jsonArray['result'][$i]['year'] = $row->firstName . ' ' . $row->middle . ' ' . $row->lastName; $jsonArray['result'][$i]['income'] = $row->total; $jsonArray['result'][$i]['url'] = base_url() . 'superadmin/dashboard/cse_chart/' . id_encrypt($row->employeeId); $total = $total + $row->total; $i++; } } $jsonArray['total'] = $total; echo json_encode($jsonArray); }
public function order_view($orderId = 0) { $this->session->set_userdata(array('log_MODULE' => 'order_view', 'log_MID' => '')); $this->data['title'] = 'Order Details View'; $orderId = id_decrypt($orderId); $result = $this->order_lib->orders_view($orderId); if ($_POST) { $this->custom_log->write_log('custom_log', 'Post data is ' . print_r($_POST, true)); $result['trackingNbr'] = $this->input->post('track_number'); $rules = add_tracking_number_rules(); $this->form_validation->set_rules($rules); $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->form_validation->run()) { if ($this->order_m->save_tracking_number($orderId, $result['trackingNbr'])) { $getDetails = $this->order_m->order_details($orderId); if (!empty($getDetails)) { $customOrderDet = $this->order_m->order_organization_custom_payment_details($getDetails->customOrderId, $getDetails->organizationProductId); if (!empty($customOrderDet)) { if (!empty($customOrderDet->orderDetailId) && $customOrderDet->orderDetailId) { $this->order_m->quick_shippment_save_tracking_number($customOrderDet->orderDetailId, $result['trackingNbr']); } } } $this->session->set_flashdata('success', $this->lang->line('success_save_track_no')); $this->custom_log->write_log('custom_log', $this->lang->line('success_save_track_no')); } else { $this->session->set_flashdata('error', $this->lang->line('error_save_track_no')); $this->custom_log->write_log('custom_log', $this->lang->line('error_save_track_no')); } redirect(base_url() . $this->session->userdata('userType') . '/order_management/order_view/' . id_encrypt($orderId)); } } $this->data['result'] = $result; $this->data['orderId'] = $orderId; $this->adminCustomView('order_managements/order_view', $this->data); }
public function unblock_category_status($categoryId, $status) { $this->CI->custom_log->write_log('custom_log', 'category id is ' . $categoryId . ' and status is ' . $status); if ($this->CI->segment_cat_m->unblock_category_status($categoryId)) { $this->CI->session->set_flashdata('success', 'Category Status changed Successfully'); $this->CI->custom_log->write_log('custom_log', 'Category Status changed Successfully'); } else { $this->CI->session->set_flashdata('error', 'Category status not change'); $this->CI->custom_log->write_log('custom_log', 'Category status not change'); } $parentList = $this->CI->segment_cat_m->category_parent_list($categoryId); $this->CI->custom_log->write_log('custom_log', 'Parent category list is ' . print_r($parentList, true)); if (!empty($parentList)) { $paretnId = 0; foreach ($parentList as $catRow) { $paretnId = $catRow->parentCategoryId; } redirect(base_url() . $this->CI->session->userdata('userType') . '/category_management/view_list/' . id_encrypt($paretnId)); } else { redirect(base_url() . $this->CI->session->userdata('userType') . '/category_management/view_list'); } }
<?php if (!empty($row->secondary_phone)) { echo $row->secondary_phone . '<br>'; } ?> <strong>Business Days : </strong> <?php echo $row->businessDays; ?> <BR /> <strong>Business Time : </strong> <?php echo $row->businessHours; ?> </span><br> </p> </div> <div class="link_edit_del"> <a href="<?php echo base_url() . 'frontend/product_cart/check_pickup_here/' . id_encrypt($row->pickupId); ?> " class="button btn-delivery btn-disable"> Pickup Here </a> </div> </div> <?php } } else { echo 'No Pickup Center Available'; }
<?php if ($dataArr['block_status']) { ?> <a onclick="unblock_block('<?php echo id_encrypt($user_id); ?> ',0);"> <button class="btn btn-danger" type="button"> Block </button> </a> <?php } else { ?> <a onclick="unblock_block('<?php echo id_encrypt($user_id); ?> ',1);"> <button class="btn btn-success" type="button"> Unblock </button> </a> <?php } ?> </div> </section> <section class="panel"> <div class="panel-body bio-graph-info"> <table class="table table-invoice table-custom"> <thead>
<img src="<?php echo base_url(); ?> images/new_images/reffer_frnd.jpg" width="100%"> <div class="col-sm-7 form-group" style="position:absolute;top: 36%; left: 26%;"> <?php if ($this->session->flashdata('successNewsRefer')) { ?> <h2 class="success_pop"> <?php echo $this->session->flashdata('successNewsRefer'); ?> </h2> <?php } else { echo form_open(base_url() . 'news-letter-subscribe-refer-friends-' . id_encrypt($newsId)); if (form_error('refer_email1')) { echo form_error('refer_email1'); } elseif (form_error('refer_email2')) { echo form_error('refer_email2'); } elseif (form_error('refer_email3')) { echo form_error('refer_email3'); } elseif (form_error('refer_email4')) { echo form_error('refer_email4'); } elseif (form_error('refer_email5')) { echo form_error('refer_email5'); } ?> <input type="text" name="refer_email1" placeholder="Enter Email Address 1" class="input-text reffer_text" style="width: 100%; height: 40px;" value="<?php echo set_value('refer_email1'); ?>
public function index() { $this->session->set_userdata(array('log_MODULE' => 'pointeforce_index', 'log_MID' => '')); $this->data['title'] = 'Pointeforce'; $result = array('firstName' => '', 'lastName' => '', 'email' => '', 'stateId' => '', 'areaId' => '', 'cityId' => '', 'phoneNo' => '', 'year' => '', 'month' => '', 'date' => ''); if ($_POST) { $this->custom_log->write_log('custom_log', 'Pointe force Form submit ' . print_r($_POST, TRUE)); //print_r($_POST); exit; //if((!empty($_POST['pointeForceSub']))&&($_POST['pointeForceSub']=='POINTEFORCE')) if (!empty($_POST['POINTEFORCESIGNUP']) && $_POST['POINTEFORCESIGNUP'] == 'POINTEFORCESIGNUP') { $result['firstName'] = $this->input->post('firstName'); $result['lastName'] = $this->input->post('lastName'); $result['email'] = $this->input->post('email'); $result['stateId'] = $this->input->post('stateId'); $result['areaId'] = $this->input->post('areaId'); $result['cityId'] = $this->input->post('cityId'); $result['phoneNo'] = $this->input->post('phoneNo'); $result['date'] = $this->input->post('date'); $result['month'] = $this->input->post('month'); $result['year'] = $this->input->post('year'); $result['street'] = $this->input->post('address1'); $result['password'] = $this->input->post('password'); if ($result['email']) { $result['email'] = html_entity_decode($result['email']); } $rules = pointe_force_sign_up_rules(); $this->form_validation->set_rules($rules); $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->form_validation->run()) { $result['birthDate'] = $this->input->post('year') . '-' . $this->input->post('month') . '-' . $this->input->post('date'); $result['varifyCode'] = new_random_password(); $customerId = $this->pointe_force_m->add_pointeforce_as_customer($result); $this->custom_log->write_log('custom_log', 'customer id is ' . $customerId); if ($customerId) { $addressId = $this->pointe_force_m->add_address_pointe_force($result); $this->custom_log->write_log('custom_log', 'pointe force address id is ' . $addressId); if ($addressId) { $this->pointe_force_m->add_pointe_force_address($customerId, $addressId); $this->custom_log->write_log('custom_log', 'customer added to address successfully'); $pointeForceVerifyId = $this->pointe_force_m->add_pointe_force_unverification($customerId); $this->custom_log->write_log('custom_log', 'pointe force verified id is ' . $pointeForceVerifyId); if ($pointeForceVerifyId) { $mailData = array('email' => $result['email'], 'cc' => '', 'slug' => 'pointe_force_verify', 'name' => $result['firstName'] . ' ' . $result['lastName'], 'password' => $result['password'], 'subject' => 'Verify your PointeForce Account', 'varify_url' => $this->config->item('customer_url') . 'auth/varification/' . id_encrypt($customerId) . '/' . $result['varifyCode']); if ($this->email_m->send_mail($mailData)) { $this->custom_log->write_log('custom_log', 'Send Mail : ' . $this->email->print_debugger()); } else { $this->custom_log->write_log('custom_log', 'Not Send Mail : ' . $this->email->print_debugger()); } /**********pointeforce***********/ $pointeForceId = $this->user_m->add_pointe_force($result); $this->custom_log->write_log('custom_log', 'pointe force id is ' . $pointeForceId); $this->user_m->add_pointe_force_address($pointeForceId, $addressId); /**********pointeforce**********/ $this->session->set_flashdata('success', 'Thank you for registering with PointeForce. Kindly verify your account by following the instructions sent to your registered email address.'); } } else { $this->session->set_flashdata('error', 'address not create'); $this->custom_log->write_log('custom_log', 'address not create'); } $this->session->set_flashdata('success', 'Thank you for registering with PointeForce. Kindly verify your account by following the instructions sent to your registered email address.'); } else { $this->session->set_flashdata('error', 'Information not add'); $this->custom_log->write_log('custom_log', 'Information not add'); } redirect(base_url() . 'pointeforce'); } } } $this->data['stateList'] = $this->location_m->nigeria_state_list(); $this->data['result'] = $result; $this->frontendCustomView('pointe_force/add_pointe_force', $this->data); }
</div> </section> </aside> </aside> </div> </section> </div> </div> <!--contant end--> </section> </section> <!--main content end--> <script language="javascript" type="application/javascript"> function unblock_block(status) { msg = 'Are you sure want to block this user ?'; if(status) { msg = 'Are you sure want to unblock this user ?'; } redirect = "<?php echo base_url() . $this->session->userdata('userType'); ?> /cse_management/unblock_block/<?php echo id_encrypt($employeeId); ?> /"+status confirm_box(redirect,msg); } </script>
<tr> <td><?php echo $i; ?> </td> <td><?php echo $row->categoryCode; ?> </td> <td><?php echo $row->commission; ?> </td> <td> <a class="btn btn-primary btn-xs tooltips" data-toggle="tooltip" data-placement="top" data-original-title="Edit" type="button" href="<?php echo base_url() . $this->session->userdata('userType') . '/category_commission_management/edit_commission/' . id_encrypt($row->categoryId); ?> "><i class="fa fa-pencil"></i> </a> </td> </tr> <?php $i++; } if (!empty($result['links'])) { ?> <tr> <td colspan="4" align="right"> <div class="pagination"> <?php echo $result['links'];
</td> <td><?php echo $row->email; ?> </td> <td><?php echo ucwords($row->organizationName); ?> </td> <td><?php echo $row->businessPhone; ?> </td> <td> <a class="btn btn-warning btn-xs tooltips" title="View Detail" type="button" href="<?php echo base_url() . $this->session->userdata('userType') . '/vendor_management/user_detail/' . id_encrypt($row->organizationId); ?> "> <i class="fa fa-eye"></i> </a> </td> </tr> <?php $i++; } if (!empty($result['links'])) { ?> <tr> <td colspan="10" align="right"> <div class="pagination"> <?php
</li> <li> <a href="<?php echo base_url() . $this->session->userdata('userType') . '/retailer_management/user_detail/' . id_encrypt($organizationId); ?> ">View</a> </li> <li> <a href="<?php echo base_url() . $this->session->userdata('userType') . '/check_stock_management/check_stock_list/' . id_encrypt($organizationId); ?> ">Inventory</a> </li> <li> <a href="<?php echo base_url() . $this->session->userdata('userType') . '/product_management/index/' . id_encrypt($organizationId); ?> ">Product Management</a> </li> <li> <a class="current" href="javascript:void(0);"> Add Inventory </a> </li> </ul> </div> </div> <?php $this->load->view('retailer/product_managements/add_inventory_form'); ?>
?> "> Retailer List </a> </li> <li> <a href="<?php echo base_url() . 'superadmin/retailer_management/user_detail/' . id_encrypt($organizationId); ?> "> View </a> </li> <li> <a href="<?php echo base_url() . 'superadmin/check_stock_management/check_stock_list/' . id_encrypt($organizationId); ?> "> Inventory </a> </li> <li> <a href="javascript:void(0);" class="current">Product Managment</a> </li> </ul> </div> <div class="col-lg-12"> <section class="panel"> <div class="panel-body"> <section class="panel custom-panel" style="margin-bottom:0;">
public function verified_news($newsletterId = '', $verifiedCode = '') { $newsletterId = id_decrypt($newsletterId); $checkRes = $this->customer_m->check_verified_newsletter($newsletterId, $verifiedCode); if (!empty($checkRes)) { if ($this->customer_m->update_verified_newsletter($newsletterId)) { //$this->session->set_flashdata('success','Verified Successfully'); } else { //$this->session->set_flashdata('error','User not verified'); } redirect(base_url() . 'frontend/newsletter/subscription/' . id_encrypt($newsletterId)); } else { $this->session->set_flashdata('error', 'User Already Verified'); } redirect(base_url() . 'frontend/newsletter'); }
</span> </h5> <?php if (!empty($isEconomicDelivery) && $isEconomicDelivery && $isBlackList == 0) { ?> <a href="<?php echo base_url() . 'frontend/checkout_cash/cash_on_economic_delivered_buy_now/' . id_encrypt($cartId); ?> " class="button btn-placeorder" > Cash On Delivery </a> <?php } elseif ($isBlackList == 0) { ?> <a href="<?php echo base_url() . 'frontend/checkout_cash/cash_on_economic_delivered_buy_now/' . id_encrypt($cartId); ?> " class="button btn-placeorder" >Cash On Delivery</a> <?php } ?> </div> </div> <?php } } else { if ($isPickUp) { ?> <div class="checkout_right col-sm-4"> <div class="chk_main_div">
?> <div class="form-group"> <div class="col-lg-6 padding-bottom"> <label id="attribute_text<?php echo id_encrypt($product_value->attributeNameId); ?> "><?php echo $product_value->productAttributeName; ?> </label> <a onclick="update_attribute(<?php echo id_encrypt($product_value->attributeNameId); ?> );" class="edit-samentics-label" style="cursor:pointer;"><i class="fa fa-pencil" title="Edit"></i></a> <a onclick="delete_attribute(<?php echo id_encrypt($product_value->attributeNameId); ?> ,<?php echo $product_value->orgProductAttributeId; ?> );" class="danger edit-samentics-label" style="cursor:pointer;color:#E21D1D"><i class="fa fa-times danger" style="color:#E21D1D" title="delete"></i></a> <div class="iconic-input right"> <textarea name="feature[<?php echo $product_value->orgProductAttributeId; ?> ]"class="form-control" ><?php echo $product_value->attributeValue; ?> </textarea > </div> </div>
$("#price").css('background','white'); } else { $("#price").css('width',''); $("#price").css('background',''); } ajaxPage('<?php echo base_url() . $this->session->userdata('userType') . '/vendor_management/shippingRatesAjaxFun/' . $result['total']; ?> '); } ajaxPage('<?php echo base_url() . $this->session->userdata('userType') . '/vendor_management/shippingRatesAjaxFun/' . $result['total']; ?> '); function delete_rate(shippRateId) { msg = 'Are you sure that you want to delete this rate?'; redirect = "<?php echo base_url() . $this->session->userdata('userType') . '/vendor_management/delete_rate/' . id_encrypt($shippingOrgId); ?> /"+shippRateId; confirm_box(redirect,msg); } </script> <style> .table-invoice thead tr th{ vertical-align:top !important;} </style>
</td> <td><?php if ($row->organizationName) { echo $row->organizationName; } else { echo $row->firstName . ' ' . $row->lastName; } ?> </td> <td>₦<?php echo number_format($row->currentPrice, 2); ?> </td> <td> <center><a href="<?php echo base_url() . $this->session->userdata('userType') . '/order_picked_up/delivered_order_view/' . id_encrypt($row->orderId); ?> " class="btn btn-warning btn-xs"> <i class="fa fa-eye"></i> </a></center> </td> </tr> <?php $i++; } if (!empty($result['links'])) { ?> <tr> <td colspan="13" align="right"> <div class="pagination"> <?php
} }); } function change_new_order_to_confirm_order() { swal({ title: '', text: 'Are You sure want to accept this order?', showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes", cancelButtonText: "No", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { window.location.href = '<?php echo base_url() . 'retailer/order_management/change_new_order_to_confirm_order/' . id_encrypt($orderId); ?> '; } else { swal("Cancelled","", "error"); } }); } </script>
?> </div> </div> </div> </div> </div> </div> </div> <div class="clearfix"></div> </center> <br /> <br /> <div class="col-sm-12 "> <center> <a class="btn btn-danger btn-save" href="<?php echo base_url() . $this->session->userdata('userType') . '/vendor_management/shipping_rate_list/' . id_encrypt($result['shippingOrgId']); ?> "> Cancel </a> <button class="btn btn-success btn-save">Save</button> </center> </div> </form> </div> </section> <!--widget end--> </div> </section> </section> </div> </div> <!--contant end-->
<a class="pr_detail" onclick="product_details('<?php echo id_encrypt($row->order_id); ?> ');"> <?php echo $row->product_name; ?> </a> </td> <td>₦<?php echo $row->total_amount; ?> </td> <td> <a class="btn btn-success btn-sm" href="javascript:void(0);" onclick="return accept_decline('<?php echo id_encrypt($row->order_id); ?> ',1);"> Accept </a> <a class="btn btn-danger btn-sm" href="javascript:void(0);" onclick="return accept_decline('<?php echo id_encrypt($row->order_id); ?> ',2);"> Decline </a> </td> </tr> <?php } }
</table> </td> <?php } else { ?> <td><?php echo $row['currentQty']; ?> </td> <?php } ?> <td> <a class="btn btn-warning btn-xs tooltips" title="View Detail" type="button" href="<?php echo base_url() . $this->session->userdata('userType') . '/check_stock_management/inventory_details/' . id_encrypt($row['organizationProductId']) . '/' . id_encrypt($row['organizationId']); ?> "> <i class="fa fa-eye"></i> </a> </td> </tr> <?php $i++; } if (!empty($result['links'])) { ?> <tr> <td colspan="7" align="right"> <div class="pagination"> <?php
public function write_review($productId = 0) { $this->session->set_userdata(array('log_MODULE' => 'write_review', 'log_MID' => '')); $productId = id_decrypt($productId); $userId = $this->session->userdata('userId'); $this->data['title'] = 'Product Rating Review'; $this->custom_log->write_log('custom_log', 'product id is ' . $productId . ' and user id is ' . $userId); $result = array('reviewTitle' => '', 'reviewDescription' => '', 'rating' => '', 'productId' => $productId, 'rating1' => 0, 'rating2' => 0, 'rating3' => 0, 'rating4' => 0, 'rating5' => 0, 'orderId' => 0, 'productName' => '', 'imageName' => ''); if (!$userId) { $this->session->set_flashdata('error', $this->lang->line('error_user_login')); $this->custom_log->write_log('custom_log', $this->lang->line('error_user_login')); redirect(base_url() . 'frontend/single/product_detail/' . id_encrypt($productId)); } if (!$productId) { $this->session->set_flashdata('error', 'Product not select for rating or review'); $this->custom_log->write_log('custom_log', 'Product not select for rating or review'); redirect(base_url()); } else { $productDetails = $this->product_m->product_details($productId); $this->custom_log->write_log('custom_log', 'Product details is ' . print_r($productDetails, true)); if (!empty($productDetails)) { $result['productName'] = $productDetails->code; $result['imageName'] = $productDetails->imageName; } } $checkTtl = $this->rating_review_m->total_customer_rating_review($productId); if ($checkTtl) { $this->session->set_flashdata('error', 'You already added rating and review this product'); $this->custom_log->write_log('custom_log', 'You already added rating and review this product'); redirect(base_url() . 'frontend/single/product_detail/' . id_encrypt($productId)); } if ($_POST) { $this->custom_log->write_log('custom_log', 'Form submit data is ' . print_r($_POST, true)); $result['reviewTitle'] = $this->input->post('reviewTitle'); $result['reviewDescription'] = $this->input->post('reviewDescription'); $result['rating'] = $this->input->post('rating'); $rules = product_rating_review(); $this->form_validation->set_rules($rules); $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->form_validation->run()) { $rating = $result['rating']; if ($rating == 1) { $result['rating1'] = 1; } elseif ($rating == 2) { $result['rating2'] = 1; } elseif ($rating == 3) { $result['rating3'] = 1; } elseif ($rating == 4) { $result['rating4'] = 1; } elseif ($rating == 5) { $result['rating5'] = 1; } $orderDetails = $this->order_m->check_order_product($productId); $this->custom_log->write_log('custom_log', 'order details is ' . print_r($orderDetails, true)); if (!empty($orderDetails)) { $result['orderId'] = $orderDetails->orderId; } $productRatingId = $this->rating_review_m->add_product_rating($productId, $result); $this->custom_log->write_log('custom_log', 'Product Rating id is ' . $productRatingId); if ($productRatingId) { $productReviewId = $this->rating_review_m->add_product_review($productRatingId, $result); $this->custom_log->write_log('custom_log', 'Product Review id is ' . $productReviewId); if ($productReviewId) { $productRatingCheck = $this->rating_review_m->check_rating_product($productId); $this->custom_log->write_log('custom_log', 'check rating product is ' . print_r($productRatingCheck, true)); if (!empty($productRatingCheck)) { $result['rating1'] = $productRatingCheck->productRating1 + $result['rating1']; $result['rating2'] = $productRatingCheck->productRating2 + $result['rating2']; $result['rating3'] = $productRatingCheck->productRating3 + $result['rating3']; $result['rating4'] = $productRatingCheck->productRating4 + $result['rating4']; $result['rating5'] = $productRatingCheck->productRating5 + $result['rating5']; $this->rating_review_m->update_product_rating_count($productId, $result); $this->custom_log->write_log('custom_log', 'Last updated query is ' . $this->db->last_query()); } else { $productRatCntId = $this->rating_review_m->add_product_rating_count($productId, $result); $this->custom_log->write_log('custom_log', 'product rating count id is ' . $productRatCntId); } $this->session->set_flashdata('success', 'Product Rating and Review added Successfully'); $this->custom_log->write_log('custom_log', 'Product Rating and Review added Successfully'); } else { $this->session->set_flashdata('error', 'Product review not add'); $this->custom_log->write_log('custom_log', 'Product review not add'); } } else { $this->session->set_flashdata('error', 'Product rating not add'); $this->custom_log->write_log('custom_log', 'Product rating not add'); } redirect(base_url() . 'frontend/single/product_detail/' . id_encrypt($productId)); } } $this->data['productId'] = $productId; $this->data['result'] = $result; $this->frontendCustomView('product_rating_review/write_review', $this->data); }
?> <tr> <td><?php echo $i; ?> </td> <td><?php echo $row->name; ?> </td> <?php $userRole = $this->session->userdata('userRole'); if (empty($userRole)) { ?> <td><center><a href="<?php echo base_url() . $this->session->userdata('userType') . '/location_management/addEditCountry/' . id_encrypt($row->countryId); ?> " class="btn btn-primary btn-xs tooltips" data-toggle="tooltip" data-placement="top" data-original-title="Edit" type="button"><i class="fa fa-pencil"></i></a></center></td> <?php } ?> </tr> <?php $i++; } if (!empty($links)) { ?> <tr> <td colspan="3" align="right"> <div class="pagination"> <?php