Пример #1
0
function top_level_settings()
{
    global $themename, $cap;
    $cap = new autoconfig();
    if (!isset($_REQUEST['updated'])) {
        $_REQUEST['updated'] = false;
    }
    if (!empty($_POST) && !empty($_POST['custom_community_theme_options'])) {
        $options = get_option('custom_community_theme_options');
        $options = array_merge((array) $options, $_POST['custom_community_theme_options']);
        $options['cap_slideshow_cat'] = !empty($_POST['custom_community_theme_options']['cap_slideshow_cat']) ? serialize($options['cap_slideshow_cat']) : serialize(array());
        $options['cap_titles_post_types'] = !empty($_POST['custom_community_theme_options']['cap_titles_post_types']) ? serialize($options['cap_titles_post_types']) : serialize(array());
        update_option('custom_community_theme_options', $options);
        $cap = new autoconfig();
        do_action('cc_after_theme_settings_saved');
    }
    if (isset($_REQUEST['saved'])) {
        echo "<div id='message' class='updated fade'><p><strong>{$themename} settings saved.</strong></p></div>";
    }
    if (isset($_REQUEST['reset'])) {
        echo "<div id='message' class='updated fade'><p><strong>{$themename} settings reset.</strong></p></div>";
    }
    ?>
	
	<div class="wrap">
	
		<h2><b><?php 
    echo $themename;
    ?>
 <?php 
    _e('Settings', 'cc');
    ?>
</b></h2>
		<div class="error">
			<p>This theme is outdated by now. Please read the <a href="http://themekraft.com/blog/custom-community-2-0-current-status/" target="_blank" title="Blogpost about the current status of Custom Community Theme version 2.0">blogpost about the current status of version 2.0</a> - Get involved and help us making it the perfect WordPress theme for you!</p>
		</div>
		<div class="updated">
			<p><i>For all you early birds and Custom Community Lovers! Pre-order the CC 2.0 <b>Premium Pack</b> today and save 50%! &nbsp;&nbsp;<a class="button button-secondary" href="http://themekraft.com/store/custom-community-2-premium-pack/" target="_blank" title="Pre-order Custom Community 2.0 Premium Pack now and save 50%!">Checkout the deal here.</a></i></p>
		</div>
        <p class="additional_info"><?php 
    _e('Proudly brought to you by ', 'cc');
    ?>
<a class="themekraft-link" href="http://themekraft.com/" target="_new">ThemeKraft</a>.
		<br> 
		<a style="margin-top:10px;" href="http://support.themekraft.com/categories/20053996-custom-community" class="button button-secondary" target="_new"><?php 
    _e('Documentation', 'cc');
    ?>
</a> <a class="button button-secondary" href="http://themekraft.com/support/" style="margin-top:10px;" target="_blank"><?php 
    _e('Support', 'cc');
    ?>
</a>
		</p>
		
		<form method="post" action="">
		<?php 
    settings_fields('custom_community_options');
    ?>
	
		<div id="config-tabs">
			<ul>
                    <?php 
    $groups = cap_get_options();
    foreach ($groups as $group) {
        $role_section = substr($group->id, 4) . "_min_role";
        if (current_user_can('switch_themes') || current_user_can(strtolower($cap->{$role_section}))) {
            ?>
                            <li><a href='#<?php 
            echo $group->id;
            ?>
'><?php 
            echo $group->name;
            ?>
</a></li>
                        <?php 
        }
    }
    if (!defined('is_pro') && current_user_can('switch_themes')) {
        $cap_getpro = 'Go Pro';
        echo " <li><a href='#cap_getpro'>{$cap_getpro}</a></li>";
    }
    ?>
			</ul>
			<?php 
    foreach ($groups as $group) {
        $id = $group->id;
        $role_section = substr($id, 4) . "_min_role";
        if (current_user_can('switch_themes') || current_user_can(strtolower($cap->{$role_section}))) {
            ?>
                            <div id="<?php 
            echo $id;
            ?>
">
                                <?php 
            do_action('cc_before_settings_tab', $id);
            $group->WriteHtml();
            ?>
                            </div>
                        <?php 
        }
    }
    get_pro();
    ?>
		</div>
		
			<p class="submit">
				<input type="submit" class="button-primary" value="<?php 
    _e('Save Options', 'cc');
    ?>
" />
			</p>
			
		</form>
        <?php 
    if (current_user_can('switch_themes')) {
        ?>
            <!--Manage options-->
            <fieldset class="import-export">
                <legend><?php 
        _e('Managing settings data', CC_TRANSLATE_DOMAIN);
        ?>
</legend>
                <form enctype="multipart/form-data" method="post">
                    <p class="submit alignleft">
                        <input type="file" name="file" />
                    </p>
                    <p class="submit alignleft">
                        <input name="action" type="submit" value="<?php 
        _e('Import', 'cc');
        ?>
" />
                    </p>
                    <p class="submit alignleft">
                        <input name="action" type="submit" value="<?php 
        _e('Export', 'cc');
        ?>
" />
                    </p>
                    <p class="submit alignright">
                        <input name="action" type="submit" value="<?php 
        _e('Reset All Settings', 'cc');
        ?>
" />
                    </p>
            </form>
            </fieldset>
        <?php 
    }
    ?>
		<div class="clear"></div>
        <?php 
    /*?>
    		<h2><?php _e('Preview (updated when options are saved)','cc');?></h2>
    		<iframe src="<?php echo site_url( '?preview=true' ); ?>" width="100%" height="600" ></iframe>
             * 
             */
    ?>
	</div>
	<?php 
}
Пример #2
0
function top_level_settings()
{
    global $themename;
    if (!isset($_REQUEST['updated'])) {
        $_REQUEST['updated'] = false;
    }
    if (isset($_REQUEST['saved'])) {
        echo "<div id='message' class='updated fade'><p><strong>{$themename} settings saved.</strong></p></div>";
    }
    if (isset($_REQUEST['reset'])) {
        echo "<div id='message' class='updated fade'><p><strong>{$themename} settings reset.</strong></p></div>";
    }
    ?>

	<div class="wrap">
	
		<h2><b><?php 
    echo $themename;
    ?>
 Options</b></h2>
		 <p style="margin-bottom:20px; color:#000;">Custom Community is proudly brought to you by <a style="color:#abc214" href="http://themekraft.com/" target="_blank">Themekraft</a>.
		 <br>For support, check out the <a href="http://themekraft.com/forums/" target="_blank">FORUM</a> and <a href="http://themekraft.com/faq/" target="_blank">FAQ</a>. 
		 Looking for more? <a style="color:#ff9900" href="https://themekraft.com/theme/custom-community-pro/" target="_blank">Get the Full Version</a> </p>
		
		
	<form method="post" action="options.php">
	<?php 
    settings_fields('custom_community_options');
    ?>

	<div id="config-tabs">
		<ul>
			<?php 
    $groups = cap_get_options();
    foreach ($groups as $group) {
        ?>
				<li><a href='#<?php 
        echo $group->id;
        ?>
'><?php 
        echo $group->name;
        ?>
</a></li>
			<?php 
    }
    echo " <li><a href='#cap_getpro'>Get the Pro</a></li>";
    ?>
		</ul>
		<?php 
    foreach ($groups as $group) {
        ?>
			<div id='<?php 
        echo $group->id;
        ?>
'>
				<?php 
        $group->WriteHtml();
        ?>
			</div>
		<?php 
    }
    get_pro();
    ?>
	</div>
	
		<p class="submit">
			<input type="submit" class="button-primary" value="<?php 
    _e('Save Options', 'buddypress');
    ?>
" />
		</p>
		
	</form>
			<form enctype="multipart/form-data" method="post">
			<p class="submit alignleft">
				<input name="action" type="submit" value="Reset" />
			</p>
			<p class="submit alignleft" style='margin-left:20px'>
				<input name="action" type="submit" value="Export" />
			</p>
			<p class="submit alignleft">
				<input name="action" type="submit" value="Import" />
				<input type="file" name="file" />
			</p>
		</form>
		<div class="clear"></div>
		<h2>Preview (updated when options are saved)</h2>
		<iframe src="<?php 
    echo home_url('?preview=true');
    ?>
" width="100%" height="600" ></iframe>
	</div>
	<?php 
}
Пример #3
0
</td>
<td></td><td></td>
<td></td>
<td class="hidden-phone text-center"><?php 
    echo $people['Distance'] * 100000;
    ?>
 VNĐ </td>
