/** * Get a field * * @access public * @param string $field * @return mixed */ public function __get($key) { if ($key == 'reseller') { return Reseller::get_by_id($this->reseller_id); } else { return $this->details[$key]; } }
function print_form($post_data, $errors) { $reseller = new Reseller(); try { $msisdn = $_GET['id']; $reseller->get($msisdn); } catch (ResellerException $e) { echo "<img src='img/false.png' width='200' height='170' /><br/><br/>"; echo "<span style='font-size: 20px; color: red;'>" . _("ERROR GETTING RESELLER INFO!") . "<br/> " . $e->getMessage() . " </span><br/><br/><br/><br/>"; echo "<a href='#' onclick=\"parent.jQuery.fancybox.close()\"><button class='b1'>" . _("Close") . "</button></a>"; } ?> <br/> <div id="stylized" class="myform"> <form id="form" name="form" method="post" action="reseller_delete.php"> <h1><?php echo _("Delete Reseller"); ?> </h1><br/> <input type="hidden" name="msisdn" value="<?php echo $reseller->msisdn; ?> " /> <?php echo _("Confirm deletion of"); ?> <?php echo $reseller->msisdn; ?> <button type="submit" name="delete_reseller"><?php echo _("Delete"); ?> </button> <div class="spacer"></div> </form> </div> <?php }
function print_form($post_data, $errors) { try { $reseller = new Reseller(); $messages = $reseller->get('messages'); } catch (ResellerException $e) { echo "<img src='img/false.png' width='200' height='170' /><br/><br/>"; echo "<span style='font-size: 20px; color: red;'>" . _("ERROR GETTING INFO!") . $e->getMessage() . " </span><br/><br/><br/><br/>"; echo "<a href='resellers_configuration.php'><button class='b1'>" . _("Go Back") . "</button></a>"; } $message1 = $_POST['message1'] != '' ? $_POST['message1'] : $messages[0]; $message2 = $_POST['message2'] != '' ? $_POST['message2'] : $messages[1]; $message3 = $_POST['message3'] != '' ? $_POST['message3'] : $messages[2]; $message4 = $_POST['message4'] != '' ? $_POST['message4'] : $messages[3]; $message5 = $_POST['message5'] != '' ? $_POST['message5'] : $messages[4]; $message6 = $_POST['message6'] != '' ? $_POST['message6'] : $messages[5]; ?> <div id="stylized" class="myform" style='width: 520px;'> <form id="form" name="form" method="post" action="resellers_configuration.php"> <h1><?php echo _("Configure reseller notification messages"); ?> </h1><br/> <span style='color: red; font-size: 12px;'><?php echo $errors; ?> </span><br/> <label><?php echo _("Invalid data"); ?> <span class="small"><?php echo _("Invalid data sent to the shortcode"); ?> </span> </label> <textarea style='margin-left: -15px;' rows="6" cols="23" name="message1" id="message1"><?php echo $message1; ?> </textarea> <label><?php echo _("Reseller not enough credit1"); ?> <span class="small"><?php echo _("Message sent to the subscriber"); ?> </span> </label> <textarea style='margin-left: -15px;' rows="6" cols="23" name="message2" id="message2"><?php echo $message2; ?> </textarea> <label><?php echo _("Reseller not enough credit2 "); ?> <span class="small"><?php echo _("Message sent to the reseller"); ?> </span> </label> <textarea style='margin-left: -15px;' rows="6" cols="23" name="message3" id="message3"><?php echo $message3; ?> </textarea> <label><?php echo _("Credit added successfully to subscriber account"); ?> <span class="small"><?php echo _("Message sent to the subscriber"); ?> </span> </label> <textarea style='margin-left: -15px;' rows="6" cols="23" name="message4" id="message4"><?php echo $message4; ?> </textarea> <label><?php echo _("Credit added successfully to subscriber account"); ?> <span class="small"><?php echo _("Message sent to the Reseller"); ?> </span> </label> <textarea style='margin-left: -15px;' rows="6" cols="23" name="message5" id="message5"><?php echo $message5; ?> </textarea> <label><?php echo _("General error"); ?> <span class="small"><?php echo _("General error notice message"); ?> </span> </label> <textarea style='margin-left: -15px;' rows="6" cols="23" name="message6" id="message6"><?php echo $message6; ?> </textarea> <button type="submit" name="save_messages"><?php echo _("Save"); ?> </button> <div class="spacer"></div> </form> </div> <?php }
<?php /* * delete_reseller.php */ require '../inc.php'; //var_dump($_POST); if (isset($_REQUEST['id'])) { $reseller_id = $_REQUEST['id']; } else { header('location: index.php'); } $myReseller = new Reseller($reseller_id, true); if (isset($_POST['submitted'])) { if (isset($_POST['confirm']) && $_POST['confirm'] == "1") { //delete the reseller record information $myReseller->deleteReseller(); header('location: index.php'); } if (!isset($_POST['confirm'])) { //tell user that they have to check the box to confirm the reseller delete action $confirmDeleteMessage = '<div class="validation_error">Must check the "confirm delete" checkbox to delete this reseller.</div>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Delete reseller</title> <script type="text/javascript" src="/admin/reseller_locator/js/jquery.1.3.2.js"></script>
// die("Reseller module not authorized.<br />Ask at www.leoferrarezi.com"); // } //} require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Language/{$MainLanguage}/Reseller.php"; if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/GeneralContent.tpl.php")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/MuDatabase.class.php"; $db = new MuDatabase(); require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php"; $acc = new Account($db); $my_array['GeneralTitle'] = $ResellerMsg01; $my_array['GeneralContent'] = ""; $db->Query("SELECT memb___id FROM Z_Resellers WHERE memb___id = '" . $acc->memb___id . "'"); if ($db->NumRows() < 1) { $return = "<div class=\"ResellerIntroDiv\">{$ResellerMsg02}</div>"; } else { require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Reseller.class.php"; $rs = new Reseller(); if (!isset($_POST['cust_memb___id']) || empty($_POST['cust_memb___id'])) { $return = $rs->ResellerForm($db, $acc); } else { $return = $rs->TransferResellerCredits($db, $acc, $_POST['cust_memb___id'], $_POST['cust_amount']); } } $my_array['GeneralContent'] = $return; $db->Disconnect(); $tpl = new Template(); $tpl->Assign($my_array); $tpl->Display($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/GeneralContent.tpl.php"); } else { echo "ERROR: File Templates/{$MainTemplate}/GeneralContent.tpl.php doesnt exists"; }
/** * Get all resellers * * @access public * @return array Reseller */ public static function get_all() { $client = new \Tigron\CP\Client\Soap('http://api.tigron.net/soap/reseller?wsdl'); $reseller_info = $client->get_all(); $resellers = []; foreach ($reseller_info as $info) { $resellers[] = Reseller::get_by_id($info['id']); } return $resellers; }
$sanity = new Sanity(); require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/System/LoggedOnly.class.php"; new LoggedOnly(); require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/IniSets.class.php"; new IniSets(); require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/System/Manager.class.php"; $mn = new Manager(); require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/MuDatabase.class.php"; $db = new MuDatabase(); if ($mn->GetUserLevel($_SESSION['ManagerId'], $db) < $ManagerResellerLevel) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Manager.php"; $db->Disconnect(); exit("{$ManagerMessage01}"); } require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/System/Reseller.class.php"; $rs = new Reseller(); switch ($_GET['action']) { default: case "manage": echo $rs->ManageResellers($db); break; case "new": echo $rs->NewResellerForm(); break; case "saveNewReseller": echo $rs->SaveNewReseller($db, $_POST); break; case "deleteReseller": $rs->DeleteReseller($db, $_POST['idx']); break; case "saveReseller":
/* * add_reseller.php * */ require '../inc.php'; //end testing... /* * if we get to this point we've... * -not posted any form data * -failed to save (possibly due to failed validation attempt) */ if ($GLOBALS['debug']) { var_dump($_POST); } $myReseller = new Reseller(); if (isset($_POST) && !empty($_POST)) { $myReseller->saveReseller(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Add reseller</title> <script type="text/javascript" src="/admin/reseller_locator/js/jquery.1.3.2.js"></script> <link href="/admin/reseller_locator/css/newtek_nav.css" rel="stylesheet" type="text/css" /> <link href="/admin/reseller_locator/css/tri_subnav.css" rel="stylesheet" type="text/css" /> <link href="/admin/reseller_locator/css/tricaster_main.css" rel="stylesheet" type="text/css" />
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); DB::table('resellers')->delete(); Reseller::create(array('username' => 'reseller_1', 'name' => 'Reseller Nr 1', 'description' => 'Der beste Reseller aller Zeiten.', 'url' => 'http://www.tagesschau.de', 'active' => true)); }
if ($pin == "" || strlen($pin) > 5 || !is_numeric($pin)) { $error_txt .= _("Reseller PIN is invalid") . "<br/>"; } if ($amount == "") { $error_txt .= _("Initial balance is empty") . "<br/>"; } } if (isset($_POST['add_reseller']) && $error_txt != "") { print_form(1, $error_txt); } elseif (isset($_POST['add_reseller']) && $error_txt == "") { // no error process form $msisdn = $_POST['msisdn']; $pin = $_POST['pin']; $amount = $_POST['amount']; echo "<center>"; $reseller = new Reseller(); try { $reseller->set($msisdn, $pin, $amount); $reseller->create(); echo "<img src='img/true.png' width='200' height='170' /><br/><br/>"; echo "<span style='font-size: 20px;'>" . _("Reseller number") . ": <b>{$pin}</b> " . _("Successfully provisioned with an initial balance of") . " {$amount}<br/><br/>"; echo "<a href='resellers_provisioning.php'><button class='b1'>" . _("Go Back") . "</button></a>"; } catch (ResellerException $e) { echo "<img src='img/false.png' width='200' height='170' /><br/><br/>"; echo "<span style='font-size: 20px; color: red;'>" . _("ERROR PROVISIONING RESELLER!") . " </span><br/>" . $e->getMessage() . "<br/><br/><br/>"; echo "<a href='resellers_provisioning.php'><button class='b1'>" . _("Go Back") . "</button></a>"; } echo "</center>"; } else { print_form(0, ''); }