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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/home/dna1981/public_html/SMB/php/
Upload File :
Current File : /home/dna1981/public_html/SMB/php/cart.php
<?php require_once ('connect.php'); ?>
<?php 
$today = date("Y-m-d");

date_default_timezone_set("America/Chicago");
$todaydate = date("Y-m-d");
//Edit Attendee
if ((isset($_POST["Attendee"])) && ($_POST["Attendee"] == "Yes")) {
  $event_id =$_POST['eid'];
  $id =$_POST['id'];
  $Degree = $_POST['degree'];
  $FirstName = mysqli_real_escape_string($SMB, $_POST['first_name']);
  $LastName = mysqli_real_escape_string($SMB, $_POST['last_name']);
  $EmailAddress = $_POST['email_address'];
  $type = $_POST['type']; 
  if($type == 'Dentist'){
	 $Dr = "Dr. ";
	  
	  }
	 else {
		 $Dr = "";
		 
		 }
 
$query_GetCourse = "SELECT * FROM Courses WHERE id = '$event_id'";
$GetCourse = mysqli_query($SMB, $query_GetCourse);
$totalRows_GetCourse = mysqli_num_rows($GetCourse);
if($totalRows_GetCourse > 0){
	while($row_GetCourse = mysqli_fetch_assoc($GetCourse)){
		$Event = $row_GetCourse['id'];
		$City = $row_GetCourse['city'];
		$State = $row_GetCourse['state'];
		$Start = date('F d, Y', strtotime($row_GetCourse['start_date']));
		
		
		$product_name = 'SMB Course: '.$City.', '.$State.' - '.$Start.'';
		
	
	}
}
  $InsertName = $product_name."-".$type." Registration: ".$Dr."".$FirstName." ".$LastName;
  
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "UPDATE Cart SET first_name='$FirstName', last_name='$LastName', email_address='$EmailAddress', name='$InsertName' WHERE id='$id'"); 

   $AddGoTo = "../cart.php";
   header("Location: $AddGoTo");
}
//Register
if ((isset($_POST["Add"])) && ($_POST["Add"] == "Yes")) {
  $event_id =$_POST['event_id'];
  $Degree = $_POST['degree'];
  $FirstName = mysqli_real_escape_string($SMB, $_POST['first_name']);
  $LastName = mysqli_real_escape_string($SMB, $_POST['last_name']);
  $Book = $_POST['book'];
  $type = $_POST['type']; 
  $product_name = mysqli_real_escape_string($SMB, $_POST['product_name']);
  $product_price = $_POST['product_price'];
  $product_qty = $_POST['product_qty'];
  $status = $_POST['status'];
  $date = $_POST['date']; 
  $email = $_POST['email_address']; 
  $license =$_POST['license'];
  if($type == 'Dentist'){
	 $Dr = "Dr. ";
	  
	  }
	 else {
		 $Dr = "";
		 
		 }
	if($license != ''){
		$ShowLiscence = "(".$license.")";
		}
	else {
		$ShowLiscence = "";		
		}

  $InsertName = $product_name."-".$type." Registration: ".$Dr."".$FirstName." ".$LastName." ".$ShowLiscence;
  
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, type, status, first_name, last_name, degree, book, event_id, email_address, license) VALUES ('$cid', '$InsertName', '$product_price', '$product_qty', '$date', '$type', '$status', '$FirstName', '$LastName', '$Degree', '$Book', '$event_id', '$email', '$license')"); 

   $AddGoTo = "../course-details.php?id=$event_id";
   header("Location: $AddGoTo");
}