<td class="hidden-phone text-center">1 tháng </td>
<td class="text-right"><?php 
    echo $people['Distance'] * 100000;
    ?>
 VNĐ</td>
</tr>

<?php 
    $pro = get_pro($_SESSION['is_valid']);
    $n = 3;
    $s = 0;
    foreach ($pro as $key => $i) {
        echo '<tr>';
        echo '<td>' . $n . '</td>';
        $n = $n + 1;
        echo '<td><strong>' . 'Lương dự án ' . $i['Name'] . '</strong></td>';
        echo '<td>' . '' . '</td>';
        echo '<td>' . '' . '</td>';
        echo '<td>' . '' . '</td>';
        echo '<td class="hidden-phone text-center">' . ($a = $i['SpH'] . ' VNĐ' . '</td>');
        echo '<td class="hidden-phone text-center">' . ($b = (strtotime($i['TTo']) - strtotime($i['TFrom'])) / (24 * 3600) . ' ngày' . '</td>');
        echo '<td class="hidden-phone text-right">' . ($pro_sal = $a * $b . ' VNĐ' . '</td>');
        echo '<input type="hidden" name="luongduan[' . $key . ']" value="Lương dự án ' . $i['Name'] . '<br>">';
        echo '</tr>';
Пример #4
0
/**
 * @param $num_proforma
 * fonction qui va generer le corps de la proforma
 */
function print_corps($num_proforma)
{
    $items = get_pro($num_proforma);
    $t = 0.0;
    $st = 0.0;
    foreach ($items as $item) {
        $t = $item['quantite'] * $item['prix_unitaire'];
        $st = $st + $t;
        echo '
            <tr>
                <td style="text-align: center;">' . $item['quantite'] . '</td>
                <td colspan="5">' . $item['designation'] . '</td>
                <td  style="text-align: center;" colspan="2">' . number_format($item['prix_unitaire'], 2, ',', '') . '</td>
                <td  style="text-align: center;" colspan="2">' . $t . '</td>
            </tr>
        ';
        $_SESSION['stt'] = $st;
        $_SESSION['tvat'] = $st * 0.1925;
        $_SESSION['ttct'] = $st + $_SESSION['tvat'];
    }
}