Advertisement
Guest User

single-invitations.php

a guest
Aug 31st, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 34.64 KB | None | 0 0
  1. <?php
  2. global $global_page_layout;
  3. $single_page_layout = get_post_meta(get_the_ID(),'sidebar_layout',true);
  4. $content_padding = get_post_meta(get_the_ID(),'content_padding',true);
  5. $layout = $single_page_layout ? $single_page_layout : ($global_page_layout ? $global_page_layout : ot_get_option('post_layout','right'));
  6. $global_page_layout = $layout;
  7. get_header();
  8. ?>
  9.   <script src="<?php echo get_template_directory_uri(); ?>/js/tableToExcel.js"></script>
  10.     <?php get_template_part( 'header', 'heading' ); ?>  
  11.     <div id="body">
  12.         <div class="container">
  13.             <?php if($content_padding!='off'){ ?>
  14.             <div class="content-pad-3x">
  15.             <?php }?>
  16.                 <div class="row">
  17.                     <div id="content" class="<?php echo $layout!='full'?'col-md-9':'col-md-12' ?><?php echo ($layout == 'left') ? " revert-layout":"";?>" role="main">
  18.                         <article class="single-post-content single-content">
  19. <?php if (is_user_logged_in()){ ?>    
  20. <style>
  21. .table-grid {
  22.   width: 100%;
  23.   margin-bottom: 1em;
  24.   border-collapse: collapse;
  25.   border-spacing: 0;
  26. }
  27.  
  28. .table-grid th, table td {
  29.   border: 1px solid #ccc;
  30.   padding: 0.5em;
  31. }
  32.  
  33. /**
  34.  * Force table cells to all render at the same width.
  35.  */
  36. .table-grid {
  37.   table-layout: fixed;
  38. }
  39. </style>
  40.  
  41. <?php
  42. if (isset($_GET['needs'])) { ?>
  43.        
  44. <?php
  45.  
  46.     // Find connected pages
  47.     $connected = new WP_Query( array(
  48.         'connected_type' => 'invitation_to_graphicdesign',
  49.         'connected_items' => $post,
  50.         'nopaging' => true
  51.     ) );
  52.     // Display connected pages
  53.      if ( $connected->have_posts() ) :
  54. ?>
  55. <table id="invitationlistexport" class="table-grid  demo">
  56.     <thead style="display: table-header-group">
  57.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  58.         <td colspan="5">
  59. <h3 style="color:#FFFFFF;text-align: center;">Graphic Design</h3></tr>
  60.         </td>
  61.    
  62.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  63.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">التصاميم</h3></th>
  64.             <th width="20%"  align="center">الكمية</th>
  65.             <th width="20%"  align="center">تفاصيل</th>
  66.             <th width="20%"  align="center">تنفيذ</th>
  67.             <th width="20%"  align="center">تكاليف</th>
  68.    </tr>
  69.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  70.         <tr style="text-align:center;color:#343434;">
  71.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  72.             </th>
  73.            <th align="center">
  74.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Number', true)) { ?>
  75.            <?php echo p2p_get_meta( get_post()->p2p_id, 'Number', true ); ?>
  76.            <?php } else { ?>
  77.            -
  78.            <?php } ?></h4>
  79.            </th>
  80.            <th align="center">
  81.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'graphicsdescription', true)) { ?>
  82.             <?php echo p2p_get_meta( get_post()->p2p_id, 'graphicsdescription', true ); ?>
  83.            <?php } else { ?>
  84.            -
  85.            <?php } ?></h4>
  86.            </th>
  87.            <th align="center">
  88.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'graphicdoneby', true)) { ?>
  89.             <?php echo p2p_get_meta( get_post()->p2p_id, 'graphicdoneby', true ); ?>
  90.            <?php } else { ?>
  91.            -
  92.            <?php } ?></h4>
  93.            </th>
  94.            <th align="center">
  95.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'printcost', true)) { ?>
  96.             <?php echo p2p_get_meta( get_post()->p2p_id, 'printcost', true ); ?>
  97.            <?php } else { ?>
  98.            -
  99.            <?php } ?></h4>
  100.            </th>
  101.         </tr>  
  102.         <?php endwhile;
  103.  
  104.         wp_reset_postdata(); // set $post back to original post
  105.         ?> 
  106.     </thead>
  107. </table>
  108.   <?php  endif; ?>
  109.  
  110. <?php
  111.     // Find connected pages
  112.     $connected = new WP_Query( array(
  113.         'connected_type' => 'invitation_to_communications',
  114.         'connected_items' => $post,
  115.         'nopaging' => true
  116.     ) );
  117.  
  118.     // Display connected pages
  119.      if ( $connected->have_posts() ) :
  120.     ?>
  121. <table id="invitationlistexport" class="table-grid  demo">
  122.     <thead style="display: table-header-group">
  123.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  124.         <td colspan="4">
  125. <h3 style="color:#FFFFFF;text-align: center;">Communications</h3></tr>
  126.         </td>
  127.    
  128.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  129.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">النشر</h3></th>
  130.             <th width="20%"  align="center">تنفيذ</th>
  131.             <th width="20%"  align="center">نشر في</th>
  132.             <th width="20%"  align="center">تكاليف</th>
  133.    </tr>
  134.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  135.         <tr style="text-align:center;color:#343434;">
  136.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  137.             <!--<?php echo $post->p2p_id; ?>-->
  138.             </th>
  139.            <th align="center">
  140.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Doneby', true)) { ?>
  141.            <?php echo p2p_get_meta( get_post()->p2p_id, 'Doneby', true ); ?>
  142.            <?php } else { ?>
  143.            -
  144.            <?php } ?></h4>
  145.            </th>
  146.            <th align="center">
  147.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'sentto', true)) { ?>
  148.             <?php echo p2p_get_meta( get_post()->p2p_id, 'sentto', true ); ?>
  149.            <?php } else { ?>
  150.            -
  151.            <?php } ?></h4>
  152.            </th>
  153.            <th align="center">
  154.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  155.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  156.            <?php } else { ?>
  157.            -
  158.            <?php } ?></h4>
  159.            </th>
  160.         </tr>  
  161.         <?php endwhile;
  162.  
  163.         wp_reset_postdata(); // set $post back to original post
  164.         ?> 
  165.     </thead>
  166. </table>
  167.   <?php  endif; ?>
  168.  
  169. <?php
  170.     // Find connected pages
  171.     $connected = new WP_Query( array(
  172.         'connected_type' => 'invitation_to_productionunit',
  173.         'connected_items' => $post,
  174.         'nopaging' => true
  175.     ) );
  176.  
  177.     // Display connected pages
  178.          if ( $connected->have_posts() ) :
  179.     ?>
  180. <table id="invitationlistexport" class="table-grid  demo">
  181.     <thead style="display: table-header-group">
  182.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  183.         <td colspan="4">
  184. <h3 style="color:#FFFFFF;text-align: center;">Production</h3></tr>
  185.         </td>
  186.    
  187.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  188.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">الخدمة</h3></th>
  189.             <th width="20%"  align="center">تنفيذ</th>            
  190.             <th width="20%"  align="center">تفاصيل</th>
  191.             <th width="20%"  align="center">تكاليف</th>
  192.    </tr>
  193.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  194.         <tr style="text-align:center;color:#343434;">
  195.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  196.             <!--<?php echo $post->p2p_id; ?>-->
  197.             </th>
  198.            <th align="center">
  199.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Doneby', true)) { ?>
  200.            <?php echo p2p_get_meta( get_post()->p2p_id, 'Doneby', true ); ?>
  201.            <?php } else { ?>
  202.            -
  203.            <?php } ?></h4>
  204.            </th>
  205.            <th align="center">
  206.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Note', true)) { ?>
  207.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Note', true ); ?>
  208.            <?php } else { ?>
  209.            -
  210.            <?php } ?></h4>
  211.            </th>
  212.            <th align="center">
  213.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  214.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  215.            <?php } else { ?>
  216.            -
  217.            <?php } ?></h4>
  218.            </th>
  219.         </tr>  
  220.         <?php endwhile;
  221.  
  222.         wp_reset_postdata(); // set $post back to original post
  223.         ?> 
  224.     </thead>
  225. </table>
  226.   <?php  endif; ?>
  227.  
  228. <?php
  229.     // Find connected pages
  230.     $connected = new WP_Query( array(
  231.         'connected_type' => 'invitation_to_itemsneeded',
  232.         'connected_items' => $post,
  233.         'nopaging' => true
  234.     ) );
  235.          if ( $connected->have_posts() ) :
  236.     // Display connected pages
  237.     ?>
  238. <table id="invitationlistexport" class="table-grid  demo">
  239.     <thead style="display: table-header-group">
  240.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  241.         <td colspan="4">
  242. <h3 style="color:#FFFFFF;text-align: center;">Items Needed</h3></tr>
  243.         </td>
  244.    
  245.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  246.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">المستلزمات</h3></th>
  247.             <th width="20%"  align="center">الكمية</th>
  248.             <th width="20%"  align="center">ملاحظات</th>
  249.             <th width="20%"  align="center">تكاليف</th>
  250.    </tr>
  251.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  252.         <tr style="text-align:center;color:#343434;">
  253.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  254.             <!--<?php echo $post->p2p_id; ?>-->
  255.             </th>
  256.            <th align="center">
  257.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'number', true)) { ?>
  258.            <?php echo p2p_get_meta( get_post()->p2p_id, 'number', true ); ?>
  259.            <?php } else { ?>
  260.            -
  261.            <?php } ?></h4>
  262.            </th>
  263.            <th align="center">
  264.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Note', true)) { ?>
  265.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Note', true ); ?>
  266.            <?php } else { ?>
  267.            -
  268.            <?php } ?></h4>
  269.            </th>
  270.            <th align="center">
  271.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  272.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  273.            <?php } else { ?>
  274.            -
  275.            <?php } ?></h4>
  276.            </th>
  277.         </tr>  
  278.         <?php endwhile;
  279.  
  280.         wp_reset_postdata(); // set $post back to original post
  281.         ?> 
  282.     </thead>
  283. </table>
  284.   <?php  endif; ?>
  285. <?php
  286.     // Find connected pages
  287.     $connected = new WP_Query( array(
  288.         'connected_type' => 'invitation_to_hallandstage',
  289.         'connected_items' => $post,
  290.         'nopaging' => true
  291.     ) );
  292.          if ( $connected->have_posts() ) :
  293.     // Display connected pages
  294.     ?>
  295. <table id="invitationlistexport" class="table-grid  demo">
  296.     <thead style="display: table-header-group">
  297.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  298.         <td colspan="3">
  299. <h3 style="color:#FFFFFF;text-align: center;">القاعة</h3></tr>
  300.         </td>
  301.    
  302.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  303.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">القاعة</h3></th>
  304.             <th width="20%"  align="center">ملاحظات</th>
  305.             <th width="20%"  align="center">تكاليف</th>
  306.    </tr>
  307.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  308.         <tr style="text-align:center;color:#343434;">
  309.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  310.             <!--<?php echo $post->p2p_id; ?>-->
  311.             </th>
  312.            <th align="center">
  313.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Note', true)) { ?>
  314.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Note', true ); ?>
  315.            <?php } else { ?>
  316.            -
  317.            <?php } ?></h4>
  318.            </th>
  319.            <th align="center">
  320.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  321.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  322.            <?php } else { ?>
  323.            -
  324.            <?php } ?></h4>
  325.            </th>
  326.         </tr>  
  327.         <?php endwhile;
  328.  
  329.         wp_reset_postdata(); // set $post back to original post
  330.         ?> 
  331.     </thead>
  332. </table>
  333.   <?php  endif; ?>
  334. <?php
  335.     // Find connected pages
  336.     $connected = new WP_Query( array(
  337.         'connected_type' => 'invitation_to_foodandcatering',
  338.         'connected_items' => $post,
  339.         'nopaging' => true
  340.     ) );
  341.          if ( $connected->have_posts() ) :
  342.     // Display connected pages
  343.     ?>
  344. <table id="invitationlistexport" class="table-grid  demo">
  345.     <thead style="display: table-header-group">
  346.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  347.         <td colspan="5">
  348. <h3 style="color:#FFFFFF;text-align: center;">Food and Catering</h3></tr>
  349.         </td>
  350.    
  351.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  352.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">الطلبات</h3></th>
  353.             <th width="20%"  align="center">العدد</th>
  354.             <th width="20%"  align="center">عدد الأشخاص</th>
  355.             <th width="20%"  align="center">ملاحظات</th>
  356.             <th width="20%"  align="center">تكاليف</th>
  357.    </tr>
  358.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  359.         <tr style="text-align:center;color:#343434;">
  360.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  361.             <!--<?php echo $post->p2p_id; ?>-->
  362.             </th>
  363.            <th align="center">
  364.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Number', true)) { ?>
  365.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Number', true ); ?>
  366.            <?php } else { ?>
  367.            -
  368.            <?php } ?></h4>
  369.            </th>
  370.            <th align="center">
  371.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Nbpersons', true)) { ?>
  372.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Nbpersons', true ); ?>
  373.            <?php } else { ?>
  374.            -
  375.            <?php } ?></h4>
  376.            </th>
  377.            <th align="center">
  378.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Description', true)) { ?>
  379.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Description', true ); ?>
  380.            <?php } else { ?>
  381.            -
  382.            <?php } ?></h4>
  383.            </th>           
  384.            <th align="center">
  385.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  386.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  387.            <?php } else { ?>
  388.            -
  389.            <?php } ?></h4>
  390.            </th>
  391.         </tr>  
  392.         <?php endwhile;
  393.  
  394.         wp_reset_postdata(); // set $post back to original post
  395.         ?> 
  396.     </thead>
  397. </table>
  398.   <?php  endif; ?>
  399. <?php
  400.     // Find connected pages
  401.     $connected = new WP_Query( array(
  402.         'connected_type' => 'invitation_to_eventbenefits',
  403.         'connected_items' => $post,
  404.         'nopaging' => true
  405.     ) );
  406.          if ( $connected->have_posts() ) :
  407.     // Display connected pages
  408.     ?>
  409. <table id="invitationlistexport" class="table-grid  demo">
  410.     <thead style="display: table-header-group">
  411.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  412.         <td colspan="3">
  413. <h3 style="color:#FFFFFF;text-align: center;">Event Benefits</h3></tr>
  414.         </td>
  415.    
  416.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  417.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;">الطلبات</h3></th>
  418.             <th width="20%"  align="center">العدد</th>
  419.             <th width="20%"  align="center">ملاحظات</th>
  420.    </tr>
  421.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  422.         <tr style="text-align:center;color:#343434;">
  423.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  424.             <!--<?php echo $post->p2p_id; ?>-->
  425.             </th>
  426.            <th align="center">
  427.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Number', true)) { ?>
  428.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Number', true ); ?>
  429.            <?php } else { ?>
  430.            -
  431.            <?php } ?></h4>
  432.            </th>
  433.            <th align="center">
  434.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Description', true)) { ?>
  435.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Description', true ); ?>
  436.            <?php } else { ?>
  437.            -
  438.            <?php } ?></h4>
  439.            </th>           
  440.         </tr>  
  441.         <?php endwhile;
  442.  
  443.         wp_reset_postdata(); // set $post back to original post
  444.         ?> 
  445.     </thead>
  446. </table>
  447.   <?php  endif; ?>
  448.  
  449. <?php
  450.     // Find connected pages
  451.     $connected = new WP_Query( array(
  452.         'connected_type' => 'invitation_to_transportation',
  453.         'connected_items' => $post,
  454.         'nopaging' => true
  455.     ) );
  456.          if ( $connected->have_posts() ) :
  457.     // Display connected pages
  458.     ?>
  459. <table id="invitationlistexport" class="table-grid  demo">
  460.     <thead style="display: table-header-group">
  461.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  462.         <td colspan="3">
  463. <h3 style="color:#FFFFFF;text-align: center;">Transportation</h3></tr>
  464.         </td>
  465.    
  466.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  467.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;"></h3></th>
  468.             <th width="20%"  align="center">ملاحظات</th>
  469.             <th width="20%"  align="center">تكاليف</th>
  470.    </tr>
  471.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  472.         <tr style="text-align:center;color:#343434;">
  473.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  474.             <!--<?php echo $post->p2p_id; ?>-->
  475.             </th>
  476.            <th align="center">
  477.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Note', true)) { ?>
  478.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Note', true ); ?>
  479.            <?php } else { ?>
  480.            -
  481.            <?php } ?></h4>
  482.            </th>
  483.            <th align="center">
  484.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  485.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  486.            <?php } else { ?>
  487.            -
  488.            <?php } ?></h4>
  489.            </th>           
  490.         </tr>  
  491.         <?php endwhile;
  492.  
  493.         wp_reset_postdata(); // set $post back to original post
  494.         ?> 
  495.     </thead>
  496. </table>
  497.   <?php  endif; ?>
  498. <?php
  499.     // Find connected pages
  500.     $connected = new WP_Query( array(
  501.         'connected_type' => 'invitation_to_hotelsaccommodations',
  502.         'connected_items' => $post,
  503.         'nopaging' => true
  504.     ) );
  505.          if ( $connected->have_posts() ) :
  506.     // Display connected pages
  507.     ?>
  508. <table id="invitationlistexport" class="table-grid  demo">
  509.     <thead style="display: table-header-group">
  510.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  511.         <td colspan="3">
  512. <h3 style="color:#FFFFFF;text-align: center;">Hotels</h3></tr>
  513.         </td>
  514.    
  515.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  516.             <th width="20%"  align="center"><h3 style="color:#FFFFFF;text-align: center;"></h3></th>
  517.             <th width="20%"  align="center">ملاحظات</th>
  518.             <th width="20%"  align="center">تكاليف</th>
  519.    </tr>
  520.         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  521.         <tr style="text-align:center;color:#343434;">
  522.             <th align="center"><h4 style="text-align: center;color:#343434;"><?php the_title(); ?></h4>
  523.             <!--<?php echo $post->p2p_id; ?>-->
  524.             </th>
  525.            <th align="center">
  526.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Note', true)) { ?>
  527.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Note', true ); ?>
  528.            <?php } else { ?>
  529.            -
  530.            <?php } ?></h4>
  531.            </th>
  532.            <th align="center">
  533.            <h4 style="text-align: center;color:#343434;"><?php if (p2p_get_meta(get_post()->p2p_id, 'Cost', true)) { ?>
  534.             <?php echo p2p_get_meta( get_post()->p2p_id, 'Cost', true ); ?>
  535.            <?php } else { ?>
  536.            -
  537.            <?php } ?></h4>
  538.            </th>           
  539.         </tr>  
  540.         <?php endwhile;
  541.  
  542.         wp_reset_postdata(); // set $post back to original post
  543.         ?> 
  544.     </thead>
  545. </table>
  546.   <?php  endif; ?>
  547. <?php } else { ?>
  548.  
  549.  
  550. <!--start--show-table-->   
  551.  
  552. <table id="invitationlistexport" class="table-grid  demo" >
  553.     <thead style="display: table-header-group">
  554.         <tr style="background-color:#17376e;color:#FFFFFF;text-align:center;">
  555.     <th width="20%" id="name" align="center"><h3 style="color:#FFFFFF;text-align: center;"><?php echo get_the_title( $ID ); ?></h3></th>
  556.             <th width="14%" id="position" align="center"></th>
  557.             <th width="14%" id="address" align="center"></th>
  558.             <th width="10%" id="phone" align="center"></th>
  559.             <th width="10%" id="mobile" align="center"></th>
  560.             <th width="16%" id="email" align="center"></th>
  561.             <th width="8%" id="invitations" align="center"></th>
  562.             <th width="8%" id="invities" align="center"></th>
  563.         </tr>
  564.         <tr style="background-color:#46a5e5;color:#FFFFFF;text-align:center;">
  565.     <th id="name" align="center"><h4 style="text-align: center;color:#FFFFFF;"><?php $date = get_post_meta($post->ID, 'ecpt_eventdate', true); echo date('F j, Y', $date); ?></h4></th>
  566.             <th id="position" align="center"></th>
  567.             <th id="address" align="center"></th>
  568.             <th id="phone" align="center"></th>
  569.             <th id="mobile" align="center"></th>
  570.             <th id="email" align="center"></th>
  571.             <th id="invitations" align="center"></th>
  572.             <th id="invities" align="center"></th>
  573.         </tr>  
  574.         <tr id="repeatheader">
  575.             <th id="name" align="center"><h4>   الإسم</h4></th>
  576.             <th id="position" align="center"><h4>   الوظيفة</h4></th>
  577.             <th id="address" align="center"><h4>    العنوان</h4></th>
  578.             <th id="phone" align="center"><h4>  الهاتف</h4></th>
  579.             <th id="mobile" align="center"><h4> الموبايل</h4></th>
  580.             <th id="email" align="center"><h4>  الإيميل</h4></th>
  581.             <th id="invitations" align="center"><h4>عدد الدعوات</h4></th>
  582.             <th id="invities" align="center"><h4>عدد المدعويين</h4></th>
  583.         </tr>
  584.     </thead>
  585.     <tbody>
  586. <?php
  587. $do_not_duplicate = array();
  588. //get all categories then display all posts in each term
  589. $taxonomy = 'category';
  590. $param_type = 'category__in';
  591. $term_args=array(
  592.  
  593. );
  594. $terms = get_terms($taxonomy,$term_args);
  595. if ($terms) {
  596.         $counter = 1;
  597.         $total_invitations=0;
  598.         $total_invitees=0;
  599.        
  600.   foreach( $terms as $term ) {
  601.     $args=array(
  602.        'parent' => 0,
  603.       "$param_type" => array($term->term_id),
  604.       'connected_type' => 'posts_to_invitations',
  605.       'connected_items' => get_queried_object(),
  606.       'nopaging' => true,
  607.       'post_type' => 'post',
  608.       'post_status' => 'publish,draft',
  609.       'posts_per_page' => -1,
  610.       'post__not_in'     => $do_not_duplicate,
  611.       'caller_get_posts'=> 1
  612.       );
  613.     $my_query = null;
  614.     $my_query = new WP_Query($args);
  615.     if( $my_query->have_posts() ) {
  616.     $cat_invitations=$my_query->found_posts;
  617.     $cat_invitees=0;
  618.     $do_not_duplicate[] = get_the_ID();
  619.  
  620.     ?>
  621.    
  622.         <tr id="categoryname">
  623.             <td style="  background-color: #17376e;color:#FFFFFF"><h3><?php echo $term->name;?></h3></td>
  624.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  625.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  626.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  627.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  628.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  629.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  630.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  631.         </tr>          
  632.             <?php
  633.      if( $my_query->have_posts() ) {
  634.  
  635.     while ($my_query->have_posts()) :
  636.     $my_query->the_post();
  637.  
  638.         $post_id = get_the_ID();
  639.  
  640.         if (in_array($post_id, $do_not_duplicate)) {
  641.             continue; // We've already seen this post ID, so skip the rest of the loop
  642.         }
  643.  
  644.       if (p2p_get_meta(get_post()->p2p_id, 'couples', true) == '1') $cat_invitees+= 2;
  645.       else $cat_invitees++;
  646.  
  647.         $do_not_duplicate[] = $post_id;
  648.  
  649.         ?> 
  650.         <tr>
  651.             <td id="name"><h5>
  652. <a href="<?php the_permalink(); ?>">
  653. <?php if (p2p_get_meta(get_post()->p2p_id, 'couples', true) == '1') { ?>
  654.     <!--if Couple Invitation Start -->     
  655.         <!-- If Male -->
  656.        
  657.         <?php $your_custom_field = get_post_meta($post->ID, 'ecpt_gender', true); if ( $your_custom_field == 'Male' ) { ?>
  658.                 <?php
  659.                 $string= get_the_title();
  660.                 if(strlen($string) != mb_strlen($string, 'utf-8'))
  661.                 {?>
  662.                     <?php $contactstatus = get_post_meta($post->ID, 'ecpt_maritalstatus', true); if ( $contactstatus == 'Married' ) { ?>
  663.                 <!-- If Arabic --><?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> <?php the_title(); ?> وعقيلته المحترمين<!-- End If Arabic -->
  664.                     <?php } else  { ?>
  665.                     <span style="color: red;font-weight: bold;">يرجى التأكد من حالة <?php the_title(); ?> الإجتماعية</span>
  666.                     <?php } ?>             
  667.                 <?php } else  { ?>
  668.                     <?php $contactstatus = get_post_meta($post->ID, 'ecpt_maritalstatus', true); if ( $contactstatus == 'Married' ) { ?>
  669.                 <!-- If English --><?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> & Ms. <?php the_title(); ?><!--End If English -->
  670.                 <?php } else  { ?>
  671.                     <span style="color: red;font-weight: bold;">يرجى التأكد من حالة <?php the_title(); ?> الإجتماعية</span>
  672.                     <?php } ?>             
  673.                 <?php } ?>
  674.         <!-- End If Male -->
  675.         <?php } else{ ?>
  676.         <!-- If Female -->
  677.                 <?php
  678.                 $string= get_the_title();
  679.                 if(strlen($string) != mb_strlen($string, 'utf-8'))
  680.                 {?>
  681.                 <?php $contactstatus = get_post_meta($post->ID, 'ecpt_maritalstatus', true); if ( $contactstatus == 'Married' ) { ?>
  682.                                 <!-- If Arabic -->
  683. <?php if( get_post_meta($post->ID, 'ecpt_partnertitle', true) ) { ?><?php echo get_post_meta($post->ID, 'ecpt_partnertitle', true); ?>  <?php } else { ?>  <span style="color: red;font-weight: bold;">يرجى تزويدنا باسم الزوج</span> <?php } ?>
  684. <?php echo get_post_meta($post->ID, 'ecpt_alternativename', true); ?> وعقيلته
  685. <?php $modifiedtitle = get_post_meta($post->ID, 'ecpt_contacttitle', true);
  686. echo str_replace("حضرة","","$modifiedtitle"); ?> <?php the_title(); ?> المحترمين<!-- End If Arabic -->
  687.  
  688.                 <?php } else  { ?>
  689.                     <span style="color: red;font-weight: bold;">يرجى التأكد من حالة <?php the_title(); ?> الإجتماعية</span>
  690.                     <?php } ?>             
  691.                 <?php } else  { ?>
  692.                 <?php $contactstatus = get_post_meta($post->ID, 'ecpt_maritalstatus', true); if ( $contactstatus == 'Married' ) { ?>
  693.                 <!-- If English -->TO ASK <?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> & Ms. <?php the_title(); ?><!--End If English -->
  694.                 <?php } else  { ?>
  695.                     <span style="color: red;font-weight: bold;">يرجى التأكد من حالة <?php the_title(); ?> الإجتماعية</span>
  696.                     <?php } ?>     
  697.                 <?php } ?>
  698.         <!-- End If Female -->
  699.         <?php } ?>
  700.     <!--if Couple Invitation End -->       
  701. <?php } else{ ?>
  702.     <!--if Single Invitation Start -->     
  703.         <!-- If Male -->
  704.         <?php $your_custom_field = get_post_meta($post->ID, 'ecpt_gender', true); if ( $your_custom_field == 'Male' ) { ?>
  705.                 <?php
  706.                 $string= get_the_title();
  707.                 if(strlen($string) != mb_strlen($string, 'utf-8'))
  708.                 {?>
  709.                 <!-- If Arabic --><?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> <?php the_title(); ?> المحترم<!-- End If Arabic -->
  710.                 <?php } else  { ?>
  711.                 <!-- If English --><?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> <?php the_title(); ?><!--End If English -->
  712.                 <?php } ?>
  713.         <!-- End If Male -->
  714.         <?php } else{ ?>
  715.         <!-- If Female -->
  716.                 <?php
  717.                 $string= get_the_title();
  718.                 if(strlen($string) != mb_strlen($string, 'utf-8'))
  719.                 {?>
  720.                 <!-- If Arabic --><?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> <?php the_title(); ?> المحترمة<!-- End If Arabic -->
  721.                 <?php } else  { ?>
  722.                 <!-- If English --><?php echo get_post_meta($post->ID, 'ecpt_contacttitle', true); ?> <?php the_title(); ?><!--End If English -->
  723.                 <?php } ?>
  724.         <!-- End If Female -->
  725.         <?php } ?>
  726.     <!--if Single Invitation End -->       
  727. <?php } ?>
  728. </a>
  729. </h5></td>
  730.             <td id="position"><h5><?php echo get_post_meta($post->ID, 'ecpt_position', true); ?></h5></td>
  731.             <td id="address"><h5><?php echo get_post_meta($post->ID, 'ecpt_address', true); ?></h5></td>
  732.             <td id="phone"><h5><?php echo get_post_meta($post->ID, 'ecpt_phone', true); ?></h5></td>
  733.             <td id="mobile"><h5><?php echo get_post_meta($post->ID, 'ecpt_mobile', true); ?></h5></td>
  734.             <td id="email"><h5><?php echo get_post_meta($post->ID, 'ecpt_email', true); ?></h5></td>
  735.             <td id="invitations"><h5></h5></td>
  736.             <td id="invities"><h5></h5></td>
  737.         </tr>
  738. <?php $counter++; ?>
  739.        <?php
  740.       endwhile;
  741.       $total_invitees+=$cat_invitees;
  742.       $total_invitations+=$cat_invitations;
  743.       } ?>
  744.         <tr id="categoryname" style="background-color:#46a5e5;">
  745.             <td style="color:#FFFFFF"></td>
  746.             <td style="color:#FFFFFF"></td>
  747.             <td style="color:#FFFFFF"></td>
  748.             <td style="color:#FFFFFF"></td>
  749.             <td style="color:#FFFFFF"></td>
  750.             <td style="color:#FFFFFF"></td>
  751.             <td style="color:#FFFFFF;text-align:center;font-weight: bold;padding: 0px;"><?php echo $cat_invitations ;?></td>
  752.             <td style="color:#FFFFFF;text-align:center;font-weight: bold;padding: 0px;"><?php echo $cat_invitees ;?></td>
  753.         </tr>            
  754. <?php
  755.     }
  756.   }
  757.  
  758.  } wp_reset_query();  // Restore global post data stomped by the_post(). ?>    
  759.          <tr id="categoryname">
  760.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  761.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  762.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  763.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  764.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  765.             <td style="  background-color: #17376e;color:#FFFFFF"></td>
  766.             <td style="  background-color: #17376e;color:#FFFFFF">
  767. إجمالي عدد الدعوات </br>
  768. <?php echo $total_invitations; ?> </td>
  769.             <td style="  background-color: #17376e;color:#FFFFFF">
  770. إجمالي عدد المدعويين<?php echo $total_invitees; ?></td>
  771.         </tr>  
  772.     </tbody>
  773. </table>
  774.  
  775. <?php } ?> <!--end--show-table-->
  776.     <?php } else { ?>
  777. <style>
  778. label {
  779.   min-width: 120px;
  780. }
  781. </style>
  782. عذراً، ليس لديكم صلاحية إضافة أو تعديل مناسبة، يرجى تسجيل الدخول
  783.  <?php $args = array(
  784.         'echo'           => true,
  785.         'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
  786.         'form_id'        => 'loginform',
  787.         'label_username' => __( 'إسم المستعار' ),
  788.         'label_password' => __( 'كلمة السر' ),
  789.         'label_remember' => __( 'تذكرني' ),
  790.         'label_log_in'   => __( 'تسجيل الدخول' ),
  791.         'id_username'    => 'user_login',
  792.         'id_password'    => 'user_pass',
  793.         'id_remember'    => 'rememberme',
  794.         'id_submit'      => 'wp-submit',
  795.         'remember'       => true,
  796.         'value_username' => '',
  797.         'value_remember' => false
  798. ); ?>
  799.  <?php wp_login_form( $args ); ?>
  800. <?php }; ?>
  801.             </article>
  802.                         <?php if(ot_get_option('enable_author')!='off'){ ?>
  803.                         <div class="about-author">
  804.                             <div class="author-avatar">
  805.                                 <?php
  806.                                 if(isset($_is_retina_)&&$_is_retina_){
  807.                                         echo get_avatar( get_the_author_meta('email'), 100, get_template_directory_uri() . '/images/avatar-2x-retina.jpg' );
  808.                                 }else{
  809.                                         echo get_avatar( get_the_author_meta('email'), 100, get_template_directory_uri() . '/images/avatar-2x.jpg' );
  810.                                 }?>
  811.                             </div>
  812.                             <div class="author-info">
  813.                                 <h4><?php the_author_posts_link(); ?></h4>
  814.                                 <?php the_author_meta('description'); ?>
  815.                             </div>
  816.                             <div class="clearfix"></div>
  817.                         </div><!--/about-author-->
  818.                         <?php }?>
  819.                         <?php if(ot_get_option('single_navi')!='off'){ ?>
  820.                         <div class="simple-navigation">
  821.                             <div class="row">
  822.                                 <?php
  823.                                 $p = get_adjacent_post(true, '', true);
  824.                                 $n = get_adjacent_post(true, '', false);
  825.                                 ?>
  826.                                 <div class="simple-navigation-item col-md-6 col-sm-6 col-xs-6 main-color-1-bg-hover <?php echo empty($n)?'no-border':'' ?>">
  827.                                 <?php
  828.                                    
  829.                                     if(!empty($p)){ echo '<a href="' . get_permalink($p->ID) . '" title="' . esc_attr($p->post_title) . '" class="maincolor2hover">
  830.                                    <i class="fa fa-angle-left pull-left"></i>
  831.                                    <div class="simple-navigation-item-content">
  832.                                        <span>'.__('Previous','cactusthemes').'</span>
  833.                                        <h4>' . $p->post_title . '</h4>
  834.                                    </div>
  835.                                     </a>';}
  836.                                 ?>
  837.                                 </div>
  838.                                 <div class="simple-navigation-item col-md-6 col-sm-6 col-xs-6 main-color-1-bg-hover <?php echo empty($n)?'hidden':'' ?>">
  839.                                 <?php
  840.                                     if(!empty($n)) echo '<a href="' . get_permalink($n->ID) . '" title="' . esc_attr($n->post_title) . '" class="maincolor2hover pull-right">
  841.                                     <i class="fa fa-angle-right pull-right"></i>
  842.                                     <div class="simple-navigation-item-content">
  843.                                         <span>'.__('Next','cactusthemes').'</span>
  844.                                         <h4>' . $n->post_title . '</h4>
  845.                                     </div>
  846.                                     </a>';  
  847.                                 ?>
  848.                                 </div>
  849.                             </div>
  850.                         </div><!--/simple-nav-->
  851.                         <?php }?>
  852.                     </div><!--/content-->
  853.                     <?php if($layout != 'full'){get_sidebar();} ?>
  854.                 </div><!--/row-->
  855.             <?php if($content_padding!='off'){ ?>
  856.             </div><!--/content-pad-3x-->
  857.             <?php }?>
  858.         </div><!--/container-->
  859.     </div><!--/body-->
  860.  
  861. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement