Browse Source

Update the uuid in many places.

Mark Crane 13 years ago
parent
commit
1ac8e2df43

+ 3 - 3
flashphoner/flashphoner.php

@@ -38,7 +38,7 @@ else {
 }
 require_once "includes/header.php";
 
-$extension_id = $_SESSION['user_extension_array'][0]['extension_id'];
+$extension_uuid = $_SESSION['user_extension_array'][0]['extension_uuid'];
 $extension = $_SESSION['user_extension_array'][0]['extension'];
 
 //get a list of assigned extensions for this user
@@ -52,7 +52,7 @@ $prepstatement->execute();
 $x = 0;
 $result = $prepstatement->fetchAll();
 foreach ($result as &$row) {
-	$extension_array[$x]['extension_id'] = $row["extension_id"];
+	$extension_array[$x]['extension_uuid'] = $row["extension_uuid"];
 	$extension_array[$x]['extension'] = $row["extension"];
 	$x++;
 }
@@ -73,7 +73,7 @@ if ($x < 1) {
 } else if ($x == 1) {
 	// DISPLAY THE PHONE HERE
 	$extension = $extension_array[0]['extension'];
-	$extension_id = $extension_array[0]['extension_id'];
+	$extension_uuid = $extension_array[0]['extension_uuid'];
 	include "phone_html.php";
 } else {
 	include "phone_choices_html.php";

+ 4 - 4
flashphoner/phone_choices_html.php

@@ -11,8 +11,8 @@ function submitform()
 
 function start_phone()
 {
-	var testvar = document.getElementById("extension_id").value; 
-	window.open("/flashphoner/phone.php?extension_id="+testvar+"&key=<?php echo $key;?>&username=<?php echo $_SESSION['username'] ?>", 
+	var testvar = document.getElementById("extension_uuid").value; 
+	window.open("/flashphoner/phone.php?extension_uuid="+testvar+"&key=<?php echo $key;?>&username=<?php echo $_SESSION['username'] ?>", 
 		"FlashPhoner", "height=300, width=230");
 }
 
@@ -20,10 +20,10 @@ function start_phone()
 
 <div>
 <form action="/flashphoner/phone.php" name="flashform">
-<select id="extension_id">
+<select id="extension_uuid">
 <?php 
 foreach($extension_array as $row)
-printf('<option value="%s">%s</option>'."\n", $row['extension_id'], $row['extension']);
+printf('<option value="%s">%s</option>'."\n", $row['extension_uuid'], $row['extension']);
 ?>
 </select>
 </form>

+ 1 - 1
flashphoner/phone_html.php

@@ -2,7 +2,7 @@
 
 function start_phone()
 {
-	window.open("/flashphoner/phone.php?key=<?php echo $key;?>&extension_id=<?php echo $extension_id;?>&username=<?php echo $_SESSION['username'] ?>", "FlashPhoner", "height=300, width=230, location=0, menubar=0");
+	window.open("/flashphoner/phone.php?key=<?php echo $key;?>&extension_uuid=<?php echo $extension_uuid;?>&username=<?php echo $_SESSION['username'] ?>", "FlashPhoner", "height=300, width=230, location=0, menubar=0");
 }
 
 </script>

+ 3 - 3
flashphoner/request_credentials.php

@@ -38,7 +38,7 @@ else {
 	echo "access denied";
 	exit;
 } */
-$extension_id = $_REQUEST['extension_id'];
+$extension_uuid = $_REQUEST['extension_uuid'];
 $key = $_REQUEST['key'];
 $username = $_REQUEST['username'];
 
@@ -69,14 +69,14 @@ if ($x < 1) {
 unset ($prepstatement);
 
 //get a list of assigned extensions for this user
-$sql = sprintf("select * from v_extensions where extension_id = '%s' and user_list like '%%|%s|%%'", $extension_id, $username);
+$sql = sprintf("select * from v_extensions where extension_uuid = '%s' and user_list like '%%|%s|%%'", $extension_uuid, $username);
 
 $prepstatement = $db->prepare(check_sql($sql));
 $prepstatement->execute();
 $x = 0;
 $result = $prepstatement->fetchAll();
 foreach ($result as &$row) {
-	$extension_array[$x]['extension_id'] = $row["extension_id"];
+	$extension_array[$x]['extension_uuid'] = $row["extension_uuid"];
 	$extension_array[$x]['extension'] = $row["extension"];
 	$extension_array[$x]['password'] = $row["password"];
 	$extension_array[$x]['user_context'] = $row["user_context"];

+ 6 - 6
invoices/v_invoice_items.php

@@ -26,7 +26,7 @@ require_once "includes/paging.php";
 		$sql = "";
 		$sql .= " select count(*) as num_rows from v_invoice_items ";
 		$sql .= " where domain_uuid = '$domain_uuid' ";
-		$sql .= " and invoice_id = '$invoice_id' ";
+		$sql .= " and invoice_uuid = '$invoice_uuid' ";
 		if (strlen($orderby)> 0) { $sql .= "order by $orderby $order "; }
 		$prep_statement = $db->prepare($sql);
 		if ($prep_statement) {
@@ -52,7 +52,7 @@ require_once "includes/paging.php";
 		$sql = "";
 		$sql .= " select * from v_invoice_items ";
 		$sql .= " where domain_uuid = '$domain_uuid' ";
-		$sql .= " and invoice_id = '$invoice_id' ";
+		$sql .= " and invoice_uuid = '$invoice_uuid' ";
 		if (strlen($orderby)> 0) { $sql .= "order by $orderby $order "; }
 		$sql .= " limit $rows_per_page offset $offset ";
 		$prep_statement = $db->prepare(check_sql($sql));
@@ -73,7 +73,7 @@ require_once "includes/paging.php";
 	echo thorderby('item_desc', 'Description', $orderby, $order);
 	echo "<th nowrap='nowrap'>Amount</th>\n";
 	echo "<td align='right' width='42'>\n";
-	echo "	<a href='v_invoice_items_edit.php?invoice_id=".$_GET['id']."&contact_uuid=".$contact_uuid."' alt='add'>$v_link_label_add</a>\n";
+	echo "	<a href='v_invoice_items_edit.php?invoice_uuid=".$_GET['id']."&contact_uuid=".$contact_uuid."' alt='add'>$v_link_label_add</a>\n";
 	echo "</td>\n";
 	echo "<tr>\n";
 
@@ -87,8 +87,8 @@ require_once "includes/paging.php";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$item_desc."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".number_format(($row['item_qty'] * $row['item_unit_price']), 2)."&nbsp;</td>\n";
 			echo "	<td valign='top' align='right'>\n";
-			echo "		<a href='v_invoice_items_edit.php?invoice_id=".$row['invoice_id']."&id=".$row['invoice_item_id']."&contact_uuid=".$contact_uuid."' alt='edit'>$v_link_label_edit</a>\n";
-			echo "		<a href='v_invoice_items_delete.php?invoice_id=".$row['invoice_id']."&id=".$row['invoice_item_id']."&contact_uuid=".$contact_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
+			echo "		<a href='v_invoice_items_edit.php?invoice_uuid=".$row['invoice_uuid']."&id=".$row['invoice_item_uuid']."&contact_uuid=".$contact_uuid."' alt='edit'>$v_link_label_edit</a>\n";
+			echo "		<a href='v_invoice_items_delete.php?invoice_uuid=".$row['invoice_uuid']."&id=".$row['invoice_item_uuid']."&contact_uuid=".$contact_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
 			echo "	</td>\n";
 			echo "</tr>\n";
 			if ($c==0) { $c=1; } else { $c=0; }
@@ -103,7 +103,7 @@ require_once "includes/paging.php";
 	echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
 	echo "		<td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
 	echo "		<td width='33.3%' align='right'>\n";
-	echo "			<a href='v_invoice_items_edit.php?invoice_id=".$_GET['id']."&contact_uuid=".$contact_uuid."' alt='add'>$v_link_label_add</a>\n";
+	echo "			<a href='v_invoice_items_edit.php?invoice_uuid=".$_GET['id']."&contact_uuid=".$contact_uuid."' alt='add'>$v_link_label_add</a>\n";
 	echo "		</td>\n";
 	echo "	</tr>\n";
  	echo "	</table>\n";

+ 3 - 3
invoices/v_invoice_items_delete.php

@@ -4,21 +4,21 @@ require_once "includes/config.php";
 
 if (count($_GET)>0) {
 	$id = check_str($_GET["id"]);
-	$invoice_id = check_str($_GET["invoice_id"]);
+	$invoice_uuid = check_str($_GET["invoice_uuid"]);
 	$contact_uuid = check_str($_GET["contact_uuid"]);
 }
 
 if (strlen($id)>0) {
 	$sql = "";
 	$sql .= "delete from v_invoice_items ";
-	$sql .= "where invoice_item_id = '$id' ";
+	$sql .= "where invoice_item_uuid = '$id' ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement->execute();
 	unset($sql);
 }
 
 require_once "includes/header.php";
-echo "<meta http-equiv=\"refresh\" content=\"2;url=v_invoices_edit.php?id=$invoice_id&contact_uuid=$contact_uuid\">\n";
+echo "<meta http-equiv=\"refresh\" content=\"2;url=v_invoices_edit.php?id=$invoice_uuid&contact_uuid=$contact_uuid\">\n";
 echo "<div align='center'>\n";
 echo "Delete Complete\n";
 echo "</div>\n";

+ 13 - 13
invoices/v_invoice_items_edit.php

@@ -5,7 +5,7 @@ require_once "includes/config.php";
 //action add or update
 	if (isset($_REQUEST["id"])) {
 		$action = "update";
-		$invoice_item_id = check_str($_REQUEST["id"]);
+		$invoice_item_uuid = check_str($_REQUEST["id"]);
 	}
 	else {
 		$action = "add";
@@ -13,7 +13,7 @@ require_once "includes/config.php";
 
 if (strlen(count($_REQUEST)) > 0) {
 	$contact_uuid = check_str($_REQUEST["contact_uuid"]);
-	$invoice_id = check_str($_REQUEST["invoice_id"]);
+	$invoice_uuid = check_str($_REQUEST["invoice_uuid"]);
 }
 
 //get http post variables and set them to php variables
@@ -27,7 +27,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 
 	$msg = '';
 	if ($action == "update") {
-		$invoice_item_id = check_str($_POST["invoice_item_id"]);
+		$invoice_item_uuid = check_str($_POST["invoice_item_uuid"]);
 	}
 
 	//check for all required data
@@ -53,7 +53,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 		if ($action == "add") {
 			$sql = "insert into v_invoice_items ";
 			$sql .= "(";
-			$sql .= "invoice_id, ";
+			$sql .= "invoice_uuid, ";
 			$sql .= "domain_uuid, ";
 			$sql .= "item_qty, ";
 			$sql .= "item_desc, ";
@@ -61,7 +61,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 			$sql .= ")";
 			$sql .= "values ";
 			$sql .= "(";
-			$sql .= "'$invoice_id', ";
+			$sql .= "'$invoice_uuid', ";
 			$sql .= "'$domain_uuid', ";
 			$sql .= "'$item_qty', ";
 			$sql .= "'$item_desc', ";
@@ -71,7 +71,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 			unset($sql);
 
 			require_once "includes/header.php";
-			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_invoices_edit.php?id=$invoice_id&contact_uuid=$contact_uuid\">\n";
+			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_invoices_edit.php?id=$invoice_uuid&contact_uuid=$contact_uuid\">\n";
 			echo "<div align='center'>\n";
 			echo "Add Complete $sql2\n";
 			echo "</div>\n";
@@ -81,17 +81,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 
 		if ($action == "update") {
 			$sql = "update v_invoice_items set ";
-			$sql .= "invoice_id = '$invoice_id', ";
+			$sql .= "invoice_uuid = '$invoice_uuid', ";
 			$sql .= "domain_uuid = '$domain_uuid', ";
 			$sql .= "item_qty = '$item_qty', ";
 			$sql .= "item_desc = '$item_desc', ";
 			$sql .= "item_unit_price = '$item_unit_price' ";
-			$sql .= "where invoice_item_id = '$invoice_item_id'";
+			$sql .= "where invoice_item_uuid = '$invoice_item_uuid'";
 			$db->exec(check_sql($sql));
 			unset($sql);
 
 			require_once "includes/header.php";
-			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_invoices_edit.php?id=$invoice_id&contact_uuid=$contact_uuid\">\n";
+			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_invoices_edit.php?id=$invoice_uuid&contact_uuid=$contact_uuid\">\n";
 			echo "<div align='center'>\n";
 			echo "Update Complete\n";
 			echo "</div>\n";
@@ -104,10 +104,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 
 //pre-populate the form
 	if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
-		$invoice_item_id = $_GET["id"];
+		$invoice_item_uuid = $_GET["id"];
 		$sql = "";
 		$sql .= "select * from v_invoice_items ";
-		$sql .= "where invoice_item_id = '$invoice_item_id' ";
+		$sql .= "where invoice_item_uuid = '$invoice_item_uuid' ";
 		$prep_statement = $db->prepare(check_sql($sql));
 		$prep_statement->execute();
 		$result = $prep_statement->fetchAll();
@@ -182,10 +182,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 
 	echo "	<tr>\n";
 	echo "		<td colspan='2' align='right'>\n";
-	echo "				<input type='hidden' name='invoice_id' value='$invoice_id'>\n";
+	echo "				<input type='hidden' name='invoice_uuid' value='$invoice_uuid'>\n";
 	echo "				<input type='hidden' name='contact_uuid' value='$contact_uuid'>\n";
 	if ($action == "update") {
-		echo "				<input type='hidden' name='invoice_item_id' value='$invoice_item_id'>\n";
+		echo "				<input type='hidden' name='invoice_item_uuid' value='$invoice_item_uuid'>\n";
 	}
 	echo "				<input type='submit' name='submit' class='btn' value='Save'>\n";
 	echo "		</td>\n";

+ 5 - 5
invoices/v_invoice_pdf.php

@@ -34,17 +34,17 @@ else {
 	exit;
 }
 
-//action invoice_id
+//action invoice_uuid
 	if (isset($_REQUEST["id"])) {
-		$invoice_id = check_str($_REQUEST["id"]);
+		$invoice_uuid = check_str($_REQUEST["id"]);
 	}
 
 //get the invoice details
 	$sql = "";
 	$sql .= "select * from v_invoices ";
 	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and invoice_id = '$invoice_id' ";
-	$sql .= "order by invoice_id desc ";
+	$sql .= "and invoice_uuid = '$invoice_uuid' ";
+	$sql .= "order by invoice_uuid desc ";
 	$sql .= "limit 1 ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	if ($prep_statement) {
@@ -233,7 +233,7 @@ else {
 	$sql = "";
 	$sql .= "select * from v_invoice_items ";
 	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and invoice_id = '$invoice_id' ";
+	$sql .= "and invoice_uuid = '$invoice_uuid' ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement->execute();
 	$result = $prep_statement->fetchAll();

+ 2 - 2
invoices/v_invoices.php

@@ -131,8 +131,8 @@ require_once "includes/paging.php";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['n_family']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['invoice_date']."&nbsp;</td>\n";
 			echo "	<td valign='top' align='right'>\n";
-			echo "		<a href='v_invoices_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['invoice_id']."' alt='edit'>$v_link_label_edit</a>\n";
-			echo "		<a href='v_invoices_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['invoice_id']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
+			echo "		<a href='v_invoices_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['invoice_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
+			echo "		<a href='v_invoices_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['invoice_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
 			echo "	</td>\n";
 			echo "</tr>\n";
 			if ($c==0) { $c=1; } else { $c=0; }

+ 1 - 1
invoices/v_invoices_delete.php

@@ -18,7 +18,7 @@ if (count($_GET)>0) {
 if (strlen($id)>0) {
 	$sql = "";
 	$sql .= "delete from v_invoices ";
-	$sql .= "where invoice_id = '$id' ";
+	$sql .= "where invoice_uuid = '$id' ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement->execute();
 	unset($sql);

+ 7 - 7
invoices/v_invoices_edit.php

@@ -37,7 +37,7 @@ else {
 //action add or update
 	if (isset($_REQUEST["id"])) {
 		$action = "update";
-		$invoice_id = check_str($_REQUEST["id"]);
+		$invoice_uuid = check_str($_REQUEST["id"]);
 	}
 	else {
 		$action = "add";
@@ -55,7 +55,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 
 	$msg = '';
 	if ($action == "update") {
-		$invoice_id = check_str($_POST["invoice_id"]);
+		$invoice_uuid = check_str($_POST["invoice_uuid"]);
 	}
 
 	//check for all required data
@@ -115,7 +115,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 				$sql .= "contact_uuid_to = '$contact_uuid_to', ";
 				$sql .= "invoice_notes = '$invoice_notes' ";
 				$sql .= "where domain_uuid = '$domain_uuid' ";
-				$sql .= "and invoice_id = '$invoice_id' ";
+				$sql .= "and invoice_uuid = '$invoice_uuid' ";
 				$db->exec(check_sql($sql));
 				unset($sql);
 
@@ -132,11 +132,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 
 //pre-populate the form
 	if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
-		$invoice_id = $_GET["id"];
+		$invoice_uuid = $_GET["id"];
 		$sql = "";
 		$sql .= "select * from v_invoices ";
 		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and invoice_id = '$invoice_id' ";
+		$sql .= "and invoice_uuid = '$invoice_uuid' ";
 		$prep_statement = $db->prepare(check_sql($sql));
 		$prep_statement->execute();
 		$result = $prep_statement->fetchAll();
@@ -159,7 +159,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 		$sql = "";
 		$sql .= "select * from v_invoices ";
 		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "order by invoice_id desc ";
+		$sql .= "order by invoice_uuid desc ";
 		$sql .= "limit 1 ";
 		$prep_statement = $db->prepare(check_sql($sql));
 		if ($prep_statement) {
@@ -319,7 +319,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 	echo "	<tr>\n";
 	echo "		<td colspan='2' align='right'>\n";
 	if ($action == "update") {
-		echo "				<input type='hidden' name='invoice_id' value='$invoice_id'>\n";
+		echo "				<input type='hidden' name='invoice_uuid' value='$invoice_uuid'>\n";
 	}
 	echo "				<input type='submit' name='submit' class='btn' value='Save'>\n";
 	echo "		</td>\n";