Ejemplo n.º 1
0
 public function update_check($transient)
 {
     $request = VD()->api->update_check($this->product, $this->product->get_key());
     if ($request->is_error()) {
         $this->add_notice($request->get_response());
     } else {
         if ($request->get_response("notice")) {
             $this->add_notice((array) $request->get_response("notice"), 'error');
         }
         if ($request->get_response("payload")) {
             $payload = $request->get_response("payload");
             // Do only add transient if remote version is newer than local version
             if (version_compare($payload->new_version, $this->product->Version, "<=")) {
                 return $transient;
             }
             // Set plugin/theme file (seems to be necessary as for 4.2)
             if (!$this->product->is_theme()) {
                 $payload->plugin = $this->product->file;
                 $payload->slug = sanitize_title($this->product->Name);
             } else {
                 $payload = (array) $payload;
                 $payload['theme'] = $this->product->file;
             }
             $transient->response[$this->product->is_theme() ? $this->product->Name : $this->product->file] = $payload;
         }
     }
     return $transient;
 }
Ejemplo n.º 2
0
 public function do_request()
 {
     // Send request
     $this->raw = wp_remote_post(VD()->get_api_url(), array('method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array('user-agent' => 'Vendidero/' . VD()->version), 'body' => $this->args, 'cookies' => array(), 'sslverify' => false));
     if ($this->raw != '') {
         $this->response = json_decode(wp_remote_retrieve_body($this->raw));
     }
 }
Ejemplo n.º 3
0
$products = get_option('vendidero_notice_expire');
?>

<div class="error fade">
	<h3><?php 
_e('Update & Support Flatrate expires', 'vendidero-helper');
?>
</h3>
	<p>
		<?php 
_e('It seems like the Update & Support Flatrate of one of your Vendidero products expires in a few days:', 'vendidero-helper');
?>
	</p>
	<?php 
foreach ($products as $key => $val) {
    $product = VD()->products[$key];
    ?>
		<p><strong><?php 
    echo $product->Name;
    ?>
</strong></p>
		<a class="button button-primary" href="<?php 
    echo $product->get_renewal_url();
    ?>
" target="_blank"><?php 
    _e('renew now', 'vendidero-helper');
    ?>
</a>
	<?php 
}
?>
Ejemplo n.º 4
0
 public function set_meta()
 {
     $this->meta = VD()->plugins[$this->file];
 }
Ejemplo n.º 5
0
 public function expire_cron()
 {
     $this->api = new VD_API();
     $this->includes();
     $this->load();
     if (!empty($this->products)) {
         foreach ($this->products as $key => $product) {
             if (!$product->is_registered()) {
                 continue;
             }
             $expire = VD()->api->expiration_check($product);
             if ($expire) {
                 $product->set_expiration_date($expire);
             }
             if ($expire = $product->get_expiration_date(false)) {
                 $diff = VD()->get_date_diff(date('Y-m-d'), $expire);
                 $notice = get_option('vendidero_notice_expire', array());
                 if (strtotime($expire) <= time() || empty($diff['y']) && empty($diff['m']) && $diff['d'] <= 7) {
                     $notice[$key] = true;
                 }
                 update_option('vendidero_notice_expire', $notice);
             }
         }
     }
 }
Ejemplo n.º 6
0
function WExcel($sql, $Titulo)
{
    VD("A1");
    ob_start();
    $objPhp = new PHPExcel();
    $con = new mysqli('localhost', 'root', '', 'fri');
    $res = $con->query($sql);
    $ncol = $con->field_count;
    $nreg = $con->affected_rows;
    $nomcol = array();
    VD("A2");
    for ($i = 0; $i <= $ncol; $i++) {
        $info = $res->fetch_field_direct($i);
        $nomcol[$i] = $info->name;
    }
    VD("A3");
    $col = 'A';
    $objPhp->getActiveSheet()->setTitle($Titulo);
    foreach ($nomcol as $columns) {
        $objPhp->getActiveSheet()->setCellValue($col . "1", $columns);
        $col++;
    }
    VD("A4");
    $rowNumber = 2;
    while ($row = $res->fetch_row()) {
        $col = 'A';
        foreach ($row as $cell) {
            $objPhp->getActiveSheet()->setCellValue($col . $rowNumber, $cell);
            $col++;
        }
        $rowNumber++;
    }
    VD("A5");
    $usu = $_SESSION['Usuario']['string'];
    $emp = $_SESSION['Empresa']['string'];
    $fh = date('ymdhms');
    $archivo = 'Rep' . $usu . $emp . $fh . '.xlsx';
    header('Content-type: text/html; charset=UTF-8');
    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
    header('Content-type: application/vnd.ms-excel');
    header('Content-Disposition: attachment; filename=' . $archivo);
    VD("A6");
    $objWriter = new PHPExcel_Writer_Excel2007($objPhp);
    $objWriter->save('../_files/' . $Titulo);
    W('<script>redireccionar("../_files/' . $Titulo . '")</script>');
    VD("A7");
    mysqli_close($con);
    VD("A8");
}
Ejemplo n.º 7
0
 public function enqueue_scripts()
 {
     wp_register_script('vd_admin_js', VD()->plugin_url() . '/assets/js/vd-admin.js', array('jquery'));
     wp_enqueue_script('vd_admin_js');
 }
Ejemplo n.º 8
0
 public function set_meta()
 {
     $this->meta = VD()->themes[$this->file];
 }
 public function save($settings)
 {
     $generator = sanitize_title($_POST['generator']);
     $product = WC_germanized_pro()->get_vd_product();
     // Delete hidden options
     $options = $this->get_options($generator . '_');
     if (!empty($options)) {
         foreach ($options as $key => $option) {
             if (!isset($_POST[$generator . '_' . $key])) {
                 delete_option($generator . '_' . $key);
             }
         }
     }
     if (!$product->is_registered()) {
         WC_Admin_Settings::add_error(_x('Please register WooCommerce Germanized Pro to enable the Generator.', 'generator', 'woocommerce-germanized-pro'));
     }
     $version = $this->get_version($generator);
     $remote = VD()->api->generator_version_check($product, $generator);
     if (!$remote) {
         return;
     }
     if (version_compare($version, $remote->version, "<")) {
         WC_Admin_Settings::add_error(_x('Seems like the Generator Version is not up to date. Please refresh before generating.', 'generator', 'woocommerce-germanized-pro'));
     }
     // Get data
     $data = array();
     if (!empty($settings)) {
         foreach ($settings as $key => $setting) {
             if (isset($_POST[$setting['id']])) {
                 $data[$setting['id']] = apply_filters('woocommerce_gzdp_generator_setting_' . $setting['id'], !is_array($_POST[$setting['id']]) ? esc_attr($_POST[$setting['id']]) : (array) $_POST[$setting['id']], $setting);
             }
         }
     }
     $result = VD()->api->generator_result_check($product, $generator, $data, $this->get_options('woocommerce_', $remote->settings));
     if (!$result) {
         WC_Admin_Settings::add_error(_x('There seems to be a problem while generating. Is your update flatrate still active?', 'generator', 'woocommerce-germanized-pro'));
     } else {
         $this->populate_settings_observal($generator);
         set_transient('woocommerce_gzdp_generator_' . $generator, $result, 3 * HOUR_IN_SECONDS);
         set_transient('woocommerce_gzdp_generator_success_' . $generator, $result, 3 * HOUR_IN_SECONDS);
     }
     remove_action('woocommerce_gzd_after_save_section_' . $generator, array($this, 'save'), 0);
 }
 public function get_vd_product()
 {
     return VD()->get_product($this->plugin_file);
 }
Ejemplo n.º 11
0
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
?>

<div class="about-wrap">

	<div class="col-wrap">

		<form id="register" method="post" action="" class="validate">
			<input type="hidden" name="action" value="vd_register" />
			<input type="hidden" name="page" value="vendidero" />
			
			<?php 
$table = new VD_Admin_License_Table();
$table->data = VD()->get_products(false);
$table->prepare_items();
$table->display();
submit_button(__('Register Products', 'vendidero-helper'), 'button-primary');
?>

			<?php 
wp_nonce_field('bulk_licenses');
?>

		</form>

	</div>

</div>
function EditarGrilla($Codigo, $nTipAsiento)
{
    VD("1");
    global $ConexionEmpresa, $enlace;
    $tSelectD = array('Tipo_Asiento' => 'SELECT Codigo,Descripcion FROM ct_tipo_asiento', 'Moneda' => 'SELECT Codigo,Abreviatura AS Descripcion FROM ct_moneda', 'Tipo_Documento' => 'SELECT Codigo,Descripcion FROM ct_tipo_documento', 'Auxiliar' => 'SELECT Codigo,RazonSocial FROM ct_entidad', 'LibroContable' => 'SELECT Codigo,Descripcion FROM ct_libros_contables WHERE Codigo=2', 'Cuenta' => 'SELECT ct_plan_cuentas.Cuenta,  CONCAT(ct_plan_cuentas.Cuenta,"  ",ct_plan_cuentas.Denominacion)
                                           FROM ct_configuracion_tipo_asiento_det as tad
                                           INNER JOIN ct_plan_cuentas ON ct_plan_cuentas.codigo=tad.cuenta
                                           WHERE tad.CtaSuscripcion=' . $_SESSION['CtaSuscripcion'] . ' AND tad.configuracion_tipo_asiento=' . $nTipAsiento . '');
    $uRLForm = "Actualizar]" . $enlace . "?metodo=AsientoDet&transaccion=UPDATE&codAsi=" . $codAsi . "&codAsiDet=" . $codAsiDet . "&cDocNumero=" . $cDocNumero . "&cDocSerie=" . $cDocSerie . "]PanelB1]F]}";
    $uRLForm .= "Eliminar]" . $enlace . "?metodo=AsientoDet&transaccion=DELETE&codAsi=" . $codAsi . "&codAsiDet=" . $codAsiDet . "]PanelB1]F]}";
    $uRLForm .= "Cancelar]" . $enlace . "?RegAsientCon=Editar&codAsi=" . $codAsi . "&codAsiDet=" . $codAsiDet . "]PanelB1]F]}";
    $form = c_form_adp('', $ConexionEmpresa, "AsientoDet", "CuadroB", '', $uRLForm, '', $tSelectD, 'Codigo');
    $panelA = layoutV2('', $form);
    $panel = array(array('PanelTA', '100%', $panelA));
    $html = LayoutPage($panel);
    $html = "<div style='height: 100%;padding: 10px;'  >" . $html . "</div>";
    return $html;
}