//Register
if ((isset($_POST["New"])) && ($_POST["New"] == "Yes")) {
  $event_id =$_POST['event_id'];
  $Degree = $_POST['degree'];
  $FirstName = mysqli_real_escape_string($SMB, $_POST['first_name']);
  $LastName = mysqli_real_escape_string($SMB, $_POST['last_name']);
  $BID = $_POST['bid'];
  $type = $_POST['type']; 
  $product_name = mysqli_real_escape_string($SMB, $_POST['product_name']);
  $product_price = $_POST['product_price'];
  $product_qty = $_POST['product_qty'];
  $status = $_POST['status'];
  $shipping = $_POST['shipping'];
  $date = $_POST['date']; 
  $email = $_POST['email_address']; 
  $license =$_POST['license'];
  $level = $_POST['level']; 
  
  if($BID != ''){

$query_Course_Books = "SELECT * FROM SMB_AddBooks WHERE id = '$BID'";
$Course_Books = mysqli_query($SMB, $query_Course_Books);
$totalRows_Course_Books = mysqli_num_rows($Course_Books);
if($totalRows_Course_Books > 0){
	while($row_Course_Books = mysqli_fetch_assoc($Course_Books)){
		$Course_Book_ID = $row_Course_Books['id'];
		$Course_BID = $row_Course_Books['bid'];
		$Course_SalePrice = $row_Course_Books['sale_price'];
		$Course_RegisterType = $row_Course_Books['type'];
		
		if($shipping > 0) {
			
		$ShipNow = " - Ship Book Now";
			
			}
		else {
			$ShipNow = "";
			
			}
		
		
$query_Get_Book_Info = "SELECT * FROM Books WHERE id = '$Course_BID'";
$Get_Book_Info = mysqli_query($SMB, $query_Get_Book_Info);
$totalRows_Get_Book_Info = mysqli_num_rows($Get_Book_Info);
if($totalRows_Get_Book_Info > 0){
	while($row_Get_Book_Info = mysqli_fetch_assoc($Get_Book_Info)){
		$Get_Book_ID = $row_Get_Book_Info['id'];
		$Get_Book_Name = $row_Get_Book_Info['title'];
		$Get_Book_Retail = $row_Get_Book_Info['price'];
		
		$Added_Book = '</br><font color="red">Book Added: '.$Get_Book_Name.' - $'.$Course_SalePrice.'</font>';
		$BookQty = 1;
		$Book_Name = $Get_Book_Name;
		
		
	}}
	}}
	else {
		$Course_SalePrice = 0.00;
		$Added_Book = '</br><font color="red">No Book Added</font>';
		$BookQty = 0;
		$Book_Name = "No Book Added";
		
		}  
	  
	  }
  if($type == 'Dentist'){
	 $Dr = "Dr. ";
	  
	  }
	 else {
		 $Dr = "";
		 
		 }
	if($license != ''){
		$ShowLiscence = "(".$license.")";
		}
	else {
		$ShowLiscence = "";		
		}
  $InsertName = $product_name.'<strong> - <font color="#00a4e4">'.$type.' Registration: '.$Dr.' '.$FirstName.' '.$LastName.' '.$ShowLiscence.'</font></strong> '.$Added_Book.''.$ShipNow;
  
  $NewPrice = $Course_SalePrice + $product_price;
  
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, type, status, first_name, last_name, degree, book, book_name, book_id, event_id, email_address, license, level, shipping) VALUES ('$cid', '$InsertName', '$NewPrice', '$product_qty', '$date', '$type', '$status', '$FirstName', '$LastName', '$Degree', '$BookQty', '$Book_Name', '$Get_Book_ID', '$event_id', '$email', '$license', '$level', '$shipping')"); 

   $AddGoTo = "../course-details.php?id=$event_id";
   header("Location: $AddGoTo");
}

//Register 2 Day
if ((isset($_POST["2Day"])) && ($_POST["2Day"] == "Yes")) {
  $event_id =$_POST['event_id'];
  $Degree = $_POST['degree'];
  $Day1 = $_POST['day1'];
  $Day2 = $_POST['day2'];
  $FirstName = mysqli_real_escape_string($SMB, $_POST['first_name']);
  $LastName = mysqli_real_escape_string($SMB, $_POST['last_name']);
  $BID = $_POST['bid'];
  $type = $_POST['type']; 
  $product_name = mysqli_real_escape_string($SMB, $_POST['product_name']);
  $product_price = $_POST['product_price'];
  $product_qty = $_POST['product_qty'];
  $status = $_POST['status'];
  $shipping = $_POST['shipping'];
  $date = $_POST['date']; 
  $email = $_POST['email_address']; 
  $license =$_POST['license'];
  $level =$_POST['level'];
  
  if($BID != ''){

$query_Course_Books = "SELECT * FROM SMB_AddBooks WHERE id = '$BID'";
$Course_Books = mysqli_query($SMB, $query_Course_Books);
$totalRows_Course_Books = mysqli_num_rows($Course_Books);
if($totalRows_Course_Books > 0){
	while($row_Course_Books = mysqli_fetch_assoc($Course_Books)){
		$Course_Book_ID = $row_Course_Books['id'];
		$Course_BID = $row_Course_Books['bid'];
		$Course_SalePrice = $row_Course_Books['sale_price'];
		$Course_RegisterType = $row_Course_Books['type'];
		
		if($shipping > 0) {
			
		$ShipNow = " - Ship Book Now";
			
			}
		else {
			$ShipNow = "";
			
			}
		
		
$query_Get_Book_Info = "SELECT * FROM Books WHERE id = '$Course_BID'";
$Get_Book_Info = mysqli_query($SMB, $query_Get_Book_Info);
$totalRows_Get_Book_Info = mysqli_num_rows($Get_Book_Info);
if($totalRows_Get_Book_Info > 0){
	while($row_Get_Book_Info = mysqli_fetch_assoc($Get_Book_Info)){
		$Get_Book_ID = $row_Get_Book_Info['id'];
		$Get_Book_Name = $row_Get_Book_Info['title'];
		$Get_Book_Retail = $row_Get_Book_Info['price'];
		
		$Added_Book = '</br><font color="red">Book Added: '.$Get_Book_Name.' - $'.$Course_SalePrice.'</font>';
		$BookQty = 1;
		$Book_Name = $Get_Book_Name;
		
		
	}}
	}}
	else {
		$Course_SalePrice = 0.00;
		$Added_Book = '</br><font color="red">No Book Added</font>';
		$BookQty = 0;
		$Book_Name = "No Book Added";
		
		}  
	  
	  }
  if($type == 'Dentist'){
	 $Dr = "Dr. ";
	  
	  }
	 else {
		 $Dr = "";
		 
		 }
	if($license != ''){
		$ShowLiscence = "(".$license.")";
		}
	else {
		$ShowLiscence = "";		
		}

  $InsertName = $product_name.'<strong> - <font color="#00a4e4">'.$type.' Registration: '.$Dr.' '.$FirstName.' '.$LastName.' '.$ShowLiscence.'</font></strong> '.$Added_Book.''.$ShipNow;
  
  $NewPrice = $Course_SalePrice + $product_price;
  
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, type, status, first_name, last_name, degree, book, book_name, book_id, event_id, email_address, license, level, shipping, day_1, day_2) VALUES ('$cid', '$InsertName', '$NewPrice', '$product_qty', '$date', '$type', '$status', '$FirstName', '$LastName', '$Degree', '$BookQty', '$Book_Name', '$Get_Book_ID', '$event_id', '$email', '$license', '$level', '$shipping', '$Day1', '$Day2')"); 

   $AddGoTo = "../2-day-course.php?id=$event_id";
   header("Location: $AddGoTo");
}


//Refresher
if ((isset($_POST["Refresher"])) && ($_POST["Refresher"] == "Yes")) {
  $event_id =$_POST['event_id'];
  $Degree = $_POST['degree'];
  $FirstName = mysqli_real_escape_string($SMB, $_POST['first_name']);
  $LastName = mysqli_real_escape_string($SMB, $_POST['last_name']);
  $BID = $_POST['bid'];
  $type = $_POST['type']; 
  $product_name = mysqli_real_escape_string($SMB, $_POST['product_name']);
  $product_price = $_POST['product_price'];
  $product_qty = $_POST['product_qty'];
  $status = $_POST['status'];
  $date = $_POST['date']; 
  $email = $_POST['email_address']; 
  $license =$_POST['license'];
  $PREV = $_POST['prev_course']; 
  

$query_Confirm_Attendence = "SELECT * FROM AddPeople WHERE eid='$PREV' AND first_name='$FirstName' AND last_name = '$LastName'";
$Confirm_Attendence = mysqli_query($SMB, $query_Confirm_Attendence);
$totalRows_Confirm_Attendence = mysqli_num_rows($Confirm_Attendence);
if($totalRows_Confirm_Attendence > 0){


$query_Course_Attended = "SELECT * FROM Courses WHERE id='$PREV'";
$Course_Attended = mysqli_query($SMB, $query_Course_Attended);
$totalRows_Course_Attended = mysqli_num_rows($Course_Attended);
if($totalRows_Course_Attended > 0){
	while($row_Course_Attended = mysqli_fetch_assoc($Course_Attended)){
		$Attended_Date = date('F d, Y', strtotime($row_Course_Attended['start_date']));
		$Attended_State = $row_Course_Attended['city'];
		$Attended_City = $row_Course_Attended['state'];
		
		$Show_Attended = "<strong> Attended: ".$Attended_Date."-".$Attended_City.", ".$Attended_State."</strong>";
		}
	
	}


  if($type == 'Dentist'){
	 $Dr = "Dr. ";
	  
	  }
	 else {
		 $Dr = "";
		 
		 }
	if($license != ''){
		$ShowLiscence = "(".$license.")";
		}
	else {
		$ShowLiscence = "";		
		}

  $InsertName = $product_name.'<strong> - <font color="#00a4e4">'.$type.' Registration: '.$Dr.' '.$FirstName.' '.$LastName.' '.$ShowLiscence.'</font></strong> '.$Show_Attended;
  
  $NewPrice = $product_price;
  
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, type, status, first_name, last_name, degree, book, book_name, book_id, event_id, email_address, license) VALUES ('$cid', '$InsertName', '$NewPrice', '$product_qty', '$date', '$type', '$status', '$FirstName', '$LastName', '$Degree', '$BookQty', '$Book_Name', '$BID', '$event_id', '$email', '$license')"); 

   $AddGoTo = "../refresher-details.php?id=$event_id";
   header("Location: $AddGoTo");
}
else {
	header("Location: https://www.successfulmedicalbilling.com/register-fail.php");
	exit();	
	
	}

}
// Add Promo to Cart	
if ((isset($_POST["PromoCode"])) && ($_POST["PromoCode"] != "")) {
  $PromoCode = trim($_POST['PromoCode']);
	
// Remove Old Codes

//Writes the information to the database
 mysqli_query($SMB, "UPDATE Cart SET promo_code='', promo_amount='0.00' WHERE cid='$cid'");

		
$query_Add_Promo = "SELECT Cart.event_id, Cart.cid, Cart.id, Cart.status, Cart.price, DiscountCodes.eid, DiscountCodes.code, DiscountCodes.type, DiscountCodes.percent, DiscountCodes.amount, DiscountCodes.start_date, DiscountCodes.end_date
FROM Cart 
JOIN DiscountCodes
ON Cart.event_id=DiscountCodes.eid
WHERE Cart.cid = '$cid' AND Cart.status != 'Refresher' AND DiscountCodes.code = '$PromoCode' AND DiscountCodes.start_date <= '$today' AND DiscountCodes.end_date >= '$today'";
$Add_Promo = mysqli_query($SMB, $query_Add_Promo);
$totalRows_Add_Promo = mysqli_num_rows($Add_Promo);
if($totalRows_Add_Promo > 0){
	while($row_Add_Promo = mysqli_fetch_assoc($Add_Promo)){
		$Get_Promo_CartID = $row_Add_Promo['id']; 
		$Get_Promo_Code = $row_Add_Promo['code']; 
		$Get_Promo_Type = $row_Add_Promo['type']; 
		$Get_Promo_Percent = $row_Add_Promo['percent']; 
		$Get_Promo_Amount= $row_Add_Promo['amount']; 
		$Get_Promo_CartPrice = $row_Add_Promo['price'];
		$Get_Promo_EID = $row_Add_Promo['eid'];
		
		if($Get_Promo_Type == 'percent'){
			
			$GetPecentage = $Get_Promo_Percent/100;
			$GetDiscount = number_format(($Get_Promo_CartPrice * $GetPecentage), 2); 
			
			}
		else {
			$GetDiscount = number_format($Get_Promo_Amount, 2); 
			
			}
	
		// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "UPDATE Cart SET promo_code='$Get_Promo_Code', promo_amount='$GetDiscount' WHERE id='$Get_Promo_CartID' AND event_id='$Get_Promo_EID'"); 
 
 $PromoMessage = '<h6 style="color:green;"><strong>Promo Code Applied!</strong></h6>'; 
   
   
		
									}}
	else {
		$PromoMessage = '<h6 style="color:red;"><strong>Not Valid Promo Code</strong></h6>'; 
		 
		
		} 
}
if($totalRows_Add_Promo < 1){
		
$query_Universal_Promo = "SELECT * FROM SMB_Promo_Code
WHERE promo = '$PromoCode' AND start_date <= '$today' AND end_date >= '$today'";
$Universal_Promo = mysqli_query($SMB, $query_Universal_Promo);
$totalRows_Universal_Promo = mysqli_num_rows($Universal_Promo);
if($totalRows_Universal_Promo > 0){
	while($row_Universal_Promo = mysqli_fetch_assoc($Universal_Promo)){
		$Universal_Promo_ID = $row_Universal_Promo['id']; 
		$Universal_Promo_Code = $row_Universal_Promo['promo']; 
		$Universal_Promo_Type = $row_Universal_Promo['type']; 
		$Universal_Promo_Percent = $row_Universal_Promo['percent']; 
		$Universal_Promo_Amount= $row_Universal_Promo['amount'];
		
// Check Events 
$query_Universal_Events = "SELECT Cart.event_id, Cart.cid, Cart.id AS ID, Cart.status, Cart.price, SMB_Promo_Items.promo_id, SMB_Promo_Items.event_id
FROM Cart 
JOIN SMB_Promo_Items
ON Cart.event_id=SMB_Promo_Items.event_id
WHERE Cart.cid = '$cid' AND Cart.status != 'Refresher' AND SMB_Promo_Items.promo_id = '$Universal_Promo_ID' AND Cart.event_id > 0";
$Universal_Events = mysqli_query($SMB, $query_Universal_Events);
$totalRows_Universal_Events = mysqli_num_rows($Universal_Events);
if($totalRows_Universal_Events > 0) {
	while($row_Universal_Events = mysqli_fetch_assoc($Universal_Events)){
		$Universal_Events_id = $row_Universal_Events['ID'];
		$Universal_Events_Price = $row_Universal_Events['price'];	
		
		if($Universal_Promo_Type == 'percent'){
			$GetPecentage = $Universal_Promo_Percent/100;
			$GetDiscount = $Universal_Events_Price * $GetPecentage;
		}
		else {
			$GetDiscount = $Universal_Promo_Amount;
		}
			

//Writes the information to the database
 mysqli_query($SMB, "UPDATE Cart SET promo_code='$Universal_Promo_Code', promo_amount='$GetDiscount' WHERE id='$Universal_Events_id'"); 
}}
		
// Check Books
$query_Universal_Books = "SELECT Cart.BookID, Cart.cid, Cart.id AS ID, Cart.status, Cart.price, SMB_Promo_Items.promo_id, SMB_Promo_Items.book_id
FROM Cart 
JOIN SMB_Promo_Items
ON Cart.BookID=SMB_Promo_Items.book_id
WHERE Cart.cid = '$cid' AND SMB_Promo_Items.promo_id = '$Universal_Promo_ID' AND Cart.BookID > 0";
$Universal_Books = mysqli_query($SMB, $query_Universal_Books);
$totalRows_Universal_Books = mysqli_num_rows($Universal_Books);
if($totalRows_Universal_Books > 0) {
	while($row_Universal_Books = mysqli_fetch_assoc($Universal_Books)){
		$Universal_Books_id = $row_Universal_Books['ID'];
		$Universal_Books_Price = $row_Universal_Books['price'];	
		
		if($Universal_Promo_Type == 'percent'){
			$GetPecentage = $Universal_Promo_Percent/100;
			$GetDiscount = number_format(($Universal_Books_Price * $GetPecentage), 2);
		}
		else {
			$GetDiscount = $Universal_Promo_Amount;
		}
			

//Writes the information to the database
 mysqli_query($SMB, "UPDATE Cart SET promo_code='$Universal_Promo_Code', promo_amount='$GetDiscount' WHERE id='$Universal_Books_id'"); 
}}

// Check Services
$query_Universal_Services = "SELECT Cart.ServiceID, Cart.cid, Cart.id AS ID, Cart.status, Cart.price, SMB_Promo_Items.promo_id, SMB_Promo_Items.service_id
FROM Cart 
JOIN SMB_Promo_Items
ON Cart.ServiceID=SMB_Promo_Items.service_id
WHERE Cart.cid = '$cid' AND Cart.status != 'Refresher' AND SMB_Promo_Items.promo_id = '$Universal_Promo_ID' AND Cart.ServiceID > 0";
$Universal_Services = mysqli_query($SMB, $query_Universal_Services);
$totalRows_Universal_Services = mysqli_num_rows($Universal_Services);
if($totalRows_Universal_Services > 0) {
	while($row_Universal_Services = mysqli_fetch_assoc($Universal_Services)){
		$Universal_Services_id = $row_Universal_Services['ID'];
		$Universal_Services_Price = $row_Universal_Services['price'];	
		
		if($Universal_Promo_Type == 'percent'){
			$GetPecentage = $Universal_Promo_Percent/100;
			$GetDiscount = number_format(($Universal_Services_Price * $GetPecentage), 2);
		}
		else {
			$GetDiscount = $Universal_Promo_Amount;
		}
			

//Writes the information to the database
 mysqli_query($SMB, "UPDATE Cart SET promo_code='$Universal_Promo_Code', promo_amount='$GetDiscount' WHERE id='$Universal_Services_id'"); 
}}		
}}
	
$TotalUpdated = $totalRows_Universal_Events + $totalRows_Universal_Books + $totalRows_Universal_Services;
	
	if($TotalUpdated > 0){
		$PromoMessage = '<h6 style="color:green;"><strong>Promo Code Applied!</strong></h6>';
	}
	
}
	
		
	else {
		$PromoMessage = ""; 

		
		}
		
