Commit 936003dc by Tobin

Merge branch 'master' into 'dev_production'

Master See merge request !32
parents b549ba82 6ead949a
......@@ -2,5 +2,5 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
\ No newline at end of file
[1] Merchant ID : 201901291000002
[2] Merchant Key : +Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=
[3] Collaborator ID : BAYANPAY
[4] Bayan URL : https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet
[5] Block Existence Indicator : 1110000
[6] DataBlock1 : TransactionDataBlock1 : 11111111|1552564762|100.00|http://localhost/timeOut/Api/paymentGateway|http://localhost/timeOut/Api/paymentGateway|INTERNET|CC|01|SAR
[7] DataBlock2 : billingDataBlock : 1111111111000|Soloman|Vandy|123,ParkStreet|Park Street|Riyadh|Riyadh|400081|IN|[email protected]|9820998209
[8] DataBlock3 : shippingDataBlock : 111111110001|Soloman|Vandy|123ParkStreet|parkstreet|Riyadh|Riyadh|400081|IN|9820998209
[9] DataBlock4 : paymentDataBlock : NULL
[10] DataBlock5 : merchantDataBlock : NULL
[11] DataBlock6 : otherDataBlock : NULL
[12] DataBlock7 : DCCDataBlock : NULL
[13] beforeEncryptionString : 1110000||11111111|1552564762|100.00|http://localhost/timeOut/Api/paymentGateway|http://localhost/timeOut/Api/paymentGateway|INTERNET|CC|01|SAR||1111111111000|Soloman|Vandy|123,ParkStreet|Park Street|Riyadh|Riyadh|400081|IN|[email protected]|9820998209||111111110001|Soloman|Vandy|123ParkStreet|parkstreet|Riyadh|Riyadh|400081|IN|9820998209
[14] EncryptedString : RKeCiPHQnrq4Ih8pVYOhUNd0KfqxD2Qby/wkUPbEvj23Xft2HvphIethb29a7Myq8E5b0uHFoKs9UpMiz9/j9ntt08QUmxUUx6796JKGexbz3qX7HwMuZaG31+FgM6BL1NqoybToj95/b2VpJ+PiznhjDPKtRHw1ghUTYRUdmM6z8dhuPGjfgKHvD93wH7p3SnktHyQVwa77nPyBT+3xVSARLWSHMzJn128/EaKVn37Hw9ml6NBR//D2fZhopsnvcdOWVLS9EOGffPbaSX3oijDjxaiW1BzrfC9opGdzXY9Vih9sohxhgqHIWvNakCk5Ctqav7hC23iZ5Aj4PCaILTpDUfQsHpF4RaP4HtC+P94DYFWPuScMYy+yeEjWCuDWNj1pcJBUwFqmN4ZHlafClfMm6vLfJOCspMq+8MShA0T/NvYd9fNYPg8C5Kl3HSTEF7cbGU7qNFT/vrlNlHkYNw==
[15] BayanPostData : 201901291000002||BAYANPAY||RKeCiPHQnrq4Ih8pVYOhUNd0KfqxD2Qby/wkUPbEvj23Xft2HvphIethb29a7Myq8E5b0uHFoKs9UpMiz9/j9ntt08QUmxUUx6796JKGexbz3qX7HwMuZaG31+FgM6BL1NqoybToj95/b2VpJ+PiznhjDPKtRHw1ghUTYRUdmM6z8dhuPGjfgKHvD93wH7p3SnktHyQVwa77nPyBT+3xVSARLWSHMzJn128/EaKVn37Hw9ml6NBR//D2fZhopsnvcdOWVLS9EOGffPbaSX3oijDjxaiW1BzrfC9opGdzXY9Vih9sohxhgqHIWvNakCk5Ctqav7hC23iZ5Aj4PCaILTpDUfQsHpF4RaP4HtC+P94DYFWPuScMYy+yeEjWCuDWNj1pcJBUwFqmN4ZHlafClfMm6vLfJOCspMq+8MShA0T/NvYd9fNYPg8C5Kl3HSTEF7cbGU7qNFT/vrlNlHkYNw==
\ No newline at end of file
......@@ -265,7 +265,7 @@ class Api extends CI_Controller {
public function event() {
$data = (array) json_decode(file_get_contents('php://input'));
//$data['auth_token'] = $this->auth_token;
$data['auth_token'] = (isset($this->auth_token))?$this->auth_token:'';
$res = $this->Api_model->event($data);
if($res['status']!=0){
$this->response($res['data']);
......@@ -328,7 +328,7 @@ class Api extends CI_Controller {
$res = $this->Api_model->payNow($payData);
if($res['status']==1){
$this->paymentGateway($amount,$res['transaction_id'],$event_id,$booking_id);
$this->paymentGateway($amount,$res['transaction_id'],$event_id,$booking_id,$res['custData']);
}
else{
redirect('https://projects.nuvento.com/failure?event_id='.$eventid);
......@@ -380,9 +380,9 @@ class Api extends CI_Controller {
}
}
public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0'){
public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0',$custData=array()){
BayanPayPayment();
$BayanPayArray = $this->bayanPayArray($amount,$lastid,$event_id,$booking_id);
$BayanPayArray = $this->bayanPayArray($amount,$lastid,$event_id,$booking_id,$custData);
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
$requestParameter = $BayanPayOnlineObject->BayanPostData;
......@@ -405,8 +405,9 @@ class Api extends CI_Controller {
return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
function bayanPayArray($amount = '0',$lastid='',$event_id='',$booking_id=''){
function bayanPayArray($amount='0',$lastid='',$event_id='',$booking_id='',$custData=array()){
$settings = getSettings();
$BayanPayArray =
array(
'BayanPay_Online_setting' => array(
......@@ -414,7 +415,7 @@ class Api extends CI_Controller {
'merchantId' => $settings['merchant_id'],
'collaboratorId' => 'BAYANPAY',
'iv' => '0123456789abcdef',
'url' => false// Set to false if you are using testing environment , set to true if you are using live environment
'url' => false
),
'Block_Existence_Indicator'=> array(
'transactionDataBlock' => true,
......@@ -436,65 +437,65 @@ class Api extends CI_Controller {
'currency' => 'SAR'
),
'Field_Existence_Indicator_Billing' => array(
'billToFirstName' => 'Soloman',
'billToLastName' => 'Vandy',
'billToStreet1' => '123,ParkStreet',
'billToStreet2' => 'Park Street',
'billToCity' => 'Riyadh',
'billToState' => 'Riyadh',
'billtoPostalCode' => '400081',
'billToCountry' => 'IN',
'billToEmail' => '[email protected]',
'billToMobileNumber' => '9820998209',
'billToFirstName' => $custData->name,
'billToLastName' => '',
'billToStreet1' => '',
'billToStreet2' => '',
'billToCity' => '',
'billToState' => '',
'billtoPostalCode' => '',
'billToCountry' => '',
'billToEmail' => $custData->email,
'billToMobileNumber' => $custData->phone,
'billToPhoneNumber1' => '',
'billToPhoneNumber2' => '',
'billToPhoneNumber3' => ''
),
'Field_Existence_Indicator_Shipping' => array(
'shipToFirstName' => 'Soloman',
'shipToLastName' => 'Vandy',
'shipToStreet1' => '123ParkStreet',
'shipToStreet2' => 'parkstreet',
'shipToCity' => 'Riyadh',
'shipToState' => 'Riyadh',
'shipToPostalCode' => '400081',
'shipToCountry' => 'IN',
'shipToFirstName' => $custData->name,
'shipToLastName' => '',
'shipToStreet1' => '',
'shipToStreet2' => '',
'shipToCity' => '',
'shipToState' => '',
'shipToPostalCode' => '',
'shipToCountry' => '',
'shipToPhoneNumber1' => '',
'shipToPhoneNumber2' => '',
'shipToPhoneNumber3' => '',
'shipToMobileNumber' => '9820998209'
'shipToMobileNumber' => $custData->phone
),
'Field_Existence_Indicator_Payment' => array(
'cardNumber' => '4111111111111111', // 1. Card Number
'expMonth' => '08', // 2. Expiry Month
'expYear' => '2020', // 3. Expiry Year
'CVV' => '123', // 4. CVV
'cardHolderName' => 'Soloman', // 5. Card Holder Name
'cardType' => 'Visa', // 6. Card Type
'custMobileNumber' => '9820998209', // 7. Customer Mobile Number
'paymentID' => '123456', // 8. Payment ID
'OTP' => '123456', // 9. OTP field
'gatewayID' => '1026', // 10.Gateway ID
'cardToken' => '1202' // 11.Card Token
'cardNumber' => '4111111111111111',
'expMonth' => '08',
'expYear' => '2020',
'CVV' => '123',
'cardHolderName' => 'Soloman',
'cardType' => 'Visa',
'custMobileNumber' => '9820998209',
'paymentID' => '123456',
'OTP' => '123456',
'gatewayID' => '1026',
'cardToken' => '1202'
),
'Field_Existence_Indicator_Merchant' => array(
'Field_Existence_Indicator_Merchant' => array(
'UDF1' => $lastid,
'UDF2' => $event_id,
'UDF3' => $booking_id
),
'Field_Existence_Indicator_OtherData' => array(
'custID' => '12345',
'custID' => $custData->userId,
'transactionSource' => 'IVR',
'productInfo' => 'Book',
'isUserLoggedIn' => 'Y',
'itemTotal' => '500.00, 1000.00',
'itemCategory' => 'CD, Book',
'productInfo' => '',
'isUserLoggedIn' => '',
'itemTotal' => '',
'itemCategory' => '',
'ignoreValidationResult'=> 'FALSE'
),
'Field_Existence_Indicator_DCC' => array(
'DCCReferenceNumber' => '09898787', // DCC Reference Number
'foreignAmount' => '240.00', // Foreign Amount
'ForeignCurrency' => 'USD' // Foreign Currency
'Field_Existence_Indicator_DCC' => array(
'DCCReferenceNumber' => $lastid.$event_id.$booking_id,
'foreignAmount' => $amount,
'ForeignCurrency' => 'SAR'
)
);
return $BayanPayArray;
......@@ -531,5 +532,9 @@ class Api extends CI_Controller {
$this->errorResponse($res['code'],$res['message']);
}
}
public function verifyMail($unique_id = '') {
$res = $this->Api_model->verifyMail(array('unique_id'=>$unique_id));
}
}
?>
\ No newline at end of file
?>
......@@ -5,7 +5,7 @@ class Booking extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Booking_model');
if(!$this->session->userdata('logged_in')) {
......@@ -143,31 +143,31 @@ class Booking extends CI_Controller {
}
function downloadCSV(){
$dataRow = $this->session->userdata('report_data');
$fileName = $this->session->userdata('file_name');
$this->session->set_userdata('file_name','');
$this->session->set_userdata('report_data','');
if(empty($dataRow) || empty($fileName)){
return;
}
if($this->session->userdata['user_type'] != 1){
$company_id = $this->session->userdata['id'];
$this->db->query("UPDATE `company_payment_details`
SET `report_count`=report_count+1,
`outstanding_amount`=outstanding_amount+report_charge
WHERE `company_id`=".$company_id);
}
//Download CSV\\
$temp_memory = fopen('php://memory', 'w');
foreach ($dataRow as $line) {
fputcsv($temp_memory, $line, ',');
}
fseek($temp_memory, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $fileName . '";');
fpassthru($temp_memory);
$dataRow = $this->session->userdata('report_data');
$fileName = $this->session->userdata('file_name');
$this->session->set_userdata('file_name','');
$this->session->set_userdata('report_data','');
if(empty($dataRow) || empty($fileName)){
return;
}
if($this->session->userdata['user_type'] != 1){
$company_id = $this->session->userdata['id'];
$this->db->query("UPDATE `company_payment_details`
SET `report_count`=report_count+1,
`outstanding_amount`=outstanding_amount+report_charge
WHERE `company_id`=".$company_id);
}
//Download CSV\\
$temp_memory = fopen('php://memory', 'w');
foreach ($dataRow as $line) {
fputcsv($temp_memory, $line, ',');
}
fseek($temp_memory, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $fileName . '";');
fpassthru($temp_memory);
}
function formatReportData($reportData = array()){
......
......@@ -5,7 +5,7 @@ class CMS extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Cms_model');
if(!$this->session->userdata('logged_in')) {
......@@ -102,11 +102,23 @@ class CMS extends CI_Controller {
if(!isset($_POST['forgot_sms']) || empty($_POST['forgot_sms'])){
unset($_POST['forgot_sms']);
}
if(!isset($_POST['verify_mail']) || empty($_POST['verify_mail'])){
unset($_POST['verify_mail']);
}
if(!isset($_POST['staff_reg_mail']) || empty($_POST['staff_reg_mail'])){
unset($_POST['staff_reg_mail']);
}
if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){
unset($_POST['registration_mail']);
}
if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){
unset($_POST['registration_mail']);
}
if(!isset($_POST['registration_sms']) || empty($_POST['registration_sms'])){
unset($_POST['registration_sms']);
if(!isset($_POST['checker_activation_mail']) || empty($_POST['checker_activation_mail'])){
unset($_POST['checker_activation_mail']);
}
if(!isset($_POST['provider_activation_mail']) || empty($_POST['provider_activation_mail'])){
unset($_POST['provider_activation_mail']);
}
$status = $this->Cms_model->updateNotif($_POST);
......
......@@ -5,7 +5,7 @@ class Category extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Category_model');
$this->load->model('Dashboard_model');
......
......@@ -5,7 +5,7 @@ class Checker extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Checker_model');
$this->load->model('Provider_model');
......@@ -75,6 +75,22 @@ class Checker extends CI_Controller {
$_POST['provider_id'] = $provider_id;
$status = $this->Checker_model->createChecker($_POST);
if($status == 1){
$this->load->model('Api_model');
$subject = "Your TimeOut Checker Account is now activated";
$template = getNotifTemplate();
$message = "<html>
<body>
Your Checker Account for the username
<strong>".$_POST['username']."</strong> is now activated.
</body>
</html>";
if(isset($template['checker_activation_mail']) && !empty($template['checker_activation_mail'])){
$message = str_replace(array('{:user_name}'),array($email_id),
$template['checker_activation_mail']);
}
$this->Api_model->send_mail($subject,$_POST['username'],$message);
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Checker Created';
......@@ -110,15 +126,20 @@ class Checker extends CI_Controller {
$subject = "Your Checker Account is now activated";
$email_id = $checkerData->username;
$template = getNotifTemplate();
$message .= "<html>
$message = "<html>
<body>
Your Checker Account for the username
<strong>".$checkerData->username."</strong> is now activated.<br>
".$template['checker_activation_mail']."
<strong>".$email_id."</strong> is now activated.
</body>
</html>";
$template = getNotifTemplate();
if(isset($template['checker_activation_mail']) &&
!empty($template['checker_activation_mail'])){
$message = str_replace(array('{:user_name}'),array($email_id),
$template['checker_activation_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
}
}
......
......@@ -5,7 +5,7 @@ class Customer extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Customer_model');
if(!$this->session->userdata('logged_in')) {
......@@ -115,6 +115,7 @@ class Customer extends CI_Controller {
redirect(base_url('Customer/addCustomer'));
}
$temp_password = rand(10000000, 99999999);
$_POST['dob'] = strtotime($_POST['dob'])*1000;
$_POST['password'] = md5($temp_password);
$status = $this->Customer_model->addCustomer($_POST);
if($status == 1){
......@@ -123,14 +124,19 @@ class Customer extends CI_Controller {
$subject = "Your TimeOut Account is now activated";
$email_id = $_POST['email'];
$template = getNotifTemplate();
$message .= "<html>
$message = "<html>
<body>
Hi,\n\r Welcome to TimeOut. \r\n Please use username:
".$_POST['email']." and Password: ".$temp_password."
for access your account <br>
".$template['registration_mail']."
".$_POST['email']." for access your account <br>
</body>
</html>";
if(isset($template['registration_mail']) && !empty($template['registration_mail'])){
$message = str_replace(array('{:email}'),array($email_id),
$template['registration_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
......@@ -218,6 +224,7 @@ class Customer extends CI_Controller {
redirect(base_url('Customer/editCustomers/'.$customer_id));
}
$_POST['dob'] = strtotime($_POST['dob'])*1000;
$status = $this->Customer_model->updateCustomer(decode_param($customer_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
......
......@@ -5,7 +5,7 @@ class Dashboard extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
......
......@@ -5,7 +5,7 @@ class Event extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Event_model');
$this->load->model('Dashboard_model');
......@@ -183,6 +183,18 @@ class Event extends CI_Controller {
$status = $this->Event_model->createEventMedia($evtMediaData);
}
// START - NEW EVENT NOTIFICATION MAIL \\
$settings = getSettings();
$this->load->model('Api_model');
$subject = "TimeOut, New Event Created";
$emailId = $settings['admin_mail_id'];
$message = "<html><body>
New Event Created, event name: <strong>".$_POST['event_name']."</strong>
</body></html>";
$this->Api_model->send_mail($subject,$emailId,$message);
// END - NEW EVENT NOTIFICATION MAIL \\
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Event Created';
......
......@@ -5,7 +5,7 @@ class Host extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Host_model');
$this->load->model('Dashboard_model');
......
......@@ -5,7 +5,7 @@ class Login extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->helper(array('form'));
$this->load->model('login_model');
$this->load->helper('security');
......
......@@ -5,7 +5,7 @@ class Logout extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
......
......@@ -5,7 +5,7 @@ class Provider extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Provider_model');
if(!$this->session->userdata('logged_in')) {
......@@ -72,15 +72,21 @@ class Provider extends CI_Controller {
$email_id = $providerData->email;
$template = getNotifTemplate();
$message .= "<html>
$message = "<html>
<body>
Your Organizer Account for the username
<strong>".$providerData->username."</strong> is now activated. Please use this link for access your account
<a href='".base_url()."'>".base_url()."</a><br>
".$template['provider_activation_mail']."
</body>
</html>";
if(isset($template['provider_activation_mail']) &&
!empty($template['provider_activation_mail'])){
$message = str_replace(array('{:user_name}','{:url}'),
array($providerData->username,base_url()),
$template['provider_activation_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
}
}
......@@ -138,6 +144,27 @@ class Provider extends CI_Controller {
$status = $this->Provider_model->addProvider($_POST);
if($status == 1){
$this->load->model('Api_model');
$subject = "Your Organizer Account is now activated";
$email_id = $_POST['email'];
$template = getNotifTemplate();
$message = "<html>
<body>
Your Organizer Account for the username
<strong>".$providerData->username."</strong> is now activated. Please use this link for access your account
<a href='".base_url()."'>".base_url()."</a><br>
</body>
</html>";
if(isset($template['provider_activation_mail']) &&
!empty($template['provider_activation_mail'])){
$message = str_replace(array('{:user_name}','{:url}'),
array($email_id,base_url()),
$template['provider_activation_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Provider/viewProviders'));
......
......@@ -5,7 +5,7 @@ class Region extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Region_model');
$this->load->model('Dashboard_model');
......
......@@ -5,7 +5,7 @@ class Settings extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Settings_model');
$this->load->model('Dashboard_model');
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Staff extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Staff_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
}
public function addStaff(){
$template['page'] = 'Staff/staffForm';
$template['menu'] = 'Staff Management';
$template['smenu'] = 'Add Staff';
$template['pTitle'] = "Add Staff";
$template['pDescription'] = "Create New Staff";
$this->load->view('template',$template);
}
public function viewStaffs(){
$template['page'] = 'Staff/viewStaff';
$template['menu'] = 'Staff Management';
$template['smenu'] = 'View Staffs';
$template['pTitle'] = "View Staffs";
$template['pDescription'] = "View and Manage Staffs";
$template['page_head'] = "Staff Management";
$template['staff_data'] = $this->Staff_model->getStaffData('','0,1');
$this->load->view('template',$template);
}
function changeStatus($staff_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($staff_id) || !is_numeric($staff_id = decode_param($staff_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Staff/viewStaffs'));
}
$status = $this->Staff_model->changeStatus($staff_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Staff/viewStaffs'));
}
public function createStaff(){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Staff/addStaff'));
}
if($err == 0 && (!isset($_POST['display_name']) || empty($_POST['display_name']))){
$err = 1;
$errMsg = 'Provide Staff Name';
}else if($err == 0 && (!isset($_POST['username']) || empty($_POST['username']))){
$err = 1;
$errMsg = 'Provide a Staff Username (Email-ID)';
}else if($err == 0 && (!isset($_POST['password']) || empty($_POST['password']))){
$err = 1;
$errMsg = 'Provide a Proper Password';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Staff/addStaff'));
}
$password = $_POST['password'];
$_POST['password']= md5($_POST['password']);
$status = $this->Staff_model->addStaff($_POST);
if($status == 1){
$this->load->model('Api_model');
$subject = "Your TimeOut Staff Account is now active";
$email_id = $_POST['username'];
$template = getNotifTemplate();
$message = "<html>
<body>
Hi,\n\r Welcome to TimeOut. \r\n Please use username:
".$email_id." and Password: ".$password." for access your account
<br>
</body>
</html>";
if(isset($template['staff_reg_mail']) && !empty($template['staff_reg_mail'])){
$message = str_replace(array('{:user_name}','{:password}'),array($email_id,$password),
$template['staff_reg_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
$flashMsg =array('message'=>'Successfully Created Your Account..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Staff/viewStaffs'));
} else if($status == 2){
$flashMsg = array('message'=>'Username (Email-ID) alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Staff/addStaff'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Staff/addStaff'));
}
}
public function editStaffs($staff_id){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($staff_id) || !is_numeric($staff_id = decode_param($staff_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Staff/viewStaffs'));
}
$template['page'] = 'Staff/staffForm';
$template['menu'] = 'Staff Management';
$template['smenu'] = 'Edit Staff';
$template['pTitle'] = "Edit Staffs";
$template['pDescription'] = "Update Staff Data";
$template['staff_data'] = $this->Staff_model->getStaffData($staff_id,'0,1');
$template['staff_id'] = encode_param($staff_id);
$this->load->view('template',$template);
}
public function updateStaff($staff_id = ''){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Staff/addStaff'));
}
if($err == 0 && (!isset($_POST['display_name']) || empty($_POST['display_name']))){
$err = 1;
$errMsg = 'Provide Staff Name';
}else if($err == 0 && (!isset($_POST['username']) || empty($_POST['username']))){
$err = 1;
$errMsg = 'Provide a Staff Username (Email-ID)';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('profile_image')){
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Staff/editStaffs/'.$staff_id));
}
$status = $this->Staff_model->updateStaff(decode_param($staff_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated Staff Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Staff/viewStaffs'));
} else if($status == 2){
$flashMsg = array('message'=>'Username (Email-ID) alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Staff/editStaffs/'.$staff_id));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Staff/editStaffs/'.$staff_id));
}
}
}
?>
\ No newline at end of file
......@@ -5,7 +5,7 @@ class Tag extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Tag_model');
$this->load->model('Dashboard_model');
......
......@@ -5,7 +5,7 @@ class User extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('User_model');
$this->load->model('Dashboard_model');
......
......@@ -5,7 +5,7 @@ class Venue extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Venue_model');
$this->load->model('Dashboard_model');
......
......@@ -12,7 +12,6 @@ class Checker_model extends CI_Model {
FROM checker AS CHK
INNER JOIN provider AS PRV ON (CHK.provider_id=PRV.provider_id)
WHERE $cond");
return $checkerData->result();
}
......
......@@ -17,7 +17,17 @@ class Customer_model extends CI_Model {
$customerData = $this->db->query($sql);
if(!empty($customerData)){
return (empty($customer_id))?$customerData->result():$customerData->row();
if(empty($customer_id)){
$custData = $customerData->result();
foreach ($custData AS $key => $value) {
$custData[$key]->dob = date("m/d/Y",$value->dob/1000);
}
return $custData;
} else {
$custData = $customerData->row();
$custData->dob = date("m/d/Y",$custData->dob/1000);
return $custData;
}
}
return 0;
}
......@@ -27,17 +37,20 @@ class Customer_model extends CI_Model {
return 0;
$userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$customer_data['email']."'");
WHERE status!='2' AND username='".$customer_data['email']."' AND
user_type='3'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4;
$emailChk = $this->db->query("SELECT * FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE USR.status!='2' AND CUST.email='".$customer_data['email']."'");
WHERE USR.status!='2' AND CUST.email='".$customer_data['email']."' AND
USR.user_type='3'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) return 2;
$phoneChk = $this->db->query("SELECT * FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE USR.status!='2' AND CUST.phone='".$customer_data['phone']."'");
WHERE USR.status!='2' AND CUST.phone='".$customer_data['phone']."' AND
USR.user_type='3'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3;
$status = $this->db->insert('users',
......
......@@ -9,7 +9,7 @@ class Login_model extends CI_Model {
public function login($username, $password) {
$query = $this->db->query("SELECT * FROM users
WHERE username='$username' AND password='$password' AND
user_type IN (1,2) AND status='1'");
user_type IN (1,2,4) AND status='1'");
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row();
......
......@@ -53,4 +53,4 @@ class Region_model extends CI_Model {
return $data->result();
}
}
?>
\ No newline at end of file
?>
<?php
class Staff_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getStaffData($staff_id='',$view=''){
$cond = (!empty($view))?" AND status IN ($view) ":" status != '2' ";
$cond .= (!empty($staff_id))?" AND id='$staff_id' ":"";
$staffData = $this->db->query("SELECT * FROM users WHERE user_type='4' ".$cond);
if(!empty($staffData)){
return (!empty($staff_id))?$staffData->row():$staffData->result();
}
return 0;
}
public function addStaff($staff_data = array()){
if(empty($staff_data))
return 0;
$userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND
user_type='4'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2;
$status = $this->db->insert('users',
array('username'=>$staff_data['username'],
'password'=>$staff_data['password'],
'display_name'=>$staff_data['display_name'],
'profile_image'=>$staff_data['profile_image'],
'user_type'=>'4','status'=>'1'));
return $status;
}
function updateStaff($staff_id = '', $staff_data = array()){
if(empty($staff_id) || empty($staff_data))
return 0;
$userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND
user_type='4' AND id!='".$staff_id."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) { return 2; }
if(!isset($staff_data['profile_image']) || empty($staff_data['profile_image'])){
unset($staff_data['profile_image']);
}
$status = $this->db->update('users',$staff_data,array('id'=>$staff_id));
return $status;
}
function changeStatus($staff_id = '', $status = '0'){
if(empty($staff_id)){
return 0;
}
$status = $this->db->update('users',array('status'=>$status),array('id'=>$staff_id));
return $status;
}
}
?>
\ No newline at end of file
......@@ -41,7 +41,7 @@ class User_model extends CI_Model {
}
$chkUser = $this->db->query("SELECT * FROM users WHERE status!='2' AND id!='".$user_id."' AND
username='".$user_data['username']."'");
username='".$user_data['username']."' AND user_type='".$user_type."'");
if(!empty($chkUser) && $chkUser->num_rows() > 0) {
return 4;
......@@ -87,7 +87,7 @@ class User_model extends CI_Model {
array('customer_id'=>$user_id));
}
if($status || $user_type == 1){
if($user_type == 1 || $user_type == 4){
$userData['username'] = $user_data['username'];
$userData['display_name'] = $user_data['display_name'];
if(isset($user_data['password']) && !empty($user_data['password'])){
......
......@@ -226,6 +226,7 @@ class Validation_model extends CI_Model {
) ,
) ,
) ,
'verifyMail' => array() ,
'search' => array(
/*'auth_token' => array(
'required' => array(
......@@ -356,37 +357,34 @@ class Validation_model extends CI_Model {
foreach ($rules as $key => $value) {
foreach ($value as $keys => $values) {
switch ($keys) {
case 'required':
if(!isset($parms[$key]) || $parms[$key]=='' || $parms[$key]== null){
$state = 1;
$error_key = $values;
}
break;
case 'email':
if (isset($parms[$key]) && !filter_var($parms[$key], FILTER_VALIDATE_EMAIL)) {
$state = 1;
$error_key = $values;
}
break;
case 'phone':
if(isset($parms[$key])){
$phone = preg_replace('/[^0-9]/', '', $parms[$key]);
if (strlen($phone) <= 9 && strlen($phone) >= 13) {
$state = 1;
$error_key = $values;
}
}
break;
default:
# code...
break;
}
if($state==1){
break;
}
case 'required':
if(!isset($parms[$key]) || $parms[$key]=='' || $parms[$key]== null){
$state = 1;
$error_key = $values;
}
break;
case 'email':
if (isset($parms[$key]) && !filter_var($parms[$key], FILTER_VALIDATE_EMAIL)) {
$state = 1;
$error_key = $values;
}
break;
case 'phone':
if(isset($parms[$key])){
$phone = preg_replace('/[^0-9]/', '', $parms[$key]);
if (strlen($phone) <= 9 && strlen($phone) >= 13) {
$state = 1;
$error_key = $values;
}
}
break;
default:
# code...
break;
}
if($state==1){
break;
}
}
if($state==1){
break;
......
......@@ -519,7 +519,11 @@ function event($data) {
$this->db->insert('customer_auth',array('user_id'=>$userId, 'auth_token'=>$auth_token));
}
function auth_token_get($token) {
function auth_token_get($token = '') {
if(empty($token)){
return 0;
}
$rs = $this->db->select('user_id')->where('auth_token', $token)->get('customer_auth')->row();
if(count($rs) > 0) {
return $rs->user_id;
......
......@@ -34,6 +34,7 @@
<div class="col-sm-6">
<div class="form-group">
<label>Registration Mail</label>
<p>Email => {:email}</p>
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Registration Mail" name="registration_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->registration_mail ?></textarea>
</div>
</div>
......@@ -41,10 +42,49 @@
<div class="col-sm-6">
<div class="form-group">
<label>Forgot Mail</label>
<p>URL => {:url}</p>
<textarea id="rich_editor_1" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Forgot Mail" name="forgot_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->forgot_mail ?></textarea>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
<label>Checker Activation Mail</label>
<p>Username => {:user_name}</p>
<textarea id="rich_editor_2" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Checker Activation Mail" name="checker_activation_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->checker_activation_mail ?></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Provider Activation Mail</label>
<p>Username => {:user_name} , URL => {:url}</p>
<textarea id="rich_editor_6" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Provider Activation Mail" style="height:108px;"
name="provider_activation_mail" data-parsley-trigger="change"><?= $notificationData->provider_activation_mail ?></textarea>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
<label>Registration Verification Mail</label>
<p>Username => {:user_name} , Reset Link => {:reset_link}</p>
<textarea id="rich_editor_8" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Checker Activation Mail" name="verify_mail"
style="height:108px;" data-parsley-trigger="change"><?= $notificationData->verify_mail ?></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Staff Registration Mail</label>
<p>Username => {:user_name} , Password => {:password}</p>
<textarea id="rich_editor_9" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Staff Registration Mail" name="staff_reg_mail"
style="height:108px;" data-parsley-trigger="change"><?= $notificationData->staff_reg_mail ?></textarea>
</div>
</div>
</div>
</div>
<div class="box-header with-border">
......
......@@ -36,7 +36,7 @@
<label>Category Name (English)</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$"
name="category" required="" value="<?= (isset($categoryData->category))?$categoryData->category:'' ?>"placeholder="Category Name">
name="category" required="" value="<?= (isset($categoryData->category))?$categoryData->category:'' ?>" placeholder="Category Name">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
......
......@@ -8,9 +8,9 @@
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
......@@ -291,7 +291,7 @@
</div>
<div class="col-sm-6">
<div class="input-group date" data-provide="datepicker">
<div date="start" class="input-group date" data-provide="datepicker">
<input id="date" type="text" class="form-control required" required
data-parsley-trigger="change" data-parsley-minlength="5"
name="event_start_date" placeholder="Event Start Date" autocomplete="off">
......@@ -300,7 +300,7 @@
</div>
</div>
<div class="input-group date padTop10 hide" data-provide="datepicker"
<div date="end" class="input-group date padTop10 hide" data-provide="datepicker"
id="eventEndDate">
<input id="date" type="text" class="form-control" disabled
data-parsley-trigger="change" data-parsley-minlength="5"
......
......@@ -39,10 +39,10 @@
<thead>
<tr>
<th class="hidden">ID</th>
<th width="120px;">Organizer</th>
<th width="120px;">User Name</th>
<th width="130px;">Email_id</th>
<th width="80px;">Phone</th>
<th width="100px;">Organizer</th>
<th width="100px;">User Name</th>
<th width="110px;">Email_id</th>
<th width="70px;">Phone</th>
<th width="60px;">Status</th>
<th width="520px;">Action</th>
</tr>
......
......@@ -33,17 +33,55 @@
</div>
<form method="post" class="validate" role="form" action="<?= base_url().'Settings/change_settings'?>" enctype="multipart/form-data" data-parsley-validate="">
<div class="box-body">
<div class="row">
<div class="form-group col-xs-4">
<label>Site Title</label>
<input type="text" name="title" class="form-control required" placeholder="Enter Site Title" value="<?= $data['title'] ?>">
</div>
<div class="form-group col-xs-3">
<label>Title Short</label>
<input type="text" name="title_short" class="form-control required" placeholder="Enter Site Title" value="<?= $data['title_short'] ?>">
<!-- <div class="form-group col-xs-12"> -->
<div class="form-group col-xs-7">
<div class="form-group col-xs-6">
<label>Site Title</label>
<input type="text" name="title" class="form-control required" placeholder="Enter Site Title" value="<?= $data['title'] ?>">
</div>
<div class="form-group col-xs-6">
<label>Title Short</label>
<input type="text" name="title_short" class="form-control required" placeholder="Enter Site Title" value="<?= $data['title_short'] ?>">
</div>
<div class="form-group col-xs-6">
<label>Country Code</label>
<input type="text" name="country_flag" class="form-control required" placeholder="Enter SMTP Username" value="<?= $data['country_flag'] ?>">
</div>
<div class="form-group col-xs-6">
<label>Currency</label>
<input type="text" name="currency" class="form-control required" placeholder="Enter SMTP Password" value="<?= $data['currency'] ?>">
</div>
<!-- <div class="form-group col-xs-6">
<label>SMTP Username</label>
<input type="text" name="smtp_username" class="form-control required" placeholder="Enter SMTP Username" value="<?= $data['smtp_username'] ?>">
</div>
<div class="form-group col-xs-6">
<label>SMTP Password</label>
<input type="text" name="smtp_password" class="form-control required" placeholder="Enter SMTP Password" value="<?= $data['smtp_password'] ?>">
</div> -->
<div class="form-group col-xs-6">
<label>Google API Key</label>
<input type="text" name="google_api_key" class="form-control required" placeholder="Enter Google API" value="<?= $data['google_api_key'] ?>">
</div>
<div class="form-group col-xs-6">
<label>Commission Per Booking</label>
<input type="text" name="service_charge" class="form-control required" placeholder="Enter Service Charge" value="<?= $data['service_charge'] ?>">
</div>
<div class="form-group col-xs-6">
<label>BayanPay Merchant Key</label>
<input type="text" name="merchant_key" class="form-control required" placeholder="Enter Merchant Key" value="<?= $data['merchant_key'] ?>">
</div>
<div class="form-group col-xs-6">
<label>BayanPay Merchant ID</label>
<input type="text" name="merchant_id" class="form-control required" placeholder="Enter Merchant ID" value="<?= $data['merchant_id'] ?>">
</div>
<div class="form-group col-xs-6">
<label>Admin Email-ID</label>
<input type="email" name="admin_mail_id" class="form-control required" placeholder="Admin Email-ID" value="<?= $data['admin_mail_id'] ?>">
</div>
</div>
<div class="form-group col-xs-5">
<div class="form-group">
<label>Site Logo</label>
<div class="col-md-12">
<div class="col-md-3">
......@@ -53,19 +91,8 @@
<input name="site_logo" type="file" accept="image/*" onchange="setImg(this,'site_logo');" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="form-group col-xs-4">
<label>Country Code</label>
<input type="text" name="country_flag" class="form-control required" placeholder="Enter SMTP Username" value="<?= $data['country_flag'] ?>">
</div>
<div class="form-group col-xs-3">
<label>Currency</label>
<input type="text" name="currency" class="form-control required" placeholder="Enter SMTP Password" value="<?= $data['currency'] ?>">
</div>
<div class="form-group col-xs-5">
</div>
<div class="form-group">
<label>Favicon Icon</label>
<div class="col-md-12">
<div class="col-md-3">
......@@ -75,36 +102,9 @@
<input name="fav_icon" type="file" accept="image/*" onchange="setImg(this,'fav_icon_image');" />
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="form-group col-xs-4">
<label>SMTP Username</label>
<input type="text" name="smtp_username" class="form-control required" placeholder="Enter SMTP Username" value="<?= $data['smtp_username'] ?>">
</div>
<div class="form-group col-xs-3">
<label>SMTP Password</label>
<input type="text" name="smtp_password" class="form-control required" placeholder="Enter SMTP Password" value="<?= $data['smtp_password'] ?>">
</div>
<div class="form-group col-xs-4">
<label>Google API Key</label>
<input type="text" name="google_api_key" class="form-control required" placeholder="Enter Google API" value="<?= $data['google_api_key'] ?>">
</div>
</div>
<div class="row">
<div class="form-group col-xs-4">
<label>Commission Per Booking</label>
<input type="text" name="service_charge" class="form-control required" placeholder="Enter Service Charge" value="<?= $data['service_charge'] ?>">
</div>
<div class="form-group col-xs-3">
<label>BayanPay Merchant Key</label>
<input type="text" name="merchant_key" class="form-control required" placeholder="Enter Merchant Key" value="<?= $data['merchant_key'] ?>">
</div>
<div class="form-group col-xs-4">
<label>BayanPay Merchant ID</label>
<input type="text" name="merchant_id" class="form-control required" placeholder="Enter Merchant ID" value="<?= $data['merchant_id'] ?>">
</div>
</div>
<!-- </div> -->
</div>
<div class="box-footer" style="padding-left:46%">
<button type="submit" class="btn btn-info">Update</button>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
$url = (!isset($staff_id) || empty($staff_id))?'Staff/createStaff':'Staff/updateStaff/'.$staff_id;
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?= base_url($url) ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Staff Data -->
<div class="col-md-6">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$"
name="display_name" required="" value="<?= (isset($staff_data->display_name))?$staff_data->display_name:'' ?>"placeholder="Enter Staff Name">
</div>
<div class="form-group">
<label>Username</label>
<input type="email" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="username" placeholder="Enter Email-ID" value="<?= (isset($staff_data->username))?$staff_data->username:'' ?>">
</div>
<?php if(!isset($staff_id) || empty($staff_id)){ ?>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="password" placeholder="Enter Password" >
</div>
<?php } ?>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= (isset($staff_data->profile_image))?base_url($staff_data->profile_image):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id');" />
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Staff/viewStaffs') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Staff List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Staff/addStaff')?>">
Add New Staff
</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="50px;">Photo</th>
<th width="150px;">Name</th>
<th width="150px;">Username</th>
<th width="50px;">Status</th>
<th width="200px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($staff_data)){
foreach($staff_data as $staff) { ?>
<tr>
<th class="hidden"><?= $staff->staff_id ?></th>
<th class="center textCenterAlign">
<img id="image_id" src="<?= base_url($staff->profile_image) ?>"
onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';"
height="50" width="50" />
</th>
<th class="center"><?= $staff->display_name ?></th>
<th class="center"><?= $staff->username ?></th>
<th class="center"><?= ($staff->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Staff/editStaffs/'.encode_param($staff->id)) ?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Staff/changeStatus/".encode_param($staff->id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($staff->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Staff/changeStatus/".encode_param($staff->id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Staff/changeStatus/".encode_param($staff->id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
......@@ -14,6 +14,7 @@
<script src="<?= base_url('assets/js/dataTables.bootstrap.min.js') ?>"></script>
<script src="<?= base_url('assets/js/bootbox.min.js') ?>"></script>
<script src="<?= base_url('assets/js/app.min.js') ?>"></script>
<script src="<?= base_url('assets/js/locationpicker.js') ?>" type="text/javascript"></script>
<script src="<?= base_url('assets/js/custom-script.js') ?>"></script>
<script src="<?= base_url('assets/js/parsley.min.js') ?>"></script>
<script src="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>
......@@ -25,10 +26,12 @@
<script>
jQuery('.clockpicker').clockpicker();
jQuery( document ).ready(function() {
if(jQuery('#rich_editor').length==1){ CKEDITOR.replace('rich_editor'); }
if(jQuery('#rich_editor_1').length==1){CKEDITOR.replace('rich_editor_1'); }
if(jQuery('#rich_editor_2').length==1){CKEDITOR.replace('rich_editor_2'); }
if(jQuery('#rich_editor_6').length==1){CKEDITOR.replace('rich_editor_6'); }
if(jQuery('#rich_editor').length==1){CKEDITOR.replace('rich_editor');}
if(jQuery('#rich_editor_1').length==1){CKEDITOR.replace('rich_editor_1');}
if(jQuery('#rich_editor_2').length==1){CKEDITOR.replace('rich_editor_2');}
if(jQuery('#rich_editor_6').length==1){CKEDITOR.replace('rich_editor_6');}
if(jQuery('#rich_editor_8').length==1){CKEDITOR.replace('rich_editor_8');}
if(jQuery('#rich_editor_9').length==1){CKEDITOR.replace('rich_editor_9');}
if(jQuery('#rich_editor_3').length==1){CKEDITOR.replace('rich_editor_3',{language:'ar'});}
if(jQuery('#rich_editor_4').length==1){CKEDITOR.replace('rich_editor_4',{language:'ar'});}
......@@ -47,26 +50,31 @@
$actionName = $ci->uri->segment(2);
$page = $controllerName . '-' . $actionName;
// switch ($page) {
//case 'Ride-view_rides': ?>
// jQuery(function () {
// jQuery('.datatable').DataTable({
// scrollY: "300px",
// scrollX: true,
// scrollCollapse: true,
// paging: false,
// fixedColumns: {
// heightMatch: 'none'
// }
// });
// });
<?php //break;
//default : ?>
switch ($page) {
case 'Event-addEvent': ?>
jQuery(function () {
jQuery('[date="start"]').datepicker({
format: 'dd - MM - yyyy',
startDate: '-0d',
endDate: '+90d'
});
jQuery('[date="end"]').datepicker({
format: 'dd - MM - yyyy',
startDate: '+1d',
endDate: '+90d'
});
});
jQuery('.datatable').DataTable({
"ordering" : jQuery(this).data("ordering"),
"order": [[ 0, "desc" ]]
});
<?php break;
default : ?>
jQuery(function () {
jQuery('.datatable').DataTable({
"ordering" : jQuery(this).data("ordering"),
"order": [[ 0, "asc" ]]
"order": [[ 0, "desc" ]]
});
});
<?php //} ?>
<?php } ?>
</script>
\ No newline at end of file
......@@ -69,7 +69,7 @@
</div>
<?php
$user_type = $this->session->userdata('user_type');
if($user_type == 2 || $user_type == 3){ ?>
if(($user_type == 2 && !empty($provider)) || ($user_type == 3 && !empty($customer))){ ?>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
......@@ -140,15 +140,17 @@
<div class="col-md-6">
<div class="form-group">
<label>New Password</label>
<input type="password" class="form-control" name="password" placeholder="New Password">
<span class="glyphicon form-control-feedback"></span>
<input type="password" class="form-control" name="password" placeholder="New Password"
autocomplete="off">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Confirm Password</label>
<input type="password" class="form-control" name="cPassword" placeholder="Confirm Password">
<span class="glyphicon form-control-feedback"></span>
<input type="password" class="form-control" name="cPassword" placeholder="Confirm Password"
autocomplete="off">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-12">
......
......@@ -38,7 +38,7 @@
<option selected disabled>Choose a Region</option>
<?php
foreach ($regionData as $region) {
$select = (isset($venue_data->region_id) && $venue_data->region_id == $region->id)?'selected':'';
$select = (isset($venue_data->region_id) && $venue_data->region_id==$region->id)?'selected':'';
echo '<option '.$select.' value="'.$region->id.'">'.
$region->name.
'</option>';
......@@ -46,21 +46,8 @@
?>
</select>
</div>
<?php } ?>
<div class="form-group">
<label>Venue Title</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="1" name="venue_name" required="" placeholder="Enter Venue Title"
value="<?= (isset($venue_data->venue_name))?$venue_data->venue_name:'' ?>">
</div>
<div class="form-group">
<label>Venue Address</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
id="loc_search_1" name="location" placeholder="Venue Address" value="<?= (isset($venue_data->location))?$venue_data->location:'' ?>" required>
</div>
</div>
<div class="col-md-6">
<?php if(!empty($host_data)){ ?>
<?php }
if(!empty($host_data)){ ?>
<div class="form-group">
<label>Venue</label>
<select name="host_cat_id" class="form-control required"
......@@ -79,12 +66,31 @@
</div>
<?php } ?>
<div class="form-group">
<label>Venue Title</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="1" name="venue_name" required="" placeholder="Enter Venue Title"
value="<?= (isset($venue_data->venue_name))?$venue_data->venue_name:'' ?>">
</div>
<div class="form-group">
<label>Venue Details</label>
<textarea type="text" class="ip_reg_form_input form-control reset-form-custom required" placeholder="Venue Details" name="venue_details" data-parsley-trigger="change" data-parsley-minlength="1" required="" style="height:106px;"><?= (isset($venue_data->venue_details))?$venue_data->venue_details:'' ?></textarea>
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Venue Address</label>
<input type="text" class="form-control required" data-parsley-trigger="change" required
name="location" placeholder="Venue Address" value="<?= (isset($venue_data->location))?$venue_data->location:'' ?>">
</div>
<input type="hidden" id="gooLocLat" value="<?= (isset($venue_data->location_lat) && !empty($venue_data->location_lat))?$venue_data->location_lat:'' ?>" />
<input type="hidden" id="gooLocLng" value="<?= (isset($venue_data->location_lng) && !empty($venue_data->location_lng))?$venue_data->location_lng:'' ?>" />
<input type="hidden" id="gooLocZoom" value="<?= (isset($venue_data->location))?15:0 ?>"/>
<div id="locPointerMap" style="height: 213px;"></div>
<?php if(!isset($venue_id) || empty($venue_id)){ ?>
<div class="form-group">
<div class="form-group" style="padding-top: 5px;">
<label id="localityLabel">Venue Locality</label>
<div id="showType" class="hide">
<div class="col-md-5">
......
......@@ -313,6 +313,18 @@
opacity: 0.5;
}
.padTop10 {
padding-top:10px !important;
}
.padTop15 {
padding-top:15px !important;
}
.padTop12 {
padding-top:12px !important;
}
/* .padBottom10 {
padding-bottom:10px !important;
}
......
......@@ -78,12 +78,14 @@ function initLocSearch_1() {
var options = {componentRestrictions: {country: country_flag}};
var autocomplete = new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window,'load',initLocSearch_1);
function initLocSearch_2() {
var input = document.getElementById('loc_search_2');
var options = {componentRestrictions: {country: country_flag}};
var autocomplete = new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window,'load',initLocSearch_2);
function initLocSearch_3() {
var input = document.getElementById('loc_search_3');
......@@ -501,7 +503,6 @@ jQuery('[id="viewCustomer"]').on('click',function() {
case '2': gender = 'Female';break;
case '3': gender = 'Others';break;
}
var html = '<div class="col-xs-12">'+
'<div class="col-md-2">'+
'<div class="row">'+
......@@ -819,4 +820,21 @@ jQuery('[name="region_id"]').on('change',function(){
}
}
});
});
\ No newline at end of file
});
jQuery('#locPointerMap').locationpicker({
location: {latitude: jQuery('#gooLocLat').val(), longitude: jQuery('#gooLocLng').val()},
radius: 0,
zoom: 10,
inputBinding: {
radiusInput: 0,
zoomInput: parseInt(jQuery('#gooLocZoom').val()),
latitudeInput: jQuery('#gooLocLat'),
longitudeInput: jQuery('#gooLocLng'),
locationNameInput: jQuery('[name="location"]')
},
enableAutocomplete: true,
onchanged: function(currentLocation, radius, isMarkerDropped) {
jQuery('#gooLocZoom').val('15');
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment