selfservice quotations, #33852
[freeside.git] / ng_selfservice / quotation_remove_pkg.php
diff --git a/ng_selfservice/quotation_remove_pkg.php b/ng_selfservice/quotation_remove_pkg.php
new file mode 100644 (file)
index 0000000..07548c7
--- /dev/null
@@ -0,0 +1,31 @@
+<? require('elements/session.php');
+
+$dest = 'quotation.php';
+
+if ( isset($_REQUEST['pkgnum']) ) {
+
+  $results = array();
+
+  $params = array( 'custnum', 'pkgnum' );
+
+  $matches = array();
+  if ( preg_match( '/^(\d+)$/', $_REQUEST['pkgnum'] ) ) {
+
+    $args = array(
+        'session_id' => $_COOKIE['session_id'],
+        'pkgnum'     => $_REQUEST['pkgnum'],
+    );
+
+    $results = $freeside->quotation_remove_pkg($args);
+
+  }
+
+  if ( isset($results['error']) && $results['error'] ) {
+    $dest .= '?error=' . $results['error'];
+  }
+
+}
+
+header("Location:$dest");
+
+?>