// Show Promo Box		
		
		$DisplayPromo = '<div class="row"><div class="grid_11"><h6>Do you have a promo code?</h6><form id="form1" name="form1" method="post">
<div class="ProcessForm"><input name="PromoCode" type="text" id="PromoCode" placeholder="ENTER PROMO CODE"></div>
<div class="ProcessForm"><input type="submit" formaction="cart.php" value="APPLY PROMO" class="submitBtn">
<input name="Promo" type="hidden" id="Promo" value="Yes"></form></div><h6></h6></div></div>';


//Add Cart
if ((isset($_POST["Cart"])) && ($_POST["Cart"] == "Book")) {
  $name = "Successful Medical Billing: The Dentist’s Guide";
  $price = 295.00;
  $qty = 1;
  $date =$_POST['date'];
  $type = "Book";
  $book =  1;

      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, book, type) VALUES ('$cid', '$name', '$price', '$qty', '$date', '$book', '$type')"); 
   
   $AddGoTo = "../cart.php";
   header("Location: $AddGoTo");
   }

//Add Cart
if ((isset($_POST["Support"])) && ($_POST["Support"] == "Yes")) {
  $name =$_POST['product_name'];
  $qty = 1;
  $date =$_POST['date'];
  $shipping =$_POST['shipping'];
  $event =$_POST['event_id'];
  $FirstName = mysqli_real_escape_string($SMB, $_POST['first_name']);
  $LastName = mysqli_real_escape_string($SMB, $_POST['last_name']);
  $type =$_POST['type'];
  $start_date = date('Y-m-d', strtotime(str_replace('-', '/', $_POST['start_date'])));
  $ShowStart = date('F d', strtotime($start_date));
  $ServiceID = $_POST['ServiceID'];
  
  // Support Products

$query_Support = "SELECT * FROM SupportOptions WHERE id='$name'";
$Support = mysqli_query($SMB, $query_Support);
$totalRows_Support = mysqli_num_rows($Support);

if($totalRows_Support > 0){
	while($row_Support = mysqli_fetch_assoc($Support)){
		$Support_ID = $row_Support['id'];
		$Support_Title = $row_Support['name'];
		$Support_price = $row_Support['price'];	
		 
		
		$SupportName = 'Claiming Wheels - '.$Support_Title.' (30 days)';
		$Price = $Support_price;
		
	}}

// Get Courses

$query_Events = "SELECT * FROM Courses WHERE id='$event'";
$Events = mysqli_query($SMB, $query_Events);
$totalRows_Events = mysqli_num_rows($Events);

if($totalRows_Events > 0){
	while($row_Events = mysqli_fetch_assoc($Events)){
		$Events_ID = $row_Events['id'];
		$Events_Start_Date = date('F d', strtotime($row_Events['start_date']));
		$Events_End_Date = date('F d', strtotime($row_Events['end_date']));
		$Events_End_Year = date('Y', strtotime($row_Events['end_date']));
		$Events_City = $row_Events['city'];
		$Events_State = $row_Events['state'];
		
		if($Events_Start_Date == $Events_End_Date) {
			$Events_Date = $Events_Start_Date.", ".$Events_End_Year;
			
			}
		else {
			$Events_Date = $Events_Start_Date." - ".$Events_End_Date.", ".$Events_End_Year;
			
			}
			$CourseOption = ''.$Events_Date.'';
	}}
	
	$ProductName = ''.$SupportName.' <strong>Course Verify:</strong> '.$CourseOption.' - '.$FirstName.' '.$LastName.' <strong>Start Date:</strong> '.$ShowStart.'';
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, shipping, event, first_name, last_name, type, start_date, claimOption, ServiceID) VALUES ('$cid', '$ProductName', '$Price', '$qty', '$date', '$shipping', '$event', '$FirstName', '$LastName', '$type', '$start_date', '$SupportName', '$ServiceID')"); 
   
   $AddGoTo = "../cart.php";
   header("Location: $AddGoTo");
   }

