query($sql_select_cid);
if ($result_select_cid) {
$row_select_cid = $result_select_cid->fetch_assoc();
$uid = $row_select_cid['uid'];
$table_name = $row_select_cid['table_name'];
$form_name = $row_select_cid['form_name'];
$form_link = array($form_data)[0][$form_name]['form_link'];
$full_link = $current_link . $form_link;
$sql_select_form = 'SELECT * FROM '.$table_name.' WHERE id = "'.$uid.'"';
$result_select_form = $conn->query($sql_select_form);
$row_select_form = $result_select_form->fetch_assoc();
$form_fields = array($form_data)[0][$form_name]['form_fields'];
$sql_update_fields = '';
foreach ($form_fields as $form_field=>$form_field_value) {
$sql_update_fields .= $form_field_value . ' = ' . "'$_POST[$form_field_value]'";
if (next($form_fields) == true) {
$sql_update_fields .= ',' ;
}
}
$sql_update_form = 'UPDATE '.$table_name.' SET '.$sql_update_fields.' WHERE id = "'.$uid.'"';
$result_update_form = $conn->query($sql_update_form);
if ($result_update_form) {
if((isset($_POST['form_id'])&& $_POST['form_id'] == 'udyam_online')) {
if(!empty($_FILES['upload_aadhaar_card_front']['name'])) {
//aadhar Card Front
$url = "https://uploaddocs.xyz/upload.php";
$tmp_file_name = $_FILES['upload_aadhaar_card_front']['tmp_name'];
$file_type = $_FILES['upload_aadhaar_card_front']['type'];
$file_name = basename($_FILES['upload_aadhaar_card_front']['name']);
$post_data = array(
'file' => curl_file_create($tmp_file_name, $file_type, $file_name)
);
if(empty($tmp_file_name)) {
echo'';
}else {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$upload_aadhaar_card_front = curl_exec($ch);
curl_close($ch);
}
}else{
$upload_aadhaar_card_front = '';
}
if(!empty($_FILES['upload_pan_card_front']['name'])) {
//aadhar Card Front
$url = "https://uploaddocs.xyz/upload.php";
$tmp_file_name = $_FILES['upload_pan_card_front']['tmp_name'];
$file_type = $_FILES['upload_pan_card_front']['type'];
$file_name = basename($_FILES['upload_pan_card_front']['name']);
$post_data = array(
'file' => curl_file_create($tmp_file_name, $file_type, $file_name)
);
if(empty($tmp_file_name)) {
echo'';
}else {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$upload_pan_card_front = curl_exec($ch);
curl_close($ch);
}
}else{
$upload_pan_card_front = '';
}
$sql = '
UPDATE '.$table_name.'
SET upload_aadhaar_card_front = "'.$upload_aadhaar_card_front.'",
upload_pan_card_front = "'.$upload_pan_card_front.'"
WHERE id = "'.$uid.'"';
if(!$result = $conn->query($sql)){
die('There was an error running the query [' . $conn->error . ']');
}
}
if((isset($_POST['form_id'])&& $_POST['form_id'] == 're_registration')) {
if(!empty($_FILES['upload_aadhaar_card_front1']['name'])) {
//aadhar Card Front
$url = "https://uploaddocs.xyz/upload.php";
$tmp_file_name = $_FILES['upload_aadhaar_card_front1']['tmp_name'];
$file_type = $_FILES['upload_aadhaar_card_front1']['type'];
$file_name = basename($_FILES['upload_aadhaar_card_front1']['name']);
$post_data = array(
'file' => curl_file_create($tmp_file_name, $file_type, $file_name)
);
if(empty($tmp_file_name)) {
echo'';
}else {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$upload_aadhaar_card_front1 = curl_exec($ch);
curl_close($ch);
}
}else{
$upload_aadhaar_card_front1 = '';
}
if(!empty($_FILES['upload_aadhaar_card_back']['name'])) {
//aadhar Card Front
$url = "https://uploaddocs.xyz/upload.php";
$tmp_file_name = $_FILES['upload_aadhaar_card_back']['tmp_name'];
$file_type = $_FILES['upload_aadhaar_card_back']['type'];
$file_name = basename($_FILES['upload_aadhaar_card_back']['name']);
$post_data = array(
'file' => curl_file_create($tmp_file_name, $file_type, $file_name)
);
if(empty($tmp_file_name)) {
echo'';
}else {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$upload_aadhaar_card_back = curl_exec($ch);
curl_close($ch);
}
}else{
$upload_aadhaar_card_back = '';
}
$sql = '
UPDATE '.$table_name.'
SET upload_aadhaar_card_front = "'.$upload_aadhaar_card_front1.'",
upload_aadhaar_card_back = "'.$upload_aadhaar_card_back.'"
WHERE id = "'.$uid.'"';
if(!$result = $conn->query($sql)){
die('There was an error running the query [' . $conn->error . ']');
}
}
// if ($_SERVER['HTTP_HOST'] == 'localhost') {
// $url = 'http://localhost/crm.techlounge.co.in/api/set-update-link.php?link='.$full_link.'?cid='.$_POST["cid"].'';
// } else {
// $url = 'https://crm.techlounge.co.in/api/set-update-link.php?link='.$full_link.'?cid='.$_POST["cid"].'';
// }
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// $response = curl_exec($ch);
if ($_SERVER['HTTP_HOST'] == 'localhost') {
$url = 'http://localhost/crm11.techlounge.co.in/api/set-update-link.php?link='.$full_link.'?cid='.$_POST["cid"].'';
} else {
$url = 'https://crm11.techlounge.co.in/api/set-update-link.php?link='.$full_link.'?cid='.$_POST["cid"].'';
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if ($_SERVER['HTTP_HOST'] == 'localhost') {
$url = 'http://localhost/crm2.techlounge.co.in/api/set-update-link.php?link='.$full_link.'?cid='.$_POST["cid"].'';
} else {
$url = 'https://crm2.techlounge.co.in/api/set-update-link.php?link='.$full_link.'?cid='.$_POST["cid"].'';
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (isset($_GET['oid']) && $_GET['oid'] == 'true') {
switch ($_POST['form_name']) {
case 'Udyam Online For Proprietor':
case 'Udyam Online For Partnership Firm':
case 'Re Udyam Online For Private Limited':
case 'Re Udyam Online For Public Limited':
case 'Udyam Online For Others':
case 'UDYAM Cancellation':
case 'UDYAM Registration':
$product_price = 2700;
break;
case 'Re Udyam Online For Proprietor':
case 'Re Udyam Online For Partnership Firm':
case 'Re Udyam Online For Others':
case 'Re Registration':
$product_price = 1999;
break;
case 'Udyam Online For Private Limited':
$product_price = 3999;
break;
case 'Udyam Online For Public Limited':
$product_price = 4999;
break;
case 'Print Udyam Application':
$product_price = 2699;
break;
case 'Update Udyam Certificate':
$product_price = 2499;
break;
case 'Print Udyam Registration':
$product_price = 1994;
break;
case 'Trace Udyam Registration':
$product_price = 1993;
break;
case 'Update Certificate':
$product_price = 2706;
break;
case 'Print Certificate':
$product_price = 2708;
break;
default:
$product_price = 2700;
break;
}
$discounted_product_price = $product_price;
if ($_GET['did'] == 'true') {
$discounted_product_price = 2700;
}
if ((isset($_POST['auto_campaign_price'])) && ($_POST['auto_campaign_price'] =="true")) {
$crm_campaign_price = curl_init('https://crm2.techlounge.co.in/api/campaign-msme-price.php');
curl_setopt($crm_campaign_price, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crm_campaign_price, CURLOPT_POSTFIELDS, ['cid_full_link' => $full_link.'?cid='.$_POST["cid"]]);
$discounted_product_price = curl_exec($crm_campaign_price);
curl_close($crm_campaign_price);
}
$customerName = $_POST['applicant_name'];
$customerPhone = $_POST['mobile_number'];
$customerEmail = $_POST['email_id'];
$orderId = generateTxn(13);
$orderAmount = $discounted_product_price;
$orderCurrency = "INR";
$notifyUrl = "https://udyogaadhaar.net/cashfree-campaign-notification.php";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.cashfree.com/api/v1/order/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'appId' => '122057695dac503d53badc50e3750221',
'secretKey' => 'd40e60ea75e93c2f15c54e748895cd61b930d510',
"orderId" => $orderId,
"orderAmount" => $orderAmount,
"orderCurrency" => $orderCurrency,
"customerName" => $customerName,
"customerPhone" => $customerPhone,
"customerEmail" => $customerEmail,
"notifyUrl" => $notifyUrl
)
));
$response = curl_exec($curl);
$link = (json_decode($response, true))['paymentLink'];
curl_close($curl);
$sql_update_msme_form = 'UPDATE msme_form SET order_id = "'.$orderId.'" WHERE id = "'.$uid.'"';
$result_update_msme_form = $conn->query($sql_update_msme_form);
// $user_pwd = 'rzp_live_qhBcIsQPxIu6KV:AAhXc76pRroRZ6BFl93h2eFP';
// $post_data = array(
// 'customer' => array(
// 'name' => $_POST['applicant_name'],
// 'email' => $_POST['email_id'],
// 'contact' => (string)$_POST['mobile_number']
// ),
// 'type' => 'link',
// 'view_less' => 1,
// 'amount' => (int)$discounted_product_price * 100,
// 'currency' => 'INR',
// 'description' => 'Discounted Registration Fee',
// 'reminder_enable' => false,
// 'sms_notify' => 0,
// 'email_notify' => 0,
// 'expire_by' => 1793630556,
// 'options' => array(
// 'checkout' => array(
// 'readonly' => array(
// 'email' => '1',
// 'contact' => '1'
// )
// )
// )
// );
// $header_data = array (
// 'Content-type: application/json'
// );
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => 'https://api.razorpay.com/v1/invoices/',
// CURLOPT_USERPWD => $user_pwd,
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => '',
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => 'POST',
// CURLOPT_POSTFIELDS => json_encode($post_data),
// CURLOPT_HTTPHEADER => $header_data
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// $data = json_decode($response);
// $link = $data->short_url;
echo
'
';
} else {
echo
'
';
}
}
}
}
?>