//Add Cart
if ((isset($_POST["Book"])) && ($_POST["Book"] == "Yes")) {
  $name =$_POST['name'];
  $price =$_POST['price'];
  $qty =$_POST['qty'];
  $date =$_POST['date'];
  $shipping =$_POST['shipping'];
  $event =$_POST['event'];
  $type =$_POST['type'];
  $book =$_POST['book'];
  $level =$_POST['level'];
  $BookID = $_POST['BookID'];
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, shipping, event, book, type, level, BookID) VALUES ('$cid', '$name', '$price', '$qty', '$date', '$shipping', '$event', '$book', '$type', '$level', '$BookID')"); 
   
   $AddGoTo = "../cart.php";
   header("Location: $AddGoTo");
   }

//Add Cart
if ((isset($_POST["Phone"])) && ($_POST["Phone"] == "Yes")) {
  $name = mysqli_real_escape_string($SMB, $_POST['name']);
  $price = $_POST['price'];
  $qty = 1;
  $type = 'Phone';
  $ServiceID = $_POST['ServiceID'];
      
// Connects to your Database

//Writes the information to the database
 mysqli_query($SMB, "INSERT INTO Cart (cid, name, price, qty, date, type, ServiceID) VALUES ('$cid', '$name', '$price', '$qty', '$today', '$type', '$ServiceID')"); 
   
   $AddGoTo = "../cart.php";
   header("Location: $AddGoTo");
   }
   
 //Edit Cart
if((isset($_POST['Edit'])) && ($_POST['Edit'] == "Yes")) {
 $Edit_Qty = $_POST['qty'];
 $Edit_id = $_POST['id'];
      
// Connects to your Database

mysqli_query($SMB, "UPDATE Cart SET qty='$Edit_Qty' WHERE id = '$Edit_id'"); 
	
	$insertGoTo = "../cart.php";
	header("Location: $insertGoTo");

}


//Delete Cart
if((isset($_POST['Delete'])) && ($_POST['Delete'] == "Yes")) {
 $Delete_id = $_POST['id'];
      
// Connects to your Database

mysqli_query($SMB, "DELETE FROM Cart WHERE id = '$Delete_id'"); 
	
	$insertGoTo = "../cart.php";
	header("Location: $insertGoTo");

}

//Show Cart	
$courseBooks = "";
$Item_Price = "";

$query_ShoppingCart = "SELECT * FROM Cart WHERE cid = '$cid' ORDER BY id ASC";
$ShoppingCart = mysqli_query($SMB, $query_ShoppingCart);
$totalRows_ShoppingCart = mysqli_num_rows($ShoppingCart);

if($totalRows_ShoppingCart > 0) {
	while($row_ShoppingCart = mysqli_fetch_assoc($ShoppingCart)){
		$ShoppingCart_Name = $row_ShoppingCart['name'];
		$ShoppingCart_Qty = $row_ShoppingCart['qty'];
		$ShoppingCart_Price = $row_ShoppingCart['price'];
		$ShoppingCart_Status = $row_ShoppingCart['status'];
		$ShoppingCart_id = $row_ShoppingCart['id'];
		$ShoppingCart_Ship = $row_ShoppingCart['shipping'];
		$ShoppingCart_Book = $row_ShoppingCart['book'];
		$ShoppingCart_BookID = $row_ShoppingCart['bid'];		
		$ShoppingCart_Type = $row_ShoppingCart['type'];
		$ShoppingCart_EID = $row_ShoppingCart['event_id'];
		$ShoppingCart_Email = $row_ShoppingCart['email_address'];
		$ShoppingCart_FirstName = $row_ShoppingCart['first_name'];
		$ShoppingCart_LastName = $row_ShoppingCart['last_name'];
		$ShoppingCart_PromoCode = $row_ShoppingCart['promo_code'];
		$ShoppingCart_PromoAmount = $row_ShoppingCart['promo_amount'];
		
		
			
		
		
		$TotalBooks = $ShoppingCart_Book + $TotalBooks;
		if($TotalBooks > 0){
		$ShowBooks = '<tr><td align="right" nowrap="nowrap"><strong>Course Books Included:</strong></td><td align="right" nowrap="nowrap"><strong>'.$TotalBooks.'</strong></td></tr>';
			
			}
		else {
			$ShowBooks = '';
			}
			
		$TotalPromoDiscount = $ShoppingCart_PromoAmount + $TotalPromoDiscount;
		if($TotalPromoDiscount > 0){
		$ShowPromoDiscount = '<tr><td align="right" nowrap="nowrap" style="color:red;"><strong>Promo Discount:</strong></td><td align="right" nowrap="nowrap" style="color:red;"><strong>- $'.number_format($TotalPromoDiscount, 2).'</strong></td></tr>';
			
			}
		else {
			$ShowPromoDiscount = '';
			}

	
	
		
		if($ShoppingCart_Status == 'Register' || $ShoppingCart_Status == 'Refresher'){
			$Attending = $ShoppingCart_Name;
			
			$Attendees .= '<p>'.$Attending.' - <strong>Price: $'.$ShoppingCart_Price.'</strong></p>';
			$CountRegister = 1;
			$TotalRegister = $CountRegister + $TotalRegister;
			
			}
			if ($TotalRegister > 0){
			$CancelPolicy = '<div class="row"><div class="grid_11"><h5>Cancellation Policy</h5><p>Cancellation policy: 
All cancellation requests must be in writing. Full refund of the course fee will be granted for cancellation requests made seven (7) days or more prior to the scheduled course date. Fifty percent of the course fee will be refunded for cancellation requests received less than seven (7) days prior to the scheduled course date. Successful Medical Billing, LLC reserves the right to cancel any course, limit enrollment, modify the announced content, or change the location, time, date, and faculty of any course, as Successful Medical Billing, LLC may deem necessary or advisable. Should Successful Medical Billing, LLC cancel a course, Successful Medical Billing, LLCs liability is limited to a full refund of the course fee.</p></div></div>';		
			
						}
			else {
				$CancelPolicy = "";	
				
				}

		$shippingTotal = $ShoppingCart_Ship + $shippingTotal;			
		
		$TotalShipping = $ShoppingCart_Ship + $TotalShipping;
		
		if($TotalShipping > 0) {
			$shipping = 8.00;
		$Showshipping = '<tr><td align="right" nowrap="nowrap"><strong>Shipping:</strong></td>
                                      <td align="right" nowrap="nowrap"><strong>$'.number_format(8.00, 2).'</strong></td></tr>';
		}
		 else {
		$shipping = 0;
		$Showshipping = "";
			
			}
		

		
		$ShoppingCart_TotalPrice = $ShoppingCart_Price * $ShoppingCart_Qty;
		$ShoppingCart_TotalPrice2 = number_format($ShoppingCart_TotalPrice, 2);
		$SubTotal = $ShoppingCart_TotalPrice + $SubTotal;
		$SubTotal2 = number_format($SubTotal, 2);
		
	
			
		
		$ShoppingCart_Output .= '<tr>';
		$ShoppingCart_Output .= '<td align="left" valign="middle"></td>';
		$ShoppingCart_Output .= '<td width="70%" align="left" valign="middle" height="40px">'.$ShoppingCart_Name.'</br></td>';
		$ShoppingCart_Output .= ' <td width="10%" align="center" valign="middle" nowrap="nowrap">'.$ShoppingCart_Qty.'</td>';
		$ShoppingCart_Output .= '<td width="10%"align="center" valign="middle" nowrap="nowrap">$'.$ShoppingCart_Price.'</td>';
		$ShoppingCart_Output .= '<td width="10%" align="center" valign="middle" nowrap="nowrap"><span class="font100-small">$'.number_format($ShoppingCart_TotalPrice, 2).'</span></td>';
		$ShoppingCart_Output .= '<td width="40" align="center" valign="middle" nowrap="nowrap"><form action="php/cart.php" method="post" name="form7" id="form7">
                                      <input type="submit" value="" class="imgTrash" />
                                      <input name="id" type="hidden" id="id" value="'.$ShoppingCart_id.'">
                                      <input name="Delete" type="hidden" id="Delete" value="Yes">
                                    </form></td>';
		$ShoppingCart_Output .= '</tr>';
		
	}
// Discount Count
		
$query_Count_Event_ID = "SELECT COUNT(*) AS nCount, event_id, cid, status FROM Cart WHERE cid = '$cid' AND status = 'Register' GROUP BY event_id";
$Count_Event_ID = mysqli_query($SMB, $query_Count_Event_ID);
$totalRows_Count_Event_ID = mysqli_num_rows($Count_Event_ID);
if($totalRows_Count_Event_ID > 0){
	while($row_Count_Event_ID = mysqli_fetch_assoc($Count_Event_ID)){
		$Get_Event_ID = $row_Count_Event_ID['event_id'];
		$Event_ID_Count = $row_Count_Event_ID['nCount'];
		
		
$query_Count_Event_Type = "SELECT COUNT(*) AS tCount, event_id, cid, level, type, status FROM Cart WHERE cid = '$cid' AND event_id = '$Get_Event_ID' AND status = 'Register' GROUP BY type";
$Count_Event_Type = mysqli_query($SMB, $query_Count_Event_Type);
$totalRows_Count_Event_Type = mysqli_num_rows($Count_Event_Type);
if($totalRows_Count_Event_Type > 0){
	while($row_Count_Event_Type = mysqli_fetch_assoc($Count_Event_Type)){
		$Get_Type_ID = $row_Count_Event_Type['event_id'];
		$Get_Type_level = $row_Count_Event_Type['level'];
		$Get_Type_Type = $row_Count_Event_Type['type'];
		$Event_Type_Count = $row_Count_Event_Type['tCount'];
		
		$ShowType = $Get_Type_Type.'('. $Event_Type_Count.')';
		
		
		if($Get_Type_Type == 'Dentist'){
			$CountDentist = $Event_Type_Count;
			}
		if($Get_Type_Type == 'Staff'){
			$CountStaff = $Event_Type_Count;
			}
			
	
			
		

$query_Course_Info = "SELECT * FROM SMB_Courses WHERE id = '$Get_Type_level'";
$Course_Info = mysqli_query($SMB, $query_Course_Info);
$totalRows_Course_Info = mysqli_num_rows($Course_Info);
if($totalRows_Course_Info > 0){
	while($row_Course_Info = mysqli_fetch_assoc($Course_Info)){
		$Info_ID = $row_Course_Info['id'];
		$GroupQty = $row_Course_Info['group_qty'];
		$GroupRate = $row_Course_Info['group_rate'];
		$GroupDentist = $row_Course_Info['dentist'];
		$GroupStaff = $row_Course_Info['staff'];
	
		echo $GroupQty;
	
	$TotalCount = $Event_Type_Count + $TotalCount;
		
		echo $TotalCount; 
	
	if($TotalCount >= $GroupQty){
		$GetDiscountQty = $TotalCount - $GroupQty;
		}
		
		if($GroupDentist <= $GroupStaff && $Get_Type_Type == 'Dentist' && $Event_Type_Count < $GetDiscountQty){
			
			$DentistDiscount = 0.00;
			
			}
		if($GroupDentist <= $GroupStaff && $Get_Type_Type == 'Dentist' && $Event_Type_Count <= $GetDiscountQty){
			
			$DentistDiscount = $GroupDentist * ($GetDiscountQty *($GroupRate)/100);
			
			}
		if($Get_Type_Type == 'Dentist' && $GetDiscountQty > 0 && $CountStaff < 1 && $CountDentist > 0){
			
			$DentistDiscount = $GroupDentist * ($GetDiscountQty *($GroupRate)/100);
			
			}
			
		if($GroupDentist >= $GroupStaff && $Get_Type_Type == 'Staff' && $Event_Type_Count < $GetDiscountQty){
			
			$StaffDiscount = 0.00;
			
			}
		if($GroupDentist >= $GroupStaff && $Get_Type_Type == 'Staff' && $Event_Type_Count >= $GetDiscountQty){
			
			$StaffDiscount = $GroupStaff * ($GetDiscountQty *($GroupRate)/100);
			
			}
		if($Get_Type_Type == 'Staff' && $GetDiscountQty > 0 && $CountStaff > 0 && $CountDentist > $CountStaff){
			
			$StaffDiscount = $GroupStaff * ($CountStaff *($GroupRate)/100);
			
			}

			
				
			$Total_GroupDiscount = $DentistDiscount + $StaffDiscount;
	}}
	}}
	}}
			
	if($Total_GroupDiscount > 0){
	$ShowDiscount = '<tr><td align="right" nowrap="nowrap" style="color:red;"><strong>Group Discount:</strong></td>
                                      <td align="right" nowrap="nowrap" style="color:red;"><strong> - $'.number_format($Total_GroupDiscount, 2).'</strong></td></tr>';
	}
	else {
		
		$ShowDiscount = '';
		$Total_GroupDiscount = 0.00; 
		}
		$GrandTotalDiscounts = $TotalPromoDiscount + $Total_GroupDiscount; 
		
	    $GrandTotal = (($SubTotal + $shipping) - $GrandTotalDiscounts);
		$GrandTotal2 = number_format($GrandTotal, 2);
		

								
		$Register_Output .= '<h5>Billing & Shipping Information</h5><form id="form1" name="form1" method="post">
<div class="ProcessForm"><input name="paractice" type="text" id="paractice" placeholder="Practice Name"></div>
<div class="ProcessForm"><input name="address" type="text" id="address" placeholder="Address"></div>
<div class="ProcessForm"><input name="city" type="text" id="city" placeholder="City"></div>
<div class="ProcessForm"><input name="state" type="text" id="state" placeholder="State"></div>
<div class="ProcessForm"><input name="zip" type="text" id="zip" placeholder="Zip Code"></div>
<div class="ProcessForm"><input name="phone" type="text" id="phone" placeholder="Phone Number"></div>
<div class="ProcessForm"><input name="email" type="text" id="email" placeholder="Email Address"></div>
<div class="ProcessForm"><input name="cc_number" type="text" id="cc_number" placeholder="Credit Card"></div>
<div class="ProcessForm"><input name="exp_date" type="text" id="exp_date" placeholder="Exp. Date"></div>
<div class="ProcessForm"><input name="billing_zip" type="text" id="billing_zip" placeholder="Billing Zip Code"></div>
<div class="ProcessForm"><input type="submit" formaction="cart.php" value="Checkout" class="submitBtn">
<input name="ProcessForm" type="hidden" id="process" value="Yes"></div>
</form>';		
		

$Show_Attendees = '<div class="grid_7">
                                <h5 class=" wow fadeInLeft"></h5>
                                <h5 class=" wow fadeInLeft">Current Attendees</h5>
                                '.$Attendees.'
								<a class="btn_02" href="cart.php">Go to Cart</a>
                                </div>';
	
}
	else {
		
		$ShoppingCart_Output .= '<tr>';
		$ShoppingCart_Output .= '<td colspan="6" align="center" valign="middle">Your Cart is Empty!</td>';
		$ShoppingCart_Output .= '</tr>';
		$shipping = number_format(0.00, 2);
		$SubTotal2 = number_format(0.00, 2);
		$GrandTotal2 = number_format(0.00, 2);
		
		$Register_Output .= '';
		$AllRegister_Output .= '';
		$Show_Attendees .= '';

		}